1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2var initSitelocation = require('../../common_javascript/initialize-sitelocation'); 3var siteLocation = require('@yola/sitelocation'); 4var callAsync = require('../../common_javascript/call-async'); 5 6require('@yola/mobilemenu'); 7 8var initMenu = function() { 9 var els = [ 10 document.querySelector('.yola_content_wrap'), 11 document.querySelector('.yola_footer_wrap'), 12 document.querySelector('.yola_banner_wrap'), 13 document.getElementById('sys_yolacredit_wrap'), 14 document.getElementById('yola_heading_block') 15 ]; 16 17 var mobileMenuOpen = function(event) { 18 els.forEach(function(el) { 19 if (!el) { return; } 20 el.classList.add('small_device_hide'); 21 }); 22 }; 23 24 var mobileMenuClose = function(event) { 25 els.forEach(function(el) { 26 if (!el) { return; } 27 el.classList.remove('small_device_hide'); 28 }); 29 }; 30 31 $('.mob_menu').mobileMenu({ 32 onOpen: mobileMenuOpen, 33 onClose: mobileMenuClose 34 }); 35}; 36 37/* With all Javascript bundled into one file, javascript is significantly 38 * more brittle, especially given that users have the power to overwrite 39 * globals that could interfere with bundled code. Initializing each component 40 * on its own turn of the event loop should minimize failures to individual 41 * Javascript components, instead of the whole site. 42 */ 43callAsync(initMenu); 44callAsync(initSitelocation(siteLocation, 'locationData')); 45 46},{"../../common_javascript/call-async":73,"../../common_javascript/initialize-sitelocation":74,"@yola/mobilemenu":2,"@yola/sitelocation":8}],2:[function(require,module,exports){ 47'use strict'; 48 49/* 50 * jQuery mobilemenu plugin 51 */ 52 53(function ($, window, document, undefined) { 54 55 var pluginName = 'mobileMenu'; 56 var subName = 'subMenu'; 57 var defaults = {}; 58 59 //The plugin constructor 60 function MobileMenu(element, options) { 61 this.$element = $(element); 62 this.options = $.extend({}, defaults, options); 63 this._defaults = defaults; 64 this._name = pluginName; 65 this._onOpen = options.onOpen || $.noop; 66 this._onClose = options.onClose || $.noop; 67 this.init(); 68 } 69 70 MobileMenu.prototype.init = function() { 71 var menuToggle = this.menuToggle.bind(this); 72 var subToggle = this.subToggle.bind(this); 73 74 this.$menuToggleBtn = this.$element.find('.mob_menu_toggle'); 75 this.$menuToggleBtn.on('click', menuToggle); 76 77 this.$subMenuToggleBtns = this.$element.find('.mob_more_toggle'); 78 this.$subMenuToggleBtns.on('click', subToggle); 79 80 this.$subMenuWrappers = this.$element.find('li'); 81 }; 82 83 MobileMenu.prototype.menuToggle = function(event) { 84 this.$element.toggleClass('menu_open'); 85 86 if(! this.$element.hasClass('menu_open')) { 87 this.closeSubMenus(); 88 this._onClose(event); 89 } else { 90 this._onOpen(event); 91 } 92 }; 93 94 MobileMenu.prototype.subToggle = function(event) { 95 var $buttonClicked = $(event.target); 96 var $subMenu = $buttonClicked.closest('li'); 97 98 $subMenu.toggleClass('sub_menu_open'); 99 this.closeSubMenus($subMenu); 100 }; 101 102 MobileMenu.prototype.closeSubMenus = function(exclude) { 103 if(! exclude) { 104 return this.$subMenuWrappers.removeClass('sub_menu_open'); 105 } 106 107 this.$subMenuWrappers.each(function(index) { 108 if(this !== exclude.get(0)) { 109 $(this).removeClass('sub_menu_open'); 110 } 111 }); 112 }; 113 114 $.fn[pluginName] = function(options) { 115 return this.each(function() { 116 if (!$.data(this, 'plugin_' + pluginName)) { 117 118 var pluginInstance = new MobileMenu(this, options); 119 $.data(this, 'plugin_' + pluginName, pluginInstance); 120 121 } 122 }); 123 }; 124 125})(jQuery, window, document); 126 127},{}],3:[function(require,module,exports){ 128module.exports={"cs":{"Address":"Adresa","Call":"Zavolat","Closed":"ZavÅeno","Closed all day":"ZavÅeno celý den","Closes":"ZavÃrá","Current Location":"Aktuálnà pozice","Currently closed":"MomentálnÄ zavÅeno","Day":"Den","Friday":"Pátek","Hours":"Hodiny","Map":"Mapa","Monday":"PondÄlÃ","Open now":"OtevÅÃt nynÃ","Open today from %s to %s":"Dnes otevÅeno od %s do %s","Opens":"OtevÃrá","Phone":"Telefon","Saturday":"Sobota","Sunday":"NedÄle","This Week":"Tento týden","Thursday":"Ätvrtek","Today":"Dnes","Today's Hours":"DneÅ¡nà otevÃracà doba","Tuesday":"Ãterý","Wednesday":"StÅeda"},"da":{"Address":"Adresse","Call":"Ring","Closed":"Lukket","Closed all day":"Lukket hele dagen","Closes":"Lukker","Current Location":"Nuværende placering","Currently closed":"Lukket lige nu","Day":"Dag","Friday":"Fredag","Hours":"à bningstider","Map":"Kort","Monday":"Mandag","Open now":"à ben nu","Open today from %s to %s":"à ben i dag fra %s til %s","Opens":"à bner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uge","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥bningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"de":{"Address":"Adresse","Call":"Telefon","Closed":"Geschlossen","Closed all day":"Ganztägig geschlossen","Closes":"schlieÃt","Current Location":"aktueller Standort","Currently closed":"derzeit geschlossen","Day":"Wochentag","Friday":"Freitag","Hours":"Ãffnungszeiten","Map":"Karte","Monday":"Montag","Open now":"Jetzt geöffnet","Open today from %s to %s":"Heute geöffnet von %s bis %s","Opens":"öffnet","Phone":"Telefon","Saturday":"Samstag","Sunday":"Sonntag","This Week":"diese Woche","Thursday":"Donnerstag","Today":"heute","Today's Hours":"Ãffnungszeiten heute","Tuesday":"Dienstag","Wednesday":"Mittwoch"},"es":{"Address":"Dirección","Call":"Llamar","Closed":"Cerrada","Closed all day":"Cerrado todo el dÃa","Closes":"Cierra","Current Location":"Ubicación actual","Currently closed":"Cerrado de momento","Day":"DÃa","Frid
128ay":"Viernes","Hours":"Horas","Map":"Mapa","Monday":"Lunes","Open now":"Abrir ahora","Open today from %s to %s":"Abrir hoy de %s a %s","Opens":"Abre","Phone":"Teléfono","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta semana","Thursday":"Jueves","Today":"Hoy","Today's Hours":"Horas para el dÃa de hoy","Tuesday":"Martes","Wednesday":"Miércoles"},"fr":{"Address":"Adresse","Call":"Appel","Closed":"Fermé","Closed all day":"Fermé toute la journée","Closes":"Ferme","Current Location":"Emplacement actuel","Currently closed":"Actuellement fermé","Day":"Jour","Friday":"Vendredi","Hours":"Heures","Map":"Carte","Monday":"Lundi","Open now":"Ouvert maintenant","Open today from %s to %s":"Ouvert aujourd'hui de %s à %s","Opens":"Ouvre","Phone":"Téléphone","Saturday":"Samedi","Sunday":"Dimanche","This Week":"Cette semaine","Thursday":"Jeudi","Today":"Aujourd'hui","Today's Hours":"Heures du Jour","Tuesday":"Mardi","Wednesday":"Mercredi"},"hu":{"Address":"CÃm","Call":"HÃvás","Closed":"Zárva","Closed all day":"Egész nap zárva","Closes":"Bezár","Current Location":"Jelenlegi hely","Currently closed":"Jelenleg zárva","Day":"Nap","Friday":"Péntek","Hours":"Ãrák","Map":"Térkép","Monday":"HétfÅ","Open now":"Most nyitva","Open today from %s to %s":"Mai napon nyitva %s-tól %s-ig","Opens":"Nyit","Phone":"Telefon","Saturday":"Szombat","Sunday":"Vasárnap","This Week":"Ezen a héten","Thursday":"Csütörtök","Today":"Ma","Today's Hours":"Mai órák","Tuesday":"Kedd","Wednesday":"Szerda"},"id":{"Address":"Alamat","Call":"Telepon","Closed":"Tutup","Closed all day":"Tutup sepanjang hari","Closes":"Menutup","Current Location":"Lokasi saat ini","Currently closed":"Saat ini tutup","Day":"Hari","Friday":"Jumat","Hours":"Jam","Map":"Peta","Monday":"Senin","Open now":"Buka sekarang","Open today from %s to %s":"Hari ini buka dari %s sampai %s","Opens":"Buka","Phone":"Telepon","Saturday":"Sabtu","Sunday":"Hari Minggu","This Week":"Minggu ini","Thursday":"Kamis","Today":"Hari ini","Today's Hours":"Jam hari ini","Tuesday":"Selasa","Wednesday":"Hari Rabu"},"it":{"Address":"indirizzo","Call":"Chiamata","Closed":"Chiuso","Closed all day":"Chiuso tutto il giorno","Closes":"Chiude","Current Location":"Indirizzo attuale","Currently closed":"Attualmente chiuso","Day":"Giorno","Friday":"Venerdi'","Hours":"Ore","Map":"Mappa","Monday":"Lunedi'","Open now":"Aperto adesso","Open today from %s to %s":"aperto oggi dalle %s alle %s","Opens":"Apre","Phone":"Telefono","Saturday":"Sabato","Sunday":"Domenica","This Week":"Questa settimana","Thursday":"Giovedi'","Today":"Oggi","Today's Hours":"Ore di oggi","Tuesday":"Martedi'","Wednesday":"Mercoledi'"},"ja":{"Address":"ã¢ãã¬ã¹","Call":"é»è©±","Closed":"éé","Closed all day":"éåºæ¥","Closes":"éåº","Current Location":"ç¾å¨å°","Currently closed":"ç¾å¨ãéãã¦ãã¾ã","Day":"ææ¥","Friday":"éææ¥","Hours":"æ","Map":"å°å³","Monday":"æææ¥","Open now":"ç¾å¨ãéãã¦ãã¾ã","Open today from %s to %s":"æ¬æ¥ã%sæãã%sæã¾ã§ãªã¼ãã³","Opens":"éåº","Phone":"é»è©±","Saturday":"åææ¥","Sunday":"æ¥ææ¥","This Week":"ä»é±","Thursday":"æ¨ææ¥","Today":"仿¥","Today's Hours":"仿¥ã®å°±æ¥æé","Tuesday":"ç«ææ¥","Wednesday":"æ°´ææ¥"},"nb":{"Address":"Adresse","Call":"Ring","Closed":"Stengt","Closed all day":"Stengt hele dagen","Closes":"Stenger","Current Location":"NÃ¥værende posisjon","Currently closed":"For øyeblikket lukket","Day":"Dag","Friday":"Fredag","Hours":"Timer","Map":"Kart","Monday":"Mandag","Open now":"Ã
pen nÃ¥","Open today from %s to %s":"Ã
pen i dag fra %s til %s","Opens":"Ã
pner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uken","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥pningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"nl":{"Address":"Adres","Call":"Bel","Closed":"Gesloten","Closed all day":"De hele dag gesloten","Closes":"Sluit","Current Location":"Huidige locatie","Currently closed":"Momenteel gesloten","Day":"Dag","Friday":"Vrijdag","Hours":"Uren","Map":"Kaart","Monday":"Maandag","Open now":"Nu open","Open today from %s to %s":"Vandaag open van %s tot %s","Opens":"Opent","Phone":"Telefoon","Saturday":"Zaterdag","Sunday":"Zondag","This Week":"Deze Week","Thursday":"Donderdag","Today":"Vandaag","Today's Hours":"Uren van vandaag","Tuesday":"Dinsdag","Wednesday":"Woensdag"},"pl":{"Address":"Adres","Call":"PoÅÄ
czenie","Closed":"ZamkniÄty","Closed all day":"ZamkniÄte przez caÅy dzieÅ","Closes":"Zamyka","Current Location":"Aktualna lokalizacja","Currently closed":"Aktualnie zamkniÄte","Day":"DzieÅ","Friday":"PiÄ
tek","Hours":"Godziny","Map":"Mapa","Monday":"PoniedziaÅek","Open now":"Otwarte teraz","Open today from %s to %s":"Otwarte dzisiaj od %s do %s","Opens":"Otwiera","Phone":"Nr telefonu","Saturday":"Sobota","Sunday":"Niedziela","This Week":"W tym tygodniu","Thursday":"Czwartek","Today":"Dzisiaj","Today's Hours":"Dzisiejsze godziny","Tuesday":"Wtorek","Wednesday":"Åroda"},"pt_BR":{"Address":"Endereço","Call":"Ligar","Closed":"Fechado","Closed all day":"Fechado durante todo o dia","Closes":"Fecha","Current Location":"Localização Atual","Currently closed":"Atualmente fechado","Day":"Dia","Friday":"Sexta-feira","Hours":"Horas","Map":"Mapa","Monday":"Segunda-feira","Open now":"Aberto agora","Open today from %s to %s":"Aberto hoje das %s as %s","Opens":"Abre","Phone":"Telefone","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta Semana","Thursday":"Quinta-feira","Today":"Hoje","Today's Hours":"Horário de Hoje","Tuesday":"Terça-feira","Wednesday":"Quarta-feira"},"ru":{"Address":"ÐдÑеÑ","Call":"Ðвонок","Closed":"ÐакÑÑÑо","Closed all day":"ÐакÑÑÑо веÑÑ Ð´ÐµÐ½Ñ","Closes":"ÐакÑÑваеÑÑÑ","Current Location":"ÐÑнеÑнее ÐеÑÑонаÑ
ождение","Currently closed":"РданнÑй Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð·Ð°ÐºÑÑÑ","Day":"ÐенÑ","Frid
128ay":"ÐÑÑниÑа","Hours":"ЧаÑÑ","Map":"ÐаÑÑа","Monday":"ÐонеделÑник","Open now":"ÐÑкÑÑÑÑ ÑейÑаÑ","Open today from %s to %s":"ÐÑкÑÑÑо ÑÐµÐ³Ð¾Ð´Ð½Ñ Ñ %s до %s","Opens":"ÐÑкÑÑваеÑÑÑ","Phone":"ТелеÑон","Saturday":"СÑббоÑа","Sunday":"ÐоÑкÑеÑенÑе","This Week":"Ðа ÑÑой неделе","Thursday":"ЧеÑвеÑг","Today":"СегоднÑ","Today's Hours":"РабоÑие ÑаÑÑ ÑегоднÑ","Tuesday":"ÐÑоÑник","Wednesday":"СÑеда"},"sk":{"Address":"Adresa","Call":"ZavolaÅ¥","Closed":"Zavreté","Closed all day":"Zavreté celý deÅ","Closes":"Zaviera sa","Current Location":"Aktuálna poloha","Currently closed":"Momentálne uzavreté","Day":"DeÅ","Friday":"Piatok","Hours":"HodÃn","Map":"Mapa","Monday":"Pondelok","Open now":"Teraz otvorené","Open today from %s to %s":"Dnes otvorené od %s do %s","Opens":"Otvára sa","Phone":"Telefón","Saturday":"Sobota","Sunday":"Nedeľa","This Week":"Tento týždeÅ","Thursday":"Å tvrtok","Today":"Dnes","Today's Hours":"DneÅ¡ný hodiny","Tuesday":"Utorok","Wednesday":"Streda"},"sv":{"Address":"Adress","Call":"Ring","Closed":"Stängd","Closed all day":"Stängt hela dagen","Closes":"Stänger","Current Location":"Nuvarande plats","Currently closed":"Stängt för närvarande","Day":"Dag","Friday":"Fredag","Hours":"Timmar","Map":"Karta","Monday":"MÃ¥ndag","Open now":"Ãppna nu","Open today from %s to %s":"Ãppet idag frÃ¥n %s till %s","Opens":"Ãppnar","Phone":"Telefon","Saturday":"Lördag","Sunday":"Söndag","This Week":"Den här veckan","Thursday":"Torsdag","Today":"Idag","Today's Hours":"Dagens timmar","Tuesday":"Tisdag","Wednesday":"Onsdag"},"zh_CN":{"Address":"å°å","Call":"æ¨æ","Closed":"å·²å ³é","Closed all day":"å ¨å¤©å ³é","Closes":"å ³é","Current Location":"å½åä½ç½®","Currently closed":"å½åå·²å ³é","Day":"天","Friday":"ææäº","Hours":"è¥ä¸æ¶é´","Map":"å°å¾","Monday":"ææä¸","Open now":"ç°å¨æå¼","Open today from %s to %s":"ä»å¤©ä» %s å° %sæå¼","Opens":"æå¼","Phone":"çµè¯","Saturday":"ææå ","Sunday":"æææ¥","This Week":"æ¬å¨","Thursday":"ææå","Today":"ä»å¤©","Today's Hours":"ä»å¤©çå°æ¶æ°","Tuesday":"ææäº","Wednesday":"ææä¸"}} 129},{}],4:[function(require,module,exports){ 130'use strict'; 131 132 133var canonicalize = function(phoneNumber) { 134 if(! phoneNumber) { 135 return null; 136 } 137 138 var canonicalPhone; 139 var phoneString = '' + phoneNumber; 140 var match = /^\+?[0-9()\-\s.]+$/.exec(phoneString); 141 142 if(match === null) { 143 console.error('Found invalid characters in phone number: ' + phoneString); 144 145 return null; 146 } 147 148 canonicalPhone = phoneString.replace(/[()\-\s.]+/g, ''); 149 150 if(canonicalPhone[0] === '+') { 151 return canonicalPhone; 152 } 153 154 if(canonicalPhone.length === 10) { 155 return '+1' + canonicalPhone; 156 } 157 158 if(canonicalPhone.length === 11 && canonicalPhone[0] === '1') { 159 return '+' + canonicalPhone; 160 } 161 162 return canonicalPhone; 163}; 164 165module.exports = canonicalize; 166 167},{}],5:[function(require,module,exports){ 168'use strict'; 169 170var cards = []; 171 172var counter = { 173 getCards: function() { 174 return cards; 175 }, 176 177 register: function(card) { 178 cards.push(card); 179 this.positionCards(); 180 }, 181 182 unregister: function(card) { 183 var cardIndex = cards.indexOf(card); 184 cards.splice(cardIndex, 1); 185 this.positionCards(); 186 }, 187 188 /* This function is responsible for vertically positioning 189 * stacked cards. The first card in the cards array will 190 * be positioned at the top, and the second below it and 191 * so on. 192 */ 193 positionCards: function() { 194 var cardEl; 195 var cardHeight; 196 var spacing = 15; 197 var verticalSpacing = 0; 198 199 for(var i = 0; i < cards.length; i++) { 200 cardEl = cards[i].getCardEl(); 201 cardHeight = cards[i].getCardHeight(); 202 cardHeight += spacing; 203 204 cardEl.style.top = (verticalSpacing + spacing) + 'px'; 205 verticalSpacing += cardHeight; 206 } 207 } 208}; 209 210module.exports = counter; 211 212},{}],6:[function(require,module,exports){ 213'use strict'; 214 215var siteData = require('./site-data'); 216var transCatalog = require('../i18n-catalog.json'); 217var Handlebars = require('hbsfy/runtime'); 218 219 220var trans = function(text) {
221 var locale = siteData.getLocale() || ''; 222 223 if (! locale) { 224 return text; 225 } 226 227 if (! transCatalog[locale]) { 228 setTimeout(function() { 229 throw new Error('Locale does not exist: ' + locale); 230 }); 231 232 return text; 233 } 234 235 if(! transCatalog[locale][text]) { 236 return text; 237 } 238 239 return transCatalog[locale][text]; 240}; 241 242Handlebars.registerHelper('trans', trans); 243 244module.exports = trans; 245 246},{"../i18n-catalog.json":3,"./site-data":13,"hbsfy/runtime":42}],7:[function(require,module,exports){ 247'use strict'; 248 249var gettext = require('./gettext'); 250var sprintf = require('sprintf-js').sprintf; 251var todaysHoursHTML = require('./templates/today-hours.hbs'); 252var weekHTML = require('./templates/hours-table.hbs'); 253require('date-utils'); 254 255var hoursRenderer = { 256 days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 257 formatTime: function(time) { 258 var formattedTime = ''; 259 var timeSplat = time.split(':'); 260 var hourDigit = Number(timeSplat[0]); 261 var isPm = hourDigit >= 12; 262 263 if(hourDigit > 12) { 264 hourDigit -= 12; 265 } else if (hourDigit === 0) { 266 hourDigit = 12; 267 } 268 269 formattedTime = hourDigit + ':' + timeSplat[1]; 270 271 formattedTime += isPm ? ' pm' : ' am'; 272 273 return formattedTime; 274 }, 275 276 today: function(hours) { 277 var date = new Date(); 278 var day = date.toFormat('DDD').substring(0,2); 279 var todaysHours = hours[day]; 280 281 if(! todaysHours) { 282 return; 283 } 284 285 var openTime = this.formatTime(todaysHours.open); 286 var closeTime = this.formatTime(todaysHours.close); 287 288 return { 289 open: openTime, 290 close: closeTime 291 }; 292 }, 293 294 openToday: function(hours) { 295 var openStatus; 296 var todaysHours = this.today(hours); 297 298 if(! todaysHours) { 299 return sprintf(gettext('Closed all day')); 300 } 301 302 openStatus = gettext('Open today from %s to %s'); 303 return sprintf(openStatus, todaysHours.open, todaysHours.close); 304 }, 305 306 isOpenNow: function(now, hours) { 307 var today = this.days[now.getDay()]; 308 var todaysHours = hours[today]; 309 310 if (! todaysHours) { 311 return false; 312 } 313 314 var openSplat = todaysHours.open.split(':'); 315 var closeSplat = todaysHours.close.split(':'); 316 317 var openDate = new Date( 318 now.getFullYear(), 319 now.getMonth(), 320 now.getDate(), 321 Number(openSplat[0]), 322 Number(openSplat[1]) 323 ); 324 325 var closeDate = new Date( 326 now.getFullYear(), 327 now.getMonth(), 328 now.getDate(), 329 Number(closeSplat[0]), 330 Number(closeSplat[1]) 331 ); 332 333 return now > openDate && now < closeDate; 334 }, 335 336 week: function(hours) { 337 var now = new Date(); 338 var wrapper = document.createElement('div'); 339 var todaysHours = this.today(hours); 340 var isOpenNow = this.isOpenNow(now, hours); 341 var dayRow, openEl, closeEl, openNowEl, openNowMsg, openCloseClass, todayEl; 342 var todayElContext; 343 var injectDay = function(day) { 344 dayRow = wrapper.querySelector('.' + day); 345 openEl = dayRow.querySelector('td:nth-child(2)'); 346 closeEl = dayRow.querySelector('td:nth-child(3)'); 347 348 if(! hours[day]) { 349 openEl.innerHTML = gettext('Closed'); 350 return; 351 } 352 353 openEl.innerHTML = this.formatTime(hours[day].open); 354 closeEl.innerHTML = this.formatTime(hours[day].close); 355 }; 356 357 wrapper.innerHTML = weekHTML(); 358 359 this.days.forEach(injectDay.bind(this)); 360 361 todayEl = wrapper.querySelector('.today'); 362 363 todayElContext = { 364 hasHours: todaysHours, 365 opens: todaysHours && todaysHours.open, 366 closes: todaysHours && todaysHours.close 367 }; 368 369 todayEl.innerHTML = todaysHoursHTML(todayElContext); 370 openNowEl = wrapper.querySelector('.now'); 371 372 openCloseClass = isOpenNow ? 'open' : 'closed'; 373 openNowMsg = isOpenNow ? gettext('Open now') : gettext('Currently closed'); 374 375 openNowEl.innerHTML = openNowMsg; 376 openNowEl.classList.add(openCloseClass); 377 return wrapper; 378 } 379}; 380 381module.exports = hoursRenderer; 382 383},{"./gettext":6,"./templates/hours-table.hbs":16,"./templates/today-hours.hbs":22,"date-utils":39,"sprintf-js":72}],8:[function(require,module,exports){ 384'use strict'; 385 386require('./gettext'); 387 388var Router = require('./router'); 389var setupMessaging = require('./messaging'); 390 391 392require('date-utils'); 393require('classlist-polyfill'); 394 395setupMessaging(Router); 396 397module.exports = { 398 initialize: Router.initInstance 399}; 400 401},{"./gettext":6,"./messaging":9,"./router":12,"classlist-polyfill":38,"date-utils":39}],9:[function(require,module,exports){ 402'use strict'; 403 404var windowManager = require('./window-manager'); 405 406 407var initializeMessageListening = function(router) { 408 var topWindow = windowManager.get('top'); 409 410 var receiveMessage = function(event) { 411 var parentOrigin = topWindow.location.origin; 412 413 if (event.origin !== parentOrigin) { 414 console.log('Message from an unknown source: ', event.origin); 415 return; 416 } 417 418 if (typeof event.data !== 'object') { 419 console.log('Message has no event.data property'); 420 return; 421 } 422 423 router.forceInit(event.data); 424 }; 425 426 windowManager.get().addEventListener('message', receiveMessage); 427}; 428 429module.exports = initializeMessageListening; 430 431}
431,{"./window-manager":32}],10:[function(require,module,exports){ 432'use strict'; 433 434/* Hideable is a mixin for objects that can be shown and hidden 435 * from view. 436 */ 437 438var hideable = { 439 hide: function(cb, timeout) { 440 var displayNone = function() { 441 this[this.contentName].classList.add('hide'); 442 this[this.contentName].classList.remove('open'); 443 if(typeof cb === 'function') { 444 cb(); 445 } 446 }; 447 448 if(timeout === undefined) { 449 timeout = 400; 450 } 451 452 if(this.noscroll) { 453 this.removeNoScroll(); 454 } 455 456 this[this.contentName].classList.remove(this.transIn || ''); 457 this[this.contentName].classList.add(this.transOut || ''); 458 setTimeout(displayNone.bind(this), timeout); 459 }, 460 461 show: function() { 462 if(this.noscroll) { 463 this.addNoScroll(); 464 } 465 466 this[this.contentName].classList.add('open'); 467 this[this.contentName].classList.remove('hide'); 468 this[this.contentName].classList.add(this.transIn || ''); 469 this[this.contentName].classList.remove(this.transOut || ''); 470 }, 471 472 addNoScroll: function() { 473 document.body.classList.add('noscroll'); 474 }, 475 476 removeNoScroll: function() { 477 document.body.classList.remove('noscroll'); 478 } 479}; 480 481module.exports = hideable; 482 483},{}],11:[function(require,module,exports){ 484'use strict'; 485 486 487var renderable = { 488 render: function(cb) { 489 if(! this.isRendered) { 490 this[this.wrapperName].appendChild(this[this.contentName]); 491 } 492 493 if(typeof this.onRender === 'function') { 494 this.onRender(cb); 495 } 496 497 this.isRendered = true; 498 }, 499 500 remove: function() { 501 if(this.isRendered) { 502 this[this.wrapperName].removeChild(this[this.contentName]); 503 } 504 505 if(typeof this.onRemove === 'function') { 506 this.onRemove(); 507 } 508 509 this.isRendered = false; 510 } 511}; 512 513module.exports = renderable; 514 515},{}],12:[function(require,module,exports){ 516'use strict'; 517 518var AmpersandRouter = require('ampersand-router'); 519var PageView = require('./views/page'); 520var siteData = require('./site-data'); 521 522 523var SiteLocationRouter = AmpersandRouter.extend({ 524 routes: { 525 'toolbar': 'toolbar', 526 'exit': 'exit', 527 'toolbar/map': 'map', 528 'toolbar/hours': 'hours' 529 }, 530 531 initialize: function() { 532 this.pageView = new PageView(); 533 }, 534 535 toolbar: function() { 536 this.pageView.renderToolbar(); 537 }, 538 539 exit: function() { 540 this.pageView.removeAll(); 541 542 this.navigate('', {replace: true}); 543 }, 544 545 map: function() { 546 this.pageView.renderMap(); 547 }, 548 549 hours: function() { 550 this.pageView.renderHours(); 551 }, 552 553 tearDown: function() { 554 var navOpts = { 555 trigger: true, 556 replace: true 557 }; 558 559 this.navigate('exit', navOpts); 560 561 this.pageView.removeAll(); 562 this.pageView.removeActionButton(); 563 } 564}); 565 566SiteLocationRouter.initInstance = function(data) { 567 if(SiteLocationRouter.instance) { 568 console.info('Sitelocation already instantiated.'); 569 return; 570 } 571 572 siteData.set(data); 573 574 if(! PageView.shouldRender()) { 575 console.info('No data for sitelocation to render.'); 576 return; 577 } 578 579 var router = new SiteLocationRouter(); 580 581 if(! router.history.started()) { 582 router.history.start({ pushState: false }); 583 } 584 585 SiteLocationRouter.instance = router; 586 587 return router; 588}; 589 590SiteLocationRouter.forceInit = function(data) { 591 var route = data.route || 'exit'; 592 var navOpts = { 593 trigger: true, 594 replace: true 595 }; 596 597 delete data.route; 598 599 if(this.instance) { 600 this.instance.tearDown(); 601 delete this.instance; 602 } 603 604 this.initInstance(data); 605 606 if(this.instance) { 607 this.instance.navigate(route, navOpts); 608 } 609}; 610 611module.exports = SiteLocationRouter; 612 613},{"./site-data":13,"./views/page":30,"ampersand-router":36}],13:[function(require,module,exports){ 614'use strict'; 615 616 617var siteData = { 618 data: {}, 619 620 set: function(key, value) { 621 if(typeof key === 'object') { 622 this.data = key; 623 } 624 625 this.data[key] = value; 626 }, 627 628 get: function(key) { 629 if (key === 'locale') { 630 return this.getLocale(); 631 } 632 633 return this.data[key]; 634 }, 635 636 getLocale: function() { 637 var langSplat; 638 var lang = this.get('lang') || ''; 639 640 if(lang === 'en') { 641 return ''; 642 } 643 644 if (lang.length !== 5) { 645 return lang; 646 } 647 648 langSplat = lang.split('-'); 649 650 return langSplat[0].toLowerCase() + '_' + langSplat[1].toUpperCase(); 651 } 652}; 653 654module.exports = siteData; 655 656},{}],14:[function(require,module,exports){ 657// hbsfy compiled Handlebars template 658var HandlebarsCompiler = require('hbsfy/runtime'); 659module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 660 return "<div class=\"title\">" 661 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(
661depth0 != null ? depth0 : (container.nullContext || {}),"Address",{"name":"trans","hash":{},"data":data})) 662 + ":</div>\n<address>\n <div class=\"line-one\"></div>\n <div class=\"line-two\"></div>\n</address>\n"; 663},"useData":true}); 664 665},{"hbsfy/runtime":42}],15:[function(require,module,exports){ 666// hbsfy compiled Handlebars template 667var HandlebarsCompiler = require('hbsfy/runtime'); 668module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 669 return "<div class=\"title\">" 670 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Today's Hours",{"name":"trans","hash":{},"data":data})) 671 + ":</div>\n<div class=\"hours\"></div>\n"; 672},"useData":true}); 673 674},{"hbsfy/runtime":42}],16:[function(require,module,exports){ 675// hbsfy compiled Handlebars template 676var HandlebarsCompiler = require('hbsfy/runtime'); 677module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 678 var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; 679 680 return "<h2>" 681 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) 682 + "</h2>\n\n<h3>" 683 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Today",{"name":"trans","hash":{},"data":data})) 684 + "</h3>\n\n<div class=\"today\"></div>\n\n<h3>" 685 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"This Week",{"name":"trans","hash":{},"data":data})) 686 + "</h3>\n\n<table>\n <thead>\n <tr>\n <th>" 687 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Day",{"name":"trans","hash":{},"data":data})) 688 + "</th>\n <th>" 689 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Opens",{"name":"trans","hash":{},"data":data})) 690 + "</th>\n <th>" 691 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Closes",{"name":"trans","hash":{},"data":data})) 692 + "</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"Su\">\n <td>" 693 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Sunday",{"name":"trans","hash":{},"data":data})) 694 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Mo\">\n <td>" 695 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Monday",{"name":"trans","hash":{},"data":data})) 696 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Tu\">\n <td>" 697 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Tuesday",{"name":"trans","hash":{},"data":data})) 698 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"We\">\n <td>" 699 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Wednesday",{"name":"trans","hash":{},"data":data})) 700 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Th\">\n <td>" 701 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Thursday",{"name":"trans","hash":{},"data":data})) 702 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Fr\">\n <td>" 703 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Friday",{"name":"trans","hash":{},"data":data})) 704 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Sa\">\n <td>" 705 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Saturday",{"name":"trans","hash":{},"data":data})) 706 + "</td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n</table>\n"; 707},"useData":true}); 708 709},{"hbsfy/runtime":42}],17:[function(require,module,exports){ 710// hbsfy compiled Handlebars template 711var HandlebarsCompiler = require('hbsfy/runtime'); 712module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 713 return "<input class=\"animated\" placeholder=\"" 714 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(
714depth0 != null ? depth0 : (container.nullContext || {}),"Current Location",{"name":"trans","hash":{},"data":data})) 715 + "\">\n<div class=\"transport-toggle\">\n <button class=\"walk-icon\" data-mode=\"walking\">\n <svg id=\"walk-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"25px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\">\n <path d=\"M48.947,11.08c0-3.972-3.111-7.08-7.081-7.08c-3.974,0-7.082,3.108-7.082,7.08 c0,3.971,3.108,7.082,7.082,7.082C45.835,18.162,48.947,15.051,48.947,11.08z\"/>\n <path d=\"M71.465,30.522c0,0-8.447-4.743-12.188-6.708c-3.744-1.97-11.175-7.06-17.801-1.17 C38.467,25.319,35,39,35,39l-14,8.634l2.299,3.204l15.251-5.544l4.262-5.516l4.513,9.945l-9.109,15.962l-7.188,26.828l7.438,2.508 l8.357-25.072l6.185-6.102l13.539,32.01l6.52-3.01L62.119,53.902c0,0,1.365-2.799,1.365-7.254c0-5.11-4.039-13.473-4.039-13.473 l6.611,1.518l1.48,16.639l4.162,0.391L71.465,30.522z\"/>\n </svg>\n </button>\n <button class=\"drive-icon selected\" data-mode=\"driving\">\n <svg id=\"drive-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"20px\" viewBox=\"0 0 100 83.648\" enable-background=\"new 0 0 100 83.648\" xml:space=\"preserve\">\n <path d=\"M15.727,43.753\"/>\n <path d=\"M90.925,28.696L82.728,7.529C81.195,3.477,77.845,0.029,71.505,0h-11.56H40.188H28.427\n c-6.311,0.029-9.661,3.477-11.222,7.529L9.006,28.696C5.751,29.116-0.01,32.941,0,40.187v26.951h7.999v8.603\n c-0.02,10.606,14.989,10.48,14.985,0v-8.603H50h26.948v8.603c0.033,10.48,15.042,10.606,15.052,0v-8.603h8V40.187\n C99.975,32.941,94.21,29.116,90.925,28.696z M15.727,50.874c-3.834,0.011-6.938-3.187-6.922-7.12\n c-0.016-3.96,3.088-7.161,6.922-7.128c3.822-0.033,6.926,3.168,6.921,7.128C22.653,47.687,19.548,50.884,15.727,50.874z M50,28.497\n h-0.067H17.541l6.182-16.668c0.746-2.366,1.904-4.059,4.639-4.1h21.571H50H71.64c2.693,0.041,3.854,1.733,4.636,4.1l6.183,16.668H50\n z M84.274,50.874c-3.861,0.011-6.967-3.187-6.988-7.12c0.021-3.96,3.127-7.161,6.988-7.128c3.795-0.033,6.898,3.168,6.922,7.128\n C91.172,47.687,88.069,50.884,84.274,50.874z\"/>\n <path d=\"M84.274,43.753\"/>\n </svg>\n </button>\n</div>\n"; 716},"useData":true}); 717 718},{"hbsfy/runtime":42}],18:[function(require,module,exports){ 719// hbsfy compiled Handlebars template 720var HandlebarsCompiler = require('hbsfy/runtime'); 721module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 722 var helper; 723 724 return "<iframe\n frameborder=\"0\"\n style=\"border:0;width:100%;height:100%;\"\n src=\"" 725 + container.escapeExpression(((helper = (helper = helpers.mapSource || (depth0 != null ? depth0.mapSource : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"mapSource","hash":{},"data":data}) : helper))) 726 + "\"\n allowfullscreen>\n</iframe>\n"; 727},"useData":true}); 728 729},{"hbsfy/runtime":42}],19:[function(require,module,exports){ 730// hbsfy compiled Handlebars template 731var HandlebarsCompiler = require('hbsfy/runtime'); 732module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 733 var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; 734 735 return "<div>\n <a id=\"location-tools-phone\" class=\"phone hide\" href=\"\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 578.106 578.106\" style=\"enable-background:new 0 0 578.106 578.106;\" xml:space=\"preserve\">\n <g>\n <path d=\"M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.
735016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z\"/>\n </g>\n </svg>\n\n " 736 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Call",{"name":"trans","hash":{},"data":data})) 737 + "\n </a>\n <a id=\"location-tools-location\" class=\"map hide\" href=\"#toolbar/map\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 51.114 51.114\" style=\"enable-background:new 0 0 51.114 51.114;\" xml:space=\"preserve\">\n <g>\n <path d=\"M41.945,16.388C41.943,7.337,34.609,0,25.56,0C16.507,0,9.169,7.337,9.169,16.388 c0,7.812,12.208,28.683,15.553,34.251c0.176,0.295,0.494,0.475,0.837,0.475c0.343,0,0.662-0.18,0.836-0.474 C29.738,45.072,41.945,24.2,41.945,16.388z M25.559,29.068c-6.991,0-12.683-5.688-12.683-12.681 c0-6.992,5.69-12.681,12.683-12.681s12.679,5.689,12.679,12.681C38.238,23.379,32.551,29.068,25.559,29.068z\"/>\n </g>\n </svg>\n\n " 738 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Map",{"name":"trans","hash":{},"data":data})) 739 + "\n </a>\n <a id=\"location-tools-hours\" class=\"hours hide\" href=\"#toolbar/hours\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 612 612\" style=\"enable-background:new 0 0 612 612;\" xml:space=\"preserve\">\n <g id=\"clock\">\n <path d=\"M306,0C136.992,0,0,136.992,0,306s136.992,306,306,306s306-137.012,306-306S475.008,0,306,0z M306,573.157 C158.451,573.157,38.843,453.55,38.843,306C38.843,158.451,158.451,38.843,306,38.843c147.55,0,267.157,119.608,267.157,267.157 C573.157,453.55,453.55,573.157,306,573.157z M325.125,115.955h-37.657l0.593,209.782l132.077,112.952l23.313-32.876 l-118.326-99.221V115.955z\"/>\n </g>\n </svg>\n\n " 740 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) 741 + "\n </a>\n</div>\n"; 742},"useData":true}); 743 744},{"hbsfy/runtime":42}],20:[function(require,module,exports){ 745// hbsfy compiled Handlebars template 746var HandlebarsCompiler = require('hbsfy/runtime'); 747module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 748 return "<div class=\"title\">" 749 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Phone",{"name":"trans","hash":{},"data":data})) 750 + ":</div>\n<div class=\"phone\"></div>\n"; 751},"useData":true}); 752 753},{"hbsfy/runtime":42}],21:[function(require,module,exports){ 754// hbsfy compiled Handlebars template 755var HandlebarsCompiler = require('hbsfy/runtime'); 756module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 757 return "<svg width=\"20\" height=\"20\">\n <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"20\" stroke-width=\"2\"></line>\n <line x1=\"0\" y1=\"10\" x2=\"20\" y2=\"10\" stroke-width=\"2\"></line>\n</svg>\n"; 758},"useData":true}); 759 760},{"hbsfy/runtime":42}],22:[function(require,module,exports){ 761// hbsfy compiled Handlebars template 762var HandlebarsCompiler = require('hbsfy/runtime'); 763module.exports = HandlebarsCompiler.template({"1":function(container,depth0,helpers,partials,data) { 764 var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; 765 766 return " <time class=\"open\">" 767 + alias4(((helper = (helper = helpers.opens || (depth0 != null ? depth0.opens : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"opens","hash":{},"data":data}) : helper))) 768 + "</time> - <time class=\"close\">" 769 + alias4(((helper = (helper = helpers.closes || (depth0 != null ? depth0.closes : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"closes","hash":{},"data":data}) : helper))) 770 + "</time>\n"; 771},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 772 var stack1; 773 774 return "<span class=\"now\"></span>\n"
775 + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.hasHours : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); 776},"useData":true}); 777 778},{"hbsfy/runtime":42}],23:[function(require,module,exports){ 779'use strict'; 780 781var renderable = require('../mixins/renderable'); 782var windowManager = require('../window-manager'); 783var actionButtonHTML = require('../templates/plus.hbs'); 784 785 786function ActionButton(options) { 787 this.options = options || {}; 788 this.actionButton = document.createElement('button'); 789 this.actionButton.setAttribute('class', 'action-button'); 790 this.actionButton.innerHTML = actionButtonHTML(); 791 this.wrapperEl = this.options.wrapperEl || document.body; 792 this.wrapperName = 'wrapperEl'; 793 this.contentName = 'actionButton'; 794 795 this.actionButton.addEventListener('click', this.toggle.bind(this)); 796} 797 798ActionButton.prototype = Object.create(renderable); 799 800ActionButton.prototype.toggle = function(event) { 801 var window = windowManager.get(); 802 803 if(this.actionButton.classList.contains('open')) { 804 window.location.hash = 'exit'; 805 this.close(); 806 } else { 807 window.location.hash = 'toolbar'; 808 this.open(); 809 } 810}; 811 812ActionButton.prototype.open = function(event) { 813 this.actionButton.classList.add('open'); 814 815 if(typeof this.openCallback === 'function') { 816 this.openCallback(event); 817 } 818}; 819 820ActionButton.prototype.close = function(event) { 821 this.actionButton.classList.remove('open'); 822 823 if(typeof this.closeCallback === 'function') { 824 this.closeCallback(event); 825 } 826}; 827 828ActionButton.prototype.onOpen = function(func) { 829 this.openCallback = func; 830}; 831 832ActionButton.prototype.onClose = function(func) { 833 this.closeCallback = func; 834}; 835 836module.exports = ActionButton; 837 838},{"../mixins/renderable":11,"../templates/plus.hbs":21,"../window-manager":32}],24:[function(require,module,exports){ 839'use strict'; 840 841var hideable = require('../mixins/hideable'); 842var renderable = require('../mixins/renderable'); 843var extend = require('extend'); 844 845function Backdrop(options) { 846 this.options = options || {}; 847 this.backdropEl = document.createElement('div'); 848 this.backdropEl.setAttribute('class', 'backdrop animated hide'); 849 this.transIn = 'fadein'; 850 this.transOut = 'fadeout'; 851 this.contentName = 'backdropEl'; 852 this.wrapperName = 'wrapper'; 853 this.wrapper = this.options.wrapperEl || document.body; 854} 855 856extend(Backdrop.prototype, hideable, renderable); 857 858Backdrop.prototype.onClick = function(route) { 859 return this.backdropEl.addEventListener('click', function() { 860 window.location.hash = route; 861 }); 862}; 863 864module.exports = Backdrop; 865 866},{"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],25:[function(require,module,exports){ 867'use strict'; 868 869 870var siteData = require('../site-data'); 871var canonicalizePhone = require('../canonicalize-phone'); 872var Card = require('./card'); 873var hoursRenderer = require('../hours-renderer'); 874var addressHTML = require('../templates/address.hbs'); 875var hoursHTML = require('../templates/hours-card.hbs'); 876var phoneHTML = require('../templates/phone-card.hbs'); 877 878 879function CardListing(options) { 880 var location = siteData.get('location'); 881 var hoursData = siteData.get('hours'); 882 var addrSecondLine; 883 var phoneNumber = siteData.get('phone'); 884 885 this.cards = []; 886 this.options = options || {}; 887 888 if(location) { 889 addrSecondLine = location.city + ' ' + location.state + ', '; 890 addrSecondLine += location.zipcode; 891 892 this.addressCard = new Card({ 893 html: addressHTML(), 894 zLayer: 120 895 }); 896 897 this.addressCard.inject('.line-one', location.address); 898 this.addressCard.inject('.line-two', addrSecondLine); 899 this.cards.push(this.addressCard); 900 } 901 902 if(hoursData) { 903 this.hoursCard = new Card({ 904 html: hoursHTML(), 905 zLayer: 120 906 }); 907 908 this.hoursCard.inject('.hours', hoursRenderer.openToday(hoursData)); 909 this.cards.push(this.hoursCard); 910 } 911 912 if(canonicalizePhone(phoneNumber) !== null) { 913 this.phoneCard = new Card({ 914 html: phoneHTML(), 915 zLayer: 120 916 }); 917 918 this.phoneCard.inject('.phone', phoneNumber); 919 this.cards.push(this.phoneCard); 920 } 921} 922 923CardListing.prototype.renderCards = function() { 924 for(var i = 0; i < this.cards.length; i++) { 925 this.cards[i].render(); 926 this.cards[i].show(); 927 } 928}; 929 930CardListing.prototype.removeCards = function() { 931 for(var i = 0; i < this.cards.length; i++) { 932 this.cards[i].hideAndRemove(); 933 } 934}; 935 936module.exports = CardListing; 937 938},{"../canonicalize-phone":4,"../hours-renderer":7,"../site-data":13,"../templates/address.hbs":14,"../templates/hours-card.hbs":15,"../templates/phone-card.hbs":20,"./card":26}],26:[function(require,module,exports){ 939'use strict'; 940 941var cardCounter = require('../card-counter'); 942var renderable = require('../mixins/renderable'); 943var hideable = require('../mixins/hideable'); 944var extend = require('extend'); 945 946function Card(options) { 947 this.options = options || {}; 948 this.html = options.html; 949 950 this.contentName = 'cardEl'; 951 this.cardEl = document.createElement('div'); 952 this.cardEl.classList.add('info-card'); 953 this.cardEl.classList.add('animated'); 954 this.cardEl.classList.add('zoomIn'); 955 this.cardEl.innerHTML = options.html; 956 this.cardEl.style['z-index'] = options.zLayer || 0; 957 958 this.closeEl = document.createElement('button'); 959 this.closeEl.classList.add('close'); 960 this.closeEl.classList.add('fa'); 961 this.closeEl.classList.add('fa-times'); 962 963 this.closeEl.addEventListener('click', this.hideAndRemove.bind(this)); 964 this.cardEl.appendChild(this.closeEl); 965 966 this.wrapperName = 'wrapper'; 967 this.wrapper = this.options.wrapperEl || document.body; 968 969 this.transIn = 'zoomIn'; 970 this.transOut = 'zoomOut'; 971} 972 973extend(Card.prototype, hideable, renderable); 974 975Card.prototype.hideAndRemove = function() { 976 this.hide(this.remove.bind(this)); 977}; 978 979Card.prototype.inject = function(selector, content) { 980 this.cardEl.querySelector(selector).innerHTML = content; 981}; 982 983Card.prototype.getCardEl = function() { 984 return this.cardEl; 985}; 986 987Card.prototype.getCardHeight = function() { 988 var cardHeight = this.cardEl.offsetHeight; 989 cardHeight += parseInt(this.cardEl.style['margin-top']) || 0; 990 cardHeight += parseInt(this.cardEl.style['margin-bottom']) || 0; 991 992 return cardHeight; 993}; 994 995Card.prototype.onRender = function() { 996 cardCounter.register(this); 997}; 998 999Card.prototype.onRemove = function() { 1000 cardCounter.unregister(this); 1001}; 1002 1003module.exports = Card; 1004 1005}
1005,{"../card-counter":5,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],27:[function(require,module,exports){ 1006'use strict'; 1007 1008var hoursRenderer = require('../hours-renderer'); 1009var hideable = require('../mixins/hideable'); 1010var renderable = require('../mixins/renderable'); 1011var extend = require('extend'); 1012 1013 1014function HoursView(options) { 1015 this.options = options || {}; 1016 this.hours = options.hours; 1017 this.hoursEl = hoursRenderer.week(this.hours); 1018 this.contentEl = document.createElement('div'); 1019 this.contentEl.classList.add('hours-view'); 1020 this.contentEl.classList.add('animated'); 1021 this.contentEl.classList.add('hide'); 1022 this.contentEl.appendChild(this.hoursEl); 1023 this.contentName = 'contentEl'; 1024 this.wrapper = this.options.wrapperEl || document.body; 1025 1026 /* Properties to be consumed by hideable mixin */ 1027 this.transIn = 'fadein'; 1028 this.transOut = 'fadeout'; 1029 this.contentName = 'contentEl'; 1030 this.wrapperName = 'wrapper'; 1031 1032 this.setHeight(options.height || 500); 1033} 1034 1035extend(HoursView.prototype, hideable, renderable); 1036 1037HoursView.prototype.setHeight = function(newHeight) { 1038 this.contentEl.style.height = newHeight + 'px'; 1039}; 1040 1041module.exports = HoursView; 1042 1043},{"../hours-renderer":7,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],28:[function(require,module,exports){ 1044'use strict'; 1045 1046var toolbarTemplate = require('../templates/map-toolbar.hbs'); 1047var renderable = require('../mixins/renderable'); 1048var hideable = require('../mixins/hideable'); 1049var extend = require('extend'); 1050 1051function MapToolbarView(options) { 1052 options = options || {}; 1053 this.options = options; 1054 this.wrapperName = options.wrapperName; 1055 this.wrapper = options.wrapper; 1056 this.contentName = 'contentEl'; 1057 this.contentEl = document.createElement('section'); 1058 this.contentEl.innerHTML = toolbarTemplate(); 1059 this.contentEl.classList.add('animated'); 1060 this.contentEl.classList.add('map-toolbar'); 1061 this.searchInput = this.contentEl.querySelector('input'); 1062 this.toggleDrive = this.contentEl.querySelector('.drive-icon'); 1063 this.toggleWalk = this.contentEl.querySelector('.walk-icon'); 1064 this.transIn = 'fadein'; 1065 this.transOut = 'fadeout'; 1066 this.selectedMode = 'driving'; 1067} 1068 1069extend(MapToolbarView.prototype, renderable, hideable); 1070 1071 1072/* This function handles the UI of the walk/drive selection. 1073 * It removes the style from the currently selected button and 1074 * adds it to the button passed in from the event handler. 1075 */ 1076MapToolbarView.prototype.select = function(button) { 1077 var selectedEl = this.contentEl.querySelector('.selected'); 1078 selectedEl.classList.remove('selected'); 1079 button.classList.add('selected'); 1080 this.selectedMode = button.getAttribute('data-mode'); 1081}; 1082 1083module.exports = MapToolbarView; 1084 1085},{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/map-toolbar.hbs":17,"extend":41}],29:[function(require,module,exports){ 1086/* global google, navigator */ 1087 1088'use strict'; 1089 1090var debounce = require('debounce'); 1091var extend = require('extend'); 1092var url = require('url'); 1093 1094var googleMapsTemplate = require('../templates/map.hbs'); 1095var MapToolbarView = require('./map-toolbar'); 1096var renderable = require('../mixins/renderable'); 1097 1098var BASEURL = 'https://www.google.com/maps/embed/v1/'; 1099 1100/* This function is the Map constructor. 1101 * Options include: 1102 * 1103 * - height: the height of the map view 1104 * - google embed API key 1105 * - address, city, state, zipcode 1106 */ 1107function MapView(options) { 1108 options = options || {}; 1109 this.options = options; 1110 this.height = options.height || '100%'; 1111 this.address = options.address + ' ' + options.city + ', ' + options.state; 1112 this.address += ' ' + options.zipcode; 1113 this.mapOptions = { 1114 embedAPIKey: options.embedAPIKey, 1115 businessLocation: this.address 1116 }; 1117 this.mapContext = {}; 1118 1119 this.setupMarkup(); 1120 this.getOriginLocation(); 1121 this.attachListeners(); 1122} 1123 1124extend(MapView.prototype, renderable); 1125 1126MapView.prototype.setupMarkup = function() { 1127 var searchHeightOffset; 1128 1129 this.contentName = 'contentEl'; 1130 this.contentEl = document.createElement('div'); 1131 1132 this.wrapperName = 'wrapper'; 1133 this.wrapper = this.options.wrapperEl || document.body; 1134 1135 this.mapToolbar = new MapToolbarView({ 1136 wrapper: this.contentEl, 1137 wrapperName: this.wrapperName 1138 }); 1139 this.mapToolbar.render(); 1140 searchHeightOffset = this.mapToolbar.offsetHeight || 50; 1141 1142 this.mapWrapper = document.createElement('div'); 1143 this.mapWrapper.classList.add('google-map'); 1144 this.mapWrapper.classList.add('animated'); 1145 this.mapWrapper.style.height = this.height - searchHeightOffset + 'px'; 1146 1147 this.contentEl.appendChild(this.mapWrapper); 1148}; 1149 1150MapView.prototype.attachListeners = function() { 1151 var debounceCurrentLocation = debounce( 1152 this.getOriginLocation.bind(this), 1000); 1153 1154 this.mapToolbar.searchInput.addEventListener( 1155 'input', debounceCurrentLocation); 1156 1157 this.mapToolbar.toggleDrive.addEventListener( 1158 'click', this.setTransportMode.bind(this), false); 1159 1160 this.mapToolbar.toggleWalk.addEventListener( 1161 'click', this.setTransportMode.bind(this), false); 1162}; 1163 1164MapView.prototype.setTransportMode = function(event) { 1165 var button = event.currentTarget; 1166 1167 if (!button.classList.contains('selected')) { 1168 var mode = button.getAttribute('data-mode'); 1169 1170 this.mapToolbar.select(button); 1171 this.mapOptions.directionsMode = mode; 1172 this.renderDirectionsMode(); 1173 } 1174}; 1175 1176/* This function sets the origin location using 1177 * one of two methods: 1178 * 1179 * 1. It will use user provided address if the user 1180 * has entered a value via the seach box at the 1181 * top of the view. 1182 * 1183 * 2. If the user has not entered a value in the 1184 * search box and the user has a geolocation 1185 * enabled device and the site has SSL enabled, 1186 * then the function will use navigator to get 1187 * the current location. 1188 * 1189 * If 1 and 2 are not available, the map will 1190 * simply display a marker where the given business 1191 * address is located. 1192 */ 1193MapView.prototype.getOriginLocation = function() { 1194 var setCurrentLocation = function(position) { 1195 var latStr = String(position.coords.latitude); 1196 var lngStr = String(position.coords.longitude); 1197 this.mapOptions.originLocation = latStr + ',' + lngStr; 1198 this.render(); 1199 }.bind(this); 1200 1201 1202 if(this.mapToolbar.searchInput.value) { 1203 this.mapOptions.originLocation = this.mapToolbar.searchInput.value; 1204 this.renderDirectionsMode(); 1205 return; 1206 } 1207 1208 if(navigator.geolocation) { 1209 // HTML5 Geolocation API 1210 // renders business location if current position cannot be retrieved 1211 navigator.geolocation.getCurrentPosition( 1212 setCurrentLocation, 1213 this.renderPlaceMode.bind(this), 1214 {timeout: 3500} 1215 ); 1216 return; 1217 } 1218 1219 this.renderPlaceMode(); 1220}; 1221 1222MapView.prototype.renderPlaceMode = function() { 1223 var placeModeUrl = BASEURL + 'place'; 1224 var urlObj = url.parse(placeModeUrl); 1225 1226 urlObj.query ={ 1227 key: this.mapOptions.embedAPIKey, 1228 q: this.mapOptions.businessLocation 1229 }; 1230 1231 this.mapContext.mapSource = urlObj.format(); 1232 this.render(); 1233}; 1234 1235MapView.prototype.renderDirectionsMode = function() { 1236 var directionsModeUrl = BASEURL + 'directions'; 1237 var urlObj = url.parse(directionsModeUrl); 1238 1239 urlObj.query = { 1240 key: this.mapOptions.embedAPIKey, 1241 origin: this.mapOptions.originLocation, 1242 destination: this.mapOptions.businessLocation 1243 } 1244 1245 if(this.mapOptions.directionsMode) { 1246 urlObj.query.mode = this.mapOptions.directionsMode; 1247 } 1248 1249 this.mapContext.mapSource = urlObj.format(); 1250 this.render(); 1251}; 1252 1253MapView.prototype.getWrapper = function() { 1254 return this.mapWrapper; 1255}; 1256 1257/* Show the Map */ 1258MapView.prototype.show = function() { 1259 this.mapWrapper.classList.add('open'); 1260 this.mapWrapper.classList.add('fadein'); 1261 this.mapWrapper.classList.remove('fadeout'); 1262 this.mapToolbar.show(); 1263}; 1264 1265/* Hide the Map */ 1266MapView.prototype.hide = function(cb, timeout) { 1267 if(timeout === undefined) { 1268 timeout = 400; 1269 } 1270 1271 this.mapWrapper.classList.add('fadeout'); 1272 this.mapWrapper.classList.remove('fadein'); 1273 this.mapToolbar.hide(); 1274 1275 var removeOpenClass = function() { 1276 this.mapWrapper.classList.remove('open'); 1277 this.mapToolbar.contentEl.classList.remove('open'); 1278 if(typeof cb === 'function') { 1279 cb(); 1280 } 1281 }; 1282 1283 setTimeout(removeOpenClass.bind(this), timeout); 1284}; 1285 1286MapView.prototype.onRender = function() { 1287 this.mapWrapper.innerHTML = googleMapsTemplate(this.mapContext); 1288}; 1289 1290module.exports = MapView; 1291 1292},{"../mixins/renderable":11,"../templates/map.hbs":18,"./map-toolbar":28,"debounce":40,"extend":41,"url":141}],30:[function(require,module,exports){ 1293'use strict'; 1294 1295var MapView = require('./map'); 1296var Backdrop = require('./backdrop'); 1297var Toolbar = require('./toolbar'); 1298var ActionButton = require('./action-button'); 1299var HoursView = require('./hours'); 1300var animatedScrollTo = require('animated-scrollto'); 1301var siteData = require('../site-data'); 1302var CardListing = require('./card-listing'); 1303var canonicalizePhone = require('../canonicalize-phone'); 1304 1305
1306var getViewportHeight = function() { 1307 return Math.max( 1308 document.documentElement.clientHeight, window.innerHeight || 0); 1309}; 1310 1311function PageView(options) { 1312 this.options = options || {}; 1313 this.actionButton = new ActionButton(); 1314 this.toolbar = new Toolbar(); 1315 this.backdrop = new Backdrop(); 1316 this.mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); 1317 1318 this.cardListing = new CardListing(); 1319 1320 this.initializePhone(); 1321 1322 var hasLoc = siteData.get('location'); 1323 var hasPhone = siteData.get('phone'); 1324 var hasHours = siteData.get('hours'); 1325 1326 if(hasHours) { 1327 this.initializeHours(); 1328 } 1329 1330 if(hasLoc) { 1331 this.initializeMap(); 1332 } 1333 1334 if(hasLoc || hasHours || hasPhone) { 1335 this.actionButton.render(); 1336 } 1337 1338 this.backdrop.onClick('exit'); 1339 1340 var resize = function(event) { 1341 var mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); 1342 if(this.mapView && this.mapView.google) { 1343 this.mapView.setHeight(mapHoursHeight); 1344 } 1345 1346 if(this.hoursView) { 1347 this.hoursView.setHeight(mapHoursHeight); 1348 } 1349 }; 1350 1351 window.addEventListener('resize', resize.bind(this)); 1352} 1353 1354PageView.prototype.initializeMap = function() { 1355 var location = siteData.get('location'); 1356 var embedAPIKey = siteData.get('embedAPIKey'); 1357 1358 this.mapView = new MapView({ 1359 address: location.address, 1360 city: location.city, 1361 state: location.state, 1362 zipcode: location.zipcode, 1363 height: this.mapHoursHeight, 1364 embedAPIKey: embedAPIKey 1365 }); 1366 1367 this.toolbar.showButton('map'); 1368}; 1369 1370PageView.prototype.initializeHours = function() { 1371 this.hoursView = new HoursView({ 1372 hours: siteData.get('hours'), 1373 height: this.mapHoursHeight 1374 }); 1375 1376 this.toolbar.showButton('hours'); 1377}; 1378 1379PageView.prototype.initializePhone = function() { 1380 var phoneNumber = siteData.get('phone'); 1381 var canonicalPhone = canonicalizePhone(phoneNumber); 1382 1383 if(canonicalPhone !== null) { 1384 this.toolbar.phoneNumber(canonicalPhone); 1385 this.toolbar.showButton('phone'); 1386 } 1387}; 1388 1389PageView.prototype.open = function() { 1390 animatedScrollTo(document.body, 0, 400); 1391 this.backdrop.render(); 1392 this.backdrop.show(); 1393 this.actionButton.open(); 1394 this.toolbar.render(); 1395 this.toolbar.show(); 1396 this.actionButton.open(); 1397}; 1398 1399PageView.prototype.renderToolbar = function() { 1400 this.open(); 1401 this.cardListing.renderCards(); 1402}; 1403 1404PageView.prototype.renderHours = function() { 1405 if(this.hoursView) { 1406 this.hoursView.render(); 1407 this.hoursView.show(); 1408 } 1409 1410 this.removeMap(); 1411 this.open(); 1412 this.cardListing.removeCards(); 1413}; 1414 1415PageView.prototype.renderMap = function() { 1416 if(this.mapView) { 1417 this.mapView.render(); 1418 this.mapView.show(); 1419 } 1420 1421 this.removeHours(); 1422 this.open(); 1423 this.cardListing.removeCards(); 1424}; 1425 1426PageView.prototype.removeActionButton = function() { 1427 if(this.actionButton.isRendered) { 1428 this.actionButton.remove(); 1429 } 1430}; 1431 1432PageView.prototype.removeMap = function() { 1433 if(this.mapView) { 1434 this.mapView.hide(this.mapView.remove.bind(this.mapView)); 1435 } 1436}; 1437 1438PageView.prototype.removeHours = function() { 1439 if(this.hoursView) { 1440 this.hoursView.hide(this.hoursView.remove.bind(this.hoursView)); 1441 } 1442}; 1443 1444PageView.prototype.removeToolbar = function() { 1445 this.toolbar.hide(this.toolbar.remove.bind(this.toolbar)); 1446}; 1447 1448PageView.prototype.removeBackdrop = function() { 1449 this.backdrop.hide(this.backdrop.remove.bind(this.backdrop)); 1450}; 1451 1452PageView.prototype.removeAll = function() { 1453 this.removeHours(); 1454 this.removeMap(); 1455 this.removeBackdrop(); 1456 this.removeToolbar(); 1457 this.actionButton.close(); 1458 1459 this.cardListing.removeCards(); 1460}; 1461 1462PageView.shouldRender = function() { 1463 var phone = siteData.get('phone'); 1464 var hours = siteData.get('hours'); 1465 var location = siteData.get('location'); 1466 1467 return phone || hours || location; 1468}; 1469 1470module.exports = PageView; 1471 1472},{"../canonicalize-phone":4,"../site-data":13,"./action-button":23,"./backdrop":24,"./card-listing":25,"./hours":27,"./map":29,"./toolbar":31,"animated-scrollto":37}],31:[function(require,module,exports){ 1473'use strict'; 1474 1475var hideable = require('../mixins/hideable'); 1476var renderable = require('../mixins/renderable'); 1477var extend = require('extend');
1478var toolbarHTML = require('../templates/mobile-features.hbs'); 1479 1480function Toolbar(options) { 1481 this.options = options || {}; 1482 this.contentEl = document.createElement('section'); 1483 this.contentName = 'contentEl'; 1484 1485 this.wrapperEl = this.options.wrapperEl || document.body; 1486 this.wrapperName = 'wrapperEl'; 1487 1488 this.transIn = 'fadeinup'; 1489 this.transOut = 'fadeoutdown'; 1490 1491 this.contentEl.innerHTML = toolbarHTML(); 1492 1493 this.contentEl.classList.add('mobile-features'); 1494 this.contentEl.classList.add('animated'); 1495 this.contentEl.classList.add('hide'); 1496 1497 this.noscroll = true; 1498} 1499 1500extend(Toolbar.prototype, hideable, renderable); 1501 1502Toolbar.prototype.getWrapperEl = function() { 1503 return this.contentEl; 1504}; 1505 1506Toolbar.prototype.showButton = function(buttonName) { 1507 var buttonEl = this.contentEl.querySelector('.' + buttonName); 1508 1509 buttonEl.classList.remove('hide'); 1510}; 1511 1512Toolbar.prototype.phoneNumber = function(phoneNumber) { 1513 var callEl = this.contentEl.querySelector('#location-tools-phone'); 1514 1515 callEl.href = 'tel:' + phoneNumber; 1516}; 1517 1518Toolbar.prototype.getHeight = function() { 1519 return this.contentEl.offsetHeight || 70; 1520}; 1521 1522Toolbar.prototype.onDirectionsClick = function(func) { 1523 this.contentEl.querySelector('#location-tools-map') 1524 .addEventListener('click', func); 1525}; 1526 1527Toolbar.prototype.onPhoneClick = function(func) { 1528 this.contentEl.querySelector('#location-tools-phone') 1529 .addEventListener('click', func); 1530}; 1531 1532Toolbar.prototype.onHoursClick = function(func) { 1533 this.contentEl.querySelector('#location-tools-hours') 1534 .addEventListener('click', func); 1535}; 1536 1537module.exports = Toolbar; 1538 1539},{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/mobile-features.hbs":19,"extend":41}],32:[function(require,module,exports){ 1540'use strict'; 1541 1542 1543var windowManager = { 1544 set: function(_window) { 1545 this.window = _window; 1546 }, 1547 1548 get: function() { 1549 return this.window; 1550 }, 1551 1552 reset: function() { 1553 this.window = this.originalWindow; 1554 }, 1555 1556 init: function(_window) { 1557 this.window = _window; 1558 this.originalWindow = _window; 1559 } 1560}; 1561 1562windowManager.init(window); 1563 1564module.exports = windowManager; 1565 1566},{}],33:[function(require,module,exports){ 1567var assign = require('lodash.assign'); 1568 1569/// Following code is largely pasted from Backbone.js 1570 1571// Helper function to correctly set up the prototype chain, for subclasses. 1572// Similar to `goog.inherits`, but uses a hash of prototype properties and 1573// class properties to be extended. 1574var extend = function(protoProps) { 1575 var parent = this; 1576 var child; 1577 var args = [].slice.call(arguments); 1578 1579 // The constructor function for the new subclass is either defined by you 1580 // (the "constructor" property in your `extend` definition), or defaulted 1581 // by us to simply call the parent's constructor. 1582 if (protoProps && protoProps.hasOwnProperty('constructor')) { 1583 child = protoProps.constructor; 1584 } else { 1585 child = function () { 1586 return parent.apply(this, arguments); 1587 }; 1588 } 1589 1590 // Add static properties to the constructor function from parent 1591 assign(child, parent); 1592 1593 // Set the prototype chain to inherit from `parent`, without calling 1594 // `parent`'s constructor function. 1595 var Surrogate = function(){ this.constructor = child; }; 1596 Surrogate.prototype = parent.prototype; 1597 child.prototype = new Surrogate(); 1598 1599 // Mix in all prototype properties to the subclass if supplied.
1600 if (protoProps) { 1601 args.unshift(child.prototype); 1602 assign.apply(null, args); 1603 } 1604 1605 // Set a convenience property in case the parent's prototype is needed 1606 // later. 1607 child.__super__ = parent.prototype; 1608 1609 return child; 1610}; 1611 1612// Expose the extend function 1613module.exports = extend; 1614 1615},{"lodash.assign":57}],34:[function(require,module,exports){ 1616;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-events"] = window.ampersand["ampersand-events"] || []; window.ampersand["ampersand-events"].push("1.1.1");} 1617var runOnce = require('lodash.once'); 1618var uniqueId = require('lodash.uniqueid'); 1619var keys = require('lodash.keys'); 1620var isEmpty = require('lodash.isempty'); 1621var each = require('lodash.foreach'); 1622var bind = require('lodash.bind'); 1623var assign = require('lodash.assign'); 1624var slice = Array.prototype.slice; 1625var eventSplitter = /\s+/; 1626 1627 1628var Events = { 1629 // Bind an event to a `callback` function. Passing `"all"` will bind 1630 // the callback to all events fired. 1631 on: function(name, callback, context) { 1632 if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; 1633 this._events || (this._events = {}); 1634 var events = this._events[name] || (this._events[name] = []); 1635 events.push({callback: callback, context: context, ctx: context || this}); 1636 return this; 1637 }, 1638 1639 // Bind an event to only be triggered a single time. After the first time 1640 // the callback is invoked, it will be removed. 1641 once: function(name, callback, context) { 1642 if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; 1643 var self = this; 1644 var once = runOnce(function() { 1645 self.off(name, once); 1646 callback.apply(this, arguments); 1647 }); 1648 once._callback = callback; 1649 return this.on(name, once, context); 1650 }, 1651 1652 // Remove one or many callbacks. If `context` is null, removes all 1653 // callbacks with that function. If `callback` is null, removes all 1654 // callbacks for the event. If `name` is null, removes all bound 1655 // callbacks for all events. 1656 off: function(name, callback, context) { 1657 var retain, ev, events, names, i, l, j, k; 1658 if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; 1659 if (!name && !callback && !context) { 1660 this._events = void 0; 1661 return this; 1662 } 1663 names = name ? [name] : keys(this._events); 1664 for (i = 0, l = names.length; i < l; i++) { 1665 name = names[i]; 1666 if (events = this._events[name]) { 1667 this._events[name] = retain = []; 1668 if (callback || context) { 1669 for (j = 0, k = events.length; j < k; j++) { 1670 ev = events[j]; 1671 if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || 1672 (context && context !== ev.context)) { 1673 retain.push(ev); 1674 } 1675 } 1676 } 1677 if (!retain.length) delete this._events[name]; 1678 } 1679 } 1680 1681 return this; 1682 }, 1683 1684 // Trigger one or many events, firing all bound callbacks. Callbacks are 1685 // passed the same arguments as `trigger` is, apart from the event name 1686 // (unless you're listening on `"all"`, which will cause your callback to 1687 // receive the true name of the event as the first argument). 1688 trigger: function(name) { 1689 if (!this._events) return this; 1690 var args = slice.call(arguments, 1); 1691 if (!eventsApi(this, 'trigger', name, args)) return this; 1692 var events = this._events[name]; 1693 var allEvents = this._events.all; 1694 if (events) triggerEvents(events, args); 1695 if (allEvents) triggerEvents(allEvents, arguments); 1696 return this; 1697 }, 1698 1699 // Tell this object to stop listening to either specific events ... or 1700 // to every object it's currently listening to. 1701 stopListening: function(obj, name, callback) { 1702 var listeningTo = this._listeningTo; 1703 if (!listeningTo) return this; 1704 var remove = !name && !callback; 1705 if (!callback && typeof name === 'object') callback = this; 1706 if (obj) (listeningTo = {})[obj._listenId] = obj; 1707 for (var id in listeningTo) { 1708 obj = listeningTo[id]; 1709 obj.off(name, callback, this); 1710 if (remove || isEmpty(obj._events)) delete this._listeningTo[id]; 1711 } 1712 return this; 1713 }, 1714 1715 // extend an object with event capabilities if passed 1716 // or just return a new one. 1717 createEmitter: function (obj) { 1718 return assign(obj || {}, Events); 1719 } 1720}; 1721 1722Events.bind = Events.on; 1723Events.unbind = Events.off; 1724 1725 1726// Implement fancy features of the Events API such as multiple event 1727// names `"change blur"` and jQuery-style event maps `{change: action}` 1728// in terms of the existing API. 1729var eventsApi = function(obj, action, name, rest) { 1730 if (!name) return true; 1731 1732 // Handle event maps. 1733 if (typeof name === 'object') { 1734 for (var key in name) { 1735 obj[action].apply(obj, [key, name[key]].concat(rest)); 1736 } 1737 return false;
1738 } 1739 1740 // Handle space separated event names. 1741 if (eventSplitter.test(name)) { 1742 var names = name.split(eventSplitter); 1743 for (var i = 0, l = names.length; i < l; i++) { 1744 obj[action].apply(obj, [names[i]].concat(rest)); 1745 } 1746 return false; 1747 } 1748 1749 return true; 1750}; 1751 1752// A difficult-to-believe, but optimized internal dispatch function for 1753// triggering events. Tries to keep the usual cases speedy. 1754var triggerEvents = function(events, args) { 1755 var ev; 1756 var i = -1; 1757 var l = events.length; 1758 var a1 = args[0]; 1759 var a2 = args[1]; 1760 var a3 = args[2]; 1761 switch (args.length) { 1762 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 1763 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 1764 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 1765 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 1766 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; 1767 } 1768}; 1769 1770var listenMethods = { 1771 listenTo: 'on', 1772 listenToOnce: 'once' 1773}; 1774 1775// Inversion-of-control versions of `on` and `once`. Tell *this* object to 1776// listen to an event in another object ... keeping track of what it's 1777// listening to. 1778each(listenMethods, function(implementation, method) { 1779 Events[method] = function(obj, name, callback, run) { 1780 var listeningTo = this._listeningTo || (this._listeningTo = {}); 1781 var id = obj._listenId || (obj._listenId = uniqueId('l')); 1782 listeningTo[id] = obj; 1783 if (!callback && typeof name === 'object') callback = this; 1784 obj[implementation](name, callback, this); 1785 return this; 1786 }; 1787}); 1788 1789Events.listenToAndRun = function (obj, name, callback) { 1790 Events.listenTo.apply(this, arguments); 1791 if (!callback && typeof name === 'object') callback = this; 1792 callback.apply(this); 1793 return this; 1794}; 1795 1796module.exports = Events; 1797 1798},{"lodash.assign":57,"lodash.bind":59,"lodash.foreach":60,"lodash.isempty":63,"lodash.keys":67,"lodash.once":68,"lodash.uniqueid":71}],35:[function(require,module,exports){ 1799var Events = require('ampersand-events'); 1800var extend = require('lodash.assign'); 1801var bind = require('lodash.bind'); 1802 1803 1804// Handles cross-browser history management, based on either 1805// [pushState](http://diveintohtml5.info/history.html) and real URLs, or 1806// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) 1807// and URL fragments. If the browser supports neither. 1808var History = function () { 1809 this.handlers = []; 1810 this.checkUrl = bind(this.checkUrl, this); 1811 1812 // Ensure that `History` can be used outside of the browser. 1813 if (typeof window !== 'undefined') { 1814 this.location = window.location; 1815 this.history = window.history; 1816 } 1817}; 1818 1819// Cached regex for stripping a leading hash/slash and trailing space. 1820var routeStripper = /^[#\/]|\s+$/g; 1821 1822// Cached regex for stripping leading and trailing slashes. 1823var rootStripper = /^\/+|\/+$/g; 1824 1825// Cached regex for stripping urls of hash. 1826var pathStripper = /#.*$/; 1827 1828// Has the history handling already been started? 1829History.started = false; 1830 1831// Set up all inheritable **Backbone.History** properties and methods. 1832extend(History.prototype, Events, { 1833 1834 // The default interval to poll for hash changes, if necessary, is 1835 // twenty times a second. 1836 interval: 50, 1837 1838 // Are we at the app root? 1839 atRoot: function () { 1840 var path = this.location.pathname.replace(/[^\/]$/, '$&/'); 1841 return path === this.root && !this.location.search; 1842 }, 1843 1844 // Gets the true hash value. Cannot use location.hash directly due to bug 1845 // in Firefox where location.hash will always be decoded. 1846 getHash: function (window) { 1847 var match = (window || this).location.href.match(/#(.*)$/); 1848 return match ? match[1] : ''; 1849 }, 1850 1851 // Get the pathname and search params, without the root. 1852 getPath: function () { 1853 var path = decodeURI(this.location.pathname + this.location.search); 1854 var root = this.root.slice(0, -1); 1855 if (!path.indexOf(root)) path = path.slice(root.length); 1856 return path.slice(1); 1857 }, 1858 1859 // Get the cross-browser normalized URL fragment from the path or hash. 1860 getFragment: function (fragment) { 1861 if (fragment == null) { 1862 if (this._hasPushState || !this._wantsHashChange) { 1863 fragment = this.getPath(); 1864 } else { 1865 fragment = this.getHash(); 1866 } 1867 } 1868 return fragment.replace(routeStripper, ''); 1869 }, 1870 1871 // Start the hash change handling, returning `true` if the current URL matches 1872 // an existing route, and `false` otherwise. 1873 start: function (options) { 1874 if (History.started) throw new Error("Backbone.history has already been started"); 1875 History.started = true; 1876 1877 // Figure out the initial configuration. 1878 // Is pushState desired ... is it available? 1879 this.options = extend({root: '/', pushState: true}, this.options, options); 1880 this.root = this.options.root; 1881 this._wantsHashChange = this.options.hashChange !== false; 1882 this._hasHashChange = 'onhashchange' in window; 1883 this._wantsPushState = !!this.options.pushState; 1884 this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); 1885 this.fragment = this.getFragment(); 1886 1887 // Add a cross-platform `addEventListener` shim for older browsers. 1888 var addEventListener = window.addEventListener; 1889 1890 // Normalize root to always include a leading and trailing slash. 1891 this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 1892 1893 // Depending on whether we're using pushState or hashes, and whether 1894 // 'onhashchange' is supported, determine how we check the URL state. 1895 if (this._hasPushState) { 1896 addEventListener('popstate', this.checkUrl, false); 1897 } else if (this._wantsHashChange && this._hasHashChange) { 1898 addEventListener('hashchange', this.checkUrl, false); 1899 } else if (this._wantsHashChange) { 1900 this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 1901 } 1902 1903 // Transition from hashChange to pushState or vice versa if both are 1904 // requested. 1905 if (this._wantsHashChange && this._wantsPushState) { 1906 1907 // If we've started off with a route from a `pushState`-enabled 1908 // browser, but we're currently in a browser that doesn't support it... 1909 if (!this._hasPushState && !this.atRoot()) { 1910 this.location.replace(this.root + '#' + this.getPath()); 1911 // Return immediately as browser will do redirect to new url 1912 return true; 1913 1914 // Or if we've started out with a hash-based route, but we're currently 1915 // in a browser where it could be `pushState`-based instead... 1916 } else if (this._hasPushState && this.atRoot()) { 1917 this.navigate(this.getHash(), {replace: true}); 1918 } 1919 } 1920 1921 if (!this.options.silent) return this.loadUrl(); 1922 }, 1923 1924 // Returns the value of History.started. Allows an app or units tests to 1925 // check whether or not the router has been started with 1926 // router.history.started(); otherwise the started flag is inaccessible 1927 started: function () { 1928 return History.started; 1929 }, 1930 1931 // Disable Backbone.history, perhaps temporarily. Not useful in a real app, 1932 // but possibly useful for unit testing Routers. 1933 stop: function () { 1934 // Add a cross-platform `removeEventListener` shim for older browsers. 1935 var removeEventListener = window.removeEventListener; 1936 1937 // Remove window listeners. 1938 if (this._hasPushState) { 1939 removeEventListener('popstate', this.checkUrl, false); 1940 } else if (this._wantsHashChange && this._hasHashChange) { 1941 removeEventListener('hashchange', this.checkUrl, false); 1942 } 1943 1944 // Some environments will throw when clearing an undefined interval. 1945 if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); 1946 History.started = false;
1947 }, 1948 1949 // Add a route to be tested when the fragment changes. Routes added later 1950 // may override previous routes. 1951 route: function (route, callback) { 1952 this.handlers.unshift({route: route, callback: callback}); 1953 }, 1954 1955 urlChanged: function () { 1956 var current = this.getFragment(); 1957 if (current === this.fragment) return false; 1958 return true; 1959 }, 1960 1961 // Checks the current URL to see if it has changed, and if it has, 1962 // calls `loadUrl`. 1963 checkUrl: function (e) { 1964 this.urlChanged() && this.loadUrl(); 1965 }, 1966 1967 // Attempt to load the current URL fragment. If a route succeeds with a 1968 // match, returns `true`. If no defined routes matches the fragment, 1969 // returns `false`. 1970 loadUrl: function (fragment) { 1971 fragment = this.fragment = this.getFragment(fragment); 1972 return this.handlers.some(function (handler) { 1973 if (handler.route.test(fragment)) { 1974 handler.callback(fragment); 1975 return true; 1976 } 1977 }); 1978 }, 1979 1980 // Save a fragment into the hash history, or replace the URL state if the 1981 // 'replace' option is passed. You are responsible for properly URL-encoding 1982 // the fragment in advance. 1983 // 1984 // The options object can contain `trigger: false` if you wish to have the 1985 // route callback not be fired (sometimes desirable), or `replace: true`, if 1986 // you wish to modify the current URL without adding an entry to the history. 1987 navigate: function (fragment, options) { 1988 if (!History.started) return false; 1989 options = extend({trigger: true}, options); 1990 1991 var url = this.root + (fragment = this.getFragment(fragment || '')); 1992 1993 // Strip the hash and decode for matching. 1994 fragment = decodeURI(fragment.replace(pathStripper, '')); 1995 1996 if (this.fragment === fragment) return; 1997 this.fragment = fragment; 1998 1999 // Don't include a trailing slash on the root. 2000 if (fragment === '' && url !== '/') url = url.slice(0, -1); 2001 2002 // If pushState is available, we use it to set the fragment as a real URL. 2003 if (this._hasPushState) { 2004 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 2005 2006 // If hash changes haven't been explicitly disabled, update the hash 2007 // fragment to store history. 2008 } else if (this._wantsHashChange) { 2009 this._updateHash(this.location, fragment, options.replace); 2010 // If you've told us that you explicitly don't want fallback hashchange- 2011 // based history, then `navigate` becomes a page refresh. 2012 } else { 2013 return this.location.assign(url); 2014 } 2015 2016 if (options.trigger) return this.loadUrl(fragment); 2017 }, 2018 2019 // Update the hash location, either replacing the current entry, or adding 2020 // a new one to the browser history. 2021 _updateHash: function (location, fragment, replace) { 2022 if (replace) { 2023 var href = location.href.replace(/(javascript:|#).*$/, ''); 2024 location.replace(href + '#' + fragment); 2025 } else { 2026 // Some browsers require that `hash` contains a leading #. 2027 location.hash = '#' + fragment; 2028 } 2029 } 2030 2031}); 2032 2033module.exports = new History(); 2034 2035},{"ampersand-events":34,"lodash.assign":57,"lodash.bind":59}],36:[function(require,module,exports){ 2036;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-router"] = window.ampersand["ampersand-router"] || []; window.ampersand["ampersand-router"].push("3.0.2");} 2037var classExtend = require('ampersand-class-extend'); 2038var Events = require('ampersand-events'); 2039var extend = require('lodash.assign'); 2040var isRegexp = require('lodash.isregexp'); 2041var isFunction = require('lodash.isfunction'); 2042var result = require('lodash.result'); 2043 2044var ampHistory = require('./ampersand-history'); 2045 2046// Routers map faux-URLs to actions, and fire events when routes are 2047// matched. Creating a new one sets its `routes` hash, if not set statically. 2048var Router = module.exports = function (options) {
2049 options || (options = {}); 2050 this.history = options.history || ampHistory; 2051 if (options.routes) this.routes = options.routes; 2052 this._bindRoutes(); 2053 this.initialize.apply(this, arguments); 2054}; 2055 2056// Cached regular expressions for matching named param parts and splatted 2057// parts of route strings. 2058var optionalParam = /\((.*?)\)/g; 2059var namedParam = /(\(\?)?:\w+/g; 2060var splatParam = /\*\w+/g; 2061var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 2062 2063// Set up all inheritable **Backbone.Router** properties and methods. 2064extend(Router.prototype, Events, { 2065 2066 // Initialize is an empty function by default. Override it with your own 2067 // initialization logic. 2068 initialize: function () {}, 2069 2070 // Manually bind a single named route to a callback. For example: 2071 // 2072 // this.route('search/:query/p:num', 'search', function (query, num) { 2073 // ... 2074 // }); 2075 // 2076 route: function (route, name, callback) { 2077 if (!isRegexp(route)) route = this._routeToRegExp(route); 2078 if (isFunction(name)) { 2079 callback = name; 2080 name = ''; 2081 } 2082 if (!callback) callback = this[name]; 2083 var router = this; 2084 this.history.route(route, function (fragment) { 2085 var args = router._extractParameters(route, fragment); 2086 if (router.execute(callback, args, name) !== false) { 2087 router.trigger.apply(router, ['route:' + name].concat(args)); 2088 router.trigger('route', name, args); 2089 router.history.trigger('route', router, name, args); 2090 } 2091 }); 2092 return this; 2093 }, 2094 2095 // Execute a route handler with the provided parameters. This is an 2096 // excellent place to do pre-route setup or post-route cleanup. 2097 execute: function (callback, args, name) { 2098 if (callback) callback.apply(this, args); 2099 }, 2100 2101 // Simple proxy to `ampHistory` to save a fragment into the history. 2102 navigate: function (fragment, options) { 2103 this.history.navigate(fragment, options); 2104 return this; 2105 }, 2106 2107 // Reload the current route as if it was navigated to from somewhere 2108 // else 2109 reload: function () { 2110 this.history.loadUrl(this.history.fragment); 2111 return this; 2112 }, 2113 2114 // Helper for doing `internal` redirects without adding to history 2115 // and thereby breaking backbutton functionality. 2116 redirectTo: function (newUrl) { 2117 this.navigate(newUrl, {replace: true}); 2118 }, 2119 2120 // Bind all defined routes to `history`. We have to reverse the 2121 // order of the routes here to support behavior where the most general 2122 // routes can be defined at the bottom of the route map. 2123 _bindRoutes: function () { 2124 if (!this.routes) return; 2125 this.routes = result(this, 'routes'); 2126 var route, routes = Object.keys(this.routes); 2127 while ((route = routes.pop()) != null) { 2128 this.route(route, this.routes[route]); 2129 } 2130 }, 2131 2132 // Convert a route string into a regular expression, suitable for matching 2133 // against the current location hash. 2134 _routeToRegExp: function (route) { 2135 route = route 2136 .replace(escapeRegExp, '\\$&') 2137 .replace(optionalParam, '(?:$1)?') 2138 .replace(namedParam, function (match, optional) { 2139 return optional ? match : '([^/?]+)'; 2140 }) 2141 .replace(splatParam, '([^?]*?)'); 2142 return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); 2143 }, 2144 2145 // Given a route, and a URL fragment that it matches, return the array of 2146 // extracted decoded parameters. Empty or unmatched parameters will be 2147 // treated as `null` to normalize cross-browser behavior. 2148 _extractParameters: function (route, fragment) { 2149 var params = route.exec(fragment).slice(1); 2150 return params.map(function (param, i) { 2151 // Don't decode the search params. 2152 if (i === params.length - 1) return param || null; 2153 return param ? decodeURIComponent(param) : null; 2154 }); 2155 } 2156 2157}); 2158 2159Router.extend = classExtend; 2160 2161},{"./ampersand-history":35,"ampersand-class-extend":33,"ampersand-events":34,"lodash.assign":57,"lodash.isfunction":64,"lodash.isregexp":65,"lodash.result":70}],37:[function(require,module,exports){ 2162(function (window) { 2163 var requestAnimFrame = (function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})(); 2164 2165 var easeInOutQuad = function (t, b, c, d) { 2166 t /= d/2; 2167 if (t < 1) return c/2*t*t + b; 2168 t--; 2169 return -c/2 * (t*(t-2) - 1) + b; 2170 }; 2171 2172 var animatedScrollTo = function (element, to, duration, callback) { 2173 var start = element.scrollTop, 2174 change = to - start, 2175 animationStart = +new Date(); 2176 var animating = true; 2177 var lastpos = null; 2178 2179 var animateScroll = function() { 2180 if (!animating) { 2181 return; 2182 }
2183 requestAnimFrame(animateScroll); 2184 var now = +new Date(); 2185 var val = Math.floor(easeInOutQuad(now - animationStart, start, change, duration)); 2186 if (lastpos) { 2187 if (lastpos === element.scrollTop) { 2188 lastpos = val; 2189 element.scrollTop = val; 2190 } else { 2191 animating = false; 2192 } 2193 } else { 2194 lastpos = val; 2195 element.scrollTop = val; 2196 } 2197 if (now > animationStart + duration) { 2198 element.scrollTop = to; 2199 animating = false; 2200 if (callback) { callback(); } 2201 } 2202 }; 2203 requestAnimFrame(animateScroll); 2204 }; 2205 2206 if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { 2207 module.exports = animatedScrollTo; 2208 } else { 2209 window.animatedScrollTo = animatedScrollTo; 2210 } 2211})(window); 2212 2213},{}],38:[function(require,module,exports){ 2214/* 2215 * classList.js: Cross-browser full element.classList implementation. 2216 * 2014-07-23 2217 * 2218 * By Eli Grey, http://eligrey.com 2219 * Public Domain. 2220 * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. 2221 */ 2222 2223/*global self, document, DOMException */ 2224 2225/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2226 2227/* Copied from MDN: 2228 * https://developer.mozilla.org/en-US/docs/Web/API/Element/classList 2229 */ 2230 2231if ("document" in window.self) { 2232 2233 // Full polyfill for browsers with no classList support 2234 // Including IE < Edge missing SVGElement.classList 2235 if (!("classList" in document.createElement("_")) 2236 || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) { 2237 2238 (function (view) { 2239 2240 "use strict"; 2241 2242 if (!('Element' in view)) return; 2243 2244 var 2245 classListProp = "classList" 2246 , protoProp = "prototype" 2247 , elemCtrProto = view.Element[protoProp] 2248 , objCtr = Object 2249 , strTrim = String[protoProp].trim || function () { 2250 return this.replace(/^\s+|\s+$/g, ""); 2251 } 2252 , arrIndexOf = Array[protoProp].indexOf || function (item) { 2253 var 2254 i = 0 2255 , len = this.length 2256 ; 2257 for (; i < len; i++) { 2258 if (i in this && this[i] === item) { 2259 return i; 2260 } 2261 } 2262 return -1; 2263 } 2264 // Vendors: please allow content code to instantiate DOMExceptions 2265 , DOMEx = function (type, message) { 2266 this.name = type; 2267 this.code = DOMException[type]; 2268 this.message = message; 2269 } 2270 , checkTokenAndGetIndex = function (classList, token) { 2271 if (token === "") { 2272 throw new DOMEx( 2273 "SYNTAX_ERR" 2274 , "An invalid or illegal string was specified" 2275 ); 2276 } 2277 if (/\s/.test(token)) { 2278 throw new DOMEx( 2279 "INVALID_CHARACTER_ERR" 2280 , "String contains an invalid character" 2281 ); 2282 } 2283 return arrIndexOf.call(classList, token); 2284 } 2285 , ClassList = function (elem) { 2286 var 2287 trimmedClasses = strTrim.call(elem.getAttribute("class") || "") 2288 , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] 2289 , i = 0 2290 , len = classes.length 2291 ; 2292 for (; i < len; i++) { 2293 this.push(classes[i]); 2294 } 2295 this._updateClassName = function () { 2296 elem.setAttribute("class", this.toString()); 2297 }; 2298 } 2299 , classListProto = ClassList[protoProp] = [] 2300 , classListGetter = function () { 2301 return new ClassList(this); 2302 } 2303 ; 2304 // Most DOMException implementations don't allow calling DOMException's toString() 2305 // on non-DOMExceptions. Error's toString() is sufficient here. 2306 DOMEx[protoProp] = Error[protoProp]; 2307 classListProto.item = function (i) { 2308 return this[i] || null; 2309 }; 2310 classListProto.contains = function (token) { 2311 token += ""; 2312 return checkTokenAndGetIndex(this, token) !== -1; 2313 }; 2314 classListProto.add = function () { 2315 var 2316 tokens = arguments 2317 , i = 0 2318 , l = tokens.length 2319 , token 2320 , updated = false 2321 ; 2322 do { 2323 token = tokens[i] + ""; 2324 if (checkTokenAndGetIndex(this, token) === -1) { 2325 this.push(token); 2326 updated = true; 2327 } 2328 } 2329 while (++i < l); 2330 2331 if (updated) { 2332 this._updateClassName(); 2333 } 2334 }; 2335 classListProto.remove = function () { 2336 var 2337 tokens = arguments 2338 , i = 0 2339 , l = tokens.length 2340 , token 2341 , updated = false 2342 , index 2343 ; 2344 do { 2345 token = tokens[i] + ""; 2346 index = checkTokenAndGetIndex(this, token); 2347 while (index !== -1) { 2348 this.splice(index, 1); 2349 updated = true; 2350 index = checkTokenAndGetIndex(this, token); 2351 } 2352 } 2353 while (++i < l); 2354 2355 if (updated) { 2356 this._updateClassName(); 2357 } 2358 }; 2359 classListProto.toggle = function (token, force) { 2360 token += ""; 2361 2362 var 2363 result = this.contains(token) 2364 , method = result ? 2365 force !== true && "remove" 2366 : 2367 force !== false && "add" 2368 ; 2369 2370 if (method) { 2371 this[method](token); 2372 } 2373 2374 if (force === true || force === false) { 2375 return force; 2376 } else { 2377 return !result; 2378 } 2379 }; 2380 classListProto.toString = function () { 2381 return this.join(" "); 2382 }; 2383 2384 if (objCtr.defineProperty) { 2385 var classListPropDesc = { 2386 get: classListGetter 2387 , enumerable: true 2388 , configurable: true 2389 };
2390 try { 2391 objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); 2392 } catch (ex) { // IE 8 doesn't support enumerable:true 2393 if (ex.number === -0x7FF5EC54) { 2394 classListPropDesc.enumerable = false; 2395 objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); 2396 } 2397 } 2398 } else if (objCtr[protoProp].__defineGetter__) { 2399 elemCtrProto.__defineGetter__(classListProp, classListGetter); 2400 } 2401 2402 }(window.self)); 2403 2404 } else { 2405 // There is full or partial native classList support, so just check if we need 2406 // to normalize the add/remove and toggle APIs. 2407 2408 (function () { 2409 "use strict"; 2410 2411 var testElement = document.createElement("_"); 2412 2413 testElement.classList.add("c1", "c2"); 2414 2415 // Polyfill for IE 10/11 and Firefox <26, where classList.add and 2416 // classList.remove exist but support only one argument at a time. 2417 if (!testElement.classList.contains("c2")) { 2418 var createMethod = function(method) { 2419 var original = DOMTokenList.prototype[method]; 2420 2421 DOMTokenList.prototype[method] = function(token) { 2422 var i, len = arguments.length; 2423 2424 for (i = 0; i < len; i++) { 2425 token = arguments[i]; 2426 original.call(this, token); 2427 } 2428 }; 2429 }; 2430 createMethod('add'); 2431 createMethod('remove'); 2432 } 2433 2434 testElement.classList.toggle("c3", false); 2435 2436 // Polyfill for IE 10 and Firefox <24, where classList.toggle does not 2437 // support the second argument. 2438 if (testElement.classList.contains("c3")) { 2439 var _toggle = DOMTokenList.prototype.toggle; 2440 2441 DOMTokenList.prototype.toggle = function(token, force) { 2442 if (1 in arguments && !this.contains(token) === !force) { 2443 return force; 2444 } else { 2445 return _toggle.call(this, token); 2446 } 2447 }; 2448 2449 } 2450 2451 testElement = null; 2452 }()); 2453 } 2454} 2455 2456},{}],39:[function(require,module,exports){ 2457/* 2458 2459© 2011 by Jerry Sievert 2460 2461Permission is hereby granted, free of charge, to any person obtaining a copy 2462of this software and associated documentation files (the "Software"), to deal 2463in the Software without restriction, including without limitation the rights 2464to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 2465copies of the Software, and to permit persons to whom the Software is 2466furnished to do so, subject to the following conditions: 2467 2468The above copyright notice and this permission notice shall be included in 2469all copies or substantial portions of the Software. 2470 2471THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2472IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2473FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 2474AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 2475LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 2476OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 2477THE SOFTWARE. 2478 2479*/ 2480 2481 2482(function () { 2483 /** @class Date */ 2484 // constants 2485 var monthsAbbr = [], monthsFull = [], daysAbbr = [], daysFull = [], dayNames = {}, monthsAll, daysAll = [], monthNames = []; 2486 monthsAbbr = [ 2487 'Jan', 2488 'Feb', 2489 'Mar', 2490 'Apr', 2491 'May', 2492 'Jun', 2493 'Jul', 2494 'Aug', 2495 'Sep', 2496 'Oct', 2497 'Nov', 2498 'Dec' 2499 ]; 2500 2501 monthsFull = [ 2502 'January', 2503 'February', 2504 'March', 2505 'April', 2506 'May', 2507 'June', 2508 'July', 2509 'August', 2510 'September', 2511 'October', 2512 'November', 2513 'December' 2514 ]; 2515 2516 daysAbbr = [ 2517 'Sun', 2518 'Mon', 2519 'Tue', 2520 'Wed', 2521 'Thu', 2522 'Fri', 2523 'Sat' 2524 ]; 2525 2526 daysFull = [ 2527 'Sunday', 2528 'Monday', 2529 'Tuesday', 2530 'Wednesday', 2531 'Thursday', 2532 'Friday', 2533 'Saturday' 2534 ]; 2535 2536 dayNames = { 2537 'su': 0, 2538 'sun': 0, 2539 'sunday': 0, 2540 'mo': 1, 2541 'mon': 1, 2542 'monday': 1, 2543 'tu': 2, 2544 'tue': 2, 2545 'tuesday': 2, 2546 'we': 3, 2547 'wed': 3, 2548 'wednesday': 3, 2549 'th': 4, 2550 'thu': 4, 2551 'thursday': 4, 2552 'fr': 5, 2553 'fri': 5, 2554 'friday': 5,
2555 'sa': 6, 2556 'sat': 6, 2557 'saturday': 6 2558 }; 2559 monthsAll = monthsFull.concat(monthsAbbr); 2560 daysAll = [ 2561 'su', 2562 'sun', 2563 'sunday', 2564 'mo', 2565 'mon', 2566 'monday', 2567 'tu', 2568 'tue', 2569 'tuesday', 2570 'we', 2571 'wed', 2572 'wednesday', 2573 'th', 2574 'thu', 2575 'thursday', 2576 'fr', 2577 'fri', 2578 'friday', 2579 'sa', 2580 'sat', 2581 'saturday' 2582 ]; 2583 2584 monthNames = { 2585 'jan': 0, 2586 'january': 0, 2587 'feb': 1, 2588 'february': 1, 2589 'mar': 2, 2590 'march': 2, 2591 'apr': 3, 2592 'april': 3, 2593 'may': 4, 2594 'jun': 5, 2595 'june': 5, 2596 'jul': 6, 2597 'july': 6, 2598 'aug': 7, 2599 'august': 7, 2600 'sep': 8, 2601 'september': 8, 2602 'oct': 9, 2603 'october': 9, 2604 'nov': 10, 2605 'november': 10, 2606 'dec': 11, 2607 'december': 11 2608 }; 2609 2610 var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; 2611 2612 2613 // private helper functions 2614 /** @ignore */ 2615 function pad(str, length) { 2616 str = String(str); 2617 while (str.length < length) { 2618 str = '0' + str; 2619 } 2620 return str; 2621 } 2622 2623 var isInteger = function (str) { 2624 if (str.match(/^(\d+)$/)) { 2625 return true; 2626 } 2627 return false; 2628 }; 2629 var getInt = function (str, i, minlength, maxlength) { 2630 for (var x = maxlength; x >= minlength; x--) { 2631 var token = str.substring(i, i + x); 2632 if (token.length < minlength) { 2633 return null; 2634 } 2635 if (isInteger(token)) { 2636 return token; 2637 } 2638 } 2639 return null; 2640 }; 2641 2642 // static class methods 2643 var origParse = Date.parse; 2644 // ------------------------------------------------------------------ 2645 // getDateFromFormat( date_string , format_string ) 2646 // 2647 // This function takes a date string and a format string. It matches 2648 // If the date string matches the format string, it returns the 2649 // getTime() of the date. If it does not match, it returns NaN. 2650 // Original Author: Matt Kruse <[email protected]> 2651 // WWW: http://www.mattkruse.com/ 2652 // Adapted from: http://www.mattkruse.com/javascript/date/source.html 2653 // ------------------------------------------------------------------ 2654 2655 2656 var getDateFromFormat = function (val, format) { 2657 val = val + ""; 2658 format = format + ""; 2659 var iVal = 0; 2660 var iFormat = 0; 2661 var c = ""; 2662 var token = ""; 2663 var token2 = ""; 2664 var x, y; 2665 var now = new Date(); 2666 var year = now.getYear(); 2667 var month = now.getMonth() + 1; 2668 var date = 1; 2669 var hh = 0; 2670 var mm = 0; 2671 var ss = 0; 2672 var ampm = ""; 2673 2674 2675 2676 while (iFormat < format.length) { 2677 // Get next token from format string 2678 c = format.charAt(iFormat); 2679 token = ""; 2680 while ((format.charAt(iFormat) === c) && (iFormat < format.length)) { 2681 token += format.charAt(iFormat++); 2682 } 2683 // Extract contents of value based on format token 2684 if (token === "yyyy" || token === "yy" || token === "y") { 2685 if (token === "yyyy") { 2686 x = 4; 2687 y = 4; 2688 } 2689 if (token === "yy") { 2690 x = 2; 2691 y = 2; 2692 } 2693 if (token === "y") { 2694 x = 2; 2695 y = 4; 2696 } 2697 year = getInt(val, iVal, x, y); 2698 if (year === null) { 2699 return NaN; 2700 } 2701 iVal += year.length; 2702 if (year.length === 2) { 2703 if (year > 70) { 2704 year = 1900 + (year - 0); 2705 } else { 2706 year = 2000 + (year - 0); 2707 } 2708 } 2709 } else if (token === "MMM" || token === "NNN") {
2710 month = 0; 2711 for (var i = 0; i < monthsAll.length; i++) { 2712 var monthName = monthsAll[i]; 2713 if (val.substring(iVal, iVal + monthName.length).toLowerCase() === monthName.toLowerCase()) { 2714 if (token === "MMM" || (token === "NNN" && i > 11)) { 2715 month = i + 1; 2716 if (month > 12) { 2717 month -= 12; 2718 } 2719 iVal += monthName.length; 2720 break; 2721 } 2722 } 2723 } 2724 if ((month < 1) || (month > 12)) { 2725 return NaN; 2726 } 2727 } else if (token === "EE" || token === "E") { 2728 for (var n = 0; n < daysAll.length; n++) { 2729 var dayName = daysAll[n]; 2730 if (val.substring(iVal, iVal + dayName.length).toLowerCase() === dayName.toLowerCase()) { 2731 iVal += dayName.length; 2732 break; 2733 } 2734 } 2735 } else if (token === "MM" || token === "M") { 2736 month = getInt(val, iVal, token.length, 2); 2737 if (month === null || (month < 1) || (month > 12)) { 2738 return NaN; 2739 } 2740 iVal += month.length; 2741 } else if (token === "dd" || token === "d") { 2742 date = getInt(val, iVal, token.length, 2); 2743 if (date === null || (date < 1) || (date > 31)) { 2744 return NaN; 2745 } 2746 iVal += date.length; 2747 } else if (token === "hh" || token === "h") { 2748 hh = getInt(val, iVal, token.length, 2); 2749 if (hh === null || (hh < 1) || (hh > 12)) { 2750 return NaN; 2751 } 2752 iVal += hh.length; 2753 } else if (token === "HH" || token === "H") { 2754 hh = getInt(val, iVal, token.length, 2); 2755 if (hh === null || (hh < 0) || (hh > 23)) { 2756 return NaN; 2757 } 2758 iVal += hh.length; 2759 } else if (token === "KK" || token === "K") { 2760 hh = getInt(val, iVal, token.length, 2); 2761 if (hh === null || (hh < 0) || (hh > 11)) { 2762 return NaN; 2763 } 2764 iVal += hh.length; 2765 } else if (token === "kk" || token === "k") { 2766 hh = getInt(val, iVal, token.length, 2); 2767 if (hh === null || (hh < 1) || (hh > 24)) { 2768 return NaN; 2769 } 2770 iVal += hh.length; 2771 hh--; 2772 } else if (token === "mm" || token === "m") { 2773 mm = getInt(val, iVal, token.length, 2); 2774 if (mm === null || (mm < 0) || (mm > 59)) { 2775 return NaN; 2776 } 2777 iVal += mm.length; 2778 } else if (token === "ss" || token === "s") { 2779 ss = getInt(val, iVal, token.length, 2); 2780 if (ss === null || (ss < 0) || (ss > 59)) { 2781 return NaN; 2782 } 2783 iVal += ss.length; 2784 } else if (token === "a") { 2785 if (val.substring(iVal, iVal + 2).toLowerCase() === "am") { 2786 ampm = "AM"; 2787 } else if (val.substring(iVal, iVal + 2).toLowerCase() === "pm") { 2788 ampm = "PM"; 2789 } else { 2790 return NaN; 2791 } 2792 iVal += 2; 2793 } else { 2794 if (val.substring(iVal, iVal + token.length) !== token) { 2795 return NaN; 2796 } else { 2797 iVal += token.length; 2798 } 2799 } 2800 } 2801 // If there are any trailing characters left in the value, it doesn't match 2802 if (iVal !== val.length) { 2803 return NaN; 2804 } 2805 // Is date valid for month? 2806 if (month === 2) { 2807 // Check for leap year 2808 if (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) { // leap year 2809 if (date > 29) { 2810 return NaN; 2811 } 2812 } else { 2813 if (date > 28) { 2814 return NaN; 2815 } 2816 } 2817 } 2818 if ((month === 4) || (month === 6) || (month === 9) || (month === 11)) { 2819 if (date > 30) { 2820 return NaN; 2821 } 2822 } 2823 // Correct hours value 2824 if (hh < 12 && ampm === "PM") { 2825 hh = hh - 0 + 12; 2826 } else if (hh > 11 && ampm === "AM") { 2827 hh -= 12; 2828 } 2829 var newdate = new Date(year, month - 1, date, hh, mm, ss); 2830 return newdate.getTime(); 2831 }; 2832 2833 2834 /** @ignore */ 2835 Date.parse = function (date, format) { 2836 if (format) { 2837 return getDateFromFormat(date, format); 2838 } 2839 var timestamp = origParse(date), minutesOffset = 0, match; 2840 if (isNaN(timestamp) && (match = /^(\d{4}|[+\-]\d{6})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?))?/.exec(date))) { 2841 if (match[8] !== 'Z') { 2842 minutesOffset = +match[10] * 60 + (+match[11]); 2843 2844 if (match[9] === '+') { 2845 minutesOffset = 0 - minutesOffset; 2846 } 2847 } 2848 2849 match[7] = match[7] || '000'; 2850 2851 timestamp = Date.UTC(+match[1], +match[2] - 1, +match[3], +match[4], +match[5] + minutesOffset, +match[6], +match[7].substr(0, 3)); 2852 } 2853 2854 return timestamp; 2855 }; 2856 2857 function polyfill(name, func) { 2858 if (Date.prototype[name] === undefined) { 2859 Date.prototype[name] = func; 2860 } 2861 } 2862 2863 /** 2864 Returns new instance of Date object with the date set to today and 2865 the time set to midnight 2866 @static 2867 @returns {Date} Today's Date 2868 @function today 2869 @memberof Date 2870 */ 2871 Date.today = function () { 2872 return new Date().clearTime(); 2873 }; 2874 2875 /** 2876 Returns new instance of Date object with the date set to today and 2877 the time set to midnight in UTC 2878 @static 2879 @returns {Date} Today's Date in UTC 2880 @function UTCtoday 2881 @memberof Date 2882 */ 2883 Date.UTCtoday = function () { 2884 return new Date().clearUTCTime(); 2885 }; 2886 2887 /** 2888 Returns new instance of Date object with the date set to tomorrow and 2889 the time set to midnight 2890 @static 2891 @returns {Date} Tomorrow's Date 2892 @function tomorrow 2893 @memberof Date 2894 */ 2895 Date.tomorrow = function () { 2896 return Date.today().add({days: 1}); 2897 }; 2898 2899 /** 2900 Returns new instance of Date object with the date set to tomorrow and 2901 the time set to midnight in UTC 2902 @static 2903 @returns {Date} Tomorrow's Date in UTC 2904 @function UTCtomorrow 2905 @memberof Date 2906 */ 2907 Date.UTCtomorrow = function () { 2908 return Date.UTCtoday().add({days: 1}); 2909 }; 2910 2911 /** 2912 Returns new instance of Date object with the date set to yesterday and 2913 the time set to midnight 2914 @static 2915 @returns {Date} Yesterday's Date 2916 @function yesterday 2917 @memberof Date 2918 */ 2919 Date.yesterday = function () { 2920 return Date.today().add({days: -1}); 2921 }; 2922 2923 /** 2924 Returns new instance of Date object with the date set to yesterday and 2925 the time set to midnight in UTC 2926 @static 2927 @returns {Date} Yesterday's Date in UTC 2928 @function UTCyesterday 2929 @memberof Date 2930 */ 2931 Date.UTCyesterday = function () { 2932 return Date.UTCtoday().add({days: -1}); 2933 }; 2934 2935 /** 2936 Returns whether the day is valid 2937 @static 2938 @param day {Number} day of the month 2939 @param year {Number} year 2940 @param month {Number} month of the year [0-11] 2941 @returns {Boolean} 2942 @function validateDay 2943 @memberof Date 2944 */ 2945 Date.validateDay = function (day, year, month) { 2946 var date = new Date(year, month, day); 2947 return (date.getFullYear() === year && 2948 date.getMonth() === month && 2949 date.getDate() === day); 2950 }; 2951 2952 /** 2953 Returns whether the year is valid 2954 @static 2955 @param year {Number} year 2956 @returns {Boolean} 2957 @function validateYear
2958 @memberof Date 2959 */ 2960 Date.validateYear = function (year) { 2961 return (year >= 0 && year <= 9999); 2962 }; 2963 2964 /** 2965 Returns whether the second is valid 2966 @static 2967 @param second {Number} second 2968 @returns {Boolean} 2969 @function validateSecond 2970 @memberof Date 2971 */ 2972 Date.validateSecond = function (second) { 2973 return (second >= 0 && second < 60); 2974 }; 2975 2976 /** 2977 Returns whether the month is valid [0-11] 2978 @static 2979 @param month {Number} month 2980 @returns {Boolean} 2981 @function validateMonth 2982 @memberof Date 2983 */ 2984 Date.validateMonth = function (month) { 2985 return (month >= 0 && month < 12); 2986 }; 2987 2988 /** 2989 Returns whether the minute is valid 2990 @static 2991 @param minute {Number} minute 2992 @returns {Boolean} 2993 @function validateMinute 2994 @memberof Date 2995 */ 2996 Date.validateMinute = function (minute) { 2997 return (minute >= 0 && minute < 60); 2998 }; 2999 3000 /** 3001 Returns whether the millisecond is valid 3002 @static 3003 @param millisecond {Number} millisecond 3004 @returns {Boolean} 3005 @function validateMillisecond 3006 @memberof Date 3007 */ 3008 Date.validateMillisecond = function (milli) { 3009 return (milli >= 0 && milli < 1000); 3010 }; 3011 3012 /** 3013 Returns whether the hour is valid [0-23] 3014 @static 3015 @param hour {Number} hour 3016 @returns {Boolean} 3017 @function validateHour 3018 @memberof Date 3019 */ 3020 Date.validateHour = function (hour) { 3021 return (hour >= 0 && hour < 24); 3022 }; 3023 3024 /** 3025 Compares two dates 3026 @static 3027 @param date1 {Date} first date 3028 @param date2 {Date} second date 3029 @returns {Number} -1 if date1 is less than date2, 0 if they are equal, 1 if date1 is more than date2 3030 @function compare 3031 @memberof Date 3032 */ 3033 Date.compare = function (date1, date2) { 3034 if (date1.valueOf() < date2.valueOf()) { 3035 return -1; 3036 } else if (date1.valueOf() > date2.valueOf()) { 3037 return 1; 3038 } 3039 return 0; 3040 }; 3041 3042 /** 3043 Compares two dates to the millisecond 3044 @static 3045 @param date1 {Date} first date 3046 @param date2 {Date} second date 3047 @returns {Boolean} 3048 @function equals 3049 @memberof Date 3050 */ 3051 Date.equals = function (date1, date2) { 3052 return date1.valueOf() === date2.valueOf(); 3053 }; 3054 3055 /** 3056 Compares two dates by day 3057 @static 3058 @param date1 {Date} first date 3059 @param date2 {Date} second date 3060 @returns {Boolean} 3061 @function equalsDay 3062 @memberof Date 3063 */ 3064 Date.equalsDay = function (date1, date2) { 3065 return date1.toYMD() === date2.toYMD(); 3066 }; 3067 3068 /** 3069 Returns the day number for a day [0-6] 3070 @static 3071 @param day {String} day name 3072 @returns {Number} 3073 @function getDayNumberFromName 3074 @memberof Date 3075 */ 3076 Date.getDayNumberFromName = function (name) { 3077 return dayNames[name.toLowerCase()]; 3078 }; 3079 3080 /** 3081 Returns the day number for a month [0-11] 3082 @static 3083 @param month {String} month name 3084 @returns {Number} 3085 @function getMonthNumberFromName 3086 @memberof Date 3087 */ 3088 Date.getMonthNumberFromName = function (name) { 3089 return monthNames[name.toLowerCase()]; 3090 }; 3091 3092 /** 3093 Returns the month name for a month [0-11] 3094 @static 3095 @param month {Number} month 3096 @returns {String} 3097 @function getMonthNameFromNumber 3098 @memberof Date 3099 */ 3100 Date.getMonthNameFromNumber = function (number) { 3101 return monthsFull[number]; 3102 }; 3103 3104 /** 3105 Returns the month name abbreviated for a month [0-11] 3106 @static 3107 @param month {Number} month 3108 @returns {String} 3109 @function getMonthAbbrFromNumber 3110 @memberof Date 3111 */ 3112 Date.getMonthAbbrFromNumber = function (number) { 3113 return monthsAbbr[number]; 3114 }; 3115 3116 /** 3117 Returns whether or not the year is a leap year 3118 @static 3119 @param year {Number} year 3120 @returns {Boolean} 3121 @function isLeapYear 3122 @memberof Date 3123 */ 3124 Date.isLeapYear = function (year) { 3125 return (new Date(year, 1, 29).getDate() === 29); 3126 }; 3127 3128 /** 3129 Returns the number of days in a month 3130 @static 3131 @param year {Number} year 3132 @param month {Number} month 3133 @returns {Number} 3134 @function getDaysInMonth 3135 @memberof Date 3136 */ 3137 Date.getDaysInMonth = function (year, month) { 3138 if (month === 1) { 3139 return Date.isLeapYear(year) ? 29 : 28; 3140 } 3141 return daysInMonth[month]; 3142 }; 3143 3144 /** 3145 Returns the abbreviated month name 3146 @returns {String} 3147 @function getMonthAbbr 3148 @instance 3149 @memberof Date 3150 */ 3151 polyfill('getMonthAbbr', function () { 3152 return monthsAbbr[this.getMonth()]; 3153 }); 3154 3155 /** 3156 Returns the month name 3157 @returns {String} 3158 @function getMonthName 3159 @instance 3160 @memberof Date 3161 */ 3162 polyfill('getMonthName', function () { 3163 return monthsFull[this.getMonth()]; 3164 }); 3165 3166 /** 3167 Returns the name of last month 3168 @returns {String} 3169 @function getLastMonthName 3170 @instance 3171 @memberof Date 3172 */ 3173 polyfill('getLastMonthName', function () { 3174 var i = this.getMonth(); 3175 i = (i === 0 ? 11 : i - 1); 3176 return monthsFull[i]; 3177 }); 3178 3179 /** 3180 Returns the current UTC office 3181 @returns {String} 3182 @function getUTCOffset 3183 @instance 3184 @memberof Date 3185 */ 3186 polyfill('getUTCOffset', function () { 3187 var tz = pad(Math.abs(this.getTimezoneOffset() / 0.6), 4); 3188 if (this.getTimezoneOffset() > 0) { 3189 tz = '-' + tz; 3190 } 3191 return tz; 3192 }); 3193 3194 /** 3195 Returns a padded Common Log Format 3196 @returns {String} 3197 @function toCLFString
3198 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3199 @instance 3200 @memberof Date 3201 */ 3202 polyfill('toCLFString', function () { 3203 return pad(this.getDate(), 2) + '/' + this.getMonthAbbr() + '/' + 3204 this.getFullYear() + ':' + pad(this.getHours(), 2) + ':' + 3205 pad(this.getMinutes(), 2) + ':' + pad(this.getSeconds(), 2) + 3206 ' ' + this.getUTCOffset(); 3207 }); 3208 3209 /** 3210 Returns a padded Year/Month/Day 3211 @returns {String} 3212 @param separator {String} optional, defaults to "-" 3213 @function toYMD 3214 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3215 @instance 3216 @memberof Date 3217 */ 3218 polyfill('toYMD', function (separator) { 3219 separator = typeof separator === 'undefined' ? '-' : separator; 3220 return this.getFullYear() + separator + pad(this.getMonth() + 1, 2) + 3221 separator + pad(this.getDate(), 2); 3222 }); 3223 3224 /** 3225 Returns a formatted String for database insertion 3226 @returns {String} 3227 @function toDBString
3228 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3229 @instance 3230 @memberof Date 3231 */ 3232 polyfill('toDBString', function () { 3233 return this.getUTCFullYear() + '-' + pad(this.getUTCMonth() + 1, 2) + 3234 '-' + pad(this.getUTCDate(), 2) + ' ' + pad(this.getUTCHours(), 2) + 3235 ':' + pad(this.getUTCMinutes(), 2) + ':' + pad(this.getUTCSeconds(), 2); 3236 }); 3237 3238 /** 3239 Sets the time to 00:00:00.0000 and returns a new Date object 3240 @returns {Date} 3241 @function clearTime 3242 @instance 3243 @memberof Date 3244 */ 3245 polyfill('clearTime', function () { 3246 this.setHours(0); 3247 this.setMinutes(0); 3248 this.setSeconds(0); 3249 this.setMilliseconds(0); 3250 3251 return this; 3252 }); 3253 3254 /** 3255 Sets the time to 00:00:00.0000 and returns a new Date object with set to UTC 3256 @returns {Date} 3257 @function clearUTCTime 3258 @instance 3259 @memberof Date 3260 */ 3261 polyfill('clearUTCTime', function () { 3262 this.setUTCHours(0); 3263 this.setUTCMinutes(0); 3264 this.setUTCSeconds(0); 3265 this.setUTCMilliseconds(0); 3266 3267 return this; 3268 }); 3269 3270 /** 3271 Adds `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. 3272 Usage: `data.add({ "seconds": 10, "days": 1 })` 3273 @param additions {Object} 3274 @returns {Date} 3275 @function add 3276 @instance 3277 @memberof Date 3278 */ 3279 polyfill('add', function (obj) { 3280 if (obj.milliseconds !== undefined) { 3281 this.setMilliseconds(this.getMilliseconds() + obj.milliseconds); 3282 } 3283 if (obj.seconds !== undefined) { 3284 this.setSeconds(this.getSeconds() + obj.seconds); 3285 } 3286 if (obj.minutes !== undefined) { 3287 this.setMinutes(this.getMinutes() + obj.minutes); 3288 } 3289 if (obj.hours !== undefined) { 3290 this.setHours(this.getHours() + obj.hours); 3291 } 3292 if (obj.days !== undefined) { 3293 this.setDate(this.getDate() + obj.days); 3294 } 3295 if (obj.weeks !== undefined) { 3296 this.setDate(this.getDate() + (obj.weeks * 7)); 3297 } 3298 if (obj.months !== undefined) { 3299 this.setMonth(this.getMonth() + obj.months); 3300 } 3301 if (obj.years !== undefined) { 3302 this.setFullYear(this.getFullYear() + obj.years); 3303 } 3304 return this; 3305 }); 3306 3307 /** 3308 Adds milliseconds to the Date and returns it 3309 @returns {Date} 3310 @param milliseconds {Number} Number of milliseconds to add 3311 @function addMilliseconds
3312 @deprecated Will be deprecated in version 2.0 in favor of add 3313 @instance 3314 @memberof Date 3315 */ 3316 polyfill('addMilliseconds', function (milliseconds) { 3317 return this.add({ milliseconds: milliseconds }); 3318 }); 3319 3320 /** 3321 Adds seconds to the Date and returns it 3322 @returns {Date} 3323 @param seconds {Number} Number of seconds to add 3324 @function addSeconds 3325 @deprecated Will be deprecated in version 2.0 in favor of add 3326 @instance 3327 @memberof Date 3328 */ 3329 polyfill('addSeconds', function (seconds) { 3330 return this.add({ seconds: seconds }); 3331 }); 3332 3333 /** 3334 Adds minutes to the Date and returns it 3335 @returns {Date} 3336 @param minutes {Number} Number of minutes to add 3337 @function addMinutes 3338 @deprecated Will be deprecated in version 2.0 in favor of add 3339 @instance 3340 @memberof Date 3341 */ 3342 polyfill('addMinutes', function (minutes) { 3343 return this.add({ minutes: minutes }); 3344 }); 3345 3346 /** 3347 Adds hours to the Date and returns it 3348 @returns {Date} 3349 @param hours {Number} Number of hours to add 3350 @function addHours
3351 @deprecated Will be deprecated in version 2.0 in favor of add 3352 @instance 3353 @memberof Date 3354 */ 3355 polyfill('addHours', function (hours) { 3356 return this.add({ hours: hours }); 3357 }); 3358 3359 /** 3360 Adds days to the Date and returns it 3361 @returns {Date} 3362 @param days {Number} Number of days to add 3363 @function addSeconds 3364 @deprecated Will be deprecated in version 2.0 in favor of add 3365 @instance 3366 @memberof Date 3367 */ 3368 polyfill('addDays', function (days) { 3369 return this.add({ days: days }); 3370 }); 3371 3372 /** 3373 Adds weeks to the Date and returns it 3374 @returns {Date} 3375 @param weeks {Number} Number of weeks to add 3376 @function addWeeks 3377 @deprecated Will be deprecated in version 2.0 in favor of add 3378 @instance 3379 @memberof Date 3380 */ 3381 polyfill('addWeeks', function (weeks) { 3382 return this.add({ days: (weeks * 7) }); 3383 }); 3384 3385 /** 3386 Adds months to the Date and returns it 3387 @returns {Date} 3388 @param months {Number} Number of months to add 3389 @function addMonths
3390 @deprecated Will be deprecated in version 2.0 in favor of add 3391 @instance 3392 @memberof Date 3393 */ 3394 polyfill('addMonths', function (months) { 3395 return this.add({ months: months }); 3396 }); 3397 3398 /** 3399 Adds years to the Date and returns it 3400 @returns {Date} 3401 @param years {Number} Number of years to add 3402 @function addYears 3403 @deprecated Will be deprecated in version 2.0 in favor of add 3404 @instance 3405 @memberof Date 3406 */ 3407 polyfill('addYears', function (years) { 3408 return this.add({ years: years }); 3409 }); 3410 3411 /** 3412 Removes `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. 3413 Usage: `data.remove({ "seconds": 10, "days": 1 })` 3414 @param removals {Object} 3415 @returns {Date} 3416 @function remove 3417 @instance 3418 @memberof Date 3419 */ 3420 polyfill('remove', function (obj) { 3421 if (obj.seconds !== undefined) { 3422 this.setSeconds(this.getSeconds() - obj.seconds); 3423 } 3424 if (obj.minutes !== undefined) { 3425 this.setMinutes(this.getMinutes() - obj.minutes); 3426 } 3427 if (obj.hours !== undefined) { 3428 this.setHours(this.getHours() - obj.hours); 3429 } 3430 if (obj.days !== undefined) { 3431 this.setDate(this.getDate() - obj.days); 3432 } 3433 if (obj.weeks !== undefined) { 3434 this.setDate(this.getDate() - (obj.weeks * 7)); 3435 } 3436 if (obj.months !== undefined) { 3437 this.setMonth(this.getMonth() - obj.months); 3438 } 3439 if (obj.years !== undefined) { 3440 this.setFullYear(this.getFullYear() - obj.years); 3441 } 3442 return this; 3443 }); 3444 3445 /** 3446 Removes milliseconds from the Date and returns it 3447 @returns {Date} 3448 @param milliseconds {Number} Number of millseconds to remove 3449 @function removeMilliseconds
3450 @deprecated Will be deprecated in version 2.0 in favor of remove 3451 @instance 3452 @memberof Date 3453 */ 3454 polyfill('removeMilliseconds', function (milliseconds) { 3455 throw new Error('Not implemented'); 3456 }); 3457 3458 /** 3459 Removes seconds from the Date and returns it 3460 @returns {Date} 3461 @param seconds {Number} Number of seconds to remove 3462 @function removeSeconds 3463 @deprecated Will be deprecated in version 2.0 in favor of remove 3464 @instance 3465 @memberof Date 3466 */ 3467 polyfill('removeSeconds', function (seconds) { 3468 return this.remove({ seconds: seconds }); 3469 }); 3470 3471 /** 3472 Removes minutes from the Date and returns it 3473 @returns {Date} 3474 @param seconds {Number} Number of minutes to remove 3475 @function removeMinutes 3476 @deprecated Will be deprecated in version 2.0 in favor of remove 3477 @instance 3478 @memberof Date 3479 */ 3480 polyfill('removeMinutes', function (minutes) { 3481 return this.remove({ minutes: minutes }); 3482 }); 3483 3484 /** 3485 Removes hours from the Date and returns it 3486 @returns {Date} 3487 @param hours {Number} Number of hours to remove 3488 @function removeHours
3489 @deprecated Will be deprecated in version 2.0 in favor of remove 3490 @instance 3491 @memberof Date 3492 */ 3493 polyfill('removeHours', function (hours) { 3494 return this.remove({ hours: hours }); 3495 }); 3496 3497 /** 3498 Removes days from the Date and returns it 3499 @returns {Date} 3500 @param days {Number} Number of days to remove 3501 @function removeDays 3502 @deprecated Will be deprecated in version 2.0 in favor of remove 3503 @instance 3504 @memberof Date 3505 */ 3506 polyfill('removeDays', function (days) { 3507 return this.remove({ days: days }); 3508 }); 3509 3510 /** 3511 Removes weeks from the Date and returns it 3512 @returns {Date} 3513 @param weeks {Number} Number of weeks to remove 3514 @function removeWeeks 3515 @deprecated Will be deprecated in version 2.0 in favor of remove 3516 @instance 3517 @memberof Date 3518 */ 3519 polyfill('removeWeeks', function (weeks) { 3520 return this.remove({ days: (weeks * 7) }); 3521 }); 3522 3523 /** 3524 Removes months from the Date and returns it 3525 @returns {Date} 3526 @param months {Number} Number of months to remove 3527 @function removeMonths
3528 @deprecated Will be deprecated in version 2.0 in favor of remove 3529 @instance 3530 @memberof Date 3531 */ 3532 polyfill('removeMonths', function (months) { 3533 return this.remove({ months: months }); 3534 }); 3535 3536 /** 3537 Removes years from the Date and returns it 3538 @returns {Date} 3539 @param years {Number} Number of years to remove 3540 @function removeYears 3541 @deprecated Will be deprecated in version 2.0 in favor of remove 3542 @instance 3543 @memberof Date 3544 */ 3545 polyfill('removeYears', function (years) { 3546 return this.remove({ years: years }); 3547 }); 3548 3549 /** 3550 Adds weekdays based on a Mon-Fri work schedule and returns it 3551 @returns {Date} 3552 @param weekdays {Number} Number of weekdays to add 3553 @function addWeekdays 3554 @instance 3555 @memberof Date 3556 */ 3557 polyfill('addWeekdays', function (weekdays) { 3558 var day = this.getDay(); 3559 if (day === 0) { day = 7; } 3560 var daysOffset = weekdays; 3561 var weekspan = Math.floor(( weekdays + day - 1 ) / 5.0); 3562 if (weekdays > 0){ 3563 daysOffset += weekspan * 2; 3564 if ( day > 5 ) { daysOffset -= day - 5; } 3565 } else { 3566 daysOffset += Math.min( weekspan * 2, 0); 3567 if ( day > 6 ) { daysOffset -= 1; } 3568 } 3569 return this.addDays( daysOffset ); 3570 }); 3571 3572 /** 3573 Sets the time and date to now 3574 @function setTimeToNow 3575 @instance 3576 @memberof Date 3577 */ 3578 polyfill('setTimeToNow', function () { 3579 var n = new Date(); 3580 this.setMilliseconds(n.getMilliseconds()); 3581 this.setSeconds(n.getSeconds()); 3582 this.setMinutes(n.getMinutes()); 3583 this.setHours(n.getHours()); 3584 }); 3585 3586 /** 3587 Returns a cloned copy of the current Date 3588 @function clone 3589 @instance 3590 @memberof Date 3591 */ 3592 polyfill('clone', function () { 3593 return new Date(this.valueOf()); 3594 }); 3595 3596 /** 3597 Returns whether this Date is between a start and end date 3598 @function between 3599 @returns {Boolean} 3600 @instance 3601 @memberof Date 3602 */ 3603 polyfill('between', function (start, end) { 3604 return (this.valueOf() >= start.valueOf() && 3605 this.valueOf() <= end.valueOf()); 3606 }); 3607 /** 3608 Compares a Date to this Date 3609 @param {Date} Date to compare to 3610 @function compareTo 3611 @returns {Number} -1 if less than date, 0 if they are equal, 1 if more than date 3612 @instance 3613 @memberof Date 3614 */ 3615 polyfill('compareTo', function (date) { 3616 return Date.compare(this, date); 3617 }); 3618 3619 /** 3620 Compares a Date and time to this Date and time for equality 3621 @param {Date} Date to compare to 3622 @function equals 3623 @returns {Boolean} 3624 @instance 3625 @memberof Date 3626 */ 3627 polyfill('equals', function (date) { 3628 return Date.equals(this, date); 3629 }); 3630 3631 /** 3632 Compares a Date to this Date for equality 3633 @param {Date} Date to compare to 3634 @function equalsDay 3635 @returns {Boolean} 3636 @instance 3637 @memberof Date 3638 */ 3639 polyfill('equalsDay', function (date) { 3640 return Date.equalsDay(this, date); 3641 }); 3642 3643 /** 3644 Checks to see if the Date is today 3645 @function isToday 3646 @returns {Boolean} 3647 @instance 3648 @memberof Date 3649 */ 3650 polyfill('isToday', function () { 3651 return Date.equalsDay(this, Date.today()); 3652 }); 3653 3654 /** 3655 Compares a Date to this Date for to see if it is after the Date passed 3656 @param {Date} Date to compare to 3657 @function isAfter 3658 @returns {Boolean} 3659 @instance 3660 @memberof Date 3661 */ 3662 polyfill('isAfter', function (date) { 3663 date = date ? date : new Date(); 3664 return (this.compareTo(date) > 0); 3665 }); 3666 3667 /** 3668 Compares a Date to this Date for to see if it is before the Date passed 3669 @param {Date} Date to compare to 3670 @function isBefore 3671 @returns {Boolean} 3672 @instance 3673 @memberof Date 3674 */ 3675 polyfill('isBefore', function (date) { 3676 date = date ? date : new Date(); 3677 return (this.compareTo(date) < 0); 3678 }); 3679 3680 /** 3681 Returns `true` if the Date is a weekend using standard Saturday/Sunday definition of a weekend 3682 @function isWeekend 3683 @returns {Boolean} 3684 @instance 3685 @memberof Date 3686 */ 3687 polyfill('isWeekend', function (date) { 3688 return (this.getDay() % 6 === 0); 3689 }); 3690 3691 /** 3692 Returns the number of days between this Date and the Date passed in 3693 @function getDaysBetween 3694 @param {Date} Date to compare to 3695 @returns {Number} 3696 @instance 3697 @memberof Date 3698 */ 3699 polyfill('getDaysBetween', function (date) { 3700 return ((date.clone().valueOf() - this.valueOf()) / 86400000) | 0; 3701 }); 3702 3703 /** 3704 Returns the number of hours between this Date and the Date passed in 3705 @function getHoursBetween 3706 @param {Date} Date to compare to 3707 @returns {Number} 3708 @instance 3709 @memberof Date 3710 */ 3711 polyfill('getHoursBetween', function (date) { 3712 return ((date.clone().valueOf() - this.valueOf()) / 3600000) | 0; 3713 }); 3714 3715 /** 3716 Returns the number of minutes between this Date and the Date passed in 3717 @function getMinutesBetween 3718 @param {Date} Date to compare to 3719 @returns {Number} 3720 @instance 3721 @memberof Date 3722 */ 3723 polyfill('getMinutesBetween', function (date) { 3724 return ((date.clone().valueOf() - this.valueOf()) / 60000) | 0; 3725 }); 3726 3727 /** 3728 Returns the number of seconds between this Date and the Date passed in 3729 @function getSecondsBetween 3730 @param {Date} Date to compare to 3731 @returns {Number} 3732 @instance 3733 @memberof Date 3734 */
3735 polyfill('getSecondsBetween', function (date) { 3736 return ((date.clone().valueOf() - this.valueOf()) / 1000) | 0; 3737 }); 3738 3739 /** 3740 Returns the number of milliseconds between this Date and the Date passed in 3741 @function getMillisecondsBetween 3742 @param {Date} Date to compare to 3743 @returns {Number} 3744 @instance 3745 @memberof Date 3746 */ 3747 polyfill('getMillisecondsBetween', function (date) { 3748 return ((date.clone().valueOf() - this.valueOf())) | 0; 3749 }); 3750 3751 /** 3752 Returns the number of months between this Date and the Date passed in 3753 @function getMonthsBetween 3754 @param {Date} Date to compare to 3755 @returns {Number} 3756 @instance 3757 @memberof Date 3758 */ 3759 polyfill('getMonthsBetween', function (date) { 3760 var daysDiff = Math.abs(((+this) / (86400 * 1000)) - ((+date) / (86400 * 1000))); 3761 var start = new Date((+date) < (+this) ? (+date) : (+this)); 3762 var end = new Date((date) > (+this) ? (+date) : (+this)); 3763 3764 var months = 0; 3765 while (+start < +end) { 3766 months++; 3767 start = start.addMonths(1); 3768 } 3769 3770 var days = Math.abs(((+start) / (86400 * 1000)) - ((+end) / (86400 * 1000))); 3771 3772 return months - (days / 31); 3773 }); 3774 3775 /** 3776 Returns the ordinal number of this Date 3777 @function getOrdinalNumber 3778 @returns {Number} 3779 @instance 3780 @memberof Date 3781 */ 3782 polyfill('getOrdinalNumber', function () { 3783 return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1; 3784 }); 3785 3786 /** 3787 Returns the a formatted version of this Date 3788 @function toFormat 3789 @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc 3790 @returns {String} 3791 @instance 3792 @memberof Date 3793 */ 3794 polyfill('toFormat', function (format) { 3795 return toFormat(format, getReplaceMap(this)); 3796 }); 3797 3798 /** 3799 Returns the a formatted version of the UTC version of this Date 3800 @function toUTCFormat 3801 @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc 3802 @returns {String} 3803 @instance 3804 @memberof Date 3805 */ 3806 polyfill('toUTCFormat', function (format) { 3807 return toFormat(format, getUTCReplaceMap(this)); 3808 }); 3809 3810 /** 3811 Returns the week number of this Date 3812 @function getWeekNumber 3813 @returns {Number} 3814 @instance 3815 @memberof Date 3816 */ 3817 polyfill('getWeekNumber', function() { 3818 var onejan = new Date(this.getFullYear(),0,1); 3819 return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7); 3820 }); 3821 3822 /** 3823 Returns the week number of this Date, zero padded 3824 @function getFullWeekNumber 3825 @returns {Number} 3826 @instance 3827 @memberof Date 3828 */ 3829 polyfill('getFullWeekNumber', function() { 3830 var weekNumber = '' + this.getWeekNumber(); 3831 if (weekNumber.length === 1) { 3832 weekNumber = "0" + weekNumber; 3833 } 3834 3835 return weekNumber; 3836 }); 3837 3838 var toFormat = function(format, replaceMap) { 3839 var f = [ format ], i, l, s; 3840 var replace = function (str, rep) { 3841 var i = 0, l = f.length, j, ll, t, n = []; 3842 for (; i < l; i++) { 3843 if (typeof f[i] == 'string') { 3844 t = f[i].split(str); 3845 for (j = 0, ll = t.length - 1; j < ll; j++) { 3846 n.push(t[j]); 3847 n.push([rep]); // replacement pushed as non-string 3848 } 3849 n.push(t[ll]); 3850 } else { 3851 // must be a replacement, don't process, just push 3852 n.push(f[i]); 3853 } 3854 } 3855 f = n; 3856 }; 3857 3858 for (i in replaceMap) { 3859 replace(i, replaceMap[i]); 3860 } 3861 3862 s = ''; 3863 for (i = 0, l = f.length; i < l; i++) 3864 s += typeof f[i] == 'string' ? f[i] : f[i][0]; 3865 return f.join(''); 3866 }; 3867 3868 var getReplaceMap = function(date) { 3869 var hours = (date.getHours() % 12) ? date.getHours() % 12 : 12; 3870 return { 3871 'YYYY': date.getFullYear(), 3872 'YY': String(date.getFullYear()).slice(-2), 3873 'MMMM': monthsFull[date.getMonth()], 3874 'MMM': monthsAbbr[date.getMonth()], 3875 'MM': pad(date.getMonth() + 1, 2), 3876 'MI': pad(date.getMinutes(), 2), 3877 'M': date.getMonth() + 1, 3878 'DDDD': daysFull[date.getDay()], 3879 'DDD': daysAbbr[date.getDay()], 3880 'DD': pad(date.getDate(), 2), 3881 'D': date.getDate(), 3882 'HH24': pad(date.getHours(), 2), 3883 'HH': pad(hours, 2), 3884 'H': hours, 3885 'SS': pad(date.getSeconds(), 2), 3886 'PP': (date.getHours() >= 12) ? 'PM' : 'AM', 3887 'P': (date.getHours() >= 12) ? 'pm' : 'am', 3888 'LL': pad(date.getMilliseconds(), 3) 3889 }; 3890 }; 3891 3892 var getUTCReplaceMap = function(date) { 3893 var hours = (date.getUTCHours() % 12) ? date.getUTCHours() % 12 : 12; 3894 return { 3895 'YYYY': date.getUTCFullYear(), 3896 'YY': String(date.getUTCFullYear()).slice(-2), 3897 'MMMM': monthsFull[date.getUTCMonth()], 3898 'MMM': monthsAbbr[date.getUTCMonth()], 3899 'MM': pad(date.getUTCMonth() + 1, 2), 3900 'MI': pad(date.getUTCMinutes(), 2), 3901 'M': date.getUTCMonth() + 1, 3902 'DDDD': daysFull[date.getUTCDay()], 3903 'DDD': daysAbbr[date.getUTCDay()], 3904 'DD': pad(date.getUTCDate(), 2), 3905 'D': date.getUTCDate(), 3906 'HH24': pad(date.getUTCHours(), 2), 3907 'HH': pad(hours, 2), 3908 'H': hours, 3909 'SS': pad(date.getUTCSeconds(), 2), 3910 'PP': (date.getUTCHours() >= 12) ? 'PM' : 'AM', 3911 'P': (date.getUTCHours() >= 12) ? 'pm' : 'am', 3912 'LL': pad(date.getUTCMilliseconds(), 3) 3913 }; 3914 }; 3915 3916 /* 3917 * change the language 3918 * @param lang => support "es" Spanish, "fr" french, "pt-BR" Portuguese Brazil 3919 * translate => diego 3920 */ 3921 var language = function (lang) { 3922 if (lang == "es") { 3923 monthsAbbr = [ 3924 'Ene', 3925 'Feb', 3926 'Mar', 3927 'Abr', 3928 'May', 3929 'Jun', 3930 'Jul', 3931 'Ago', 3932 'Sep', 3933 'Oct',
3934 'Nov', 3935 'Dic' 3936 ]; 3937 3938 monthsFull = [ 3939 'Enero', 3940 'Febrero', 3941 'Marzo', 3942 'Abril', 3943 'Mayo', 3944 'Junio', 3945 'Julio', 3946 'Agosto', 3947 'Septiembre', 3948 'Octubre', 3949 'Noviembre', 3950 'Diciembre' 3951 ]; 3952 3953 daysAbbr = [ 3954 'Dom', 3955 'Lun', 3956 'Mar', 3957 'Mie', 3958 'Jue', 3959 'Vie', 3960 'Sab' 3961 ]; 3962 3963 daysFull = [ 3964 'Domingo', 3965 'Lunes', 3966 'Martes', 3967 'Miércoles', 3968 'Jueves', 3969 'Viernes', 3970 'Sábado' 3971 ]; 3972 3973 dayNames = { 3974 'do': 0, 3975 'dom': 0, 3976 'domingo': 0, 3977 'lu': 1, 3978 'lun': 1, 3979 'lunes': 1, 3980 'ma': 2, 3981 'mar': 2, 3982 'martes': 2, 3983 'mi': 3, 3984 'mie': 3, 3985 'miercoles': 3, 3986 'ju': 4, 3987 'jue': 4, 3988 'jueves': 4, 3989 'vi': 5, 3990 'vie': 5, 3991 'viernes': 5, 3992 'sa': 6, 3993 'sab': 6, 3994 'sabado': 6 3995 }; 3996 monthsAll = monthsFull.concat(monthsAbbr); 3997 daysAll = [ 3998 'do', 3999 'dom', 4000 'domingo', 4001 'lu', 4002 'lun', 4003 'lunes', 4004 'ma', 4005 'mar', 4006 'martes', 4007 'mi', 4008 'mie', 4009 'miércoles', 4010 'ju', 4011 'jue', 4012 'jueves', 4013 'vi', 4014 'vie', 4015 'viernes', 4016 'sa', 4017 'sab', 4018 'sábado' 4019 ]; 4020 4021 monthNames = { 4022 'ene': 0, 4023 'enero': 0, 4024 'feb': 1, 4025 'febrero': 1, 4026 'mar': 2, 4027 'marzo': 2, 4028 'abr': 3, 4029 'abril': 3, 4030 'may': 4, 4031 'mayo':4, 4032 'jun': 5, 4033 'junio': 5, 4034 'jul': 6, 4035 'julio': 6, 4036 'ago': 7, 4037 'agosto': 7, 4038 'sep': 8, 4039 'septiembre': 8, 4040 'oct': 9, 4041 'octubre': 9, 4042 'nov': 10, 4043 'noviembre': 10, 4044 'dic': 11, 4045 'diciembre': 11 4046 }; 4047 } else if (lang == "fr") { 4048 monthsAbbr = [ 4049 'Jan', 4050 'Fév', 4051 'Mar', 4052 'Avr', 4053 'Mai', 4054 'Jui', 4055 'Jul', 4056 'Aoû', 4057 'Sep', 4058 'Oct', 4059 'Nov', 4060 'Déc' 4061 ]; 4062 4063 monthsFull = [ 4064 'Janvier', 4065 'Février', 4066 'Mars', 4067 'Avril', 4068 'Mai', 4069 'Juin', 4070 'Juillet', 4071 'Août', 4072 'Septembre', 4073 'Octobre', 4074 'Novembre', 4075 'Décembre' 4076 ]; 4077 4078 daysAbbr = [ 4079 'Dim', 4080 'Lun', 4081 'Mar', 4082 'Mer', 4083 'Jeu', 4084 'Ven', 4085 'Sam' 4086 ]; 4087 4088 daysFull = [ 4089 'Dimanchi', 4090 'Lundi', 4091 'Mardi', 4092 'Mercredi', 4093 'Jeudi', 4094 'Vendredi', 4095 'Samedi' 4096 ]; 4097 4098 dayNames = { 4099 'di': 0, 4100 'dim': 0, 4101 'dimanchi': 0, 4102 'lu': 1, 4103 'lun': 1, 4104 'lundi': 1, 4105 'ma': 2, 4106 'mar': 2, 4107 'mardi': 2, 4108 'me': 3, 4109 'mer': 3, 4110 'mercredi': 3, 4111 'je': 4, 4112 'jeu': 4, 4113 'jeudi': 4, 4114 've': 5, 4115 'ven': 5, 4116 'vendredi': 5,
4117 'sa': 6, 4118 'sam': 6, 4119 'samedi': 6 4120 }; 4121 monthsAll = monthsFull.concat(monthsAbbr); 4122 daysAll = [ 4123 'di', 4124 'dim', 4125 'dimanchi', 4126 'lu', 4127 'lun', 4128 'lundi', 4129 'ma', 4130 'mar', 4131 'mardi', 4132 'me', 4133 'mer', 4134 'mercredi', 4135 'je', 4136 'jeu', 4137 'jeudi', 4138 've', 4139 'ven', 4140 'vendredi', 4141 'sa', 4142 'sam', 4143 'samedi' 4144 ]; 4145 4146 monthNames = { 4147 'jan': 0, 4148 'janvier': 0, 4149 'fév': 1, 4150 'février': 1, 4151 'mar': 2, 4152 'mars': 2, 4153 'avr': 3, 4154 'avril': 3, 4155 'mai': 4, 4156 'jui': 5, 4157 'juin': 5, 4158 'jul': 6, 4159 'juillet': 6, 4160 'aoû': 7, 4161 'août': 7, 4162 'sep': 8, 4163 'septembre': 8, 4164 'oct': 9, 4165 'octobre': 9, 4166 'nov': 10, 4167 'novembre': 10, 4168 'déc': 11, 4169 'décembre': 11 4170 }; 4171 } else if (lang == "pt-BR") { 4172 monthsAbbr = [ 4173 'Jan', 4174 'Fev', 4175 'Mar', 4176 'Abr', 4177 'Mai', 4178 'Jun', 4179 'Jul', 4180 'Ago', 4181 'Set', 4182 'Out', 4183 'Nov', 4184 'Dez' 4185 ]; 4186 4187 monthsFull = [ 4188 'Janeiro', 4189 'Fevereiro', 4190 'Março', 4191 'Abril', 4192 'Maio', 4193 'Junho', 4194 'Julho', 4195 'Agosto', 4196 'Setembro', 4197 'Outubro', 4198 'Novembro', 4199 'Dezembro' 4200 ]; 4201 4202 daysAbbr = [ 4203 'Dom', 4204 'Seg', 4205 'Ter', 4206 'Qua', 4207 'Qui', 4208 'Sex', 4209 'Sab' 4210 ]; 4211 4212 daysFull = [ 4213 'Domingo', 4214 'Segunda', 4215 'Terça', 4216 'Quarta', 4217 'Quinta', 4218 'Sexta', 4219 'Sábado' 4220 ]; 4221 4222 dayNames = { 4223 'do': 0, 4224 'dom': 0, 4225 'domingo': 0, 4226 'se': 1, 4227 'seg': 1, 4228 'segunda': 1, 4229 'te': 2, 4230 'ter': 2, 4231 'terca': 2, 4232 'qa': 3, 4233 'qua': 3, 4234 'quarta': 3, 4235 'qi': 4, 4236 'qui': 4, 4237 'quinta': 4, 4238 'se': 5, 4239 'sex': 5, 4240 'sexta': 5, 4241 'sa': 6, 4242 'sab': 6, 4243 'sabado': 6 4244 }; 4245 monthsAll = monthsFull.concat(monthsAbbr); 4246 daysAll = [ 4247 'do', 4248 'dom', 4249 'domingo', 4250 'se', 4251 'seg', 4252 'segunda', 4253 'te', 4254 'ter', 4255 'terça', 4256 'qa', 4257 'qua', 4258 'quarta', 4259 'qi', 4260 'qui', 4261 'quinta', 4262 'se', 4263 'sex', 4264 'sexta', 4265 'sa', 4266 'sab', 4267 'sábado' 4268 ]; 4269 4270 monthNames = { 4271 'jan': 0, 4272 'janeiro': 0, 4273 'fev': 1, 4274 'fevereiro': 1, 4275 'mar': 2, 4276 'março': 2, 4277 'abr': 3, 4278 'abril': 3, 4279 'mai': 4, 4280 'jun': 5, 4281 'junho': 5, 4282 'jul': 6, 4283 'julho': 6, 4284 'ago': 7, 4285 'agosto': 7, 4286 'set': 8, 4287 'setembro': 8, 4288 'out': 9, 4289 'outubro': 9, 4290 'nov': 10, 4291 'novembro': 10, 4292 'dez': 11, 4293 'dezembro': 11 4294 }; 4295 } 4296 }; 4297 4298 // Are we being imported?.. 4299 if (typeof module !== "undefined" && typeof module.exports === "object") { 4300 module.exports.language = language; 4301 } else if (typeof exports === "object") { 4302 exports.language = language; 4303 } else if (typeof Date.language === "undefined"){ 4304 // ...if not and if no language, then add statically to Date (for browsers.) 4305 Date.language = language; 4306 } 4307}()); 4308 4309},{}],40:[function(require,module,exports){ 4310/** 4311 * Returns a function, that, as long as it continues to be invoked, will not 4312 * be triggered. The function will be called after it stops being called for 4313 * N milliseconds. If `immediate` is passed, trigger the function on the 4314 * leading edge, instead of the trailing. The function also has a property 'clear' 4315 * that is a function which will clear the timer to prevent previously scheduled executions. 4316 * 4317 * @source underscore.js 4318 * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ 4319 * @param {Function} function to wrap 4320 * @param {Number} timeout in ms (`100`) 4321 * @param {Boolean} whether to execute at the beginning (`false`) 4322 * @api public 4323 */ 4324 4325module.exports = function debounce(func, wait, immediate){ 4326 var timeout, args, context, timestamp, result;
4327 if (null == wait) wait = 100; 4328 4329 function later() { 4330 var last = Date.now() - timestamp; 4331 4332 if (last < wait && last >= 0) { 4333 timeout = setTimeout(later, wait - last); 4334 } else { 4335 timeout = null; 4336 if (!immediate) { 4337 result = func.apply(context, args); 4338 context = args = null; 4339 } 4340 } 4341 }; 4342 4343 var debounced = function(){ 4344 context = this; 4345 args = arguments; 4346 timestamp = Date.now(); 4347 var callNow = immediate && !timeout; 4348 if (!timeout) timeout = setTimeout(later, wait); 4349 if (callNow) { 4350 result = func.apply(context, args); 4351 context = args = null; 4352 } 4353 4354 return result; 4355 }; 4356 4357 debounced.clear = function() { 4358 if (timeout) { 4359 clearTimeout(timeout); 4360 timeout = null; 4361 } 4362 }; 4363 4364 return debounced; 4365}; 4366 4367},{}],41:[function(require,module,exports){ 4368'use strict'; 4369 4370var hasOwn = Object.prototype.hasOwnProperty; 4371var toStr = Object.prototype.toString; 4372var defineProperty = Object.defineProperty; 4373var gOPD = Object.getOwnPropertyDescriptor; 4374 4375var isArray = function isArray(arr) { 4376 if (typeof Array.isArray === 'function') { 4377 return Array.isArray(arr); 4378 } 4379 4380 return toStr.call(arr) === '[object Array]'; 4381}; 4382 4383var isPlainObject = function isPlainObject(obj) { 4384 if (!obj || toStr.call(obj) !== '[object Object]') { 4385 return false; 4386 } 4387 4388 var hasOwnConstructor = hasOwn.call(obj, 'constructor'); 4389 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); 4390 // Not own constructor property must be Object 4391 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { 4392 return false; 4393 } 4394 4395 // Own properties are enumerated firstly, so to speed up, 4396 // if last one is own, then all properties are own. 4397 var key; 4398 for (key in obj) { /**/ } 4399 4400 return typeof key === 'undefined' || hasOwn.call(obj, key); 4401}; 4402 4403// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target 4404var setProperty = function setProperty(target, options) { 4405 if (defineProperty && options.name === '__proto__') { 4406 defineProperty(target, options.name, { 4407 enumerable: true, 4408 configurable: true, 4409 value: options.newValue, 4410 writable: true 4411 }); 4412 } else { 4413 target[options.name] = options.newValue; 4414 } 4415}; 4416 4417// Return undefined instead of __proto__ if '__proto__' is not an own property 4418var getProperty = function getProperty(obj, name) { 4419 if (name === '__proto__') { 4420 if (!hasOwn.call(obj, name)) { 4421 return void 0; 4422 } else if (gOPD) { 4423 // In early versions of node, obj['__proto__'] is buggy when obj has 4424 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. 4425 return gOPD(obj, name).value; 4426 } 4427 } 4428 4429 return obj[name]; 4430}; 4431 4432module.exports = function extend() { 4433 var options, name, src, copy, copyIsArray, clone; 4434 var target = arguments[0]; 4435 var i = 1; 4436 var length = arguments.length; 4437 var deep = false; 4438 4439 // Handle a deep copy situation 4440 if (typeof target === 'boolean') { 4441 deep = target; 4442 target = arguments[1] || {}; 4443 // skip the boolean and the target 4444 i = 2; 4445 } 4446 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { 4447 target = {}; 4448 } 4449 4450 for (; i < length; ++i) { 4451 options = arguments[i]; 4452 // Only deal with non-null/undefined values 4453 if (options != null) { 4454 // Extend the base object 4455 for (name in options) { 4456 src = getProperty(target, name); 4457 copy = getProperty(options, name); 4458 4459 // Prevent never-ending loop 4460 if (target !== copy) { 4461 // Recurse if we're merging plain objects or arrays 4462 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { 4463 if (copyIsArray) { 4464 copyIsArray = false; 4465 clone = src && isArray(src) ? src : []; 4466 } else { 4467 clone = src && isPlainObject(src) ? src : {}; 4468 } 4469 4470 // Never move original objects, clone them 4471 setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); 4472 4473 // Don't bring in undefined values 4474 } else if (typeof copy !== 'undefined') { 4475 setProperty(target, { name: name, newValue: copy }); 4476 } 4477 } 4478 } 4479 } 4480 } 4481 4482 // Return the modified object 4483 return target; 4484}; 4485 4486},{}],42:[function(require,module,exports){ 4487module.exports = require("handlebars/runtime")["default"]; 4488 4489},{"handlebars/runtime":118}],43:[function(require,module,exports){ 4490/** 4491 * lodash 3.0.0 (Custom Build) <https://lodash.com/>
4492 * Build: `lodash modern modularize exports="npm" -o ./` 4493 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4494 * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> 4495 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4496 * Available under MIT license <https://lodash.com/license> 4497 */ 4498 4499/** 4500 * A specialized version of `_.forEach` for arrays without support for callback 4501 * shorthands or `this` binding. 4502 * 4503 * @private 4504 * @param {Array} array The array to iterate over. 4505 * @param {Function} iteratee The function invoked per iteration. 4506 * @returns {Array} Returns `array`. 4507 */ 4508function arrayEach(array, iteratee) { 4509 var index = -1, 4510 length = array.length; 4511 4512 while (++index < length) { 4513 if (iteratee(array[index], index, array) === false) { 4514 break; 4515 } 4516 } 4517 return array; 4518} 4519 4520module.exports = arrayEach; 4521 4522},{}],44:[function(require,module,exports){ 4523/** 4524 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 4525 * Build: `lodash modern modularize exports="npm" -o ./` 4526 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4527 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4528 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4529 * Available under MIT license <https://lodash.com/license> 4530 */ 4531var baseCopy = require('lodash._basecopy'), 4532 keys = require('lodash.keys'); 4533 4534/** 4535 * The base implementation of `_.assign` without support for argument juggling, 4536 * multiple sources, and `customizer` functions. 4537 * 4538 * @private 4539 * @param {Object} object The destination object. 4540 * @param {Object} source The source object. 4541 * @returns {Object} Returns `object`. 4542 */ 4543function baseAssign(object, source) { 4544 return source == null 4545 ? object 4546 : baseCopy(source, keys(source), object); 4547} 4548 4549module.exports = baseAssign; 4550 4551},{"lodash._basecopy":45,"lodash.keys":67}],45:[function(require,module,exports){ 4552/** 4553 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 4554 * Build: `lodash modern modularize exports="npm" -o ./` 4555 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4556 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4557 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4558 * Available under MIT license <https://lodash.com/license> 4559 */ 4560 4561/** 4562 * Copies properties of `source` to `object`. 4563 * 4564 * @private 4565 * @param {Object} source The object to copy properties from. 4566 * @param {Array} props The property names to copy. 4567 * @param {Object} [object={}] The object to copy properties to. 4568 * @returns {Object} Returns `object`. 4569 */ 4570function baseCopy(source, props, object) { 4571 object || (object = {}); 4572 4573 var index = -1, 4574 length = props.length; 4575 4576 while (++index < length) { 4577 var key = props[index]; 4578 object[key] = source[key]; 4579 } 4580 return object; 4581} 4582 4583module.exports = baseCopy; 4584 4585},{}],46:[function(require,module,exports){ 4586/** 4587 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 4588 * Build: `lodash modern modularize exports="npm" -o ./` 4589 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4590 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4591 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4592 * Available under MIT license <https://lodash.com/license> 4593 */ 4594var keys = require('lodash.keys'); 4595 4596/** 4597 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 4598 * of an array-like value. 4599 */ 4600var MAX_SAFE_INTEGER = 9007199254740991; 4601 4602/** 4603 * The base implementation of `_.forEach` without support for callback 4604 * shorthands and `this` binding. 4605 * 4606 * @private 4607 * @param {Array|Object|string} collection The collection to iterate over. 4608 * @param {Function} iteratee The function invoked per iteration. 4609 * @returns {Array|Object|string} Returns `collection`. 4610 */ 4611var baseEach = createBaseEach(baseForOwn); 4612 4613/** 4614 * The base implementation of `baseForIn` and `baseForOwn` which iterates 4615 * over `object` properties returned by `keysFunc` invoking `iteratee` for 4616 * each property. Iteratee functions may exit iteration early by explicitly 4617 * returning `false`. 4618 * 4619 * @private 4620 * @param {Object} object The object to iterate over. 4621 * @param {Function} iteratee The function invoked per iteration. 4622 * @param {Function} keysFunc The function to get the keys of `object`. 4623 * @returns {Object} Returns `object`. 4624 */ 4625var baseFor = createBaseFor(); 4626 4627/** 4628 * The base implementation of `_.forOwn` without support for callback 4629 * shorthands and `this` binding. 4630 * 4631 * @private 4632 * @param {Object} object The object to iterate over. 4633 * @param {Function} iteratee The function invoked per iteration. 4634 * @returns {Object} Returns `object`. 4635 */ 4636function baseForOwn(object, iteratee) { 4637 return baseFor(object, iteratee, keys); 4638} 4639 4640/** 4641 * The base implementation of `_.property` without support for deep paths. 4642 * 4643 * @private 4644 * @param {string} key The key of the property to get. 4645 * @returns {Function} Returns the new function. 4646 */ 4647function baseProperty(key) { 4648 return function(object) { 4649 return object == null ? undefined : object[key]; 4650 }; 4651} 4652 4653/** 4654 * Creates a `baseEach` or `baseEachRight` function. 4655 * 4656 * @private 4657 * @param {Function} eachFunc The function to iterate over a collection. 4658 * @param {boolean} [fromRight] Specify iterating from right to left. 4659 * @returns {Function} Returns the new base function. 4660 */ 4661function createBaseEach(eachFunc, fromRight) { 4662 return function(collection, iteratee) { 4663 var length = collection ? getLength(collection) : 0; 4664 if (!isLength(length)) { 4665 return eachFunc(collection, iteratee); 4666 } 4667 var index = fromRight ? length : -1, 4668 iterable = toObject(collection); 4669 4670 while ((fromRight ? index-- : ++index < length)) { 4671 if (iteratee(iterable[index], index, iterable) === false) { 4672 break; 4673 } 4674 } 4675 return collection; 4676 }; 4677} 4678 4679/** 4680 * Creates a base function for `_.forIn` or `_.forInRight`. 4681 * 4682 * @private 4683 * @param {boolean} [fromRight] Specify iterating from right to left. 4684 * @returns {Function} Returns the new base function. 4685 */ 4686function createBaseFor(fromRight) { 4687 return function(object, iteratee, keysFunc) { 4688 var iterable = toObject(object), 4689 props = keysFunc(object), 4690 length = props.length, 4691 index = fromRight ? length : -1; 4692 4693 while ((fromRight ? index-- : ++index < length)) { 4694 var key = props[index]; 4695 if (iteratee(iterable[key], key, iterable) === false) { 4696 break; 4697 } 4698 } 4699 return object; 4700 }; 4701} 4702 4703/** 4704 * Gets the "length" property value of `object`. 4705 * 4706 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 4707 * that affects Safari on at least iOS 8.1-8.3 ARM64. 4708 * 4709 * @private 4710 * @param {Object} object The object to query. 4711 * @returns {*} Returns the "length" value. 4712 */ 4713var getLength = baseProperty('length'); 4714 4715/** 4716 * Checks if `value` is a valid array-like length. 4717 * 4718 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 4719 * 4720 * @private 4721 * @param {*} value The value to check. 4722 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 4723 */ 4724function isLength(value) { 4725 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 4726} 4727 4728/** 4729 * Converts `value` to an object if it's not one. 4730 * 4731 * @private 4732 * @param {*} value The value to process. 4733 * @returns {Object} Returns the object. 4734 */ 4735function toObject(value) { 4736 return isObject(value) ? value : Object(value); 4737} 4738 4739/** 4740 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 4741 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 4742 * 4743 * @static 4744 * @memberOf _ 4745 * @category Lang 4746 * @param {*} value The value to check. 4747 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 4748 * @example 4749 * 4750 * _.isObject({}); 4751 * // => true 4752 * 4753 * _.isObject([1, 2, 3]); 4754 * // => true 4755 * 4756 * _.isObject(1); 4757 * // => false 4758 */ 4759function isObject(value) { 4760 // Avoid a V8 JIT bug in Chrome 19-20. 4761 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 4762 var type = typeof value; 4763 return !!value && (type == 'object' || type == 'function'); 4764} 4765 4766module.exports = baseEach; 4767 4768},{"lodash.keys":67}],47:[function(require,module,exports){ 4769/** 4770 * lodash 3.7.2 (Custom Build) <https://lodash.com/>
vendor: 5,345 bytes, lines 4771-4956
4771 * Build: `lodash modern modularize exports="npm" -o ./` 4772 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4773 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4774 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4775 * Available under MIT license <https://lodash.com/license> 4776 */ 4777 4778/** 4779 * The base implementation of `get` without support for string paths 4780 * and default values. 4781 * 4782 * @private 4783 * @param {Object} object The object to query. 4784 * @param {Array} path The path of the property to get. 4785 * @param {string} [pathKey] The key representation of path. 4786 * @returns {*} Returns the resolved value. 4787 */ 4788function baseGet(object, path, pathKey) { 4789 if (object == null) { 4790 return; 4791 } 4792 if (pathKey !== undefined && pathKey in toObject(object)) { 4793 path = [pathKey]; 4794 } 4795 var index = 0, 4796 length = path.length; 4797 4798 while (object != null && index < length) { 4799 object = object[path[index++]]; 4800 } 4801 return (index && index == length) ? object : undefined; 4802} 4803 4804/** 4805 * Converts `value` to an object if it's not one. 4806 * 4807 * @private 4808 * @param {*} value The value to process. 4809 * @returns {Object} Returns the object. 4810 */ 4811function toObject(value) { 4812 return isObject(value) ? value : Object(value); 4813} 4814 4815/** 4816 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 4817 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 4818 * 4819 * @static 4820 * @memberOf _ 4821 * @category Lang 4822 * @param {*} value The value to check. 4823 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 4824 * @example 4825 * 4826 * _.isObject({}); 4827 * // => true 4828 * 4829 * _.isObject([1, 2, 3]); 4830 * // => true 4831 * 4832 * _.isObject(1); 4833 * // => false 4834 */ 4835function isObject(value) { 4836 // Avoid a V8 JIT bug in Chrome 19-20. 4837 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 4838 var type = typeof value; 4839 return !!value && (type == 'object' || type == 'function'); 4840} 4841 4842module.exports = baseGet; 4843 4844},{}],48:[function(require,module,exports){ 4845/** 4846 * lodash 3.0.3 (Custom Build) <https://lodash.com/> 4847 * Build: `lodash modern modularize exports="npm" -o ./` 4848 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4849 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4850 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4851 * Available under MIT license <https://lodash.com/license> 4852 */ 4853 4854/** 4855 * The base implementation of `_.slice` without an iteratee call guard. 4856 * 4857 * @private 4858 * @param {Array} array The array to slice. 4859 * @param {number} [start=0] The start position. 4860 * @param {number} [end=array.length] The end position. 4861 * @returns {Array} Returns the slice of `array`. 4862 */ 4863function baseSlice(array, start, end) { 4864 var index = -1, 4865 length = array.length; 4866 4867 start = start == null ? 0 : (+start || 0); 4868 if (start < 0) { 4869 start = -start > length ? 0 : (length + start); 4870 } 4871 end = (end === undefined || end > length) ? length : (+end || 0); 4872 if (end < 0) { 4873 end += length; 4874 } 4875 length = start > end ? 0 : ((end - start) >>> 0); 4876 start >>>= 0; 4877 4878 var result = Array(length); 4879 while (++index < length) { 4880 result[index] = array[index + start]; 4881 } 4882 return result; 4883} 4884 4885module.exports = baseSlice; 4886 4887},{}],49:[function(require,module,exports){ 4888/** 4889 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 4890 * Build: `lodash modern modularize exports="npm" -o ./` 4891 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4892 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4893 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4894 * Available under MIT license <https://lodash.com/license> 4895 */ 4896 4897/** 4898 * A specialized version of `baseCallback` which only supports `this` binding 4899 * and specifying the number of arguments to provide to `func`. 4900 * 4901 * @private 4902 * @param {Function} func The function to bind. 4903 * @param {*} thisArg The `this` binding of `func`. 4904 * @param {number} [argCount] The number of arguments to provide to `func`. 4905 * @returns {Function} Returns the callback. 4906 */ 4907function bindCallback(func, thisArg, argCount) { 4908 if (typeof func != 'function') { 4909 return identity; 4910 } 4911 if (thisArg === undefined) { 4912 return func; 4913 } 4914 switch (argCount) { 4915 case 1: return function(value) { 4916 return func.call(thisArg, value); 4917 }; 4918 case 3: return function(value, index, collection) { 4919 return func.call(thisArg, value, index, collection); 4920 }; 4921 case 4: return function(accumulator, value, index, collection) { 4922 return func.call(thisArg, accumulator, value, index, collection); 4923 }; 4924 case 5: return function(value, other, key, object, source) { 4925 return func.call(thisArg, value, other, key, object, source); 4926 }; 4927 } 4928 return function() { 4929 return func.apply(thisArg, arguments); 4930 }; 4931} 4932 4933/** 4934 * This method returns the first argument provided to it. 4935 * 4936 * @static 4937 * @memberOf _ 4938 * @category Utility 4939 * @param {*} value Any value. 4940 * @returns {*} Returns `value`. 4941 * @example 4942 * 4943 * var object = { 'user': 'fred' }; 4944 * 4945 * _.identity(object) === object; 4946 * // => true 4947 */ 4948function identity(value) { 4949 return value; 4950} 4951 4952module.exports = bindCallback; 4953 4954},{}],50:[function(require,module,exports){ 4955/** 4956 * lodash 3.1.1 (Custom Build) <https://lodash.com/>
4957 * Build: `lodash modern modularize exports="npm" -o ./` 4958 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4959 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4960 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4961 * Available under MIT license <https://lodash.com/license> 4962 */ 4963var bindCallback = require('lodash._bindcallback'), 4964 isIterateeCall = require('lodash._isiterateecall'), 4965 restParam = require('lodash.restparam'); 4966 4967/** 4968 * Creates a function that assigns properties of source object(s) to a given 4969 * destination object. 4970 * 4971 * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. 4972 * 4973 * @private 4974 * @param {Function} assigner The function to assign values. 4975 * @returns {Function} Returns the new assigner function. 4976 */ 4977function createAssigner(assigner) { 4978 return restParam(function(object, sources) { 4979 var index = -1, 4980 length = object == null ? 0 : sources.length, 4981 customizer = length > 2 ? sources[length - 2] : undefined, 4982 guard = length > 2 ? sources[2] : undefined, 4983 thisArg = length > 1 ? sources[length - 1] : undefined; 4984 4985 if (typeof customizer == 'function') { 4986 customizer = bindCallback(customizer, thisArg, 5); 4987 length -= 2; 4988 } else { 4989 customizer = typeof thisArg == 'function' ? thisArg : undefined; 4990 length -= (customizer ? 1 : 0); 4991 } 4992 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 4993 customizer = length < 3 ? undefined : customizer; 4994 length = 1; 4995 } 4996 while (++index < length) { 4997 var source = sources[index]; 4998 if (source) { 4999 assigner(object, source, customizer); 5000 } 5001 } 5002 return object; 5003 }); 5004} 5005 5006module.exports = createAssigner; 5007 5008},{"lodash._bindcallback":49,"lodash._isiterateecall":53,"lodash.restparam":69}],51:[function(require,module,exports){ 5009/** 5010 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 5011 * Build: `lodash modularize exports="npm" -o ./` 5012 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 5013 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5014 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5015 * Available under MIT license <https://lodash.com/license> 5016 */ 5017var root = require('lodash._root'); 5018 5019/** Used to compose bitmasks for wrapper metadata. */ 5020var BIND_FLAG = 1, 5021 BIND_KEY_FLAG = 2, 5022 CURRY_BOUND_FLAG = 4, 5023 CURRY_FLAG = 8, 5024 CURRY_RIGHT_FLAG = 16, 5025 PARTIAL_FLAG = 32, 5026 PARTIAL_RIGHT_FLAG = 64, 5027 ARY_FLAG = 128, 5028 FLIP_FLAG = 512; 5029 5030/** Used as the `TypeError` message for "Functions" methods. */ 5031var FUNC_ERROR_TEXT = 'Expected a function'; 5032 5033/** Used as references for various `Number` constants. */ 5034var INFINITY = 1 / 0, 5035 MAX_SAFE_INTEGER = 9007199254740991, 5036 MAX_INTEGER = 1.7976931348623157e+308, 5037 NAN = 0 / 0; 5038 5039/** Used as the internal argument placeholder. */ 5040var PLACEHOLDER = '__lodash_placeholder__'; 5041 5042/** `Object#toString` result references. */ 5043var funcTag = '[object Function]', 5044 genTag = '[object GeneratorFunction]'; 5045 5046/** Used to match leading and trailing whitespace. */ 5047var reTrim = /^\s+|\s+$/g; 5048 5049/** Used to detect bad signed hexadecimal string values. */ 5050var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 5051 5052/** Used to detect binary string values. */ 5053var reIsBinary = /^0b[01]+$/i; 5054 5055/** Used to detect octal string values. */ 5056var reIsOctal = /^0o[0-7]+$/i; 5057 5058/** Used to detect unsigned integer values. */ 5059var reIsUint = /^(?:0|[1-9]\d*)$/; 5060 5061/** Built-in method references without a dependency on `root`. */ 5062var freeParseInt = parseInt; 5063 5064/** 5065 * A faster alternative to `Function#apply`, this function invokes `func` 5066 * with the `this` binding of `thisArg` and the arguments of `args`. 5067 * 5068 * @private 5069 * @param {Function} func The function to invoke. 5070 * @param {*} thisArg The `this` binding of `func`. 5071 * @param {...*} args The arguments to invoke `func` with. 5072 * @returns {*} Returns the result of `func`. 5073 */ 5074function apply(func, thisArg, args) { 5075 var length = args.length; 5076 switch (length) { 5077 case 0: return func.call(thisArg); 5078 case 1: return func.call(thisArg, args[0]); 5079 case 2: return func.call(thisArg, args[0], args[1]); 5080 case 3: return func.call(thisArg, args[0], args[1], args[2]); 5081 } 5082 return func.apply(thisArg, args); 5083} 5084 5085/** 5086 * Checks if `value` is a valid array-like index. 5087 * 5088 * @private 5089 * @param {*} value The value to check. 5090 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5091 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5092 */ 5093function isIndex(value, length) { 5094 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 5095 length = length == null ? MAX_SAFE_INTEGER : length; 5096 return value > -1 && value % 1 == 0 && value < length; 5097} 5098 5099/** 5100 * Replaces all `placeholder` elements in `array` with an internal placeholder 5101 * and returns an array of their indexes. 5102 * 5103 * @private 5104 * @param {Array} array The array to modify. 5105 * @param {*} placeholder The placeholder to replace. 5106 * @returns {Array} Returns the new array of placeholder indexes. 5107 */ 5108function replaceHolders(array, placeholder) { 5109 var index = -1, 5110 length = array.length, 5111 resIndex = -1, 5112 result = []; 5113 5114 while (++index < length) { 5115 if (array[index] === placeholder) { 5116 array[index] = PLACEHOLDER; 5117 result[++resIndex] = index; 5118 } 5119 } 5120 return result; 5121} 5122 5123/** Used for built-in method references. */ 5124var objectProto = Object.prototype; 5125 5126/** 5127 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 5128 * of values. 5129 */ 5130var objectToString = objectProto.toString; 5131 5132/* Built-in method references for those with the same name as other `lodash` methods. */ 5133var nativeMax = Math.max, 5134 nativeMin = Math.min; 5135 5136/** 5137 * The base implementation of `_.create` without support for assigning 5138 * properties to the created object. 5139 * 5140 * @private 5141 * @param {Object} prototype The object to inherit from. 5142 * @returns {Object} Returns the new object. 5143 */ 5144var baseCreate = (function() { 5145 function object() {} 5146 return function(prototype) { 5147 if (isObject(prototype)) { 5148 object.prototype = prototype; 5149 var result = new object; 5150 object.prototype = undefined; 5151 } 5152 return result || {}; 5153 }; 5154}()); 5155 5156/** 5157 * Creates an array that is the composition of partially applied arguments, 5158 * placeholders, and provided arguments into a single array of arguments. 5159 * 5160 * @private 5161 * @param {Array|Object} args The provided arguments. 5162 * @param {Array}
5162 partials The arguments to prepend to those provided. 5163 * @param {Array} holders The `partials` placeholder indexes. 5164 * @returns {Array} Returns the new array of composed arguments. 5165 */ 5166function composeArgs(args, partials, holders) { 5167 var holdersLength = holders.length, 5168 argsIndex = -1, 5169 argsLength = nativeMax(args.length - holdersLength, 0), 5170 leftIndex = -1, 5171 leftLength = partials.length, 5172 result = Array(leftLength + argsLength); 5173 5174 while (++leftIndex < leftLength) { 5175 result[leftIndex] = partials[leftIndex]; 5176 } 5177 while (++argsIndex < holdersLength) { 5178 result[holders[argsIndex]] = args[argsIndex]; 5179 } 5180 while (argsLength--) { 5181 result[leftIndex++] = args[argsIndex++]; 5182 } 5183 return result; 5184} 5185 5186/** 5187 * This function is like `composeArgs` except that the arguments composition 5188 * is tailored for `_.partialRight`. 5189 * 5190 * @private 5191 * @param {Array|Object} args The provided arguments. 5192 * @param {Array} partials The arguments to append to those provided. 5193 * @param {Array} holders The `partials` placeholder indexes. 5194 * @returns {Array} Returns the new array of composed arguments. 5195 */ 5196function composeArgsRight(args, partials, holders) { 5197 var holdersIndex = -1, 5198 holdersLength = holders.length, 5199 argsIndex = -1, 5200 argsLength = nativeMax(args.length - holdersLength, 0), 5201 rightIndex = -1, 5202 rightLength = partials.length, 5203 result = Array(argsLength + rightLength); 5204 5205 while (++argsIndex < argsLength) { 5206 result[argsIndex] = args[argsIndex]; 5207 } 5208 var offset = argsIndex; 5209 while (++rightIndex < rightLength) { 5210 result[offset + rightIndex] = partials[rightIndex]; 5211 } 5212 while (++holdersIndex < holdersLength) { 5213 result[offset + holders[holdersIndex]] = args[argsIndex++]; 5214 } 5215 return result; 5216} 5217 5218/** 5219 * Copies the values of `source` to `array`. 5220 * 5221 * @private 5222 * @param {Array} source The array to copy values from. 5223 * @param {Array} [array=[]] The array to copy values to. 5224 * @returns {Array} Returns `array`. 5225 */ 5226function copyArray(source, array) { 5227 var index = -1, 5228 length = source.length; 5229 5230 array || (array = Array(length)); 5231 while (++index < length) { 5232 array[index] = source[index]; 5233 } 5234 return array; 5235} 5236 5237/** 5238 * Creates a function that wraps `func` to invoke it with the optional `this` 5239 * binding of `thisArg`. 5240 * 5241 * @private 5242 * @param {Function} func The function to wrap. 5243 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5244 * @param {*} [thisArg] The `this` binding of `func`. 5245 * @returns {Function} Returns the new wrapped function. 5246 */ 5247function createBaseWrapper(func, bitmask, thisArg) { 5248 var isBind = bitmask & BIND_FLAG, 5249 Ctor = createCtorWrapper(func); 5250 5251 function wrapper() { 5252 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 5253 return fn.apply(isBind ? thisArg : this, arguments); 5254 } 5255 return wrapper; 5256} 5257 5258/** 5259 * Creates a function that produces an instance of `Ctor` regardless of 5260 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 5261 * 5262 * @private 5263 * @param {Function} Ctor The constructor to wrap. 5264 * @returns {Function} Returns the new wrapped function. 5265 */ 5266function createCtorWrapper(Ctor) { 5267 return function() { 5268 // Use a `switch` statement to work with class constructors. 5269 // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 5270 // for more details. 5271 var args = arguments; 5272 switch (args.length) { 5273 case 0: return new Ctor; 5274 case 1: return new Ctor(args[0]); 5275 case 2: return new Ctor(args[0], args[1]); 5276 case 3: return new Ctor(args[0], args[1], args[2]); 5277 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 5278 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 5279 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 5280 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 5281 } 5282 var thisBinding = baseCreate(Ctor.prototype), 5283 result = Ctor.apply(thisBinding, args); 5284
5285 // Mimic the constructor's `return` behavior. 5286 // See https://es5.github.io/#x13.2.2 for more details. 5287 return isObject(result) ? result : thisBinding; 5288 }; 5289} 5290 5291/** 5292 * Creates a function that wraps `func` to enable currying. 5293 * 5294 * @private 5295 * @param {Function} func The function to wrap. 5296 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5297 * @param {number} arity The arity of `func`. 5298 * @returns {Function} Returns the new wrapped function. 5299 */ 5300function createCurryWrapper(func, bitmask, arity) { 5301 var Ctor = createCtorWrapper(func); 5302 5303 function wrapper() { 5304 var length = arguments.length, 5305 index = length, 5306 args = Array(length), 5307 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, 5308 placeholder = wrapper.placeholder; 5309 5310 while (index--) { 5311 args[index] = arguments[index]; 5312 } 5313 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 5314 ? [] 5315 : replaceHolders(args, placeholder); 5316 5317 length -= holders.length; 5318 return length < arity 5319 ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) 5320 : apply(fn, this, args); 5321 } 5322 return wrapper; 5323} 5324 5325/** 5326 * Creates a function that wraps `func` to invoke it with optional `this` 5327 * binding of `thisArg`, partial application, and currying. 5328 * 5329 * @private 5330 * @param {Function|string} func The function or method name to wrap. 5331 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5332 * @param {*} [thisArg] The `this` binding of `func`. 5333 * @param {Array} [partials] The arguments to prepend to those provided to the new function. 5334 * @param {Array} [holders] The `partials` placeholder indexes. 5335 * @param {Array} [partialsRight] The arguments to append to those provided to the new function. 5336 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 5337 * @param {Array} [argPos] The argument positions of the new function. 5338 * @param {number} [ary] The arity cap of `func`. 5339 * @param {number} [arity] The arity of `func`. 5340 * @returns {Function} Returns the new wrapped function. 5341 */ 5342function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 5343 var isAry = bitmask & ARY_FLAG, 5344 isBind = bitmask & BIND_FLAG, 5345 isBindKey = bitmask & BIND_KEY_FLAG, 5346 isCurry = bitmask & CURRY_FLAG, 5347 isCurryRight = bitmask & CURRY_RIGHT_FLAG, 5348 isFlip = bitmask & FLIP_FLAG, 5349 Ctor = isBindKey ? undefined : createCtorWrapper(func); 5350 5351 function wrapper() { 5352 var length = arguments.length, 5353 index = length, 5354 args = Array(length); 5355 5356 while (index--) { 5357 args[index] = arguments[index]; 5358 } 5359 if (partials) { 5360 args = composeArgs(args, partials, holders); 5361 } 5362 if (partialsRight) { 5363 args = composeArgsRight(args, partialsRight, holdersRight); 5364 } 5365 if (isCurry || isCurryRight) { 5366 var placeholder = wrapper.placeholder, 5367 argsHolders = replaceHolders(args, placeholder); 5368 5369 length -= argsHolders.length; 5370 if (length < arity) { 5371 return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); 5372 } 5373 } 5374 var thisBinding = isBind ? thisArg : this, 5375 fn = isBindKey ? thisBinding[func] : func; 5376 5377 if (argPos) { 5378 args = reorder(args, argPos); 5379 } else if (isFlip && args.length > 1) { 5380 args.reverse(); 5381 } 5382 if (isAry && ary < args.length) { 5383 args.length = ary; 5384 } 5385 if (this && this !== root && this instanceof wrapper) { 5386 fn = Ctor || createCtorWrapper(fn); 5387 } 5388 return fn.apply(thisBinding, args); 5389 } 5390 return wrapper; 5391} 5392 5393/** 5394 * Creates a function that wraps `func` to invoke it with the optional `this` 5395 * binding of `thisArg` and the `partials` prepended to those provided to 5396 * the wrapper. 5397 * 5398 * @private 5399 * @param {Function} func The function to wrap. 5400 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5401 * @param {*} thisArg The `this` binding of `func`. 5402 * @param {Array}
5402 partials The arguments to prepend to those provided to the new function. 5403 * @returns {Function} Returns the new wrapped function. 5404 */ 5405function createPartialWrapper(func, bitmask, thisArg, partials) { 5406 var isBind = bitmask & BIND_FLAG, 5407 Ctor = createCtorWrapper(func); 5408 5409 function wrapper() { 5410 var argsIndex = -1, 5411 argsLength = arguments.length, 5412 leftIndex = -1, 5413 leftLength = partials.length, 5414 args = Array(leftLength + argsLength), 5415 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 5416 5417 while (++leftIndex < leftLength) { 5418 args[leftIndex] = partials[leftIndex]; 5419 } 5420 while (argsLength--) { 5421 args[leftIndex++] = arguments[++argsIndex]; 5422 } 5423 return apply(fn, isBind ? thisArg : this, args); 5424 } 5425 return wrapper; 5426} 5427 5428/** 5429 * Creates a function that wraps `func` to continue currying. 5430 * 5431 * @private 5432 * @param {Function} func The function to wrap. 5433 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5434 * @param {Function} wrapFunc The function to create the `func` wrapper. 5435 * @param {*} placeholder The placeholder to replace. 5436 * @param {*} [thisArg] The `this` binding of `func`. 5437 * @param {Array} [partials] The arguments to prepend to those provided to the new function. 5438 * @param {Array} [holders] The `partials` placeholder indexes. 5439 * @param {Array} [argPos] The argument positions of the new function. 5440 * @param {number} [ary] The arity cap of `func`. 5441 * @param {number} [arity] The arity of `func`. 5442 * @returns {Function} Returns the new wrapped function. 5443 */ 5444function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 5445 var isCurry = bitmask & CURRY_FLAG, 5446 newArgPos = argPos ? copyArray(argPos) : undefined, 5447 newsHolders = isCurry ? holders : undefined, 5448 newHoldersRight = isCurry ? undefined : holders, 5449 newPartials = isCurry ? partials : undefined, 5450 newPartialsRight = isCurry ? undefined : partials; 5451 5452 bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); 5453 bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); 5454 5455 if (!(bitmask & CURRY_BOUND_FLAG)) { 5456 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); 5457 } 5458 var result = wrapFunc(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity); 5459 5460 result.placeholder = placeholder; 5461 return result; 5462} 5463 5464/** 5465 * Creates a function that either curries or invokes `func` with optional 5466 * `this` binding and partially applied arguments. 5467 * 5468 * @private 5469 * @param {Function|string} func The function or method name to wrap. 5470 * @param {number} bitmask The bitmask of wrapper flags. 5471 * The bitmask may be composed of the following flags: 5472 * 1 - `_.bind` 5473 * 2 - `_.bindKey` 5474 * 4 - `_.curry` or `_.curryRight` of a bound function 5475 * 8 - `_.curry` 5476 * 16 - `_.curryRight` 5477 * 32 - `_.partial` 5478 * 64 - `_.partialRight` 5479 * 128 - `_.rearg` 5480 * 256 - `_.ary` 5481 * @param {*} [thisArg] The `this` binding of `func`. 5482 * @param {Array} [partials] The arguments to be partially applied. 5483 * @param {Array} [holders] The `partials` placeholder indexes. 5484 * @param {Array} [argPos] The argument positions of the new function. 5485 * @param {number} [ary] The arity cap of `func`. 5486 * @param {number} [arity] The arity of `func`. 5487 * @returns {Function} Returns the new wrapped function. 5488 */ 5489function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 5490 var isBindKey = bitmask & BIND_KEY_FLAG; 5491 if (!isBindKey && typeof func != 'function') { 5492 throw new TypeError(FUNC_ERROR_TEXT); 5493 } 5494 var length = partials ? partials.length : 0; 5495 if (!length) { 5496 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); 5497 partials = holders = undefined; 5498 } 5499 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 5500 arity = arity === undefined ? arity : toInteger(arity); 5501 length -= holders ? holders.length : 0; 5502 5503 if (bitmask & PARTIAL_RIGHT_FLAG) { 5504 var partialsRight = partials, 5505 holdersRight = holders; 5506 5507 partials = holders = undefined; 5508 } 5509 var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; 5510 5511 func = newData[0]; 5512 bitmask = newData[1]; 5513 thisArg = newData[2]; 5514 partials = newData[3]; 5515 holders = newData[4]; 5516 arity = newData[9] = newData[9] == null 5517 ? (isBindKey ? 0 : func.length) 5518 : nativeMax(newData[9] - length, 0); 5519 5520 if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { 5521 bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); 5522 } 5523 if (!bitmask || bitmask == BIND_FLAG) { 5524 var result = createBaseWrapper(func, bitmask, thisArg); 5525 } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { 5526 result = createCurryWrapper(func, bitmask, arity); 5527 } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
5528 result = createPartialWrapper(func, bitmask, thisArg, partials); 5529 } else { 5530 result = createHybridWrapper.apply(undefined, newData); 5531 } 5532 return result; 5533} 5534 5535/** 5536 * Reorder `array` according to the specified indexes where the element at 5537 * the first index is assigned as the first element, the element at 5538 * the second index is assigned as the second element, and so on. 5539 * 5540 * @private 5541 * @param {Array} array The array to reorder. 5542 * @param {Array} indexes The arranged array indexes. 5543 * @returns {Array} Returns `array`. 5544 */ 5545function reorder(array, indexes) { 5546 var arrLength = array.length, 5547 length = nativeMin(indexes.length, arrLength), 5548 oldArray = copyArray(array); 5549 5550 while (length--) { 5551 var index = indexes[length]; 5552 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 5553 } 5554 return array; 5555} 5556 5557/** 5558 * Checks if `value` is classified as a `Function` object. 5559 * 5560 * @static 5561 * @memberOf _ 5562 * @category Lang 5563 * @param {*} value The value to check. 5564 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 5565 * @example 5566 * 5567 * _.isFunction(_); 5568 * // => true 5569 * 5570 * _.isFunction(/abc/); 5571 * // => false 5572 */ 5573function isFunction(value) { 5574 // The use of `Object#toString` avoids issues with the `typeof` operator 5575 // in Safari 8 which returns 'object' for typed array constructors, and 5576 // PhantomJS 1.9 which returns 'function' for `NodeList` instances. 5577 var tag = isObject(value) ? objectToString.call(value) : ''; 5578 return tag == funcTag || tag == genTag; 5579} 5580 5581/** 5582 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5583 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5584 * 5585 * @static 5586 * @memberOf _ 5587 * @category Lang 5588 * @param {*} value The value to check. 5589 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5590 * @example 5591 * 5592 * _.isObject({}); 5593 * // => true 5594 * 5595 * _.isObject([1, 2, 3]); 5596 * // => true 5597 * 5598 * _.isObject(_.noop); 5599 * // => true 5600 * 5601 * _.isObject(null); 5602 * // => false 5603 */ 5604function isObject(value) { 5605 var type = typeof value; 5606 return !!value && (type == 'object' || type == 'function'); 5607} 5608 5609/** 5610 * Converts `value` to an integer. 5611 * 5612 * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). 5613 * 5614 * @static 5615 * @memberOf _ 5616 * @category Lang 5617 * @param {*} value The value to convert. 5618 * @returns {number} Returns the converted integer. 5619 * @example 5620 * 5621 * _.toInteger(3); 5622 * // => 3 5623 * 5624 * _.toInteger(Number.MIN_VALUE); 5625 * // => 0 5626 * 5627 * _.toInteger(Infinity); 5628 * // => 1.7976931348623157e+308 5629 * 5630 * _.toInteger('3'); 5631 * // => 3 5632 */ 5633function toInteger(value) { 5634 if (!value) { 5635 return value === 0 ? value : 0; 5636 } 5637 value = toNumber(value); 5638 if (value === INFINITY || value === -INFINITY) { 5639 var sign = (value < 0 ? -1 : 1); 5640 return sign * MAX_INTEGER; 5641 } 5642 var remainder = value % 1; 5643 return value === value ? (remainder ? value - remainder : value) : 0; 5644} 5645 5646/** 5647 * Converts `value` to a number. 5648 * 5649 * @static 5650 * @memberOf _ 5651 * @category Lang 5652 * @param {*} value The value to process. 5653 * @returns {number} Returns the number. 5654 * @example 5655 * 5656 * _.toNumber(3); 5657 * // => 3 5658 * 5659 * _.toNumber(Number.MIN_VALUE); 5660 * // => 5e-324 5661 * 5662 * _.toNumber(Infinity); 5663 * // => Infinity 5664 * 5665 * _.toNumber('3'); 5666 * // => 3 5667 */ 5668function toNumber(value) { 5669 if (isObject(value)) { 5670 var other = isFunction(value.valueOf) ? value.valueOf() : value; 5671 value = isObject(other) ? (other + '') : other; 5672 } 5673 if (typeof value != 'string') { 5674 return value === 0 ? value : +value; 5675 } 5676 value = value.replace(reTrim, ''); 5677 var isBinary = reIsBinary.test(value); 5678 return (isBinary || reIsOctal.test(value)) 5679 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 5680 : (reIsBadHex.test(value) ? NAN : +value); 5681} 5682 5683module.exports = createWrapper; 5684 5685},{"lodash._root":55}],52:[function(require,module,exports){ 5686/** 5687 * lodash 3.9.1 (Custom Build) <https://lodash.com/> 5688 * Build: `lodash modern modularize exports="npm" -o ./` 5689 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5690 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5691 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5692 * Available under MIT license <https://lodash.com/license> 5693 */ 5694 5695/** `Object#toString` result references. */ 5696var funcTag = '[object Function]'; 5697 5698/** Used to detect host constructors (Safari > 5). */ 5699var reIsHostCtor = /^\[object .+?Constructor\]$/; 5700 5701/** 5702 * Checks if `value` is object-like. 5703 * 5704 * @private 5705 * @param {*} value The value to check. 5706 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 5707 */ 5708function isObjectLike(value) { 5709 return !!value && typeof value == 'object'; 5710} 5711 5712/** Used for native method references. */ 5713var objectProto = Object.prototype; 5714 5715/** Used to resolve the decompiled source of functions. */ 5716var fnToString = Function.prototype.toString; 5717 5718/** Used to check objects for own properties. */ 5719var hasOwnProperty = objectProto.hasOwnProperty; 5720 5721/** 5722 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 5723 * of values. 5724 */ 5725var objToString = objectProto.toString; 5726 5727/** Used to detect if a method is native. */ 5728var reIsNative = RegExp('^' + 5729 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') 5730 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 5731); 5732 5733/** 5734 * Gets the native function at `key` of `object`. 5735 * 5736 * @private 5737 * @param {Object} object The object to query. 5738 * @param {string} key The key of the method to get. 5739 * @returns {*} Returns the function if it's native, else `undefined`. 5740 */ 5741function getNative(object, key) { 5742 var value = object == null ? undefined : object[key]; 5743 return isNative(value) ? value : undefined; 5744} 5745 5746/** 5747 * Checks if `value` is classified as a `Function` object. 5748 * 5749 * @static 5750 * @memberOf _ 5751 * @category Lang 5752 * @param {*} value The value to check. 5753 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 5754 * @example 5755 * 5756 * _.isFunction(_); 5757 * // => true 5758 * 5759 * _.isFunction(/abc/); 5760 * // => false 5761 */ 5762function isFunction(value) {
vendor: 9,135 bytes, lines 5763-6062
5763 // The use of `Object#toString` avoids issues with the `typeof` operator 5764 // in older versions of Chrome and Safari which return 'function' for regexes 5765 // and Safari 8 equivalents which return 'object' for typed array constructors. 5766 return isObject(value) && objToString.call(value) == funcTag; 5767} 5768 5769/** 5770 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5771 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5772 * 5773 * @static 5774 * @memberOf _ 5775 * @category Lang 5776 * @param {*} value The value to check. 5777 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5778 * @example 5779 * 5780 * _.isObject({}); 5781 * // => true 5782 * 5783 * _.isObject([1, 2, 3]); 5784 * // => true 5785 * 5786 * _.isObject(1); 5787 * // => false 5788 */ 5789function isObject(value) { 5790 // Avoid a V8 JIT bug in Chrome 19-20. 5791 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 5792 var type = typeof value; 5793 return !!value && (type == 'object' || type == 'function'); 5794} 5795 5796/** 5797 * Checks if `value` is a native function. 5798 * 5799 * @static 5800 * @memberOf _ 5801 * @category Lang 5802 * @param {*} value The value to check. 5803 * @returns {boolean} Returns `true` if `value` is a native function, else `false`. 5804 * @example 5805 * 5806 * _.isNative(Array.prototype.push); 5807 * // => true 5808 * 5809 * _.isNative(_); 5810 * // => false 5811 */ 5812function isNative(value) { 5813 if (value == null) { 5814 return false; 5815 } 5816 if (isFunction(value)) { 5817 return reIsNative.test(fnToString.call(value)); 5818 } 5819 return isObjectLike(value) && reIsHostCtor.test(value); 5820} 5821 5822module.exports = getNative; 5823 5824},{}],53:[function(require,module,exports){ 5825/** 5826 * lodash 3.0.9 (Custom Build) <https://lodash.com/> 5827 * Build: `lodash modern modularize exports="npm" -o ./` 5828 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5829 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5830 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5831 * Available under MIT license <https://lodash.com/license> 5832 */ 5833 5834/** Used to detect unsigned integer values. */ 5835var reIsUint = /^\d+$/; 5836 5837/** 5838 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 5839 * of an array-like value. 5840 */ 5841var MAX_SAFE_INTEGER = 9007199254740991; 5842 5843/** 5844 * The base implementation of `_.property` without support for deep paths. 5845 * 5846 * @private 5847 * @param {string} key The key of the property to get. 5848 * @returns {Function} Returns the new function. 5849 */ 5850function baseProperty(key) { 5851 return function(object) { 5852 return object == null ? undefined : object[key]; 5853 }; 5854} 5855 5856/** 5857 * Gets the "length" property value of `object`. 5858 * 5859 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 5860 * that affects Safari on at least iOS 8.1-8.3 ARM64. 5861 * 5862 * @private 5863 * @param {Object} object The object to query. 5864 * @returns {*} Returns the "length" value. 5865 */ 5866var getLength = baseProperty('length'); 5867 5868/** 5869 * Checks if `value` is array-like. 5870 * 5871 * @private 5872 * @param {*} value The value to check. 5873 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 5874 */ 5875function isArrayLike(value) { 5876 return value != null && isLength(getLength(value)); 5877} 5878 5879/** 5880 * Checks if `value` is a valid array-like index. 5881 * 5882 * @private 5883 * @param {*} value The value to check. 5884 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5885 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5886 */ 5887function isIndex(value, length) { 5888 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 5889 length = length == null ? MAX_SAFE_INTEGER : length; 5890 return value > -1 && value % 1 == 0 && value < length; 5891} 5892 5893/** 5894 * Checks if the provided arguments are from an iteratee call. 5895 * 5896 * @private 5897 * @param {*} value The potential iteratee value argument. 5898 * @param {*} index The potential iteratee index or key argument. 5899 * @param {*} object The potential iteratee object argument. 5900 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. 5901 */ 5902function isIterateeCall(value, index, object) { 5903 if (!isObject(object)) { 5904 return false; 5905 } 5906 var type = typeof index; 5907 if (type == 'number' 5908 ? (isArrayLike(object) && isIndex(index, object.length)) 5909 : (type == 'string' && index in object)) { 5910 var other = object[index]; 5911 return value === value ? (value === other) : (other !== other); 5912 } 5913 return false; 5914} 5915 5916/** 5917 * Checks if `value` is a valid array-like length. 5918 * 5919 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 5920 * 5921 * @private 5922 * @param {*} value The value to check. 5923 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 5924 */ 5925function isLength(value) { 5926 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 5927} 5928 5929/** 5930 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5931 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5932 * 5933 * @static 5934 * @memberOf _ 5935 * @category Lang 5936 * @param {*} value The value to check. 5937 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5938 * @example 5939 * 5940 * _.isObject({}); 5941 * // => true 5942 * 5943 * _.isObject([1, 2, 3]); 5944 * // => true 5945 * 5946 * _.isObject(1); 5947 * // => false 5948 */ 5949function isObject(value) { 5950 // Avoid a V8 JIT bug in Chrome 19-20. 5951 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 5952 var type = typeof value; 5953 return !!value && (type == 'object' || type == 'function'); 5954} 5955 5956module.exports = isIterateeCall; 5957 5958},{}],54:[function(require,module,exports){ 5959/** 5960 * lodash 3.0.0 (Custom Build) <https://lodash.com/> 5961 * Build: `lodash modern modularize exports="npm" -o ./` 5962 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5963 * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> 5964 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5965 * Available under MIT license <https://lodash.com/license> 5966 */ 5967 5968/** Used as the internal argument placeholder. */ 5969var PLACEHOLDER = '__lodash_placeholder__'; 5970 5971/** 5972 * Replaces all `placeholder` elements in `array` with an internal placeholder 5973 * and returns an array of their indexes. 5974 * 5975 * @private 5976 * @param {Array} array The array to modify. 5977 * @param {*} placeholder The placeholder to replace. 5978 * @returns {Array} Returns the new array of placeholder indexes. 5979 */ 5980function replaceHolders(array, placeholder) { 5981 var index = -1, 5982 length = array.length, 5983 resIndex = -1, 5984 result = []; 5985 5986 while (++index < length) { 5987 if (array[index] === placeholder) { 5988 array[index] = PLACEHOLDER; 5989 result[++resIndex] = index; 5990 } 5991 } 5992 return result; 5993} 5994 5995module.exports = replaceHolders; 5996 5997},{}],55:[function(require,module,exports){ 5998(function (global){(function (){ 5999/** 6000 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 6001 * Build: `lodash modularize exports="npm" -o ./` 6002 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 6003 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6004 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6005 * Available under MIT license <https://lodash.com/license> 6006 */ 6007 6008/** Used to determine if values are of the language type `Object`. */ 6009var objectTypes = { 6010 'function': true, 6011 'object': true 6012}; 6013 6014/** Detect free variable `exports`. */ 6015var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) 6016 ? exports 6017 : undefined; 6018 6019/** Detect free variable `module`. */ 6020var freeModule = (objectTypes[typeof module] && module && !module.nodeType) 6021 ? module 6022 : undefined; 6023 6024/** Detect free variable `global` from Node.js. */ 6025var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); 6026 6027/** Detect free variable `self`. */ 6028var freeSelf = checkGlobal(objectTypes[typeof self] && self); 6029 6030/** Detect free variable `window`. */ 6031var freeWindow = checkGlobal(objectTypes[typeof window] && window); 6032 6033/** Detect `this` as the global object. */ 6034var thisGlobal = checkGlobal(objectTypes[typeof this] && this); 6035 6036/** 6037 * Used as a reference to the global object. 6038 * 6039 * The `this` value is used if it's the global object to avoid Greasemonkey's 6040 * restricted `window` object, otherwise the `window` object is used. 6041 */ 6042var root = freeGlobal || 6043 ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || 6044 freeSelf || thisGlobal || Function('return this')(); 6045 6046/** 6047 * Checks if `value` is a global object. 6048 * 6049 * @private 6050 * @param {*} value The value to check. 6051 * @returns {null|Object} Returns `value` if it's a global object, else `null`. 6052 */ 6053function checkGlobal(value) { 6054 return (value && value.Object === Object) ? value : null; 6055} 6056 6057module.exports = root; 6058 6059}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 6060},{}],56:[function(require,module,exports){ 6061/** 6062 * lodash 3.8.1 (Custom Build) <https://lodash.com/>
6063 * Build: `lodash modern modularize exports="npm" -o ./` 6064 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6065 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6066 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6067 * Available under MIT license <https://lodash.com/license> 6068 */ 6069var isArray = require('lodash.isarray'); 6070 6071/** Used to match property names within property paths. */ 6072var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; 6073 6074/** Used to match backslashes in property paths. */ 6075var reEscapeChar = /\\(\\)?/g; 6076 6077/** 6078 * Converts `value` to a string if it's not one. An empty string is returned 6079 * for `null` or `undefined` values. 6080 * 6081 * @private 6082 * @param {*} value The value to process. 6083 * @returns {string} Returns the string. 6084 */ 6085function baseToString(value) { 6086 return value == null ? '' : (value + ''); 6087} 6088 6089/** 6090 * Converts `value` to property path array if it's not one. 6091 * 6092 * @private 6093 * @param {*} value The value to process. 6094 * @returns {Array} Returns the property path array. 6095 */ 6096function toPath(value) { 6097 if (isArray(value)) { 6098 return value; 6099 } 6100 var result = []; 6101 baseToString(value).replace(rePropName, function(match, number, quote, string) { 6102 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); 6103 }); 6104 return result; 6105} 6106 6107module.exports = toPath; 6108 6109},{"lodash.isarray":62}],57:[function(require,module,exports){ 6110/** 6111 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 6112 * Build: `lodash modern modularize exports="npm" -o ./` 6113 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6114 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6115 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6116 * Available under MIT license <https://lodash.com/license> 6117 */ 6118var baseAssign = require('lodash._baseassign'), 6119 createAssigner = require('lodash._createassigner'), 6120 keys = require('lodash.keys'); 6121 6122/** 6123 * A specialized version of `_.assign` for customizing assigned values without 6124 * support for argument juggling, multiple sources, and `this` binding `customizer` 6125 * functions. 6126 * 6127 * @private 6128 * @param {Object} object The destination object. 6129 * @param {Object} source The source object. 6130 * @param {Function} customizer The function to customize assigned values. 6131 * @returns {Object} Returns `object`. 6132 */ 6133function assignWith(object, source, customizer) { 6134 var index = -1, 6135 props = keys(source), 6136 length = props.length; 6137 6138 while (++index < length) { 6139 var key = props[index], 6140 value = object[key], 6141 result = customizer(value, source[key], key, object, source); 6142 6143 if ((result === result ? (result !== value) : (value === value)) || 6144 (value === undefined && !(key in object))) { 6145 object[key] = result; 6146 } 6147 } 6148 return object; 6149} 6150 6151/** 6152 * Assigns own enumerable properties of source object(s) to the destination 6153 * object. Subsequent sources overwrite property assignments of previous sources. 6154 * If `customizer` is provided it is invoked to produce the assigned values. 6155 * The `customizer` is bound to `thisArg` and invoked with five arguments: 6156 * (objectValue, sourceValue, key, object, source). 6157 * 6158 * **Note:** This method mutates `object` and is based on 6159 * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). 6160 * 6161 * @static 6162 * @memberOf _ 6163 * @alias extend 6164 * @category Object 6165 * @param {Object} object The destination object. 6166 * @param {...Object} [sources] The source objects. 6167 * @param {Function} [customizer] The function to customize assigned values. 6168 * @param {*} [thisArg] The `this` binding of `customizer`. 6169 * @returns {Object} Returns `object`. 6170 * @example 6171 * 6172 * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); 6173 * // => { 'user': 'fred', 'age': 40 } 6174 * 6175 * // using a customizer callback 6176 * var defaults = _.partialRight(_.assign, function(value, other) { 6177 * return _.isUndefined(value) ? other : value; 6178 * }); 6179 * 6180 * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); 6181 * // => { 'user': 'barney', 'age': 36 } 6182 */ 6183var assign = createAssigner(function(object, source, customizer) { 6184 return customizer 6185 ? assignWith(object, source, customizer) 6186 : baseAssign(object, source); 6187}); 6188 6189module.exports = assign; 6190 6191},{"lodash._baseassign":44,"lodash._createassigner":50,"lodash.keys":67}],58:[function(require,module,exports){ 6192/** 6193 * lodash 3.0.3 (Custom Build) <https://lodash.com/>
6194 * Build: `lodash modern modularize exports="npm" -o ./` 6195 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6196 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6197 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6198 * Available under MIT license <https://lodash.com/license> 6199 */ 6200 6201/** Used as the `TypeError` message for "Functions" methods. */ 6202var FUNC_ERROR_TEXT = 'Expected a function'; 6203 6204/** 6205 * Creates a function that invokes `func`, with the `this` binding and arguments 6206 * of the created function, while it is called less than `n` times. Subsequent 6207 * calls to the created function return the result of the last `func` invocation. 6208 * 6209 * @static 6210 * @memberOf _ 6211 * @category Function 6212 * @param {number} n The number of calls at which `func` is no longer invoked. 6213 * @param {Function} func The function to restrict. 6214 * @returns {Function} Returns the new restricted function. 6215 * @example 6216 * 6217 * jQuery('#add').on('click', _.before(5, addContactToList)); 6218 * // => allows adding up to 4 contacts to the list 6219 */ 6220function before(n, func) { 6221 var result; 6222 if (typeof func != 'function') { 6223 if (typeof n == 'function') { 6224 var temp = n; 6225 n = func; 6226 func = temp; 6227 } else { 6228 throw new TypeError(FUNC_ERROR_TEXT); 6229 } 6230 } 6231 return function() { 6232 if (--n > 0) { 6233 result = func.apply(this, arguments); 6234 } 6235 if (n <= 1) { 6236 func = undefined; 6237 } 6238 return result; 6239 }; 6240} 6241 6242module.exports = before; 6243 6244},{}],59:[function(require,module,exports){ 6245/** 6246 * lodash 3.1.0 (Custom Build) <https://lodash.com/> 6247 * Build: `lodash modern modularize exports="npm" -o ./` 6248 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6249 * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> 6250 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6251 * Available under MIT license <https://lodash.com/license> 6252 */ 6253var createWrapper = require('lodash._createwrapper'), 6254 replaceHolders = require('lodash._replaceholders'), 6255 restParam = require('lodash.restparam'); 6256 6257/** Used to compose bitmasks for wrapper metadata. */ 6258var BIND_FLAG = 1, 6259 PARTIAL_FLAG = 32; 6260 6261/** 6262 * Creates a function that invokes `func` with the `this` binding of `thisArg` 6263 * and prepends any additional `_.bind` arguments to those provided to the 6264 * bound function. 6265 * 6266 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 6267 * may be used as a placeholder for partially applied arguments. 6268 * 6269 * **Note:** Unlike native `Function#bind` this method does not set the `length` 6270 * property of bound functions. 6271 * 6272 * @static 6273 * @memberOf _ 6274 * @category Function 6275 * @param {Function} func The function to bind. 6276 * @param {*} thisArg The `this` binding of `func`. 6277 * @param {...*} [partials] The arguments to be partially applied. 6278 * @returns {Function} Returns the new bound function. 6279 * @example 6280 * 6281 * var greet = function(greeting, punctuation) { 6282 * return greeting + ' ' + this.user + punctuation; 6283 * }; 6284 * 6285 * var object = { 'user': 'fred' }; 6286 * 6287 * var bound = _.bind(greet, object, 'hi'); 6288 * bound('!'); 6289 * // => 'hi fred!' 6290 * 6291 * // using placeholders 6292 * var bound = _.bind(greet, object, _, '!'); 6293 * bound('hi'); 6294 * // => 'hi fred!' 6295 */ 6296var bind = restParam(function(func, thisArg, partials) { 6297 var bitmask = BIND_FLAG; 6298 if (partials.length) { 6299 var holders = replaceHolders(partials, bind.placeholder); 6300 bitmask |= PARTIAL_FLAG; 6301 } 6302 return createWrapper(func, bitmask, thisArg, partials, holders); 6303}); 6304 6305// Assign default placeholders. 6306bind.placeholder = {}; 6307 6308module.exports = bind; 6309 6310},{"lodash._createwrapper":51,"lodash._replaceholders":54,"lodash.restparam":69}],60:[function(require,module,exports){ 6311/** 6312 * lodash 3.0.3 (Custom Build) <https://lodash.com/> 6313 * Build: `lodash modern modularize exports="npm" -o ./` 6314 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6315 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6316 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6317 * Available under MIT license <https://lodash.com/license> 6318 */ 6319var arrayEach = require('lodash._arrayeach'), 6320 baseEach = require('lodash._baseeach'), 6321 bindCallback = require('lodash._bindcallback'), 6322 isArray = require('lodash.isarray'); 6323 6324/** 6325 * Creates a function for `_.forEach` or `_.forEachRight`. 6326 * 6327 * @private 6328 * @param {Function} arrayFunc The function to iterate over an array.
6329 * @param {Function} eachFunc The function to iterate over a collection. 6330 * @returns {Function} Returns the new each function. 6331 */ 6332function createForEach(arrayFunc, eachFunc) { 6333 return function(collection, iteratee, thisArg) { 6334 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) 6335 ? arrayFunc(collection, iteratee) 6336 : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); 6337 }; 6338} 6339 6340/** 6341 * Iterates over elements of `collection` invoking `iteratee` for each element. 6342 * The `iteratee` is bound to `thisArg` and invoked with three arguments: 6343 * (value, index|key, collection). Iteratee functions may exit iteration early 6344 * by explicitly returning `false`. 6345 * 6346 * **Note:** As with other "Collections" methods, objects with a "length" property 6347 * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` 6348 * may be used for object iteration. 6349 * 6350 * @static 6351 * @memberOf _ 6352 * @alias each 6353 * @category Collection 6354 * @param {Array|Object|string} collection The collection to iterate over. 6355 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 6356 * @param {*} [thisArg] The `this` binding of `iteratee`. 6357 * @returns {Array|Object|string} Returns `collection`. 6358 * @example 6359 * 6360 * _([1, 2]).forEach(function(n) { 6361 * console.log(n); 6362 * }).value(); 6363 * // => logs each value from left to right and returns the array 6364 * 6365 * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { 6366 * console.log(n, key); 6367 * }); 6368 * // => logs each value-key pair and returns the object (iteration order is not guaranteed) 6369 */ 6370var forEach = createForEach(arrayEach, baseEach); 6371 6372module.exports = forEach; 6373 6374},{"lodash._arrayeach":43,"lodash._baseeach":46,"lodash._bindcallback":49,"lodash.isarray":62}],61:[function(require,module,exports){ 6375/** 6376 * lodash (Custom Build) <https://lodash.com/> 6377 * Build: `lodash modularize exports="npm" -o ./` 6378 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 6379 * Released under MIT license <https://lodash.com/license> 6380 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6381 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6382 */ 6383 6384/** Used as references for various `Number` constants. */ 6385var MAX_SAFE_INTEGER = 9007199254740991; 6386 6387/** `Object#toString` result references. */ 6388var argsTag = '[object Arguments]', 6389 funcTag = '[object Function]', 6390 genTag = '[object GeneratorFunction]'; 6391 6392/** Used for built-in method references. */ 6393var objectProto = Object.prototype; 6394 6395/** Used to check objects for own properties. */ 6396var hasOwnProperty = objectProto.hasOwnProperty; 6397 6398/** 6399 * Used to resolve the 6400 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 6401 * of values. 6402 */ 6403var objectToString = objectProto.toString; 6404 6405/** Built-in value references. */ 6406var propertyIsEnumerable = objectProto.propertyIsEnumerable; 6407 6408/** 6409 * Checks if `value` is likely an `arguments` object. 6410 * 6411 * @static 6412 * @memberOf _ 6413 * @since 0.1.0 6414 * @category Lang 6415 * @param {*} value The value to check. 6416 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 6417 * else `false`. 6418 * @example 6419 * 6420 * _.isArguments(function() { return arguments; }()); 6421 * // => true 6422 * 6423 * _.isArguments([1, 2, 3]); 6424 * // => false 6425 */ 6426function isArguments(value) { 6427 // Safari 8.1 makes `arguments.callee` enumerable in strict mode. 6428 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && 6429 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); 6430} 6431 6432/** 6433 * Checks if `value` is array-like. A value is considered array-like if it's 6434 * not a function and has a `value.length` that's an integer greater than or 6435 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 6436 * 6437 * @static 6438 * @memberOf _ 6439 * @since 4.0.0 6440 * @category Lang 6441 * @param {*} value The value to check. 6442 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 6443 * @example 6444 * 6445 * _.isArrayLike([1, 2, 3]); 6446 * // => true 6447 * 6448 * _.isArrayLike(document.body.children); 6449 * // => true 6450 * 6451 * _.isArrayLike('abc'); 6452 * // => true 6453 * 6454 * _.isArrayLike(_.noop); 6455 * // => false 6456 */ 6457function isArrayLike(value) { 6458 return value != null && isLength(value.length) && !isFunction(value); 6459} 6460 6461/** 6462 * This method is like `_.isArrayLike` except that it also checks if `value` 6463 * is an object. 6464 * 6465 * @static 6466 * @memberOf _ 6467 * @since 4.0.0 6468 * @category Lang 6469 * @param {*} value The value to check. 6470 * @returns {boolean} Returns `true` if `value` is an array-like object, 6471 * else `false`. 6472 * @example 6473 * 6474 * _.isArrayLikeObject([1, 2, 3]); 6475 * // => true 6476 * 6477 * _.isArrayLikeObject(document.body.children); 6478 * // => true 6479 * 6480 * _.isArrayLikeObject('abc'); 6481 * // => false 6482 * 6483 * _.isArrayLikeObject(_.noop); 6484 * // => false 6485 */ 6486function isArrayLikeObject(value) { 6487 return isObjectLike(value) && isArrayLike(value); 6488} 6489 6490/** 6491 * Checks if `value` is classified as a `Function` object. 6492 * 6493 * @static 6494 * @memberOf _ 6495 * @since 0.1.0 6496 * @category Lang 6497 * @param {*} value The value to check. 6498 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 6499 * @example 6500 * 6501 * _.isFunction(_); 6502 * // => true 6503 * 6504 * _.isFunction(/abc/); 6505 * // => false 6506 */ 6507function isFunction(value) {
vendor: 11,073 bytes, lines 6508-6910
6508 // The use of `Object#toString` avoids issues with the `typeof` operator 6509 // in Safari 8-9 which returns 'object' for typed array and other constructors. 6510 var tag = isObject(value) ? objectToString.call(value) : ''; 6511 return tag == funcTag || tag == genTag; 6512} 6513 6514/** 6515 * Checks if `value` is a valid array-like length. 6516 * 6517 * **Note:** This method is loosely based on 6518 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 6519 * 6520 * @static 6521 * @memberOf _ 6522 * @since 4.0.0 6523 * @category Lang 6524 * @param {*} value The value to check. 6525 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6526 * @example 6527 * 6528 * _.isLength(3); 6529 * // => true 6530 * 6531 * _.isLength(Number.MIN_VALUE); 6532 * // => false 6533 * 6534 * _.isLength(Infinity); 6535 * // => false 6536 * 6537 * _.isLength('3'); 6538 * // => false 6539 */ 6540function isLength(value) { 6541 return typeof value == 'number' && 6542 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6543} 6544 6545/** 6546 * Checks if `value` is the 6547 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 6548 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6549 * 6550 * @static 6551 * @memberOf _ 6552 * @since 0.1.0 6553 * @category Lang 6554 * @param {*} value The value to check. 6555 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6556 * @example 6557 * 6558 * _.isObject({}); 6559 * // => true 6560 * 6561 * _.isObject([1, 2, 3]); 6562 * // => true 6563 * 6564 * _.isObject(_.noop); 6565 * // => true 6566 * 6567 * _.isObject(null); 6568 * // => false 6569 */ 6570function isObject(value) { 6571 var type = typeof value; 6572 return !!value && (type == 'object' || type == 'function'); 6573} 6574 6575/** 6576 * Checks if `value` is object-like. A value is object-like if it's not `null` 6577 * and has a `typeof` result of "object". 6578 * 6579 * @static 6580 * @memberOf _ 6581 * @since 4.0.0 6582 * @category Lang 6583 * @param {*} value The value to check. 6584 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6585 * @example 6586 * 6587 * _.isObjectLike({}); 6588 * // => true 6589 * 6590 * _.isObjectLike([1, 2, 3]); 6591 * // => true 6592 * 6593 * _.isObjectLike(_.noop); 6594 * // => false 6595 * 6596 * _.isObjectLike(null); 6597 * // => false 6598 */ 6599function isObjectLike(value) { 6600 return !!value && typeof value == 'object'; 6601} 6602 6603module.exports = isArguments; 6604 6605},{}],62:[function(require,module,exports){ 6606/** 6607 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 6608 * Build: `lodash modern modularize exports="npm" -o ./` 6609 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6610 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6611 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6612 * Available under MIT license <https://lodash.com/license> 6613 */ 6614 6615/** `Object#toString` result references. */ 6616var arrayTag = '[object Array]', 6617 funcTag = '[object Function]'; 6618 6619/** Used to detect host constructors (Safari > 5). */ 6620var reIsHostCtor = /^\[object .+?Constructor\]$/; 6621 6622/** 6623 * Checks if `value` is object-like. 6624 * 6625 * @private 6626 * @param {*} value The value to check. 6627 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6628 */ 6629function isObjectLike(value) { 6630 return !!value && typeof value == 'object'; 6631} 6632 6633/** Used for native method references. */ 6634var objectProto = Object.prototype; 6635 6636/** Used to resolve the decompiled source of functions. */ 6637var fnToString = Function.prototype.toString; 6638 6639/** Used to check objects for own properties. */ 6640var hasOwnProperty = objectProto.hasOwnProperty; 6641 6642/** 6643 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 6644 * of values. 6645 */ 6646var objToString = objectProto.toString; 6647 6648/** Used to detect if a method is native. */ 6649var reIsNative = RegExp('^' + 6650 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') 6651 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 6652); 6653 6654/* Native method references for those with the same name as other `lodash` methods. */ 6655var nativeIsArray = getNative(Array, 'isArray'); 6656 6657/** 6658 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) 6659 * of an array-like value. 6660 */ 6661var MAX_SAFE_INTEGER = 9007199254740991; 6662 6663/** 6664 * Gets the native function at `key` of `object`. 6665 * 6666 * @private 6667 * @param {Object} object The object to query. 6668 * @param {string} key The key of the method to get. 6669 * @returns {*} Returns the function if it's native, else `undefined`. 6670 */ 6671function getNative(object, key) { 6672 var value = object == null ? undefined : object[key]; 6673 return isNative(value) ? value : undefined; 6674} 6675 6676/** 6677 * Checks if `value` is a valid array-like length. 6678 * 6679 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). 6680 * 6681 * @private 6682 * @param {*} value The value to check. 6683 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6684 */ 6685function isLength(value) { 6686 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6687} 6688 6689/** 6690 * Checks if `value` is classified as an `Array` object. 6691 * 6692 * @static 6693 * @memberOf _ 6694 * @category Lang 6695 * @param {*} value The value to check. 6696 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 6697 * @example 6698 * 6699 * _.isArray([1, 2, 3]); 6700 * // => true 6701 * 6702 * _.isArray(function() { return arguments; }()); 6703 * // => false 6704 */ 6705var isArray = nativeIsArray || function(value) { 6706 return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; 6707}; 6708 6709/** 6710 * Checks if `value` is classified as a `Function` object. 6711 * 6712 * @static 6713 * @memberOf _ 6714 * @category Lang 6715 * @param {*} value The value to check. 6716 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 6717 * @example 6718 * 6719 * _.isFunction(_); 6720 * // => true 6721 * 6722 * _.isFunction(/abc/); 6723 * // => false 6724 */ 6725function isFunction(value) { 6726 // The use of `Object#toString` avoids issues with the `typeof` operator 6727 // in older versions of Chrome and Safari which return 'function' for regexes 6728 // and Safari 8 equivalents which return 'object' for typed array constructors. 6729 return isObject(value) && objToString.call(value) == funcTag; 6730} 6731 6732/** 6733 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 6734 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6735 * 6736 * @static 6737 * @memberOf _ 6738 * @category Lang 6739 * @param {*} value The value to check. 6740 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6741 * @example 6742 * 6743 * _.isObject({}); 6744 * // => true 6745 * 6746 * _.isObject([1, 2, 3]); 6747 * // => true 6748 * 6749 * _.isObject(1); 6750 * // => false 6751 */ 6752function isObject(value) { 6753 // Avoid a V8 JIT bug in Chrome 19-20. 6754 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 6755 var type = typeof value; 6756 return !!value && (type == 'object' || type == 'function'); 6757} 6758 6759/** 6760 * Checks if `value` is a native function. 6761 * 6762 * @static 6763 * @memberOf _ 6764 * @category Lang 6765 * @param {*} value The value to check. 6766 * @returns {boolean} Returns `true` if `value` is a native function, else `false`. 6767 * @example 6768 * 6769 * _.isNative(Array.prototype.push); 6770 * // => true 6771 * 6772 * _.isNative(_); 6773 * // => false 6774 */ 6775function isNative(value) { 6776 if (value == null) { 6777 return false; 6778 } 6779 if (isFunction(value)) { 6780 return reIsNative.test(fnToString.call(value)); 6781 } 6782 return isObjectLike(value) && reIsHostCtor.test(value); 6783} 6784 6785module.exports = isArray; 6786 6787},{}],63:[function(require,module,exports){ 6788/** 6789 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 6790 * Build: `lodash modern modularize exports="npm" -o ./` 6791 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6792 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6793 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6794 * Available under MIT license <https://lodash.com/license> 6795 */ 6796var isArguments = require('lodash.isarguments'), 6797 isArray = require('lodash.isarray'), 6798 isFunction = require('lodash.isfunction'), 6799 isString = require('lodash.isstring'), 6800 keys = require('lodash.keys'); 6801 6802/** 6803 * Checks if `value` is object-like. 6804 * 6805 * @private 6806 * @param {*} value The value to check. 6807 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6808 */ 6809function isObjectLike(value) { 6810 return !!value && typeof value == 'object'; 6811} 6812 6813/** 6814 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 6815 * of an array-like value. 6816 */ 6817var MAX_SAFE_INTEGER = 9007199254740991; 6818 6819/** 6820 * The base implementation of `_.property` without support for deep paths. 6821 * 6822 * @private 6823 * @param {string} key The key of the property to get. 6824 * @returns {Function} Returns the new function. 6825 */ 6826function baseProperty(key) { 6827 return function(object) { 6828 return object == null ? undefined : object[key]; 6829 }; 6830} 6831 6832/** 6833 * Gets the "length" property value of `object`. 6834 * 6835 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 6836 * that affects Safari on at least iOS 8.1-8.3 ARM64. 6837 * 6838 * @private 6839 * @param {Object} object The object to query. 6840 * @returns {*} Returns the "length" value. 6841 */ 6842var getLength = baseProperty('length'); 6843 6844/** 6845 * Checks if `value` is array-like. 6846 * 6847 * @private 6848 * @param {*} value The value to check. 6849 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 6850 */ 6851function isArrayLike(value) { 6852 return value != null && isLength(getLength(value)); 6853} 6854 6855/** 6856 * Checks if `value` is a valid array-like length. 6857 * 6858 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 6859 * 6860 * @private 6861 * @param {*} value The value to check. 6862 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6863 */ 6864function isLength(value) { 6865 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6866} 6867 6868/** 6869 * Checks if `value` is empty. A value is considered empty unless it is an 6870 * `arguments` object, array, string, or jQuery-like collection with a length 6871 * greater than `0` or an object with own enumerable properties. 6872 * 6873 * @static 6874 * @memberOf _ 6875 * @category Lang 6876 * @param {Array|Object|string} value The value to inspect. 6877 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 6878 * @example 6879 * 6880 * _.isEmpty(null); 6881 * // => true 6882 * 6883 * _.isEmpty(true); 6884 * // => true 6885 * 6886 * _.isEmpty(1); 6887 * // => true 6888 * 6889 * _.isEmpty([1, 2, 3]); 6890 * // => false 6891 * 6892 * _.isEmpty({ 'a': 1 }); 6893 * // => false 6894 */ 6895function isEmpty(value) { 6896 if (value == null) { 6897 return true; 6898 } 6899 if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || 6900 (isObjectLike(value) && isFunction(value.splice)))) { 6901 return !value.length; 6902 } 6903 return !keys(value).length; 6904} 6905 6906module.exports = isEmpty; 6907 6908},{"lodash.isarguments":61,"lodash.isarray":62,"lodash.isfunction":64,"lodash.isstring":66,"lodash.keys":67}],64:[function(require,module,exports){ 6909(function (global){(function (){ 6910/**
6911 * Lodash (Custom Build) <https://lodash.com/> 6912 * Build: `lodash modularize exports="npm" -o ./` 6913 * Copyright JS Foundation and other contributors <https://js.foundation/> 6914 * Released under MIT license <https://lodash.com/license> 6915 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6916 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6917 */ 6918 6919/** `Object#toString` result references. */ 6920var asyncTag = '[object AsyncFunction]', 6921 funcTag = '[object Function]', 6922 genTag = '[object GeneratorFunction]', 6923 nullTag = '[object Null]', 6924 proxyTag = '[object Proxy]', 6925 undefinedTag = '[object Undefined]'; 6926 6927/** Detect free variable `global` from Node.js. */ 6928var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 6929 6930/** Detect free variable `self`. */ 6931var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 6932 6933/** Used as a reference to the global object. */ 6934var root = freeGlobal || freeSelf || Function('return this')(); 6935 6936/** Used for built-in method references. */ 6937var objectProto = Object.prototype; 6938 6939/** Used to check objects for own properties. */ 6940var hasOwnProperty = objectProto.hasOwnProperty; 6941 6942/** 6943 * Used to resolve the 6944 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 6945 * of values. 6946 */ 6947var nativeObjectToString = objectProto.toString; 6948 6949/** Built-in value references. */ 6950var Symbol = root.Symbol, 6951 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 6952 6953/** 6954 * The base implementation of `getTag` without fallbacks for buggy environments. 6955 * 6956 * @private 6957 * @param {*} value The value to query. 6958 * @returns {string} Returns the `toStringTag`. 6959 */ 6960function baseGetTag(value) { 6961 if (value == null) { 6962 return value === undefined ? undefinedTag : nullTag; 6963 } 6964 return (symToStringTag && symToStringTag in Object(value)) 6965 ? getRawTag(value) 6966 : objectToString(value); 6967} 6968 6969/** 6970 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 6971 * 6972 * @private 6973 * @param {*} value The value to query. 6974 * @returns {string} Returns the raw `toStringTag`. 6975 */ 6976function getRawTag(value) { 6977 var isOwn = hasOwnProperty.call(value, symToStringTag), 6978 tag = value[symToStringTag]; 6979 6980 try { 6981 value[symToStringTag] = undefined; 6982 var unmasked = true; 6983 } catch (e) {} 6984 6985 var result = nativeObjectToString.call(value); 6986 if (unmasked) { 6987 if (isOwn) { 6988 value[symToStringTag] = tag; 6989 } else { 6990 delete value[symToStringTag]; 6991 } 6992 } 6993 return result; 6994} 6995 6996/** 6997 * Converts `value` to a string using `Object.prototype.toString`. 6998 * 6999 * @private 7000 * @param {*} value The value to convert. 7001 * @returns {string} Returns the converted string. 7002 */ 7003function objectToString(value) { 7004 return nativeObjectToString.call(value); 7005} 7006 7007/** 7008 * Checks if `value` is classified as a `Function` object. 7009 * 7010 * @static 7011 * @memberOf _ 7012 * @since 0.1.0 7013 * @category Lang 7014 * @param {*} value The value to check. 7015 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 7016 * @example 7017 * 7018 * _.isFunction(_); 7019 * // => true 7020 * 7021 * _.isFunction(/abc/); 7022 * // => false 7023 */ 7024function isFunction(value) { 7025 if (!isObject(value)) { 7026 return false; 7027 } 7028 // The use of `Object#toString` avoids issues with the `typeof` operator 7029 // in Safari 9 which returns 'object' for typed arrays and other constructors. 7030 var tag = baseGetTag(value); 7031 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 7032} 7033 7034/** 7035 * Checks if `value` is the 7036 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 7037 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7038 * 7039 * @static 7040 * @memberOf _ 7041 * @since 0.1.0 7042 * @category Lang 7043 * @param {*} value The value to check. 7044 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7045 * @example 7046 * 7047 * _.isObject({}); 7048 * // => true 7049 * 7050 * _.isObject([1, 2, 3]); 7051 * // => true 7052 * 7053 * _.isObject(_.noop); 7054 * // => true 7055 * 7056 * _.isObject(null); 7057 * // => false 7058 */ 7059function isObject(value) { 7060 var type = typeof value; 7061 return value != null && (type == 'object' || type == 'function'); 7062} 7063 7064module.exports = isFunction; 7065 7066}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 7067},{}],65:[function(require,module,exports){ 7068/** 7069 * lodash 3.0.5 (Custom Build) <https://lodash.com/>
vendor: 10,156 bytes, lines 7070-7434
7070 * Build: `lodash modularize exports="npm" -o ./` 7071 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 7072 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7073 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7074 * Available under MIT license <https://lodash.com/license> 7075 */ 7076 7077/** `Object#toString` result references. */ 7078var regexpTag = '[object RegExp]'; 7079 7080/** Used for built-in method references. */ 7081var objectProto = Object.prototype; 7082 7083/** 7084 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 7085 * of values. 7086 */ 7087var objectToString = objectProto.toString; 7088 7089/** 7090 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7091 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7092 * 7093 * @static 7094 * @memberOf _ 7095 * @category Lang 7096 * @param {*} value The value to check. 7097 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7098 * @example 7099 * 7100 * _.isObject({}); 7101 * // => true 7102 * 7103 * _.isObject([1, 2, 3]); 7104 * // => true 7105 * 7106 * _.isObject(_.noop); 7107 * // => true 7108 * 7109 * _.isObject(null); 7110 * // => false 7111 */ 7112function isObject(value) { 7113 var type = typeof value; 7114 return !!value && (type == 'object' || type == 'function'); 7115} 7116 7117/** 7118 * Checks if `value` is classified as a `RegExp` object. 7119 * 7120 * @static 7121 * @memberOf _ 7122 * @category Lang 7123 * @param {*} value The value to check. 7124 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7125 * @example 7126 * 7127 * _.isRegExp(/abc/); 7128 * // => true 7129 * 7130 * _.isRegExp('/abc/'); 7131 * // => false 7132 */ 7133function isRegExp(value) { 7134 return isObject(value) && objectToString.call(value) == regexpTag; 7135} 7136 7137module.exports = isRegExp; 7138 7139},{}],66:[function(require,module,exports){ 7140/** 7141 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 7142 * Build: `lodash modern modularize exports="npm" -o ./` 7143 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7144 * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> 7145 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7146 * Available under MIT license <https://lodash.com/license> 7147 */ 7148 7149/** `Object#toString` result references. */ 7150var stringTag = '[object String]'; 7151 7152/** 7153 * Checks if `value` is object-like. 7154 * 7155 * @private 7156 * @param {*} value The value to check. 7157 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 7158 */ 7159function isObjectLike(value) { 7160 return !!value && typeof value == 'object'; 7161} 7162 7163/** Used for native method references. */ 7164var objectProto = Object.prototype; 7165 7166/** 7167 * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) 7168 * of values. 7169 */ 7170var objToString = objectProto.toString; 7171 7172/** 7173 * Checks if `value` is classified as a `String` primitive or object. 7174 * 7175 * @static 7176 * @memberOf _ 7177 * @category Lang 7178 * @param {*} value The value to check. 7179 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7180 * @example 7181 * 7182 * _.isString('abc'); 7183 * // => true 7184 * 7185 * _.isString(1); 7186 * // => false 7187 */ 7188function isString(value) { 7189 return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); 7190} 7191 7192module.exports = isString; 7193 7194},{}],67:[function(require,module,exports){ 7195/** 7196 * lodash 3.1.2 (Custom Build) <https://lodash.com/> 7197 * Build: `lodash modern modularize exports="npm" -o ./` 7198 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7199 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7200 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7201 * Available under MIT license <https://lodash.com/license> 7202 */ 7203var getNative = require('lodash._getnative'), 7204 isArguments = require('lodash.isarguments'), 7205 isArray = require('lodash.isarray'); 7206 7207/** Used to detect unsigned integer values. */ 7208var reIsUint = /^\d+$/; 7209 7210/** Used for native method references. */ 7211var objectProto = Object.prototype; 7212 7213/** Used to check objects for own properties. */ 7214var hasOwnProperty = objectProto.hasOwnProperty; 7215 7216/* Native method references for those with the same name as other `lodash` methods. */ 7217var nativeKeys = getNative(Object, 'keys'); 7218 7219/** 7220 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) 7221 * of an array-like value. 7222 */ 7223var MAX_SAFE_INTEGER = 9007199254740991; 7224 7225/** 7226 * The base implementation of `_.property` without support for deep paths. 7227 * 7228 * @private 7229 * @param {string} key The key of the property to get. 7230 * @returns {Function} Returns the new function. 7231 */ 7232function baseProperty(key) { 7233 return function(object) { 7234 return object == null ? undefined : object[key]; 7235 }; 7236} 7237 7238/** 7239 * Gets the "length" property value of `object`. 7240 * 7241 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 7242 * that affects Safari on at least iOS 8.1-8.3 ARM64. 7243 * 7244 * @private 7245 * @param {Object} object The object to query. 7246 * @returns {*} Returns the "length" value. 7247 */ 7248var getLength = baseProperty('length'); 7249 7250/** 7251 * Checks if `value` is array-like. 7252 * 7253 * @private 7254 * @param {*} value The value to check. 7255 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 7256 */ 7257function isArrayLike(value) { 7258 return value != null && isLength(getLength(value)); 7259} 7260 7261/** 7262 * Checks if `value` is a valid array-like index. 7263 * 7264 * @private 7265 * @param {*} value The value to check. 7266 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 7267 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 7268 */ 7269function isIndex(value, length) { 7270 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 7271 length = length == null ? MAX_SAFE_INTEGER : length; 7272 return value > -1 && value % 1 == 0 && value < length; 7273} 7274 7275/** 7276 * Checks if `value` is a valid array-like length. 7277 * 7278 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). 7279 * 7280 * @private 7281 * @param {*} value The value to check. 7282 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 7283 */ 7284function isLength(value) { 7285 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 7286} 7287 7288/** 7289 * A fallback implementation of `Object.keys` which creates an array of the 7290 * own enumerable property names of `object`. 7291 * 7292 * @private 7293 * @param {Object} object The object to query. 7294 * @returns {Array} Returns the array of property names. 7295 */ 7296function shimKeys(object) { 7297 var props = keysIn(object), 7298 propsLength = props.length, 7299 length = propsLength && object.length; 7300 7301 var allowIndexes = !!length && isLength(length) && 7302 (isArray(object) || isArguments(object)); 7303 7304 var index = -1, 7305 result = []; 7306 7307 while (++index < propsLength) { 7308 var key = props[index]; 7309 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { 7310 result.push(key); 7311 } 7312 } 7313 return result; 7314} 7315 7316/** 7317 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7318 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7319 * 7320 * @static 7321 * @memberOf _ 7322 * @category Lang 7323 * @param {*} value The value to check. 7324 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7325 * @example 7326 * 7327 * _.isObject({}); 7328 * // => true 7329 * 7330 * _.isObject([1, 2, 3]); 7331 * // => true 7332 * 7333 * _.isObject(1); 7334 * // => false 7335 */ 7336function isObject(value) { 7337 // Avoid a V8 JIT bug in Chrome 19-20. 7338 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 7339 var type = typeof value; 7340 return !!value && (type == 'object' || type == 'function'); 7341} 7342 7343/** 7344 * Creates an array of the own enumerable property names of `object`. 7345 * 7346 * **Note:** Non-object values are coerced to objects. See the 7347 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) 7348 * for more details. 7349 * 7350 * @static 7351 * @memberOf _ 7352 * @category Object 7353 * @param {Object} object The object to query. 7354 * @returns {Array} Returns the array of property names. 7355 * @example 7356 * 7357 * function Foo() { 7358 * this.a = 1; 7359 * this.b = 2; 7360 * } 7361 * 7362 * Foo.prototype.c = 3; 7363 * 7364 * _.keys(new Foo); 7365 * // => ['a', 'b'] (iteration order is not guaranteed) 7366 * 7367 * _.keys('hi'); 7368 * // => ['0', '1'] 7369 */ 7370var keys = !nativeKeys ? shimKeys : function(object) { 7371 var Ctor = object == null ? undefined : object.constructor; 7372 if ((typeof Ctor == 'function' && Ctor.prototype === object) || 7373 (typeof object != 'function' && isArrayLike(object))) { 7374 return shimKeys(object); 7375 } 7376 return isObject(object) ? nativeKeys(object) : []; 7377}; 7378 7379/** 7380 * Creates an array of the own and inherited enumerable property names of `object`. 7381 * 7382 * **Note:** Non-object values are coerced to objects. 7383 * 7384 * @static 7385 * @memberOf _ 7386 * @category Object 7387 * @param {Object} object The object to query. 7388 * @returns {Array} Returns the array of property names. 7389 * @example 7390 * 7391 * function Foo() { 7392 * this.a = 1; 7393 * this.b = 2; 7394 * } 7395 * 7396 * Foo.prototype.c = 3; 7397 * 7398 * _.keysIn(new Foo); 7399 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 7400 */ 7401function keysIn(object) { 7402 if (object == null) { 7403 return []; 7404 } 7405 if (!isObject(object)) { 7406 object = Object(object); 7407 } 7408 var length = object.length; 7409 length = (length && isLength(length) && 7410 (isArray(object) || isArguments(object)) && length) || 0; 7411 7412 var Ctor = object.constructor, 7413 index = -1, 7414 isProto = typeof Ctor == 'function' && Ctor.prototype === object, 7415 result = Array(length), 7416 skipIndexes = length > 0; 7417 7418 while (++index < length) { 7419 result[index] = (index + ''); 7420 } 7421 for (var key in object) { 7422 if (!(skipIndexes && isIndex(key, length)) && 7423 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 7424 result.push(key); 7425 } 7426 } 7427 return result; 7428} 7429 7430module.exports = keys; 7431 7432},{"lodash._getnative":52,"lodash.isarguments":61,"lodash.isarray":62}],68:[function(require,module,exports){ 7433/** 7434 * lodash 3.0.1 (Custom Build) <https://lodash.com/>
7435 * Build: `lodash modern modularize exports="npm" -o ./` 7436 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7437 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7438 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7439 * Available under MIT license <https://lodash.com/license> 7440 */ 7441var before = require('lodash.before'); 7442 7443/** 7444 * Creates a function that is restricted to invoking `func` once. Repeat calls 7445 * to the function return the value of the first call. The `func` is invoked 7446 * with the `this` binding and arguments of the created function. 7447 * 7448 * @static 7449 * @memberOf _ 7450 * @category Function 7451 * @param {Function} func The function to restrict. 7452 * @returns {Function} Returns the new restricted function. 7453 * @example 7454 * 7455 * var initialize = _.once(createApplication); 7456 * initialize(); 7457 * initialize(); 7458 * // `initialize` invokes `createApplication` once 7459 */ 7460function once(func) { 7461 return before(2, func); 7462} 7463 7464module.exports = once; 7465 7466},{"lodash.before":58}],69:[function(require,module,exports){ 7467/** 7468 * lodash 3.6.1 (Custom Build) <https://lodash.com/> 7469 * Build: `lodash modern modularize exports="npm" -o ./` 7470 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7471 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7472 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7473 * Available under MIT license <https://lodash.com/license> 7474 */ 7475 7476/** Used as the `TypeError` message for "Functions" methods. */ 7477var FUNC_ERROR_TEXT = 'Expected a function'; 7478 7479/* Native method references for those with the same name as other `lodash` methods. */ 7480var nativeMax = Math.max; 7481 7482/** 7483 * Creates a function that invokes `func` with the `this` binding of the 7484 * created function and arguments from `start` and beyond provided as an array. 7485 * 7486 * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). 7487 * 7488 * @static 7489 * @memberOf _ 7490 * @category Function 7491 * @param {Function} func The function to apply a rest parameter to. 7492 * @param {number} [start=func.length-1] The start position of the rest parameter. 7493 * @returns {Function} Returns the new function. 7494 * @example 7495 * 7496 * var say = _.restParam(function(what, names) { 7497 * return what + ' ' + _.initial(names).join(', ') + 7498 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 7499 * }); 7500 * 7501 * say('hello', 'fred', 'barney', 'pebbles'); 7502 * // => 'hello fred, barney, & pebbles' 7503 */ 7504function restParam(func, start) { 7505 if (typeof func != 'function') { 7506 throw new TypeError(FUNC_ERROR_TEXT); 7507 } 7508 start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); 7509 return function() { 7510 var args = arguments, 7511 index = -1, 7512 length = nativeMax(args.length - start, 0), 7513 rest = Array(length); 7514 7515 while (++index < length) { 7516 rest[index] = args[start + index]; 7517 } 7518 switch (start) { 7519 case 0: return func.call(this, rest); 7520 case 1: return func.call(this, args[0], rest); 7521 case 2: return func.call(this, args[0], args[1], rest); 7522 } 7523 var otherArgs = Array(start + 1); 7524 index = -1; 7525 while (++index < start) { 7526 otherArgs[index] = args[index]; 7527 } 7528 otherArgs[start] = rest; 7529 return func.apply(this, otherArgs); 7530 }; 7531} 7532 7533module.exports = restParam; 7534 7535},{}],70:[function(require,module,exports){ 7536/** 7537 * lodash 3.1.2 (Custom Build) <https://lodash.com/> 7538 * Build: `lodash modern modularize exports="npm" -o ./` 7539 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7540 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7541 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7542 * Available under MIT license <https://lodash.com/license> 7543 */ 7544var baseGet = require('lodash._baseget'), 7545 baseSlice = require('lodash._baseslice'), 7546 toPath = require('lodash._topath'), 7547 isArray = require('lodash.isarray'), 7548 isFunction = require('lodash.isfunction'); 7549 7550/** Used to match property names within property paths. */ 7551var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, 7552 reIsPlainProp = /^\w*$/; 7553 7554/** 7555 * Checks if `value` is a property name and not a property path. 7556 * 7557 * @private 7558 * @param {*} value The value to check. 7559 * @param {Object} [object] The object to query keys on. 7560 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 7561 */ 7562function isKey(value, object) { 7563 var type = typeof value; 7564 if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { 7565 return true; 7566 } 7567 if (isArray(value)) { 7568 return false;
7569 } 7570 var result = !reIsDeepProp.test(value); 7571 return result || (object != null && value in toObject(object)); 7572} 7573 7574/** 7575 * Converts `value` to an object if it's not one. 7576 * 7577 * @private 7578 * @param {*} value The value to process. 7579 * @returns {Object} Returns the object. 7580 */ 7581function toObject(value) { 7582 return isObject(value) ? value : Object(value); 7583} 7584 7585/** 7586 * Gets the last element of `array`. 7587 * 7588 * @static 7589 * @memberOf _ 7590 * @category Array 7591 * @param {Array} array The array to query. 7592 * @returns {*} Returns the last element of `array`. 7593 * @example 7594 * 7595 * _.last([1, 2, 3]); 7596 * // => 3 7597 */ 7598function last(array) { 7599 var length = array ? array.length : 0; 7600 return length ? array[length - 1] : undefined; 7601} 7602 7603/** 7604 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7605 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7606 * 7607 * @static 7608 * @memberOf _ 7609 * @category Lang 7610 * @param {*} value The value to check. 7611 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7612 * @example 7613 * 7614 * _.isObject({}); 7615 * // => true 7616 * 7617 * _.isObject([1, 2, 3]); 7618 * // => true 7619 * 7620 * _.isObject(1); 7621 * // => false 7622 */ 7623function isObject(value) { 7624 // Avoid a V8 JIT bug in Chrome 19-20. 7625 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 7626 var type = typeof value; 7627 return !!value && (type == 'object' || type == 'function'); 7628} 7629 7630/** 7631 * This method is like `_.get` except that if the resolved value is a function 7632 * it is invoked with the `this` binding of its parent object and its result 7633 * is returned. 7634 * 7635 * @static 7636 * @memberOf _ 7637 * @category Object 7638 * @param {Object} object The object to query. 7639 * @param {Array|string} path The path of the property to resolve. 7640 * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. 7641 * @returns {*} Returns the resolved value. 7642 * @example 7643 * 7644 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 7645 * 7646 * _.result(object, 'a[0].b.c1'); 7647 * // => 3 7648 * 7649 * _.result(object, 'a[0].b.c2'); 7650 * // => 4 7651 * 7652 * _.result(object, 'a.b.c', 'default'); 7653 * // => 'default' 7654 * 7655 * _.result(object, 'a.b.c', _.constant('default')); 7656 * // => 'default' 7657 */ 7658function result(object, path, defaultValue) { 7659 var result = object == null ? undefined : object[path]; 7660 if (result === undefined) { 7661 if (object != null && !isKey(path, object)) { 7662 path = toPath(path); 7663 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); 7664 result = object == null ? undefined : object[last(path)]; 7665 } 7666 result = result === undefined ? defaultValue : result; 7667 } 7668 return isFunction(result) ? result.call(object) : result; 7669} 7670 7671module.exports = result; 7672 7673},{"lodash._baseget":47,"lodash._baseslice":48,"lodash._topath":56,"lodash.isarray":62,"lodash.isfunction":64}],71:[function(require,module,exports){ 7674/** 7675 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 7676 * Build: `lodash modularize exports="npm" -o ./` 7677 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 7678 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7679 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7680 * Available under MIT license <https://lodash.com/license> 7681 */ 7682var root = require('lodash._root'); 7683 7684/** Used as references for various `Number` constants. */ 7685var INFINITY = 1 / 0; 7686 7687/** `Object#toString` result references. */ 7688var symbolTag = '[object Symbol]'; 7689 7690/** Used for built-in method references. */ 7691var objectProto = Object.prototype; 7692 7693/** Used to generate unique IDs. */ 7694var idCounter = 0; 7695 7696/** 7697 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 7698 * of values. 7699 */ 7700var objectToString = objectProto.toString; 7701 7702/** Built-in value references. */ 7703var Symbol = root.Symbol; 7704 7705/** Used to convert symbols to primitives and strings. */ 7706var symbolProto = Symbol ? Symbol.prototype : undefined, 7707 symbolToString = Symbol ? symbolProto.toString : undefined; 7708 7709/** 7710 * Checks if `value` is object-like. A value is object-like if it's not `null` 7711 * and has a `typeof` result of "object". 7712 * 7713 * @static 7714 * @memberOf _ 7715 * @category Lang 7716 * @param {*} value The value to check. 7717 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 7718 * @example 7719 * 7720 * _.isObjectLike({}); 7721 * // => true 7722 * 7723 * _.isObjectLike([1, 2, 3]); 7724 * // => true 7725 * 7726 * _.isObjectLike(_.noop); 7727 * // => false 7728 * 7729 * _.isObjectLike(null); 7730 * // => false 7731 */ 7732function isObjectLike(value) { 7733 return !!value && typeof value == 'object'; 7734} 7735 7736/** 7737 * Checks if `value` is classified as a `Symbol` primitive or object. 7738 * 7739 * @static 7740 * @memberOf _ 7741 * @category Lang 7742 * @param {*} value The value to check. 7743 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7744 * @example 7745 * 7746 * _.isSymbol(Symbol.iterator); 7747 * // => true 7748 * 7749 * _.isSymbol('abc'); 7750 * // => false 7751 */ 7752function isSymbol(value) { 7753 return typeof value == 'symbol' || 7754 (isObjectLike(value) && objectToString.call(value) == symbolTag); 7755} 7756 7757/** 7758 * Converts `value` to a string if it's not one. An empty string is returned 7759 * for `null` and `undefined` values. The sign of `-0` is preserved. 7760 * 7761 * @static 7762 * @memberOf _ 7763 * @category Lang 7764 * @param {*} value The value to process. 7765 * @returns {string} Returns the string. 7766 * @example 7767 * 7768 * _.toString(null); 7769 * // => '' 7770 * 7771 * _.toString(-0); 7772 * // => '-0' 7773 * 7774 * _.toString([1, 2, 3]); 7775 * // => '1,2,3' 7776 */ 7777function toString(value) { 7778 // Exit early for strings to avoid a performance hit in some environments. 7779 if (typeof value == 'string') { 7780 return value; 7781 } 7782 if (value == null) { 7783 return ''; 7784 } 7785 if (isSymbol(value)) { 7786 return Symbol ? symbolToString.call(value) : ''; 7787 } 7788 var result = (value + ''); 7789 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 7790} 7791 7792/** 7793 * Generates a unique ID. If `prefix` is provided the ID is appended to it. 7794 * 7795 * @static 7796 * @memberOf _ 7797 * @category Util 7798 * @param {string} [prefix] The value to prefix the ID with. 7799 * @returns {string} Returns the unique ID. 7800 * @example 7801 * 7802 * _.uniqueId('contact_'); 7803 * // => 'contact_104' 7804 * 7805 * _.uniqueId(); 7806 * // => '105' 7807 */ 7808function uniqueId(prefix) { 7809 var id = ++idCounter; 7810 return toString(prefix) + id; 7811} 7812 7813module.exports = uniqueId; 7814 7815},{"lodash._root":55}],72:[function(require,module,exports){ 7816(function(window) { 7817 var re = { 7818 not_string: /[^s]/, 7819 number: /[diefg]/, 7820 json: /[j]/, 7821 not_json: /[^j]/, 7822 text: /^[^\x25]+/, 7823 modulo: /^\x25{2}/, 7824 placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])
7824/, 7825 key: /^([a-z_][a-z_\d]*)/i, 7826 key_access: /^\.([a-z_][a-z_\d]*)/i, 7827 index_access: /^\[(\d+)\]/, 7828 sign: /^[\+\-]/ 7829 } 7830 7831 function sprintf() { 7832 var key = arguments[0], cache = sprintf.cache 7833 if (!(cache[key] && cache.hasOwnProperty(key))) { 7834 cache[key] = sprintf.parse(key) 7835 } 7836 return sprintf.format.call(null, cache[key], arguments) 7837 } 7838 7839 sprintf.format = function(parse_tree, argv) { 7840 var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" 7841 for (i = 0; i < tree_length; i++) { 7842 node_type = get_type(parse_tree[i]) 7843 if (node_type === "string") { 7844 output[output.length] = parse_tree[i] 7845 } 7846 else if (node_type === "array") { 7847 match = parse_tree[i] // convenience purposes only 7848 if (match[2]) { // keyword argument 7849 arg = argv[cursor] 7850 for (k = 0; k < match[2].length; k++) { 7851 if (!arg.hasOwnProperty(match[2][k])) { 7852 throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) 7853 } 7854 arg = arg[match[2][k]] 7855 } 7856 } 7857 else if (match[1]) { // positional argument (explicit) 7858 arg = argv[match[1]] 7859 } 7860 else { // positional argument (implicit) 7861 arg = argv[cursor++] 7862 } 7863 7864 if (get_type(arg) == "function") { 7865 arg = arg() 7866 } 7867 7868 if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { 7869 throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) 7870 } 7871 7872 if (re.number.test(match[8])) { 7873 is_positive = arg >= 0 7874 } 7875 7876 switch (match[8]) { 7877 case "b": 7878 arg = arg.toString(2) 7879 break 7880 case "c": 7881 arg = String.fromCharCode(arg) 7882 break 7883 case "d": 7884 case "i": 7885 arg = parseInt(arg, 10) 7886 break 7887 case "j": 7888 arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) 7889 break 7890 case "e": 7891 arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() 7892 break 7893 case "f": 7894 arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) 7895 break 7896 case "g": 7897 arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) 7898 break 7899 case "o": 7900 arg = arg.toString(8) 7901 break 7902 case "s": 7903 arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) 7904 break 7905 case "u": 7906 arg = arg >>> 0 7907 break 7908 case "x": 7909 arg = arg.toString(16) 7910 break 7911 case "X": 7912 arg = arg.toString(16).toUpperCase() 7913 break 7914 } 7915 if (re.json.test(match[8])) { 7916 output[output.length] = arg 7917 } 7918 else { 7919 if (re.number.test(match[8]) && (!is_positive || match[3])) { 7920 sign = is_positive ? "+" : "-" 7921 arg = arg.toString().replace(re.sign, "") 7922 } 7923 else { 7924 sign = "" 7925 } 7926 pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " 7927 pad_length = match[6] - (sign + arg).length 7928 pad = match[6] ? (pad_length >
7928 0 ? str_repeat(pad_character, pad_length) : "") : "" 7929 output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) 7930 } 7931 } 7932 } 7933 return output.join("") 7934 } 7935 7936 sprintf.cache = {} 7937 7938 sprintf.parse = function(fmt) { 7939 var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 7940 while (_fmt) { 7941 if ((match = re.text.exec(_fmt)) !== null) { 7942 parse_tree[parse_tree.length] = match[0] 7943 } 7944 else if ((match = re.modulo.exec(_fmt)) !== null) { 7945 parse_tree[parse_tree.length] = "%" 7946 } 7947 else if ((match = re.placeholder.exec(_fmt)) !== null) { 7948 if (match[2]) { 7949 arg_names |= 1 7950 var field_list = [], replacement_field = match[2], field_match = [] 7951 if ((field_match = re.key.exec(replacement_field)) !== null) { 7952 field_list[field_list.length] = field_match[1] 7953 while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { 7954 if ((field_match = re.key_access.exec(replacement_field)) !== null) { 7955 field_list[field_list.length] = field_match[1] 7956 } 7957 else if ((field_match = re.index_access.exec(replacement_field)) !== null) { 7958 field_list[field_list.length] = field_match[1] 7959 } 7960 else { 7961 throw new SyntaxError("[sprintf] failed to parse named argument key") 7962 } 7963 } 7964 } 7965 else { 7966 throw new SyntaxError("[sprintf] failed to parse named argument key") 7967 } 7968 match[2] = field_list 7969 } 7970 else { 7971 arg_names |= 2 7972 } 7973 if (arg_names === 3) { 7974 throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") 7975 } 7976 parse_tree[parse_tree.length] = match 7977 } 7978 else { 7979 throw new SyntaxError("[sprintf] unexpected placeholder") 7980 } 7981 _fmt = _fmt.substring(match[0].length) 7982 } 7983 return parse_tree 7984 } 7985 7986 var vsprintf = function(fmt, argv, _argv) { 7987 _argv = (argv || []).slice(0) 7988 _argv.splice(0, 0, fmt) 7989 return sprintf.apply(null, _argv) 7990 } 7991 7992 /** 7993 * helpers 7994 */ 7995 function get_type(variable) { 7996 return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() 7997 } 7998 7999 function str_repeat(input, multiplier) { 8000 return Array(multiplier + 1).join(input) 8001 } 8002 8003 /** 8004 * export to either browser or node.js 8005 */ 8006 if (typeof exports !== "undefined") { 8007 exports.sprintf = sprintf 8008 exports.vsprintf = vsprintf 8009 } 8010 else { 8011 window.sprintf = sprintf 8012 window.vsprintf = vsprintf 8013 8014 if (typeof define === "function" && define.amd) { 8015 define(function() { 8016 return { 8017 sprintf: sprintf, 8018 vsprintf: vsprintf 8019 } 8020 }) 8021 } 8022 } 8023})(typeof window === "undefined" ? this : window); 8024 8025},{}],73:[function(require,module,exports){ 8026module.exports = function(func) { 8027 setTimeout(func, 0); 8028}; 8029 8030},{}],74:[function(require,module,exports){ 8031var checkEmpty = function(locationData) { 8032 if(! locationData || locationData.trim().length === 0 ) { 8033 return null; 8034 } 8035 return locationData; 8036}; 8037 8038var parseJsonLocationData = function(jsonLocationDataEl) { 8039 if(!jsonLocationDataEl) { 8040 return {address: {}}; 8041 } 8042 8043 return JSON.parse(jsonLocationDataEl.textContent); 8044}; 8045 8046var getEmbedKey = function(locationDataEl) { 8047 if(!locationDataEl) { 8048 return ''; 8049 } 8050 8051 return locationDataEl.getAttribute('data-embed-key'); 8052}; 8053 8054var formatHours = function(hoursData) { 8055 8056 if (! hoursData || hoursData.length === 0) { 8057 return null; 8058 } 8059 8060 var hoursArray = hoursData.map(function(day) { 8061 var daySplat = day.split(' '); 8062 var dayAbbrev = daySplat[0]; 8063 var openCloseSplat = daySplat[1].split('-'); 8064 8065 return { 8066 day: dayAbbrev, 8067 open: openCloseSplat[0], 8068 close: openCloseSplat[1] 8069 }; 8070 }); 8071 8072 return hoursArray.reduce(function(accumulatedDayObject, dayObject) { 8073 accumulatedDayObject[dayObject.day] = { 8074 open: dayObject.open, 8075 close: dayObject.close 8076 }; 8077 8078 return accumulatedDayObject; 8079 }, {}); 8080}; 8081 8082var initializeSiteLocation = function(siteLocation, locationDataID) { 8083 var initializeHelper = function() { 8084 var locationDataEl = document.getElementById(locationDataID); 8085 var embedAPIKey = getEmbedKey(locationDataEl); 8086 var jsonld = parseJsonLocationData(locationDataEl); 8087 var hoursObject, locationData, address, city, state, zipcode, country; 8088 address = checkEmpty(jsonld.address.streetAddress); 8089 city = checkEmpty(jsonld.address.addressLocality); 8090 state = checkEmpty(jsonld.address.addressRegion); 8091 zipcode = checkEmpty(jsonld.address.postalCode); 8092 country = checkEmpty(jsonld.address.addressCountry); 8093 hoursObject = formatHours(jsonld.openingHours); 8094 8095 8096 if(address || city || state || zipcode || country) { 8097 locationData = { 8098 address: address, 8099 city: city, 8100 state: state, 8101 zipcode: zipcode, 8102 country: country 8103 }; 8104 } 8105 8106 var cleintWidth = document.documentElement.clientWidth; 8107 var innerWidth = window.innerWidth || 0; 8108 var viewportWidth = Math.max(cleintWidth, innerWidth); 8109 var lang = document.body.lang || 'en'; 8110 8111 /* Only initialize the sitelocation view if the viewport is smaller than 8112 * 736 pixels. 8113 */ 8114 if(viewportWidth <= 736) { 8115 siteLocation.initialize({ 8116 lang: lang, 8117 hours: hoursObject, 8118 phone: checkEmpty(jsonld.telephone), 8119 location: locationData, 8120 embedAPIKey: embedAPIKey 8121 }); 8122 } 8123 }; 8124 8125 return initializeHelper; 8126}; 8127 8128module.exports = initializeSiteLocation; 8129 8130},{}],75:[function(require,module,exports){ 8131 8132},{}],76:[function(require,module,exports){ 8133'use strict'; 8134 8135var bind = require('function-bind'); 8136 8137var $apply = require('./functionApply'); 8138var $call = require('./functionCall');
vendor: 6,737 bytes, lines 8139-8389
8139var $reflectApply = require('./reflectApply'); 8140 8141/** @type {import('./actualApply')} */ 8142module.exports = $reflectApply || bind.call($call, $apply); 8143 8144},{"./functionApply":77,"./functionCall":78,"./reflectApply":80,"function-bind":93}],77:[function(require,module,exports){ 8145'use strict'; 8146 8147/** @type {import('./functionApply')} */ 8148module.exports = Function.prototype.apply; 8149 8150},{}],78:[function(require,module,exports){ 8151'use strict'; 8152 8153/** @type {import('./functionCall')} */ 8154module.exports = Function.prototype.call; 8155 8156},{}],79:[function(require,module,exports){ 8157'use strict'; 8158 8159var bind = require('function-bind'); 8160var $TypeError = require('es-errors/type'); 8161 8162var $call = require('./functionCall'); 8163var $actualApply = require('./actualApply'); 8164 8165/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ 8166module.exports = function callBindBasic(args) { 8167 if (args.length < 1 || typeof args[0] !== 'function') { 8168 throw new $TypeError('a function is required'); 8169 } 8170 return $actualApply(bind, $call, args); 8171}; 8172 8173},{"./actualApply":76,"./functionCall":78,"es-errors/type":89,"function-bind":93}],80:[function(require,module,exports){ 8174'use strict'; 8175 8176/** @type {import('./reflectApply')} */ 8177module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; 8178 8179},{}],81:[function(require,module,exports){ 8180'use strict'; 8181 8182var GetIntrinsic = require('get-intrinsic'); 8183 8184var callBindBasic = require('call-bind-apply-helpers'); 8185 8186/** @type {(thisArg: string, searchString: string, position?: number) => number} */ 8187var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); 8188 8189/** @type {import('.')} */ 8190module.exports = function callBoundIntrinsic(name, allowMissing) { 8191 /* eslint no-extra-parens: 0 */ 8192 8193 var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); 8194 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 8195 return callBindBasic(/** @type {const} */ ([intrinsic])); 8196 } 8197 return intrinsic; 8198}; 8199 8200},{"call-bind-apply-helpers":79,"get-intrinsic":94}],82:[function(require,module,exports){ 8201'use strict'; 8202 8203var callBind = require('call-bind-apply-helpers'); 8204var gOPD = require('gopd'); 8205 8206var hasProtoAccessor; 8207try { 8208 // eslint-disable-next-line no-extra-parens, no-proto 8209 hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; 8210} catch (e) { 8211 if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { 8212 throw e; 8213 } 8214} 8215 8216// eslint-disable-next-line no-extra-parens 8217var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); 8218 8219var $Object = Object; 8220var $getPrototypeOf = $Object.getPrototypeOf; 8221 8222/** @type {import('./get')} */ 8223module.exports = desc && typeof desc.get === 'function' 8224 ? callBind([desc.get]) 8225 : typeof $getPrototypeOf === 'function' 8226 ? /** @type {import('./get')} */ function getDunder(value) { 8227 // eslint-disable-next-line eqeqeq 8228 return $getPrototypeOf(value == null ? value : $Object(value)); 8229 } 8230 : false; 8231 8232},{"call-bind-apply-helpers":79,"gopd":99}],83:[function(require,module,exports){ 8233'use strict'; 8234 8235/** @type {import('.')} */ 8236var $defineProperty = Object.defineProperty || false; 8237if ($defineProperty) { 8238 try { 8239 $defineProperty({}, 'a', { value: 1 }); 8240 } catch (e) { 8241 // IE 8 has a broken defineProperty 8242 $defineProperty = false; 8243 } 8244} 8245 8246module.exports = $defineProperty; 8247 8248},{}],84:[function(require,module,exports){ 8249'use strict'; 8250 8251/** @type {import('./eval')} */ 8252module.exports = EvalError; 8253 8254},{}],85:[function(require,module,exports){ 8255'use strict'; 8256 8257/** @type {import('.')} */ 8258module.exports = Error; 8259 8260},{}],86:[function(require,module,exports){ 8261'use strict'; 8262 8263/** @type {import('./range')} */ 8264module.exports = RangeError; 8265 8266},{}],87:[function(require,module,exports){ 8267'use strict'; 8268 8269/** @type {import('./ref')} */ 8270module.exports = ReferenceError; 8271 8272},{}],88:[function(require,module,exports){ 8273'use strict'; 8274 8275/** @type {import('./syntax')} */ 8276module.exports = SyntaxError; 8277 8278},{}],89:[function(require,module,exports){ 8279'use strict'; 8280 8281/** @type {import('./type')} */ 8282module.exports = TypeError; 8283 8284},{}],90:[function(require,module,exports){ 8285'use strict'; 8286 8287/** @type {import('./uri')} */ 8288module.exports = URIError; 8289 8290},{}],91:[function(require,module,exports){ 8291'use strict'; 8292 8293/** @type {import('.')} */ 8294module.exports = Object; 8295 8296},{}],92:[function(require,module,exports){ 8297'use strict'; 8298 8299/* eslint no-invalid-this: 1 */ 8300 8301var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 8302var toStr = Object.prototype.toString; 8303var max = Math.max; 8304var funcType = '[object Function]'; 8305 8306var concatty = function concatty(a, b) { 8307 var arr = []; 8308 8309 for (var i = 0; i < a.length; i += 1) { 8310 arr[i] = a[i]; 8311 } 8312 for (var j = 0; j < b.length; j += 1) { 8313 arr[j + a.length] = b[j]; 8314 } 8315 8316 return arr; 8317}; 8318 8319var slicy = function slicy(arrLike, offset) { 8320 var arr = []; 8321 for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { 8322 arr[j] = arrLike[i]; 8323 } 8324 return arr; 8325}; 8326 8327var joiny = function (arr, joiner) { 8328 var str = ''; 8329 for (var i = 0; i < arr.length; i += 1) { 8330 str += arr[i]; 8331 if (i + 1 < arr.length) { 8332 str += joiner; 8333 } 8334 } 8335 return str; 8336}; 8337 8338module.exports = function bind(that) { 8339 var target = this; 8340 if (typeof target !== 'function' || toStr.apply(target) !== funcType) { 8341 throw new TypeError(ERROR_MESSAGE + target); 8342 } 8343 var args = slicy(arguments, 1); 8344 8345 var bound; 8346 var binder = function () { 8347 if (this instanceof bound) { 8348 var result = target.apply( 8349 this, 8350 concatty(args, arguments) 8351 ); 8352 if (Object(result) === result) { 8353 return result; 8354 } 8355 return this; 8356 } 8357 return target.apply( 8358 that, 8359 concatty(args, arguments) 8360 ); 8361 8362 }; 8363 8364 var boundLength = max(0, target.length - args.length); 8365 var boundArgs = []; 8366 for (var i = 0; i < boundLength; i++) { 8367 boundArgs[i] = '$' + i; 8368 } 8369 8370 bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); 8371 8372 if (target.prototype) { 8373 var Empty = function Empty() {}; 8374 Empty.prototype = target.prototype; 8375 bound.prototype = new Empty(); 8376 Empty.prototype = null; 8377 } 8378 8379 return bound; 8380}; 8381 8382},{}],93:[function(require,module,exports){ 8383'use strict'; 8384 8385var implementation = require('./implementation'); 8386 8387module.exports = Function.prototype.bind || implementation; 8388 8389},{"./implementation":92}],94
vendor: 6,095 bytes, lines 8389-8536
8389:[function(require,module,exports){ 8390'use strict'; 8391 8392var undefined; 8393 8394var $Object = require('es-object-atoms'); 8395 8396var $Error = require('es-errors'); 8397var $EvalError = require('es-errors/eval'); 8398var $RangeError = require('es-errors/range'); 8399var $ReferenceError = require('es-errors/ref'); 8400var $SyntaxError = require('es-errors/syntax'); 8401var $TypeError = require('es-errors/type'); 8402var $URIError = require('es-errors/uri'); 8403 8404var abs = require('math-intrinsics/abs'); 8405var floor = require('math-intrinsics/floor'); 8406var max = require('math-intrinsics/max'); 8407var min = require('math-intrinsics/min'); 8408var pow = require('math-intrinsics/pow'); 8409var round = require('math-intrinsics/round'); 8410var sign = require('math-intrinsics/sign'); 8411 8412var $Function = Function; 8413 8414// eslint-disable-next-line consistent-return 8415var getEvalledConstructor = function (expressionSyntax) { 8416 try { 8417 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 8418 } catch (e) {} 8419}; 8420 8421var $gOPD = require('gopd'); 8422var $defineProperty = require('es-define-property'); 8423 8424var throwTypeError = function () { 8425 throw new $TypeError(); 8426}; 8427var ThrowTypeError = $gOPD 8428 ? (function () { 8429 try { 8430 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 8431 arguments.callee; // IE 8 does not throw here 8432 return throwTypeError; 8433 } catch (calleeThrows) { 8434 try { 8435 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 8436 return $gOPD(arguments, 'callee').get; 8437 } catch (gOPDthrows) { 8438 return throwTypeError; 8439 } 8440 } 8441 }()) 8442 : throwTypeError; 8443 8444var hasSymbols = require('has-symbols')(); 8445 8446var getProto = require('get-proto'); 8447var $ObjectGPO = require('get-proto/Object.getPrototypeOf'); 8448var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf'); 8449 8450var $apply = require('call-bind-apply-helpers/functionApply'); 8451var $call = require('call-bind-apply-helpers/functionCall'); 8452 8453var needsEval = {}; 8454 8455var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); 8456 8457var INTRINSICS = { 8458 __proto__: null, 8459 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 8460 '%Array%': Array, 8461 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 8462 '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, 8463 '%AsyncFromSyncIteratorPrototype%': undefined, 8464 '%AsyncFunction%': needsEval, 8465 '%AsyncGenerator%': needsEval, 8466 '%AsyncGeneratorFunction%': needsEval, 8467 '%AsyncIteratorPrototype%': needsEval, 8468 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 8469 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 8470 '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, 8471 '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, 8472 '%Boolean%': Boolean, 8473 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 8474 '%Date%': Date, 8475 '%decodeURI%': decodeURI, 8476 '%decodeURIComponent%': decodeURIComponent, 8477 '%encodeURI%': encodeURI, 8478 '%encodeURIComponent%': encodeURIComponent, 8479 '%Error%': $Error, 8480 '%eval%': eval, // eslint-disable-line no-eval 8481 '%EvalError%': $EvalError, 8482 '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, 8483 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 8484 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 8485 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 8486 '%Function%': $Function, 8487 '%GeneratorFunction%': needsEval, 8488 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 8489 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 8490 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 8491 '%isFinite%': isFinite, 8492 '%isNaN%': isNaN, 8493 '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, 8494 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 8495 '%Map%': typeof Map === 'undefined' ? undefined : Map, 8496 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), 8497 '%Math%': Math, 8498 '%Number%': Number, 8499 '%Object%': $Object, 8500 '%Object.getOwnPropertyDescriptor%': $gOPD, 8501 '%parseFloat%': parseFloat, 8502 '%parseInt%': parseInt, 8503 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 8504 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 8505 '%RangeError%': $RangeError, 8506 '%ReferenceError%': $ReferenceError, 8507 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 8508 '%RegExp%': RegExp, 8509 '%Set%': typeof Set === 'undefined' ? undefined : Set, 8510 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), 8511 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 8512 '%String%': String, 8513 '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, 8514 '%Symbol%': hasSymbols ? Symbol : undefined, 8515 '%SyntaxError%': $SyntaxError, 8516 '%ThrowTypeError%': ThrowTypeError, 8517 '%TypedArray%': TypedArray, 8518 '%TypeError%': $TypeError, 8519 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 8520 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 8521 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 8522 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 8523 '%URIError%': $URIError, 8524 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 8525 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 8526 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, 8527 8528 '%Function.prototype.call%': $call, 8529 '%Function.prototype.apply%': $apply, 8530 '%Object.defineProperty%': $defineProperty, 8531 '%Object.getPrototypeOf%': $ObjectGPO, 8532 '%Math.abs%': abs, 8533 '%Math.floor%': floor, 8534 '%Math.max%': max, 8535 '%Math.min%': min, 8536 '%Math.pow%': pow,
vendor: 8,380 bytes, lines 8537-8767
8537 '%Math.round%': round, 8538 '%Math.sign%': sign, 8539 '%Reflect.getPrototypeOf%': $ReflectGPO 8540}; 8541 8542if (getProto) { 8543 try { 8544 null.error; // eslint-disable-line no-unused-expressions 8545 } catch (e) { 8546 // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 8547 var errorProto = getProto(getProto(e)); 8548 INTRINSICS['%Error.prototype%'] = errorProto; 8549 } 8550} 8551 8552var doEval = function doEval(name) { 8553 var value; 8554 if (name === '%AsyncFunction%') { 8555 value = getEvalledConstructor('async function () {}'); 8556 } else if (name === '%GeneratorFunction%') { 8557 value = getEvalledConstructor('function* () {}'); 8558 } else if (name === '%AsyncGeneratorFunction%') { 8559 value = getEvalledConstructor('async function* () {}'); 8560 } else if (name === '%AsyncGenerator%') { 8561 var fn = doEval('%AsyncGeneratorFunction%'); 8562 if (fn) { 8563 value = fn.prototype; 8564 } 8565 } else if (name === '%AsyncIteratorPrototype%') { 8566 var gen = doEval('%AsyncGenerator%'); 8567 if (gen && getProto) { 8568 value = getProto(gen.prototype); 8569 } 8570 } 8571 8572 INTRINSICS[name] = value; 8573 8574 return value; 8575}; 8576 8577var LEGACY_ALIASES = { 8578 __proto__: null, 8579 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 8580 '%ArrayPrototype%': ['Array', 'prototype'], 8581 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 8582 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 8583 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 8584 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 8585 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 8586 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 8587 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 8588 '%BooleanPrototype%': ['Boolean', 'prototype'], 8589 '%DataViewPrototype%': ['DataView', 'prototype'], 8590 '%DatePrototype%': ['Date', 'prototype'], 8591 '%ErrorPrototype%': ['Error', 'prototype'], 8592 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 8593 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 8594 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 8595 '%FunctionPrototype%': ['Function', 'prototype'], 8596 '%Generator%': ['GeneratorFunction', 'prototype'], 8597 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 8598 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 8599 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 8600 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 8601 '%JSONParse%': ['JSON', 'parse'], 8602 '%JSONStringify%': ['JSON', 'stringify'], 8603 '%MapPrototype%': ['Map', 'prototype'], 8604 '%NumberPrototype%': ['Number', 'prototype'], 8605 '%ObjectPrototype%': ['Object', 'prototype'], 8606 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 8607 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 8608 '%PromisePrototype%': ['Promise', 'prototype'], 8609 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 8610 '%Promise_all%': ['Promise', 'all'], 8611 '%Promise_reject%': ['Promise', 'reject'], 8612 '%Promise_resolve%': ['Promise', 'resolve'], 8613 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 8614 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 8615 '%RegExpPrototype%': ['RegExp', 'prototype'], 8616 '%SetPrototype%': ['Set', 'prototype'], 8617 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 8618 '%StringPrototype%': ['String', 'prototype'], 8619 '%SymbolPrototype%': ['Symbol', 'prototype'], 8620 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 8621 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 8622 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 8623 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 8624 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 8625 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 8626 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 8627 '%URIErrorPrototype%': ['URIError', 'prototype'], 8628 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 8629 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 8630}; 8631 8632var bind = require('function-bind'); 8633var hasOwn = require('hasown'); 8634var $concat = bind.call($call, Array.prototype.concat); 8635var $spliceApply = bind.call($apply, Array.prototype.splice); 8636var $replace = bind.call($call, String.prototype.replace); 8637var $strSlice = bind.call($call, String.prototype.slice); 8638var $exec = bind.call($call, RegExp.prototype.exec); 8639 8640/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 8641var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 8642var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 8643var stringToPath = function stringToPath(string) { 8644 var first = $strSlice(string, 0, 1); 8645 var last = $strSlice(string, -1); 8646 if (first === '%' && last !== '%') { 8647 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 8648 } else if (last === '%' && first !== '%') { 8649 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 8650 } 8651 var result = []; 8652 $replace(string, rePropName, function (match, number, quote, subString) { 8653 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 8654 }); 8655 return result; 8656}; 8657/* end adaptation */ 8658 8659var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 8660 var intrinsicName = name; 8661 var alias; 8662 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 8663 alias = LEGACY_ALIASES[intrinsicName]; 8664 intrinsicName = '%' + alias[0] + '%'; 8665 } 8666 8667 if (hasOwn(INTRINSICS, intrinsicName)) { 8668 var value = INTRINSICS[intrinsicName]; 8669 if (value === needsEval) { 8670 value = doEval(intrinsicName); 8671 } 8672 if (typeof value === 'undefined' && !allowMissing) { 8673 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 8674 } 8675 8676 return { 8677 alias: alias, 8678 name: intrinsicName, 8679 value: value 8680 }; 8681 } 8682 8683 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 8684}; 8685 8686module.exports = function GetIntrinsic(name, allowMissing) { 8687 if (typeof name !== 'string' || name.length === 0) { 8688 throw new $TypeError('intrinsic name must be a non-empty string'); 8689 } 8690 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 8691 throw new $TypeError('"allowMissing" argument must be a boolean'); 8692 } 8693 8694 if ($exec(/^%?[^%]*%?$/, name) === null) { 8695 throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); 8696 } 8697 var parts = stringToPath(name); 8698 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 8699 8700 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 8701 var intrinsicRealName = intrinsic.name; 8702 var value = intrinsic.value; 8703 var skipFurtherCaching = false; 8704 8705 var alias = intrinsic.alias; 8706 if (alias) { 8707 intrinsicBaseName = alias[0]; 8708 $spliceApply(parts, $concat([0, 1], alias)); 8709 } 8710 8711 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 8712 var part = parts[i]; 8713 var first = $strSlice(part, 0, 1); 8714 var last = $strSlice(part, -1); 8715 if ( 8716 ( 8717 (first === '"' || first === "'" || first === '`') 8718 || (last === '"' || last === "'" || last === '`') 8719 ) 8720 && first !== last 8721 ) { 8722 throw new $SyntaxError('property names with quotes must have matching quotes'); 8723 } 8724 if (part === 'constructor' || !isOwn) { 8725 skipFurtherCaching = true; 8726 } 8727 8728 intrinsicBaseName += '.' + part; 8729 intrinsicRealName = '%' + intrinsicBaseName + '%'; 8730 8731 if (hasOwn(INTRINSICS, intrinsicRealName)) { 8732 value = INTRINSICS[intrinsicRealName]; 8733 } else if (value != null) { 8734 if (!(part in value)) { 8735 if (!allowMissing) { 8736 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 8737 } 8738 return void undefined; 8739 } 8740 if ($gOPD && (i + 1) >= parts.length) { 8741 var desc = $gOPD(value, part); 8742 isOwn = !!desc; 8743 8744 // By convention, when a data property is converted to an accessor 8745 // property to emulate a data property that does not suffer from 8746 // the override mistake, that accessor's getter is marked with 8747 // an `originalValue` property. Here, when we detect this, we 8748 // uphold the illusion by pretending to see that original data 8749 // property, i.e., returning the value rather than the getter 8750 // itself. 8751 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 8752 value = desc.get; 8753 } else { 8754 value = value[part]; 8755 } 8756 } else { 8757 isOwn = hasOwn(value, part); 8758 value = value[part]; 8759 } 8760 8761 if (isOwn && !skipFurtherCaching) { 8762 INTRINSICS[intrinsicRealName] = value; 8763 } 8764 } 8765 } 8766 return value; 8767};
8768 8769},{"call-bind-apply-helpers/functionApply":77,"call-bind-apply-helpers/functionCall":78,"es-define-property":83,"es-errors":85,"es-errors/eval":84,"es-errors/range":86,"es-errors/ref":87,"es-errors/syntax":88,"es-errors/type":89,"es-errors/uri":90,"es-object-atoms":91,"function-bind":93,"get-proto":97,"get-proto/Object.getPrototypeOf":95,"get-proto/Reflect.getPrototypeOf":96,"gopd":99,"has-symbols":119,"hasown":121,"math-intrinsics/abs":122,"math-intrinsics/floor":123,"math-intrinsics/max":125,"math-intrinsics/min":126,"math-intrinsics/pow":127,"math-intrinsics/round":128,"math-intrinsics/sign":129}],95:[function(require,module,exports){ 8770'use strict'; 8771 8772var $Object = require('es-object-atoms'); 8773 8774/** @type {import('./Object.getPrototypeOf')} */ 8775module.exports = $Object.getPrototypeOf || null; 8776 8777},{"es-object-atoms":91}],96:[function(require,module,exports){ 8778'use strict'; 8779 8780/** @type {import('./Reflect.getPrototypeOf')} */ 8781module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; 8782 8783},{}],97:[function(require,module,exports){ 8784'use strict'; 8785 8786var reflectGetProto = require('./Reflect.getPrototypeOf'); 8787var originalGetProto = require('./Object.getPrototypeOf'); 8788 8789var getDunderProto = require('dunder-proto/get'); 8790 8791/** @type {import('.')} */ 8792module.exports = reflectGetProto 8793 ? function getProto(O) { 8794 // @ts-expect-error TS can't narrow inside a closure, for some reason 8795 return reflectGetProto(O); 8796 } 8797 : originalGetProto 8798 ? function getProto(O) { 8799 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 8800 throw new TypeError('getProto: not an object'); 8801 } 8802 // @ts-expect-error TS can't narrow inside a closure, for some reason 8803 return originalGetProto(O); 8804 } 8805 : getDunderProto 8806 ? function getProto(O) { 8807 // @ts-expect-error TS can't narrow inside a closure, for some reason 8808 return getDunderProto(O); 8809 } 8810 : null; 8811 8812},{"./Object.getPrototypeOf":95,"./Reflect.getPrototypeOf":96,"dunder-proto/get":82}],98:[function(require,module,exports){ 8813'use strict'; 8814 8815/** @type {import('./gOPD')} */ 8816module.exports = Object.getOwnPropertyDescriptor; 8817 8818},{}],99:[function(require,module,exports){ 8819'use strict'; 8820 8821/** @type {import('.')} */ 8822var $gOPD = require('./gOPD'); 8823 8824if ($gOPD) { 8825 try { 8826 $gOPD([], 'length'); 8827 } catch (e) { 8828 // IE 8 has a broken gOPD 8829 $gOPD = null; 8830 } 8831} 8832 8833module.exports = $gOPD; 8834 8835},{"./gOPD":98}],100:[function(require,module,exports){ 8836'use strict'; 8837 8838exports.__esModule = true; 8839// istanbul ignore next 8840 8841function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8842 8843// istanbul ignore next 8844 8845function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } 8846 8847var _handlebarsBase = require('./handlebars/base'); 8848 8849var base = _interopRequireWildcard(_handlebarsBase); 8850 8851// Each of these augment the Handlebars object. No need to setup here. 8852// (This is done to easily share code between commonjs and browse envs) 8853 8854var _handlebarsSafeString = require('./handlebars/safe-string'); 8855 8856var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 8857 8858var _handlebarsException = require('./handlebars/exception'); 8859 8860var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 8861 8862var _handlebarsUtils = require('./handlebars/utils'); 8863 8864var Utils = _interopRequireWildcard(_handlebarsUtils); 8865 8866var _handlebarsRuntime = require('./handlebars/runtime'); 8867 8868var runtime = _interopRequireWildcard(_handlebarsRuntime); 8869 8870var _handlebarsNoConflict = require('./handlebars/no-conflict'); 8871 8872var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 8873 8874// For compatibility and usage outside of module systems, make the Handlebars object a namespace 8875function create() { 8876 var hb = new base.HandlebarsEnvironment(); 8877 8878 Utils.extend(hb, base); 8879 hb.SafeString = _handlebarsSafeString2['default']; 8880 hb.Exception = _handlebarsException2['default']; 8881 hb.Utils = Utils; 8882 hb.escapeExpression = Utils.escapeExpression; 8883 8884 hb.VM = runtime; 8885 hb.template = function (spec) { 8886 return runtime.template(spec, hb); 8887 }; 8888 8889 return hb; 8890} 8891 8892var inst = create(); 8893inst.create = create; 8894 8895_handlebarsNoConflict2['default'](inst); 8896 8897inst['default'] = inst; 8898 8899exports['default'] = inst; 8900module.exports = exports['default']; 8901 8902 8903},{"./handlebars/base":101,"./handlebars/exception":104,"./handlebars/no-conflict":114,"./handlebars/runtime":115,"./handlebars/safe-string":116,"./handlebars/utils":117}],101:[function(require,module,exports){ 8904'use strict'; 8905 8906exports.__esModule = true; 8907exports.HandlebarsEnvironment = HandlebarsEnvironment; 8908// istanbul ignore next 8909 8910function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8911 8912var _utils = require('./utils'); 8913 8914var _exception = require('./exception'); 8915 8916var _exception2 = _interopRequireDefault(_exception); 8917 8918var _helpers = require('./helpers'); 8919 8920var _decorators = require('./decorators'); 8921 8922var _logger = require('./logger'); 8923 8924var _logger2 = _interopRequireDefault(_logger); 8925 8926var VERSION = '4.0.14'; 8927exports.VERSION = VERSION; 8928var COMPILER_REVISION = 7; 8929 8930exports.COMPILER_REVISION = COMPILER_REVISION; 8931var REVISION_CHANGES = { 8932 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 8933 2: '== 1.0.0-rc.3', 8934 3: '== 1.0.0-rc.4', 8935 4: '== 1.x.x', 8936 5: '== 2.0.0-alpha.x', 8937 6: '>
vendor: 28,057 bytes, lines 8937-9901
8937= 2.0.0-beta.1', 8938 7: '>= 4.0.0' 8939}; 8940 8941exports.REVISION_CHANGES = REVISION_CHANGES; 8942var objectType = '[object Object]'; 8943 8944function HandlebarsEnvironment(helpers, partials, decorators) { 8945 this.helpers = helpers || {}; 8946 this.partials = partials || {}; 8947 this.decorators = decorators || {}; 8948 8949 _helpers.registerDefaultHelpers(this); 8950 _decorators.registerDefaultDecorators(this); 8951} 8952 8953HandlebarsEnvironment.prototype = { 8954 constructor: HandlebarsEnvironment, 8955 8956 logger: _logger2['default'], 8957 log: _logger2['default'].log, 8958 8959 registerHelper: function registerHelper(name, fn) { 8960 if (_utils.toString.call(name) === objectType) { 8961 if (fn) { 8962 throw new _exception2['default']('Arg not supported with multiple helpers'); 8963 } 8964 _utils.extend(this.helpers, name); 8965 } else { 8966 this.helpers[name] = fn; 8967 } 8968 }, 8969 unregisterHelper: function unregisterHelper(name) { 8970 delete this.helpers[name]; 8971 }, 8972 8973 registerPartial: function registerPartial(name, partial) { 8974 if (_utils.toString.call(name) === objectType) { 8975 _utils.extend(this.partials, name); 8976 } else { 8977 if (typeof partial === 'undefined') { 8978 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 8979 } 8980 this.partials[name] = partial; 8981 } 8982 }, 8983 unregisterPartial: function unregisterPartial(name) { 8984 delete this.partials[name]; 8985 }, 8986 8987 registerDecorator: function registerDecorator(name, fn) { 8988 if (_utils.toString.call(name) === objectType) { 8989 if (fn) { 8990 throw new _exception2['default']('Arg not supported with multiple decorators'); 8991 } 8992 _utils.extend(this.decorators, name); 8993 } else { 8994 this.decorators[name] = fn; 8995 } 8996 }, 8997 unregisterDecorator: function unregisterDecorator(name) { 8998 delete this.decorators[name]; 8999 } 9000}; 9001 9002var log = _logger2['default'].log; 9003 9004exports.log = log; 9005exports.createFrame = _utils.createFrame; 9006exports.logger = _logger2['default']; 9007 9008 9009},{"./decorators":102,"./exception":104,"./helpers":105,"./logger":113,"./utils":117}],102:[function(require,module,exports){ 9010'use strict'; 9011 9012exports.__esModule = true; 9013exports.registerDefaultDecorators = registerDefaultDecorators; 9014// istanbul ignore next 9015 9016function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9017 9018var _decoratorsInline = require('./decorators/inline'); 9019 9020var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 9021 9022function registerDefaultDecorators(instance) { 9023 _decoratorsInline2['default'](instance); 9024} 9025 9026 9027},{"./decorators/inline":103}],103:[function(require,module,exports){ 9028'use strict'; 9029 9030exports.__esModule = true; 9031 9032var _utils = require('../utils'); 9033 9034exports['default'] = function (instance) { 9035 instance.registerDecorator('inline', function (fn, props, container, options) { 9036 var ret = fn; 9037 if (!props.partials) { 9038 props.partials = {}; 9039 ret = function (context, options) { 9040 // Create a new partials stack frame prior to exec. 9041 var original = container.partials; 9042 container.partials = _utils.extend({}, original, props.partials); 9043 var ret = fn(context, options); 9044 container.partials = original; 9045 return ret; 9046 }; 9047 } 9048 9049 props.partials[options.args[0]] = options.fn; 9050 9051 return ret; 9052 }); 9053}; 9054 9055module.exports = exports['default']; 9056 9057 9058},{"../utils":117}],104:[function(require,module,exports){ 9059'use strict'; 9060 9061exports.__esModule = true; 9062 9063var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; 9064 9065function Exception(message, node) { 9066 var loc = node && node.loc, 9067 line = undefined, 9068 column = undefined; 9069 if (loc) { 9070 line = loc.start.line; 9071 column = loc.start.column; 9072 9073 message += ' - ' + line + ':' + column; 9074 } 9075 9076 var tmp = Error.prototype.constructor.call(this, message); 9077 9078 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 9079 for (var idx = 0; idx < errorProps.length; idx++) { 9080 this[errorProps[idx]] = tmp[errorProps[idx]]; 9081 } 9082 9083 /* istanbul ignore else */ 9084 if (Error.captureStackTrace) { 9085 Error.captureStackTrace(this, Exception); 9086 } 9087 9088 try { 9089 if (loc) { 9090 this.lineNumber = line; 9091 9092 // Work around issue under safari where we can't directly set the column value 9093 /* istanbul ignore next */ 9094 if (Object.defineProperty) { 9095 Object.defineProperty(this, 'column', { 9096 value: column, 9097 enumerable: true 9098 }); 9099 } else { 9100 this.column = column; 9101 } 9102 } 9103 } catch (nop) { 9104 /* Ignore if the browser is very particular */ 9105 } 9106} 9107 9108Exception.prototype = new Error(); 9109 9110exports['default'] = Exception; 9111module.exports = exports['default']; 9112 9113 9114},{}],105:[function(require,module,exports){ 9115'use strict'; 9116 9117exports.__esModule = true; 9118exports.registerDefaultHelpers = registerDefaultHelpers; 9119// istanbul ignore next 9120 9121function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9122 9123var _helpersBlockHelperMissing = require('./helpers/block-helper-missing'); 9124 9125var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 9126 9127var _helpersEach = require('./helpers/each'); 9128 9129var _helpersEach2 = _interopRequireDefault(_helpersEach); 9130 9131var _helpersHelperMissing = require('./helpers/helper-missing'); 9132 9133var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 9134 9135var _helpersIf = require('./helpers/if'); 9136 9137var _helpersIf2 = _interopRequireDefault(_helpersIf); 9138 9139var _helpersLog = require('./helpers/log'); 9140 9141var _helpersLog2 = _interopRequireDefault(_helpersLog); 9142 9143var _helpersLookup = require('./helpers/lookup'); 9144 9145var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 9146 9147var _helpersWith = require('./helpers/with'); 9148 9149var _helpersWith2 = _interopRequireDefault(_helpersWith); 9150 9151function registerDefaultHelpers(instance) { 9152 _helpersBlockHelperMissing2['default'](instance); 9153 _helpersEach2['default'](instance); 9154 _helpersHelperMissing2['default'](instance); 9155 _helpersIf2['default'](instance); 9156 _helpersLog2['default'](instance); 9157 _helpersLookup2['default'](instance); 9158 _helpersWith2['default'](instance); 9159} 9160 9161 9162},{"./helpers/block-helper-missing":106,"./helpers/each":107,"./helpers/helper-missing":108,"./helpers/if":109,"./helpers/log":110,"./helpers/lookup":111,"./helpers/with":112}],106:[function(require,module,exports){ 9163'use strict'; 9164 9165exports.__esModule = true; 9166 9167var _utils = require('../utils'); 9168 9169exports['default'] = function (instance) { 9170 instance.registerHelper('blockHelperMissing', function (context, options) { 9171 var inverse = options.inverse, 9172 fn = options.fn; 9173 9174 if (context === true) { 9175 return fn(this); 9176 } else if (context === false || context == null) { 9177 return inverse(this); 9178 } else if (_utils.isArray(context)) { 9179 if (context.length > 0) { 9180 if (options.ids) { 9181 options.ids = [options.name]; 9182 } 9183 9184 return instance.helpers.each(context, options); 9185 } else { 9186 return inverse(this); 9187 } 9188 } else { 9189 if (options.data && options.ids) { 9190 var data = _utils.createFrame(options.data); 9191 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 9192 options = { data: data }; 9193 } 9194 9195 return fn(context, options); 9196 } 9197 }); 9198}; 9199 9200module.exports = exports['default']; 9201 9202 9203},{"../utils":117}],107:[function(require,module,exports){ 9204'use strict'; 9205 9206exports.__esModule = true; 9207// istanbul ignore next 9208 9209function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9210 9211var _utils = require('../utils'); 9212 9213var _exception = require('../exception'); 9214 9215var _exception2 = _interopRequireDefault(_exception); 9216 9217exports['default'] = function (instance) { 9218 instance.registerHelper('each', function (context, options) { 9219 if (!options) { 9220 throw new _exception2['default']('Must pass iterator to #each'); 9221 } 9222 9223 var fn = options.fn, 9224 inverse = options.inverse, 9225 i = 0, 9226 ret = '', 9227 data = undefined, 9228 contextPath = undefined; 9229 9230 if (options.data && options.ids) { 9231 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 9232 } 9233 9234 if (_utils.isFunction(context)) { 9235 context = context.call(this); 9236 } 9237 9238 if (options.data) { 9239 data = _utils.createFrame(options.data); 9240 } 9241 9242 function execIteration(field, index, last) { 9243 if (data) { 9244 data.key = field; 9245 data.index = index; 9246 data.first = index === 0; 9247 data.last = !!last; 9248 9249 if (contextPath) { 9250 data.contextPath = contextPath + field; 9251 } 9252 } 9253 9254 ret = ret + fn(context[field], { 9255 data: data, 9256 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 9257 }); 9258 } 9259 9260 if (context && typeof context === 'object') { 9261 if (_utils.isArray(context)) { 9262 for (var j = context.length; i < j; i++) { 9263 if (i in context) { 9264 execIteration(i, i, i === context.length - 1); 9265 } 9266 } 9267 } else { 9268 var priorKey = undefined; 9269 9270 for (var key in context) { 9271 if (context.hasOwnProperty(key)) { 9272 // We're running the iterations one step out of sync so we can detect 9273 // the last iteration without have to scan the object twice and create 9274 // an itermediate keys array. 9275 if (priorKey !== undefined) { 9276 execIteration(priorKey, i - 1); 9277 } 9278 priorKey = key; 9279 i++; 9280 } 9281 } 9282 if (priorKey !== undefined) { 9283 execIteration(priorKey, i - 1, true); 9284 } 9285 } 9286 } 9287 9288 if (i === 0) { 9289 ret = inverse(this); 9290 } 9291 9292 return ret; 9293 }); 9294}; 9295 9296module.exports = exports['default']; 9297 9298 9299},{"../exception":104,"../utils":117}],108:[function(require,module,exports){ 9300'use strict'; 9301 9302exports.__esModule = true; 9303// istanbul ignore next 9304 9305function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9306 9307var _exception = require('../exception'); 9308 9309var _exception2 = _interopRequireDefault(_exception); 9310 9311exports['default'] = function (instance) { 9312 instance.registerHelper('helperMissing', function () /* [args, ]options */{ 9313 if (arguments.length === 1) { 9314 // A missing field in a {{foo}} construct. 9315 return undefined; 9316 } else { 9317 // Someone is actually trying to call something, blow up. 9318 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 9319 } 9320 }); 9321}; 9322 9323module.exports = exports['default']; 9324 9325 9326},{"../exception":104}],109:[function(require,module,exports){ 9327'use strict'; 9328 9329exports.__esModule = true; 9330 9331var _utils = require('../utils'); 9332 9333exports['default'] = function (instance) { 9334 instance.registerHelper('if', function (conditional, options) { 9335 if (_utils.isFunction(conditional)) { 9336 conditional = conditional.call(this); 9337 } 9338 9339 // Default behavior is to render the positive path if the value is truthy and not empty. 9340 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 9341 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 9342 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 9343 return options.inverse(this); 9344 } else { 9345 return options.fn(this); 9346 } 9347 }); 9348 9349 instance.registerHelper('unless', function (conditional, options) { 9350 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); 9351 }); 9352}; 9353 9354module.exports = exports['default']; 9355 9356 9357},{"../utils":117}],110:[function(require,module,exports){ 9358'use strict'; 9359 9360exports.__esModule = true; 9361 9362exports['default'] = function (instance) { 9363 instance.registerHelper('log', function () /* message, options */{ 9364 var args = [undefined], 9365 options = arguments[arguments.length - 1]; 9366 for (var i = 0; i < arguments.length - 1; i++) { 9367 args.push(arguments[i]); 9368 } 9369 9370 var level = 1; 9371 if (options.hash.level != null) { 9372 level = options.hash.level; 9373 } else if (options.data && options.data.level != null) { 9374 level = options.data.level; 9375 } 9376 args[0] = level; 9377 9378 instance.log.apply(instance, args); 9379 }); 9380}; 9381 9382module.exports = exports['default']; 9383 9384 9385},{}],111:[function(require,module,exports){ 9386'use strict'; 9387 9388exports.__esModule = true; 9389 9390exports['default'] = function (instance) { 9391 instance.registerHelper('lookup', function (obj, field) { 9392 if (!obj) { 9393 return obj; 9394 } 9395 if (field === 'constructor' && !obj.propertyIsEnumerable(field)) { 9396 return undefined; 9397 } 9398 return obj[field]; 9399 }); 9400}; 9401 9402module.exports = exports['default']; 9403 9404 9405},{}],112:[function(require,module,exports){ 9406'use strict'; 9407 9408exports.__esModule = true; 9409 9410var _utils = require('../utils'); 9411 9412exports['default'] = function (instance) { 9413 instance.registerHelper('with', function (context, options) { 9414 if (_utils.isFunction(context)) { 9415 context = context.call(this); 9416 } 9417 9418 var fn = options.fn; 9419 9420 if (!_utils.isEmpty(context)) { 9421 var data = options.data; 9422 if (options.data && options.ids) { 9423 data = _utils.createFrame(options.data); 9424 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 9425 } 9426 9427 return fn(context, { 9428 data: data, 9429 blockParams: _utils.blockParams([context], [data && data.contextPath]) 9430 }); 9431 } else { 9432 return options.inverse(this); 9433 } 9434 }); 9435}; 9436 9437module.exports = exports['default']; 9438 9439 9440},{"../utils":117}],113:[function(require,module,exports){ 9441'use strict'; 9442 9443exports.__esModule = true; 9444 9445var _utils = require('./utils'); 9446 9447var logger = { 9448 methodMap: ['debug', 'info', 'warn', 'error'], 9449 level: 'info', 9450 9451 // Maps a given level value to the `methodMap` indexes above. 9452 lookupLevel: function lookupLevel(level) { 9453 if (typeof level === 'string') { 9454 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 9455 if (levelMap >= 0) { 9456 level = levelMap; 9457 } else { 9458 level = parseInt(level, 10); 9459 } 9460 } 9461 9462 return level; 9463 }, 9464 9465 // Can be overridden in the host environment 9466 log: function log(level) { 9467 level = logger.lookupLevel(level); 9468 9469 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 9470 var method = logger.methodMap[level]; 9471 if (!console[method]) { 9472 // eslint-disable-line no-console 9473 method = 'log'; 9474 } 9475 9476 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 9477 message[_key - 1] = arguments[_key]; 9478 } 9479 9480 console[method].apply(console, message); // eslint-disable-line no-console 9481 } 9482 } 9483}; 9484 9485exports['default'] = logger; 9486module.exports = exports['default']; 9487 9488 9489},{"./utils":117}],114:[function(require,module,exports){ 9490(function (global){(function (){ 9491/* global window */ 9492'use strict'; 9493 9494exports.__esModule = true; 9495 9496exports['default'] = function (Handlebars) { 9497 /* istanbul ignore next */ 9498 var root = typeof global !== 'undefined' ? global : window, 9499 $Handlebars = root.Handlebars; 9500 /* istanbul ignore next */ 9501 Handlebars.noConflict = function () { 9502 if (root.Handlebars === Handlebars) { 9503 root.Handlebars = $Handlebars; 9504 } 9505 return Handlebars; 9506 }; 9507}; 9508 9509module.exports = exports['default']; 9510 9511 9512}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 9513},{}],115:[function(require,module,exports){ 9514'use strict'; 9515 9516exports.__esModule = true; 9517exports.checkRevision = checkRevision; 9518exports.template = template; 9519exports.wrapProgram = wrapProgram; 9520exports.resolvePartial = resolvePartial; 9521exports.invokePartial = invokePartial; 9522exports.noop = noop; 9523// istanbul ignore next 9524 9525function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9526 9527// istanbul ignore next 9528 9529function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } 9530 9531var _utils = require('./utils'); 9532 9533var Utils = _interopRequireWildcard(_utils); 9534 9535var _exception = require('./exception'); 9536 9537var _exception2 = _interopRequireDefault(_exception); 9538 9539var _base = require('./base'); 9540 9541function checkRevision(compilerInfo) { 9542 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 9543 currentRevision = _base.COMPILER_REVISION; 9544 9545 if (compilerRevision !== currentRevision) { 9546 if (compilerRevision < currentRevision) { 9547 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 9548 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 9549 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); 9550 } else { 9551 // Use the embedded version info since the runtime doesn't know about this revision yet 9552 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); 9553 } 9554 } 9555} 9556 9557function template(templateSpec, env) { 9558 /* istanbul ignore next */ 9559 if (!env) { 9560 throw new _exception2['default']('No environment passed to template'); 9561 } 9562 if (!templateSpec || !templateSpec.main) { 9563 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 9564 } 9565 9566 templateSpec.main.decorator = templateSpec.main_d; 9567 9568 // Note: Using env.VM references rather than local var references throughout this section to allow 9569 // for external users to override these as psuedo-supported APIs. 9570 env.VM.checkRevision(templateSpec.compiler); 9571 9572 function invokePartialWrapper(partial, context, options) { 9573 if (options.hash) { 9574 context = Utils.extend({}, context, options.hash); 9575 if (options.ids) { 9576 options.ids[0] = true; 9577 } 9578 } 9579 9580 partial = env.VM.resolvePartial.call(this, partial, context, options); 9581 var result = env.VM.invokePartial.call(this, partial, context, options); 9582 9583 if (result == null && env.compile) { 9584 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 9585 result = options.partials[options.name](context, options); 9586 } 9587 if (result != null) { 9588 if (options.indent) { 9589 var lines = result.split('\n'); 9590 for (var i = 0, l = lines.length; i < l; i++) { 9591 if (!lines[i] && i + 1 === l) { 9592 break; 9593 } 9594 9595 lines[i] = options.indent + lines[i]; 9596 } 9597 result = lines.join('\n'); 9598 } 9599 return result; 9600 } else { 9601 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 9602 } 9603 } 9604 9605 // Just add water 9606 var container = { 9607 strict: function strict(obj, name) { 9608 if (!(name in obj)) { 9609 throw new _exception2['default']('"' + name + '" not defined in ' + obj); 9610 } 9611 return obj[name]; 9612 }, 9613 lookup: function lookup(depths, name) { 9614 var len = depths.length; 9615 for (var i = 0; i < len; i++) { 9616 if (depths[i] && depths[i][name] != null) { 9617 return depths[i][name]; 9618 } 9619 } 9620 }, 9621 lambda: function lambda(current, context) { 9622 return typeof current === 'function' ? current.call(context) : current; 9623 }, 9624 9625 escapeExpression: Utils.escapeExpression, 9626 invokePartial: invokePartialWrapper, 9627 9628 fn: function fn(i) { 9629 var ret = templateSpec[i]; 9630 ret.decorator = templateSpec[i + '_d']; 9631 return ret; 9632 }, 9633 9634 programs: [], 9635 program: function program(i, data, declaredBlockParams, blockParams, depths) { 9636 var programWrapper = this.programs[i], 9637 fn = this.fn(i); 9638 if (data || depths || blockParams || declaredBlockParams) { 9639 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 9640 } else if (!programWrapper) { 9641 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 9642 } 9643 return programWrapper; 9644 }, 9645 9646 data: function data(value, depth) { 9647 while (value && depth--) { 9648 value = value._parent; 9649 } 9650 return value; 9651 }, 9652 merge: function merge(param, common) { 9653 var obj = param || common; 9654 9655 if (param && common && param !== common) { 9656 obj = Utils.extend({}, common, param); 9657 } 9658 9659 return obj; 9660 }, 9661 // An empty object to use as replacement for null-contexts 9662 nullContext: Object.seal({}), 9663 9664 noop: env.VM.noop, 9665 compilerInfo: templateSpec.compiler 9666 }; 9667 9668 function ret(context) { 9669 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9670 9671 var data = options.data; 9672 9673 ret._setup(options); 9674 if (!options.partial && templateSpec.useData) { 9675 data = initData(context, data); 9676 } 9677 var depths = undefined, 9678 blockParams = templateSpec.useBlockParams ? [] : undefined; 9679 if (templateSpec.useDepths) { 9680 if (options.depths) { 9681 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; 9682 } else { 9683 depths = [context]; 9684 } 9685 } 9686 9687 function main(context /*, options*/) { 9688 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 9689 } 9690 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 9691 return main(context, options); 9692 } 9693 ret.isTop = true; 9694 9695 ret._setup = function (options) { 9696 if (!options.partial) { 9697 container.helpers = container.merge(options.helpers, env.helpers); 9698 9699 if (templateSpec.usePartial) { 9700 container.partials = container.merge(options.partials, env.partials); 9701 } 9702 if (templateSpec.usePartial || templateSpec.useDecorators) { 9703 container.decorators = container.merge(options.decorators, env.decorators); 9704 } 9705 } else { 9706 container.helpers = options.helpers; 9707 container.partials = options.partials; 9708 container.decorators = options.decorators; 9709 } 9710 }; 9711 9712 ret._child = function (i, data, blockParams, depths) { 9713 if (templateSpec.useBlockParams && !blockParams) { 9714 throw new _exception2['default']('must pass block params'); 9715 } 9716 if (templateSpec.useDepths && !depths) { 9717 throw new _exception2['default']('must pass parent depths'); 9718 } 9719 9720 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 9721 }; 9722 return ret; 9723} 9724 9725function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 9726 function prog(context) { 9727 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9728 9729 var currentDepths = depths; 9730 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { 9731 currentDepths = [context].concat(depths); 9732 } 9733 9734 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 9735 } 9736 9737 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 9738 9739 prog.program = i; 9740 prog.depth = depths ? depths.length : 0; 9741 prog.blockParams = declaredBlockParams || 0; 9742 return prog; 9743} 9744 9745function resolvePartial(partial, context, options) { 9746 if (!partial) { 9747 if (options.name === '@partial-block') { 9748 partial = options.data['partial-block']; 9749 } else { 9750 partial = options.partials[options.name]; 9751 } 9752 } else if (!partial.call && !options.name) { 9753 // This is a dynamic partial that returned a string 9754 options.name = partial; 9755 partial = options.partials[partial]; 9756 } 9757 return partial; 9758} 9759 9760function invokePartial(partial, context, options) { 9761 // Use the current closure context to save the partial-block if this partial 9762 var currentPartialBlock = options.data && options.data['partial-block']; 9763 options.partial = true; 9764 if (options.ids) { 9765 options.data.contextPath = options.ids[0] || options.data.contextPath; 9766 } 9767 9768 var partialBlock = undefined; 9769 if (options.fn && options.fn !== noop) { 9770 (function () { 9771 options.data = _base.createFrame(options.data); 9772 // Wrapper function to get access to currentPartialBlock from the closure 9773 var fn = options.fn; 9774 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { 9775 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9776 9777 // Restore the partial-block from the closure for the execution of the block 9778 // i.e. the part inside the block of the partial call. 9779 options.data = _base.createFrame(options.data); 9780 options.data['partial-block'] = currentPartialBlock; 9781 return fn(context, options); 9782 }; 9783 if (fn.partials) { 9784 options.partials = Utils.extend({}, options.partials, fn.partials); 9785 } 9786 })(); 9787 } 9788 9789 if (partial === undefined && partialBlock) { 9790 partial = partialBlock; 9791 } 9792 9793 if (partial === undefined) { 9794 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 9795 } else if (partial instanceof Function) { 9796 return partial(context, options); 9797 } 9798} 9799 9800function noop() { 9801 return ''; 9802} 9803 9804function initData(context, data) { 9805 if (!data || !('root' in data)) { 9806 data = data ? _base.createFrame(data) : {}; 9807 data.root = context; 9808 } 9809 return data; 9810} 9811 9812function executeDecorators(fn, prog, container, depths, data, blockParams) { 9813 if (fn.decorator) { 9814 var props = {}; 9815 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 9816 Utils.extend(prog, props); 9817 } 9818 return prog; 9819} 9820 9821 9822},{"./base":101,"./exception":104,"./utils":117}],116:[function(require,module,exports){ 9823// Build out our basic SafeString type 9824'use strict'; 9825 9826exports.__esModule = true; 9827function SafeString(string) { 9828 this.string = string; 9829} 9830 9831SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 9832 return '' + this.string; 9833}; 9834 9835exports['default'] = SafeString; 9836module.exports = exports['default']; 9837 9838 9839},{}],117:[function(require,module,exports){ 9840'use strict'; 9841 9842exports.__esModule = true; 9843exports.extend = extend; 9844exports.indexOf = indexOf; 9845exports.escapeExpression = escapeExpression; 9846exports.isEmpty = isEmpty; 9847exports.createFrame = createFrame; 9848exports.blockParams = blockParams; 9849exports.appendContextPath = appendContextPath; 9850var escape = { 9851 '&': '&', 9852 '<': '<', 9853 '>': '>', 9854 '"': '"', 9855 "'": ''', 9856 '`': '`', 9857 '=': '=' 9858}; 9859 9860var badChars = /[&<>"'`=]/g, 9861 possible = /[&<>"'`=]/; 9862 9863function escapeChar(chr) { 9864 return escape[chr]; 9865} 9866 9867function extend(obj /* , ...source */) { 9868 for (var i = 1; i < arguments.length; i++) { 9869 for (var key in arguments[i]) { 9870 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 9871 obj[key] = arguments[i][key]; 9872 } 9873 } 9874 } 9875 9876 return obj; 9877} 9878 9879var toString = Object.prototype.toString; 9880 9881exports.toString = toString; 9882// Sourced from lodash 9883// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 9884/* eslint-disable func-style */ 9885var isFunction = function isFunction(value) { 9886 return typeof value === 'function'; 9887}; 9888// fallback for older versions of Chrome and Safari 9889/* istanbul ignore next */ 9890if (isFunction(/x/)) { 9891 exports.isFunction = isFunction = function (value) { 9892 return typeof value === 'function' && toString.call(value) === '[object Function]'; 9893 }; 9894} 9895exports.isFunction = isFunction; 9896 9897/* eslint-enable func-style */ 9898 9899/* istanbul ignore next */ 9900var isArray = Array.isArray || function (value) { 9901 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
9902}; 9903 9904exports.isArray = isArray; 9905// Older IE versions do not directly support indexOf so we must implement our own, sadly. 9906 9907function indexOf(array, value) { 9908 for (var i = 0, len = array.length; i < len; i++) { 9909 if (array[i] === value) { 9910 return i; 9911 } 9912 } 9913 return -1; 9914} 9915 9916function escapeExpression(string) { 9917 if (typeof string !== 'string') { 9918 // don't escape SafeStrings, since they're already safe 9919 if (string && string.toHTML) { 9920 return string.toHTML(); 9921 } else if (string == null) { 9922 return ''; 9923 } else if (!string) { 9924 return string + ''; 9925 } 9926 9927 // Force a string conversion as this will be done by the append regardless and 9928 // the regex test will do this transparently behind the scenes, causing issues if 9929 // an object's to string has escaped characters in it. 9930 string = '' + string; 9931 } 9932 9933 if (!possible.test(string)) { 9934 return string; 9935 } 9936 return string.replace(badChars, escapeChar); 9937} 9938 9939function isEmpty(value) { 9940 if (!value && value !== 0) { 9941 return true; 9942 } else if (isArray(value) && value.length === 0) { 9943 return true; 9944 } else { 9945 return false; 9946 } 9947} 9948 9949function createFrame(object) { 9950 var frame = extend({}, object); 9951 frame._parent = object; 9952 return frame; 9953} 9954 9955function blockParams(params, ids) { 9956 params.path = ids; 9957 return params; 9958} 9959 9960function appendContextPath(contextPath, id) { 9961 return (contextPath ? contextPath + '.' : '') + id; 9962} 9963 9964 9965},{}],118:[function(require,module,exports){ 9966// Create a simple path alias to allow browserify to resolve 9967// the runtime on a supported path. 9968module.exports = require('./dist/cjs/handlebars.runtime')['default']; 9969 9970},{"./dist/cjs/handlebars.runtime":100}],119:[function(require,module,exports){ 9971'use strict'; 9972 9973var origSymbol = typeof Symbol !== 'undefined' && Symbol; 9974var hasSymbolSham = require('./shams'); 9975 9976/** @type {import('.')} */ 9977module.exports = function hasNativeSymbols() { 9978 if (typeof origSymbol !== 'function') { return false; } 9979 if (typeof Symbol !== 'function') { return false; } 9980 if (typeof origSymbol('foo') !== 'symbol') { return false; } 9981 if (typeof Symbol('bar') !== 'symbol') { return false; } 9982 9983 return hasSymbolSham(); 9984}; 9985 9986},{"./shams":120}],120:[function(require,module,exports){ 9987'use strict'; 9988 9989/** @type {import('./shams')} */ 9990/* eslint complexity: [2, 18], max-statements: [2, 33] */ 9991module.exports = function hasSymbols() { 9992 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 9993 if (typeof Symbol.iterator === 'symbol') { return true; } 9994 9995 /** @type {{ [k in symbol]?: unknown }} */ 9996 var obj = {}; 9997 var sym = Symbol('test'); 9998 var symObj = Object(sym); 9999 if (typeof sym === 'string') { return false; } 10000 10001 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 10002 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 10003 10004 // temp disabled per https://github.com/ljharb/object.assign/issues/17 10005 // if (sym instanceof Symbol) { return false; } 10006 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 10007 // if (!(symObj instanceof Symbol)) { return false; } 10008 10009 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 10010 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 10011 10012 var symVal = 42; 10013 obj[sym] = symVal; 10014 for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 10015 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 10016 10017 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 10018 10019 var syms = Object.getOwnPropertySymbols(obj); 10020 if (syms.length !== 1 || syms[0] !== sym) { return false; } 10021 10022 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 10023 10024 if (typeof Object.getOwnPropertyDescriptor === 'function') { 10025 // eslint-disable-next-line no-extra-parens 10026 var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); 10027 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 10028 } 10029 10030 return true; 10031}; 10032 10033},{}],121:[function(require,module,exports){ 10034'use strict'; 10035 10036var call = Function.prototype.call; 10037var $hasOwn = Object.prototype.hasOwnProperty; 10038var bind = require('function-bind'); 10039 10040/** @type {import('.')} */ 10041module.exports = bind.call(call, $hasOwn); 10042 10043},{"function-bind":93}],122:[function(require,module,exports){ 10044'use strict'; 10045 10046/** @type {import('./abs')} */ 10047module.exports = Math.abs; 10048 10049},{}],123:[function(require,module,exports){ 10050'use strict'; 10051 10052/** @type {import('./floor')} */ 10053module.exports = Math.floor; 10054 10055},{}],124:[function(require,module,exports){ 10056'use strict'; 10057 10058/** @type {import('./isNaN')} */ 10059module.exports = Number.isNaN || function isNaN(a) { 10060 return a !== a; 10061}; 10062 10063},{}],125:[function(require,module,exports){ 10064'use strict'; 10065 10066/** @type {import('./max')} */ 10067module.exports = Math.max; 10068 10069},{}],126:[function(require,module,exports){ 10070'use strict'; 10071 10072/** @type {import('./min')} */ 10073module.exports = Math.min; 10074 10075},{}],127:[function(require,module,exports){ 10076'use strict'; 10077 10078/** @type {import('./pow')} */ 10079module.exports = Math.pow; 10080 10081},{}],128:[function(require,module,exports){ 10082'use strict'; 10083 10084/** @type {import('./round')} */ 10085module.exports = Math.round; 10086 10087},{}],129:[function(require,module,exports){ 10088'use strict'; 10089 10090var $isNaN = require('./isNaN'); 10091 10092/** @type {import('./sign')} */ 10093module.exports = function sign(number) { 10094 if ($isNaN(number) || number === 0) { 10095 return number; 10096 } 10097 return number < 0 ? -1 : +1; 10098}; 10099 10100},{"./isNaN":124}],13
vendor: 6,833 bytes, lines 10100-10274
101000:[function(require,module,exports){ 10101(function (global){(function (){ 10102var hasMap = typeof Map === 'function' && Map.prototype; 10103var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 10104var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 10105var mapForEach = hasMap && Map.prototype.forEach; 10106var hasSet = typeof Set === 'function' && Set.prototype; 10107var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 10108var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 10109var setForEach = hasSet && Set.prototype.forEach; 10110var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 10111var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 10112var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 10113var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 10114var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 10115var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 10116var booleanValueOf = Boolean.prototype.valueOf; 10117var objectToString = Object.prototype.toString; 10118var functionToString = Function.prototype.toString; 10119var $match = String.prototype.match; 10120var $slice = String.prototype.slice; 10121var $replace = String.prototype.replace; 10122var $toUpperCase = String.prototype.toUpperCase; 10123var $toLowerCase = String.prototype.toLowerCase; 10124var $test = RegExp.prototype.test; 10125var $concat = Array.prototype.concat; 10126var $join = Array.prototype.join; 10127var $arrSlice = Array.prototype.slice; 10128var $floor = Math.floor; 10129var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 10130var gOPS = Object.getOwnPropertySymbols; 10131var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 10132var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 10133// ie, `has-tostringtag/shams 10134var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') 10135 ? Symbol.toStringTag 10136 : null; 10137var isEnumerable = Object.prototype.propertyIsEnumerable; 10138 10139var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 10140 [].__proto__ === Array.prototype // eslint-disable-line no-proto 10141 ? function (O) { 10142 return O.__proto__; // eslint-disable-line no-proto 10143 } 10144 : null 10145); 10146 10147function addNumericSeparator(num, str) { 10148 if ( 10149 num === Infinity 10150 || num === -Infinity 10151 || num !== num 10152 || (num && num > -1000 && num < 1000) 10153 || $test.call(/e/, str) 10154 ) { 10155 return str; 10156 } 10157 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 10158 if (typeof num === 'number') { 10159 var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) 10160 if (int !== num) { 10161 var intStr = String(int); 10162 var dec = $slice.call(str, intStr.length + 1); 10163 return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); 10164 } 10165 } 10166 return $replace.call(str, sepRegex, '$&_'); 10167} 10168 10169var utilInspect = require('./util.inspect'); 10170var inspectCustom = utilInspect.custom; 10171var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; 10172 10173var quotes = { 10174 __proto__: null, 10175 'double': '"', 10176 single: "'" 10177}; 10178var quoteREs = { 10179 __proto__: null, 10180 'double': /(["\\])/g, 10181 single: /(['\\])/g 10182}; 10183 10184module.exports = function inspect_(obj, options, depth, seen) { 10185 var opts = options || {}; 10186 10187 if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { 10188 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 10189 } 10190 if ( 10191 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 10192 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 10193 : opts.maxStringLength !== null 10194 ) 10195 ) { 10196 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 10197 } 10198 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 10199 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 10200 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 10201 } 10202 10203 if ( 10204 has(opts, 'indent') 10205 && opts.indent !== null 10206 && opts.indent !== '\t' 10207 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 10208 ) { 10209 throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); 10210 } 10211 if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { 10212 throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); 10213 } 10214 var numericSeparator = opts.numericSeparator; 10215 10216 if (typeof obj === 'undefined') { 10217 return 'undefined'; 10218 } 10219 if (obj === null) { 10220 return 'null'; 10221 } 10222 if (typeof obj === 'boolean') { 10223 return obj ? 'true' : 'false'; 10224 } 10225 10226 if (typeof obj === 'string') { 10227 return inspectString(obj, opts); 10228 } 10229 if (typeof obj === 'number') { 10230 if (obj === 0) { 10231 return Infinity / obj > 0 ? '0' : '-0'; 10232 } 10233 var str = String(obj); 10234 return numericSeparator ? addNumericSeparator(obj, str) : str; 10235 } 10236 if (typeof obj === 'bigint') { 10237 var bigIntStr = String(obj) + 'n'; 10238 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 10239 } 10240 10241 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 10242 if (typeof depth === 'undefined') { depth = 0; } 10243 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 10244 return isArray(obj) ? '[Array]' : '[Object]'; 10245 } 10246 10247 var indent = getIndent(opts, depth); 10248 10249 if (typeof seen === 'undefined') { 10250 seen = []; 10251 } else if (indexOf(seen, obj) >= 0) { 10252 return '[Circular]'; 10253 } 10254 10255 function inspect(value, from, noIndent) { 10256 if (from) { 10257 seen = $arrSlice.call(seen); 10258 seen.push(from); 10259 } 10260 if (noIndent) { 10261 var newOpts = { 10262 depth: opts.depth 10263 }; 10264 if (has(opts, 'quoteStyle')) { 10265 newOpts.quoteStyle = opts.quoteStyle; 10266 } 10267 return inspect_(value, newOpts, depth + 1, seen); 10268 } 10269 return inspect_(value, opts, depth + 1, seen); 10270 } 10271 10272 if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable 10273 var name = nameOf(obj); 10274 var keys = arrObjKeys(obj, inspect);
vendor: 5,552 bytes, lines 10275-10401
10275 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); 10276 } 10277 if (isSymbol(obj)) { 10278 var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 10279 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 10280 } 10281 if (isElement(obj)) { 10282 var s = '<' + $toLowerCase.call(String(obj.nodeName)); 10283 var attrs = obj.attributes || []; 10284 for (var i = 0; i < attrs.length; i++) { 10285 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 10286 } 10287 s += '>'; 10288 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 10289 s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; 10290 return s; 10291 } 10292 if (isArray(obj)) { 10293 if (obj.length === 0) { return '[]'; } 10294 var xs = arrObjKeys(obj, inspect); 10295 if (indent && !singleLineValues(xs)) { 10296 return '[' + indentedJoin(xs, indent) + ']'; 10297 } 10298 return '[ ' + $join.call(xs, ', ') + ' ]'; 10299 } 10300 if (isError(obj)) { 10301 var parts = arrObjKeys(obj, inspect); 10302 if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { 10303 return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; 10304 } 10305 if (parts.length === 0) { return '[' + String(obj) + ']'; } 10306 return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; 10307 } 10308 if (typeof obj === 'object' && customInspect) { 10309 if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { 10310 return utilInspect(obj, { depth: maxDepth - depth }); 10311 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 10312 return obj.inspect(); 10313 } 10314 } 10315 if (isMap(obj)) { 10316 var mapParts = []; 10317 if (mapForEach) { 10318 mapForEach.call(obj, function (value, key) { 10319 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 10320 }); 10321 } 10322 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 10323 } 10324 if (isSet(obj)) { 10325 var setParts = []; 10326 if (setForEach) { 10327 setForEach.call(obj, function (value) { 10328 setParts.push(inspect(value, obj)); 10329 }); 10330 } 10331 return collectionOf('Set', setSize.call(obj), setParts, indent); 10332 } 10333 if (isWeakMap(obj)) { 10334 return weakCollectionOf('WeakMap'); 10335 } 10336 if (isWeakSet(obj)) { 10337 return weakCollectionOf('WeakSet'); 10338 } 10339 if (isWeakRef(obj)) { 10340 return weakCollectionOf('WeakRef'); 10341 } 10342 if (isNumber(obj)) { 10343 return markBoxed(inspect(Number(obj))); 10344 } 10345 if (isBigInt(obj)) { 10346 return markBoxed(inspect(bigIntValueOf.call(obj))); 10347 } 10348 if (isBoolean(obj)) { 10349 return markBoxed(booleanValueOf.call(obj)); 10350 } 10351 if (isString(obj)) { 10352 return markBoxed(inspect(String(obj))); 10353 } 10354 // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other 10355 /* eslint-env browser */ 10356 if (typeof window !== 'undefined' && obj === window) { 10357 return '{ [object Window] }'; 10358 } 10359 if ( 10360 (typeof globalThis !== 'undefined' && obj === globalThis) 10361 || (typeof global !== 'undefined' && obj === global) 10362 ) { 10363 return '{ [object globalThis] }'; 10364 } 10365 if (!isDate(obj) && !isRegExp(obj)) { 10366 var ys = arrObjKeys(obj, inspect); 10367 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 10368 var protoTag = obj instanceof Object ? '' : 'null prototype'; 10369 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; 10370 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 10371 var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); 10372 if (ys.length === 0) { return tag + '{}'; } 10373 if (indent) { 10374 return tag + '{' + indentedJoin(ys, indent) + '}'; 10375 } 10376 return tag + '{ ' + $join.call(ys, ', ') + ' }'; 10377 } 10378 return String(obj); 10379}; 10380 10381function wrapQuotes(s, defaultStyle, opts) { 10382 var style = opts.quoteStyle || defaultStyle; 10383 var quoteChar = quotes[style]; 10384 return quoteChar + s + quoteChar; 10385} 10386 10387function quote(s) { 10388 return $replace.call(String(s), /"/g, '"'); 10389} 10390 10391function canTrustToString(obj) { 10392 return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); 10393} 10394function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } 10395function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } 10396function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } 10397function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } 10398function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } 10399function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } 10400function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } 10401
vendor: 6,745 bytes, lines 10402-10646
10402// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 10403function isSymbol(obj) { 10404 if (hasShammedSymbols) { 10405 return obj && typeof obj === 'object' && obj instanceof Symbol; 10406 } 10407 if (typeof obj === 'symbol') { 10408 return true; 10409 } 10410 if (!obj || typeof obj !== 'object' || !symToString) { 10411 return false; 10412 } 10413 try { 10414 symToString.call(obj); 10415 return true; 10416 } catch (e) {} 10417 return false; 10418} 10419 10420function isBigInt(obj) { 10421 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 10422 return false; 10423 } 10424 try { 10425 bigIntValueOf.call(obj); 10426 return true; 10427 } catch (e) {} 10428 return false; 10429} 10430 10431var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 10432function has(obj, key) { 10433 return hasOwn.call(obj, key); 10434} 10435 10436function toStr(obj) { 10437 return objectToString.call(obj); 10438} 10439 10440function nameOf(f) { 10441 if (f.name) { return f.name; } 10442 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 10443 if (m) { return m[1]; } 10444 return null; 10445} 10446 10447function indexOf(xs, x) { 10448 if (xs.indexOf) { return xs.indexOf(x); } 10449 for (var i = 0, l = xs.length; i < l; i++) { 10450 if (xs[i] === x) { return i; } 10451 } 10452 return -1; 10453} 10454 10455function isMap(x) { 10456 if (!mapSize || !x || typeof x !== 'object') { 10457 return false; 10458 } 10459 try { 10460 mapSize.call(x); 10461 try { 10462 setSize.call(x); 10463 } catch (s) { 10464 return true; 10465 } 10466 return x instanceof Map; // core-js workaround, pre-v2.5.0 10467 } catch (e) {} 10468 return false; 10469} 10470 10471function isWeakMap(x) { 10472 if (!weakMapHas || !x || typeof x !== 'object') { 10473 return false; 10474 } 10475 try { 10476 weakMapHas.call(x, weakMapHas); 10477 try { 10478 weakSetHas.call(x, weakSetHas); 10479 } catch (s) { 10480 return true; 10481 } 10482 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 10483 } catch (e) {} 10484 return false; 10485} 10486 10487function isWeakRef(x) { 10488 if (!weakRefDeref || !x || typeof x !== 'object') { 10489 return false; 10490 } 10491 try { 10492 weakRefDeref.call(x); 10493 return true; 10494 } catch (e) {} 10495 return false; 10496} 10497 10498function isSet(x) { 10499 if (!setSize || !x || typeof x !== 'object') { 10500 return false; 10501 } 10502 try { 10503 setSize.call(x); 10504 try { 10505 mapSize.call(x); 10506 } catch (m) { 10507 return true; 10508 } 10509 return x instanceof Set; // core-js workaround, pre-v2.5.0 10510 } catch (e) {} 10511 return false; 10512} 10513 10514function isWeakSet(x) { 10515 if (!weakSetHas || !x || typeof x !== 'object') { 10516 return false; 10517 } 10518 try { 10519 weakSetHas.call(x, weakSetHas); 10520 try { 10521 weakMapHas.call(x, weakMapHas); 10522 } catch (s) { 10523 return true; 10524 } 10525 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 10526 } catch (e) {} 10527 return false; 10528} 10529 10530function isElement(x) { 10531 if (!x || typeof x !== 'object') { return false; } 10532 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 10533 return true; 10534 } 10535 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 10536} 10537 10538function inspectString(str, opts) { 10539 if (str.length > opts.maxStringLength) { 10540 var remaining = str.length - opts.maxStringLength; 10541 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 10542 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 10543 } 10544 var quoteRE = quoteREs[opts.quoteStyle || 'single']; 10545 quoteRE.lastIndex = 0; 10546 // eslint-disable-next-line no-control-regex 10547 var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); 10548 return wrapQuotes(s, 'single', opts); 10549} 10550 10551function lowbyte(c) { 10552 var n = c.charCodeAt(0); 10553 var x = { 10554 8: 'b', 10555 9: 't', 10556 10: 'n', 10557 12: 'f', 10558 13: 'r' 10559 }[n]; 10560 if (x) { return '\\' + x; } 10561 return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); 10562} 10563 10564function markBoxed(str) { 10565 return 'Object(' + str + ')'; 10566} 10567 10568function weakCollectionOf(type) { 10569 return type + ' { ? }'; 10570} 10571 10572function collectionOf(type, size, entries, indent) { 10573 var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); 10574 return type + ' (' + size + ') {' + joinedEntries + '}'; 10575} 10576 10577function singleLineValues(xs) { 10578 for (var i = 0; i < xs.length; i++) { 10579 if (indexOf(xs[i], '\n') >= 0) { 10580 return false; 10581 } 10582 } 10583 return true; 10584} 10585 10586function getIndent(opts, depth) { 10587 var baseIndent; 10588 if (opts.indent === '\t') { 10589 baseIndent = '\t'; 10590 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 10591 baseIndent = $join.call(Array(opts.indent + 1), ' '); 10592 } else { 10593 return null; 10594 } 10595 return { 10596 base: baseIndent, 10597 prev: $join.call(Array(depth + 1), baseIndent) 10598 }; 10599} 10600 10601function indentedJoin(xs, indent) { 10602 if (xs.length === 0) { return ''; } 10603 var lineJoiner = '\n' + indent.prev + indent.base; 10604 return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; 10605} 10606 10607function arrObjKeys(obj, inspect) { 10608 var isArr = isArray(obj); 10609 var xs = []; 10610 if (isArr) { 10611 xs.length = obj.length; 10612 for (var i = 0; i < obj.length; i++) { 10613 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 10614 } 10615 } 10616 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 10617 var symMap; 10618 if (hasShammedSymbols) { 10619 symMap = {}; 10620 for (var k = 0; k < syms.length; k++) { 10621 symMap['$' + syms[k]] = syms[k]; 10622 } 10623 } 10624 10625 for (var key in obj) { // eslint-disable-line no-restricted-syntax 10626 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 10627 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 10628 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 10629 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 10630 continue; // eslint-disable-line no-restricted-syntax, no-continue 10631 } else if ($test.call(/[^\w$]/, key)) { 10632 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 10633 } else { 10634 xs.push(key + ': ' + inspect(obj[key], obj)); 10635 } 10636 } 10637 if (typeof gOPS === 'function') { 10638 for (var j = 0; j < syms.length; j++) { 10639 if (isEnumerable.call(obj, syms[j])) { 10640 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 10641 } 10642 } 10643 } 10644 return xs; 10645} 10646
10647}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 10648},{"./util.inspect":75}],131:[function(require,module,exports){ 10649(function (global){(function (){
vendor: 14,672 bytes, lines 10649-11183
10649 10650/*! https://mths.be/punycode v1.4.1 by @mathias */ 10651;(function(root) { 10652 10653 /** Detect free variables */ 10654 var freeExports = typeof exports == 'object' && exports && 10655 !exports.nodeType && exports; 10656 var freeModule = typeof module == 'object' && module && 10657 !module.nodeType && module; 10658 var freeGlobal = typeof global == 'object' && global; 10659 if ( 10660 freeGlobal.global === freeGlobal || 10661 freeGlobal.window === freeGlobal || 10662 freeGlobal.self === freeGlobal 10663 ) { 10664 root = freeGlobal; 10665 } 10666 10667 /** 10668 * The `punycode` object. 10669 * @name punycode 10670 * @type Object 10671 */ 10672 var punycode, 10673 10674 /** Highest positive signed 32-bit float value */ 10675 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 10676 10677 /** Bootstring parameters */ 10678 base = 36, 10679 tMin = 1, 10680 tMax = 26, 10681 skew = 38, 10682 damp = 700, 10683 initialBias = 72, 10684 initialN = 128, // 0x80 10685 delimiter = '-', // '\x2D' 10686 10687 /** Regular expressions */ 10688 regexPunycode = /^xn--/, 10689 regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars 10690 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators 10691 10692 /** Error messages */ 10693 errors = { 10694 'overflow': 'Overflow: input needs wider integers to process', 10695 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 10696 'invalid-input': 'Invalid input' 10697 }, 10698 10699 /** Convenience shortcuts */ 10700 baseMinusTMin = base - tMin, 10701 floor = Math.floor, 10702 stringFromCharCode = String.fromCharCode, 10703 10704 /** Temporary variable */ 10705 key; 10706 10707 /*--------------------------------------------------------------------------*/ 10708 10709 /** 10710 * A generic error utility function. 10711 * @private 10712 * @param {String} type The error type. 10713 * @returns {Error} Throws a `RangeError` with the applicable error message. 10714 */ 10715 function error(type) { 10716 throw new RangeError(errors[type]); 10717 } 10718 10719 /** 10720 * A generic `Array#map` utility function. 10721 * @private 10722 * @param {Array} array The array to iterate over. 10723 * @param {Function} callback The function that gets called for every array 10724 * item. 10725 * @returns {Array} A new array of values returned by the callback function. 10726 */ 10727 function map(array, fn) { 10728 var length = array.length; 10729 var result = []; 10730 while (length--) { 10731 result[length] = fn(array[length]); 10732 } 10733 return result; 10734 } 10735 10736 /** 10737 * A simple `Array#map`-like wrapper to work with domain name strings or email 10738 * addresses. 10739 * @private 10740 * @param {String} domain The domain name or email address. 10741 * @param {Function} callback The function that gets called for every 10742 * character. 10743 * @returns {Array} A new string of characters returned by the callback 10744 * function. 10745 */ 10746 function mapDomain(string, fn) { 10747 var parts = string.split('@'); 10748 var result = ''; 10749 if (parts.length > 1) { 10750 // In email addresses, only the domain name should be punycoded. Leave 10751 // the local part (i.e. everything up to `@`) intact. 10752 result = parts[0] + '@'; 10753 string = parts[1]; 10754 } 10755 // Avoid `split(regex)` for IE8 compatibility. See #17. 10756 string = string.replace(regexSeparators, '\x2E'); 10757 var labels = string.split('.'); 10758 var encoded = map(labels, fn).join('.'); 10759 return result + encoded; 10760 } 10761 10762 /** 10763 * Creates an array containing the numeric code points of each Unicode 10764 * character in the string. While JavaScript uses UCS-2 internally, 10765 * this function will convert a pair of surrogate halves (each of which 10766 * UCS-2 exposes as separate characters) into a single code point, 10767 * matching UTF-16. 10768 * @see `punycode.ucs2.encode` 10769 * @see <https://mathiasbynens.be/notes/javascript-encoding> 10770 * @memberOf punycode.ucs2 10771 * @name decode 10772 * @param {String} string The Unicode input string (UCS-2). 10773 * @returns {Array} The new array of code points. 10774 */ 10775 function ucs2decode(string) { 10776 var output = [], 10777 counter = 0, 10778 length = string.length, 10779 value, 10780 extra; 10781 while (counter < length) { 10782 value = string.charCodeAt(counter++); 10783 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 10784 // high surrogate, and there is a next character 10785 extra = string.charCodeAt(counter++); 10786 if ((extra & 0xFC00) == 0xDC00) { // low surrogate 10787 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 10788 } else { 10789 // unmatched surrogate; only append this code unit, in case the next 10790 // code unit is the high surrogate of a surrogate pair 10791 output.push(value); 10792 counter--; 10793 } 10794 } else { 10795 output.push(value); 10796 } 10797 } 10798 return output; 10799 } 10800 10801 /** 10802 * Creates a string based on an array of numeric code points. 10803 * @see `punycode.ucs2.decode` 10804 * @memberOf punycode.ucs2 10805 * @name encode 10806 * @param {Array} codePoints The array of numeric code points. 10807 * @returns {String} The new Unicode string (UCS-2). 10808 */ 10809 function ucs2encode(array) { 10810 return map(array, function(value) { 10811 var output = ''; 10812 if (value > 0xFFFF) { 10813 value -= 0x10000; 10814 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); 10815 value = 0xDC00 | value & 0x3FF; 10816 } 10817 output += stringFromCharCode(value); 10818 return output; 10819 }).join(''); 10820 } 10821 10822 /** 10823 * Converts a basic code point into a digit/integer. 10824 * @see `digitToBasic()` 10825 * @private 10826 * @param {Number} codePoint The basic numeric code point value. 10827 * @returns {Number} The numeric value of a basic code point (for use in 10828 * representing integers) in the range `0` to `base - 1`, or `base` if 10829 * the code point does not represent a value. 10830 */ 10831 function basicToDigit(codePoint) { 10832 if (codePoint - 48 < 10) { 10833 return codePoint - 22; 10834 } 10835 if (codePoint - 65 < 26) { 10836 return codePoint - 65; 10837 } 10838 if (codePoint - 97 < 26) { 10839 return codePoint - 97; 10840 } 10841 return base; 10842 } 10843 10844 /** 10845 * Converts a digit/integer into a basic code point. 10846 * @see `basicToDigit()` 10847 * @private 10848 * @param {Number} digit The numeric value of a basic code point. 10849 * @returns {Number} The basic code point whose value (when used for 10850 * representing integers) is `digit`, which needs to be in the range 10851 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 10852 * used; else, the lowercase form is used. The behavior is undefined 10853 * if `flag` is non-zero and `digit` has no uppercase form. 10854 */ 10855 function digitToBasic(digit, flag) { 10856 // 0..25 map to ASCII a..z or A..Z 10857 // 26..35 map to ASCII 0..9 10858 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 10859 } 10860 10861 /** 10862 * Bias adaptation function as per section 3.4 of RFC 3492. 10863 * https://tools.ietf.org/html/rfc3492#section-3.4 10864 * @private 10865 */ 10866 function adapt(delta, numPoints, firstTime) { 10867 var k = 0; 10868 delta = firstTime ? floor(delta / damp) : delta >> 1; 10869 delta += floor(delta / numPoints); 10870 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 10871 delta = floor(delta / baseMinusTMin); 10872 } 10873 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 10874 } 10875 10876 /** 10877 * Converts a Punycode string of ASCII-only symbols to a string of Unicode 10878 * symbols. 10879 * @memberOf punycode 10880 * @param {String} input The Punycode string of ASCII-only symbols. 10881 * @returns {String} The resulting string of Unicode symbols. 10882 */ 10883 function decode(input) { 10884 // Don't use UCS-2 10885 var output = [], 10886 inputLength = input.length, 10887 out, 10888 i = 0, 10889 n = initialN, 10890 bias = initialBias, 10891 basic, 10892 j, 10893 index, 10894 oldi, 10895 w, 10896 k, 10897 digit, 10898 t, 10899 /** Cached calculation results */ 10900 baseMinusT; 10901 10902 // Handle the basic code points: let `basic` be the number of input code 10903 // points before the last delimiter, or `0` if there is none, then copy 10904 // the first basic code points to the output. 10905 10906 basic = input.lastIndexOf(delimiter); 10907 if (basic < 0) { 10908 basic = 0; 10909 } 10910 10911 for (j = 0; j < basic; ++j) { 10912 // if it's not a basic code point 10913 if (input.charCodeAt(j) >= 0x80) { 10914 error('not-basic'); 10915 } 10916 output.push(input.charCodeAt(j)); 10917 } 10918 10919 // Main decoding loop: start just after the last delimiter if any basic code 10920 // points were copied; start at the beginning otherwise. 10921 10922 for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 10923 10924 // `index` is the index of the next character to be consumed. 10925 // Decode a generalized variable-length integer into `delta`, 10926 // which gets added to `i`. The overflow checking is easier 10927 // if we increase `i` as we go, then subtract off its starting 10928 // value at the end to obtain `delta`. 10929 for (oldi = i, w = 1, k = base; /* no condition */; k += base) { 10930 10931 if (index >= inputLength) { 10932 error('invalid-input'); 10933 } 10934 10935 digit = basicToDigit(input.charCodeAt(index++)); 10936 10937 if (digit >= base || digit > floor((maxInt - i) / w)) { 10938 error('overflow'); 10939 } 10940 10941 i += digit * w; 10942 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 10943 10944 if (digit < t) { 10945 break; 10946 } 10947 10948 baseMinusT = base - t; 10949 if (w > floor(maxInt / baseMinusT)) { 10950 error('overflow'); 10951 } 10952 10953 w *= baseMinusT; 10954 10955 } 10956 10957 out = output.length + 1; 10958 bias = adapt(i - oldi, out, oldi == 0); 10959 10960 // `i` was supposed to wrap around from `out` to `0`, 10961 // incrementing `n` each time, so we'll fix that now: 10962 if (floor(i / out) > maxInt - n) { 10963 error('overflow'); 10964 } 10965 10966 n += floor(i / out); 10967 i %= out; 10968 10969 // Insert `n` at position `i` of the output 10970 output.splice(i++, 0, n); 10971 10972 } 10973 10974 return ucs2encode(output); 10975 } 10976 10977 /** 10978 * Converts a string of Unicode symbols (e.g. a domain name label) to a 10979 * Punycode string of ASCII-only symbols. 10980 * @memberOf punycode 10981 * @param {String} input The string of Unicode symbols. 10982 * @returns {String} The resulting Punycode string of ASCII-only symbols. 10983 */ 10984 function encode(input) { 10985 var n, 10986 delta, 10987 handledCPCount, 10988 basicLength, 10989 bias, 10990 j, 10991 m, 10992 q, 10993 k, 10994 t, 10995 currentValue, 10996 output = [], 10997 /** `inputLength` will hold the number of code points in `input`. */ 10998 inputLength, 10999 /** Cached calculation results */ 11000 handledCPCountPlusOne, 11001 baseMinusT, 11002 qMinusT; 11003 11004 // Convert the input in UCS-2 to Unicode 11005 input = ucs2decode(input); 11006 11007 // Cache the length 11008 inputLength = input.length; 11009 11010 // Initialize the state 11011 n = initialN; 11012 delta = 0; 11013 bias = initialBias; 11014 11015 // Handle the basic code points 11016 for (j = 0; j < inputLength; ++j) { 11017 currentValue = input[j]; 11018 if (currentValue < 0x80) { 11019 output.push(stringFromCharCode(currentValue)); 11020 } 11021 } 11022 11023 handledCPCount = basicLength = output.length; 11024 11025 // `handledCPCount` is the number of code points that have been handled; 11026 // `basicLength` is the number of basic code points. 11027 11028 // Finish the basic string - if it is not empty - with a delimiter 11029 if (basicLength) { 11030 output.push(delimiter); 11031 } 11032 11033 // Main encoding loop: 11034 while (handledCPCount < inputLength) { 11035 11036 // All non-basic code points < n have been handled already. Find the next 11037 // larger one: 11038 for (m = maxInt, j = 0; j < inputLength; ++j) { 11039 currentValue = input[j]; 11040 if (currentValue >= n && currentValue < m) { 11041 m = currentValue; 11042 } 11043 } 11044 11045 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, 11046 // but guard against overflow 11047 handledCPCountPlusOne = handledCPCount + 1; 11048 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 11049 error('overflow'); 11050 } 11051 11052 delta += (m - n) * handledCPCountPlusOne; 11053 n = m; 11054 11055 for (j = 0; j < inputLength; ++j) { 11056 currentValue = input[j]; 11057 11058 if (currentValue < n && ++delta > maxInt) { 11059 error('overflow'); 11060 } 11061 11062 if (currentValue == n) { 11063 // Represent delta as a generalized variable-length integer 11064 for (q = delta, k = base; /* no condition */; k += base) { 11065 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 11066 if (q < t) { 11067 break; 11068 } 11069 qMinusT = q - t; 11070 baseMinusT = base - t; 11071 output.push( 11072 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 11073 ); 11074 q = floor(qMinusT / baseMinusT); 11075 } 11076 11077 output.push(stringFromCharCode(digitToBasic(q, 0))); 11078 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 11079 delta = 0; 11080 ++handledCPCount; 11081 } 11082 } 11083 11084 ++delta; 11085 ++n; 11086 11087 } 11088 return output.join(''); 11089 } 11090 11091 /** 11092 * Converts a Punycode string representing a domain name or an email address 11093 * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 11094 * it doesn't matter if you call it on a string that has already been 11095 * converted to Unicode. 11096 * @memberOf punycode 11097 * @param {String} input The Punycoded domain name or email address to 11098 * convert to Unicode. 11099 * @returns {String} The Unicode representation of the given Punycode 11100 * string. 11101 */ 11102 function toUnicode(input) { 11103 return mapDomain(input, function(string) { 11104 return regexPunycode.test(string) 11105 ? decode(string.slice(4).toLowerCase()) 11106 : string; 11107 }); 11108 } 11109 11110 /** 11111 * Converts a Unicode string representing a domain name or an email address to 11112 * Punycode. Only the non-ASCII parts of the domain name will be converted, 11113 * i.e. it doesn't matter if you call it with a domain that's already in 11114 * ASCII. 11115 * @memberOf punycode 11116 * @param {String} input The domain name or email address to convert, as a 11117 * Unicode string. 11118 * @returns {String} The Punycode representation of the given domain name or 11119 * email address. 11120 */ 11121 function toASCII(input) { 11122 return mapDomain(input, function(string) { 11123 return regexNonASCII.test(string) 11124 ? 'xn--' + encode(string) 11125 : string; 11126 }); 11127 } 11128 11129 /*--------------------------------------------------------------------------*/ 11130 11131 /** Define the public API */ 11132 punycode = { 11133 /** 11134 * A string representing the current Punycode.js version number. 11135 * @memberOf punycode 11136 * @type String 11137 */ 11138 'version': '1.4.1', 11139 /** 11140 * An object of methods to convert from JavaScript's internal character 11141 * representation (UCS-2) to Unicode code points, and back. 11142 * @see <https://mathiasbynens.be/notes/javascript-encoding> 11143 * @memberOf punycode 11144 * @type Object 11145 */ 11146 'ucs2': { 11147 'decode': ucs2decode, 11148 'encode': ucs2encode 11149 }, 11150 'decode': decode, 11151 'encode': encode, 11152 'toASCII': toASCII, 11153 'toUnicode': toUnicode 11154 }; 11155 11156 /** Expose `punycode` */ 11157 // Some AMD build optimizers, like r.js, check for specific condition patterns 11158 // like the following: 11159 if ( 11160 typeof define == 'function' && 11161 typeof define.amd == 'object' && 11162 define.amd 11163 ) { 11164 define('punycode', function() { 11165 return punycode; 11166 }); 11167 } else if (freeExports && freeModule) { 11168 if (module.exports == freeExports) { 11169 // in Node.js, io.js, or RingoJS v0.8.0+ 11170 freeModule.exports = punycode; 11171 } else { 11172 // in Narwhal or RingoJS v0.7.0- 11173 for (key in punycode) { 11174 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); 11175 } 11176 } 11177 } else { 11178 // in Rhino or a web browser 11179 root.punycode = punycode; 11180 } 11181 11182}(this)); 11183
vendor: 10,122 bytes, lines 11184-11509
11184}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 11185},{}],132:[function(require,module,exports){ 11186'use strict'; 11187 11188var inspect = require('object-inspect'); 11189 11190var $TypeError = require('es-errors/type'); 11191 11192/* 11193* This function traverses the list returning the node corresponding to the given key. 11194* 11195* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. 11196* By doing so, all the recently used nodes can be accessed relatively quickly. 11197*/ 11198/** @type {import('./list.d.ts').listGetNode} */ 11199// eslint-disable-next-line consistent-return 11200var listGetNode = function (list, key, isDelete) { 11201 /** @type {typeof list | NonNullable<(typeof list)['next']>} */ 11202 var prev = list; 11203 /** @type {(typeof list)['next']} */ 11204 var curr; 11205 // eslint-disable-next-line eqeqeq 11206 for (; (curr = prev.next) != null; prev = curr) { 11207 if (curr.key === key) { 11208 prev.next = curr.next; 11209 if (!isDelete) { 11210 // eslint-disable-next-line no-extra-parens 11211 curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next); 11212 list.next = curr; // eslint-disable-line no-param-reassign 11213 } 11214 return curr; 11215 } 11216 } 11217}; 11218 11219/** @type {import('./list.d.ts').listGet} */ 11220var listGet = function (objects, key) { 11221 if (!objects) { 11222 return void undefined; 11223 } 11224 var node = listGetNode(objects, key); 11225 return node && node.value; 11226}; 11227/** @type {import('./list.d.ts').listSet} */ 11228var listSet = function (objects, key, value) { 11229 var node = listGetNode(objects, key); 11230 if (node) { 11231 node.value = value; 11232 } else { 11233 // Prepend the new node to the beginning of the list 11234 objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens 11235 key: key, 11236 next: objects.next, 11237 value: value 11238 }); 11239 } 11240}; 11241/** @type {import('./list.d.ts').listHas} */ 11242var listHas = function (objects, key) { 11243 if (!objects) { 11244 return false; 11245 } 11246 return !!listGetNode(objects, key); 11247}; 11248/** @type {import('./list.d.ts').listDelete} */ 11249// eslint-disable-next-line consistent-return 11250var listDelete = function (objects, key) { 11251 if (objects) { 11252 return listGetNode(objects, key, true); 11253 } 11254}; 11255 11256/** @type {import('.')} */ 11257module.exports = function getSideChannelList() { 11258 /** @typedef {ReturnType<typeof getSideChannelList>} Channel */ 11259 /** @typedef {Parameters<Channel['get']>[0]} K */ 11260 /** @typedef {Parameters<Channel['set']>[1]} V */ 11261 11262 /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o; 11263 11264 /** @type {Channel} */ 11265 var channel = { 11266 assert: function (key) { 11267 if (!channel.has(key)) { 11268 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11269 } 11270 }, 11271 'delete': function (key) { 11272 var root = $o && $o.next; 11273 var deletedNode = listDelete($o, key); 11274 if (deletedNode && root && root === deletedNode) { 11275 $o = void undefined; 11276 } 11277 return !!deletedNode; 11278 }, 11279 get: function (key) { 11280 return listGet($o, key); 11281 }, 11282 has: function (key) { 11283 return listHas($o, key); 11284 }, 11285 set: function (key, value) { 11286 if (!$o) { 11287 // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head 11288 $o = { 11289 next: void undefined 11290 }; 11291 } 11292 // eslint-disable-next-line no-extra-parens 11293 listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value); 11294 } 11295 }; 11296 // @ts-expect-error TODO: figure out why this is erroring 11297 return channel; 11298}; 11299 11300},{"es-errors/type":89,"object-inspect":130}],133:[function(require,module,exports){ 11301'use strict'; 11302 11303var GetIntrinsic = require('get-intrinsic'); 11304var callBound = require('call-bound'); 11305var inspect = require('object-inspect'); 11306 11307var $TypeError = require('es-errors/type'); 11308var $Map = GetIntrinsic('%Map%', true); 11309 11310/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */ 11311var $mapGet = callBound('Map.prototype.get', true); 11312/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */ 11313var $mapSet = callBound('Map.prototype.set', true); 11314/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 11315var $mapHas = callBound('Map.prototype.has', true); 11316/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 11317var $mapDelete = callBound('Map.prototype.delete', true); 11318/** @type {<K, V>(thisArg: Map<K, V>) => number} */ 11319var $mapSize = callBound('Map.prototype.size', true); 11320 11321/** @type {import('.')} */ 11322module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() { 11323 /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */ 11324 /** @typedef {Parameters<Channel['get']>[0]} K */ 11325 /** @typedef {Parameters<Channel['set']>[1]} V */ 11326 11327 /** @type {Map<K, V> | undefined} */ var $m; 11328 11329 /** @type {Channel} */ 11330 var channel = { 11331 assert: function (key) { 11332 if (!channel.has(key)) { 11333 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11334 } 11335 }, 11336 'delete': function (key) { 11337 if ($m) { 11338 var result = $mapDelete($m, key); 11339 if ($mapSize($m) === 0) { 11340 $m = void undefined; 11341 } 11342 return result; 11343 } 11344 return false; 11345 }, 11346 get: function (key) { // eslint-disable-line consistent-return 11347 if ($m) { 11348 return $mapGet($m, key); 11349 } 11350 }, 11351 has: function (key) { 11352 if ($m) { 11353 return $mapHas($m, key); 11354 } 11355 return false; 11356 }, 11357 set: function (key, value) { 11358 if (!$m) { 11359 // @ts-expect-error TS can't handle narrowing a variable inside a closure 11360 $m = new $Map(); 11361 } 11362 $mapSet($m, key, value); 11363 } 11364 }; 11365 11366 // @ts-expect-error TODO: figure out why TS is erroring here 11367 return channel; 11368}; 11369 11370},{"call-bound":81,"es-errors/type":89,"get-intrinsic":94,"object-inspect":130}],134:[function(require,module,exports){ 11371'use strict'; 11372 11373var GetIntrinsic = require('get-intrinsic'); 11374var callBound = require('call-bound'); 11375var inspect = require('object-inspect'); 11376var getSideChannelMap = require('side-channel-map'); 11377 11378var $TypeError = require('es-errors/type'); 11379var $WeakMap = GetIntrinsic('%WeakMap%', true); 11380 11381/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */ 11382var $weakMapGet = callBound('WeakMap.prototype.get', true); 11383/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */ 11384var $weakMapSet = callBound('WeakMap.prototype.set', true); 11385/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 11386var $weakMapHas = callBound('WeakMap.prototype.has', true); 11387/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 11388var $weakMapDelete = callBound('WeakMap.prototype.delete', true); 11389 11390/** @type {import('.')} */ 11391module.exports = $WeakMap 11392 ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() { 11393 /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */ 11394 /** @typedef {Parameters<Channel['get']>[0]} K */ 11395 /** @typedef {Parameters<Channel['set']>[1]} V */ 11396 11397 /** @type {WeakMap<K & object, V> | undefined} */ var $wm; 11398 /** @type {Channel | undefined} */ var $m; 11399 11400 /** @type {Channel} */ 11401 var channel = { 11402 assert: function (key) { 11403 if (!channel.has(key)) { 11404 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11405 } 11406 }, 11407 'delete': function (key) { 11408 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11409 if ($wm) { 11410 return $weakMapDelete($wm, key); 11411 } 11412 } else if (getSideChannelMap) { 11413 if ($m) { 11414 return $m['delete'](key); 11415 } 11416 } 11417 return false; 11418 }, 11419 get: function (key) { 11420 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11421 if ($wm) { 11422 return $weakMapGet($wm, key); 11423 } 11424 } 11425 return $m && $m.get(key); 11426 }, 11427 has: function (key) { 11428 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11429 if ($wm) { 11430 return $weakMapHas($wm, key); 11431 } 11432 } 11433 return !!$m && $m.has(key); 11434 }, 11435 set: function (key, value) { 11436 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11437 if (!$wm) { 11438 $wm = new $WeakMap(); 11439 } 11440 $weakMapSet($wm, key, value); 11441 } else if (getSideChannelMap) { 11442 if (!$m) { 11443 $m = getSideChannelMap(); 11444 } 11445 // eslint-disable-next-line no-extra-parens 11446 /** @type {NonNullable<typeof $m>} */ ($m).set(key, value); 11447 } 11448 } 11449 }; 11450 11451 // @ts-expect-error TODO: figure out why this is erroring 11452 return channel; 11453 } 11454 : getSideChannelMap; 11455 11456},{"call-bound":81,"es-errors/type":89,"get-intrinsic":94,"object-inspect":130,"side-channel-map":133}],135:[function(require,module,exports){ 11457'use strict'; 11458 11459var $TypeError = require('es-errors/type'); 11460var inspect = require('object-inspect'); 11461var getSideChannelList = require('side-channel-list'); 11462var getSideChannelMap = require('side-channel-map'); 11463var getSideChannelWeakMap = require('side-channel-weakmap'); 11464 11465var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; 11466 11467/** @type {import('.')} */ 11468module.exports = function getSideChannel() { 11469 /** @typedef {ReturnType<typeof getSideChannel>} Channel */ 11470 11471 /** @type {Channel | undefined} */ var $channelData; 11472 11473 /** @type {Channel} */ 11474 var channel = { 11475 assert: function (key) { 11476 if (!channel.has(key)) { 11477 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11478 } 11479 }, 11480 'delete': function (key) { 11481 return !!$channelData && $channelData['delete'](key); 11482 }, 11483 get: function (key) { 11484 return $channelData && $channelData.get(key); 11485 }, 11486 has: function (key) { 11487 return !!$channelData && $channelData.has(key); 11488 }, 11489 set: function (key, value) { 11490 if (!$channelData) { 11491 $channelData = makeChannel(); 11492 } 11493 11494 $channelData.set(key, value); 11495 } 11496 }; 11497 // @ts-expect-error TODO: figure out why this is erroring 11498 return channel; 11499}; 11500 11501},{"es-errors/type":89,"object-inspect":130,"side-channel-list":132,"side-channel-map":133,"side-channel-weakmap":134}],136:[function(require,module,exports){ 11502'use strict'; 11503 11504var replace = String.prototype.replace; 11505var percentTwenties = /%20/g; 11506 11507var Format = { 11508 RFC1738: 'RFC1738', 11509 RFC3986: 'RFC3986'
vendor: 11,115 bytes, lines 11510-11850
11510}; 11511 11512module.exports = { 11513 'default': Format.RFC3986, 11514 formatters: { 11515 RFC1738: function (value) { 11516 return replace.call(value, percentTwenties, '+'); 11517 }, 11518 RFC3986: function (value) { 11519 return String(value); 11520 } 11521 }, 11522 RFC1738: Format.RFC1738, 11523 RFC3986: Format.RFC3986 11524}; 11525 11526},{}],137:[function(require,module,exports){ 11527'use strict'; 11528 11529var stringify = require('./stringify'); 11530var parse = require('./parse'); 11531var formats = require('./formats'); 11532 11533module.exports = { 11534 formats: formats, 11535 parse: parse, 11536 stringify: stringify 11537}; 11538 11539},{"./formats":136,"./parse":138,"./stringify":139}],138:[function(require,module,exports){ 11540'use strict'; 11541 11542var utils = require('./utils'); 11543 11544var has = Object.prototype.hasOwnProperty; 11545var isArray = Array.isArray; 11546 11547var defaults = { 11548 allowDots: false, 11549 allowEmptyArrays: false, 11550 allowPrototypes: false, 11551 allowSparse: false, 11552 arrayLimit: 20, 11553 charset: 'utf-8', 11554 charsetSentinel: false, 11555 comma: false, 11556 decodeDotInKeys: false, 11557 decoder: utils.decode, 11558 delimiter: '&', 11559 depth: 5, 11560 duplicates: 'combine', 11561 ignoreQueryPrefix: false, 11562 interpretNumericEntities: false, 11563 parameterLimit: 1000, 11564 parseArrays: true, 11565 plainObjects: false, 11566 strictDepth: false, 11567 strictNullHandling: false, 11568 throwOnLimitExceeded: false 11569}; 11570 11571var interpretNumericEntities = function (str) { 11572 return str.replace(/&#(\d+);/g, function ($0, numberStr) { 11573 return String.fromCharCode(parseInt(numberStr, 10)); 11574 }); 11575}; 11576 11577var parseArrayValue = function (val, options, currentArrayLength) { 11578 if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { 11579 return val.split(','); 11580 } 11581 11582 if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { 11583 throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); 11584 } 11585 11586 return val; 11587}; 11588 11589// This is what browsers will submit when the â character occurs in an 11590// application/x-www-form-urlencoded body and the encoding of the page containing 11591// the form is iso-8859-1, or when the submitted form has an accept-charset 11592// attribute of iso-8859-1. Presumably also with other charsets that do not contain 11593// the â character, such as us-ascii. 11594var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') 11595 11596// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. 11597var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('â') 11598 11599var parseValues = function parseQueryStringValues(str, options) { 11600 var obj = { __proto__: null }; 11601 11602 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 11603 cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); 11604 11605 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 11606 var parts = cleanStr.split( 11607 options.delimiter, 11608 options.throwOnLimitExceeded ? limit + 1 : limit 11609 ); 11610 11611 if (options.throwOnLimitExceeded && parts.length > limit) { 11612 throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); 11613 } 11614 11615 var skipIndex = -1; // Keep track of where the utf8 sentinel was found 11616 var i; 11617 11618 var charset = options.charset; 11619 if (options.charsetSentinel) { 11620 for (i = 0; i < parts.length; ++i) { 11621 if (parts[i].indexOf('utf8=') === 0) { 11622 if (parts[i] === charsetSentinel) { 11623 charset = 'utf-8'; 11624 } else if (parts[i] === isoSentinel) { 11625 charset = 'iso-8859-1'; 11626 } 11627 skipIndex = i; 11628 i = parts.length; // The eslint settings do not allow break; 11629 } 11630 } 11631 } 11632 11633 for (i = 0; i < parts.length; ++i) { 11634 if (i === skipIndex) { 11635 continue; 11636 } 11637 var part = parts[i]; 11638 11639 var bracketEqualsPos = part.indexOf(']='); 11640 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; 11641 11642 var key; 11643 var val; 11644 if (pos === -1) { 11645 key = options.decoder(part, defaults.decoder, charset, 'key'); 11646 val = options.strictNullHandling ? null : ''; 11647 } else { 11648 key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); 11649 11650 if (key !== null) { 11651 val = utils.maybeMap( 11652 parseArrayValue( 11653 part.slice(pos + 1), 11654 options, 11655 isArray(obj[key]) ? obj[key].length : 0 11656 ), 11657 function (encodedVal) { 11658 return options.decoder(encodedVal, defaults.decoder, charset, 'value'); 11659 } 11660 ); 11661 } 11662 } 11663 11664 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { 11665 val = interpretNumericEntities(String(val)); 11666 } 11667 11668 if (part.indexOf('[]=') > -1) { 11669 val = isArray(val) ? [val] : val; 11670 } 11671 11672 if (key !== null) { 11673 var existing = has.call(obj, key); 11674 if (existing && options.duplicates === 'combine') { 11675 obj[key] = utils.combine( 11676 obj[key], 11677 val, 11678 options.arrayLimit, 11679 options.plainObjects 11680 ); 11681 } else if (!existing || options.duplicates === 'last') { 11682 obj[key] = val; 11683 } 11684 } 11685 } 11686 11687 return obj; 11688}; 11689 11690var parseObject = function (chain, val, options, valuesParsed) { 11691 var currentArrayLength = 0; 11692 if (chain.length > 0 && chain[chain.length - 1] === '[]') { 11693 var parentKey = chain.slice(0, -1).join(''); 11694 currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; 11695 } 11696 11697 var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); 11698 11699 for (var i = chain.length - 1; i >= 0; --i) { 11700 var obj; 11701 var root = chain[i]; 11702 11703 if (root === '[]' && options.parseArrays) { 11704 if (utils.isOverflow(leaf)) { 11705 // leaf is already an overflow object, preserve it 11706 obj = leaf; 11707 } else { 11708 obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) 11709 ? [] 11710 : utils.combine( 11711 [], 11712 leaf, 11713 options.arrayLimit, 11714 options.plainObjects 11715 ); 11716 } 11717 } else { 11718 obj = options.plainObjects ? { __proto__: null } : {}; 11719 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; 11720 var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; 11721 var index = parseInt(decodedRoot, 10); 11722 if (!options.parseArrays && decodedRoot === '') { 11723 obj = { 0: leaf }; 11724 } else if ( 11725 !isNaN(index) 11726 && root !== decodedRoot 11727 && String(index) === decodedRoot 11728 && index >= 0 11729 && (options.parseArrays && index <= options.arrayLimit) 11730 ) { 11731 obj = []; 11732 obj[index] = leaf; 11733 } else if (decodedRoot !== '__proto__') { 11734 obj[decodedRoot] = leaf; 11735 } 11736 } 11737 11738 leaf = obj; 11739 } 11740 11741 return leaf; 11742}; 11743 11744var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) { 11745 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; 11746 11747 if (options.depth <= 0) { 11748 if (!options.plainObjects && has.call(Object.prototype, key)) { 11749 if (!options.allowPrototypes) { 11750 return; 11751 } 11752 } 11753 11754 return [key]; 11755 } 11756 11757 var brackets = /(\[[^[\]]*])/; 11758 var child = /(\[[^[\]]*])/g; 11759 11760 var segment = brackets.exec(key); 11761 var parent = segment ? key.slice(0, segment.index) : key; 11762 11763 var keys = []; 11764 11765 if (parent) { 11766 if (!options.plainObjects && has.call(Object.prototype, parent)) { 11767 if (!options.allowPrototypes) { 11768 return; 11769 } 11770 } 11771 11772 keys.push(parent); 11773 } 11774 11775 var i = 0; 11776 while ((segment = child.exec(key)) !== null && i < options.depth) { 11777 i += 1; 11778 11779 var segmentContent = segment[1].slice(1, -1); 11780 if (!options.plainObjects && has.call(Object.prototype, segmentContent)) { 11781 if (!options.allowPrototypes) { 11782 return; 11783 } 11784 } 11785 11786 keys.push(segment[1]); 11787 } 11788 11789 if (segment) { 11790 if (options.strictDepth === true) { 11791 throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); 11792 } 11793 11794 keys.push('[' + key.slice(segment.index) + ']'); 11795 } 11796 11797 return keys; 11798}; 11799 11800var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { 11801 if (!givenKey) { 11802 return; 11803 } 11804 11805 var keys = splitKeyIntoSegments(givenKey, options); 11806 11807 if (!keys) { 11808 return; 11809 } 11810 11811 return parseObject(keys, val, options, valuesParsed); 11812}; 11813 11814var normalizeParseOptions = function normalizeParseOptions(opts) { 11815 if (!opts) { 11816 return defaults; 11817 } 11818 11819 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 11820 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 11821 } 11822 11823 if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { 11824 throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); 11825 } 11826 11827 if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { 11828 throw new TypeError('Decoder has to be a function.'); 11829 } 11830 11831 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 11832 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 11833 } 11834 11835 if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { 11836 throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); 11837 } 11838 11839 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; 11840 11841 var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; 11842 11843 if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { 11844 throw new TypeError('The duplicates option must be either combine, first, or last'); 11845 } 11846 11847 var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 11848 11849 return { 11850 allowDots: allowDots,
vendor: 3,003 bytes, lines 11851-11906
11851 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 11852 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, 11853 allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, 11854 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, 11855 charset: charset, 11856 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 11857 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, 11858 decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, 11859 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, 11860 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, 11861 // eslint-disable-next-line no-implicit-coercion, no-extra-parens 11862 depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, 11863 duplicates: duplicates, 11864 ignoreQueryPrefix: opts.ignoreQueryPrefix === true, 11865 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, 11866 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, 11867 parseArrays: opts.parseArrays !== false, 11868 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, 11869 strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, 11870 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, 11871 throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false 11872 }; 11873}; 11874 11875module.exports = function (str, opts) { 11876 var options = normalizeParseOptions(opts); 11877 11878 if (str === '' || str === null || typeof str === 'undefined') { 11879 return options.plainObjects ? { __proto__: null } : {}; 11880 } 11881 11882 var tempObj = typeof str === 'string' ? parseValues(str, options) : str; 11883 var obj = options.plainObjects ? { __proto__: null } : {}; 11884 11885 // Iterate over the keys and setup the new object 11886 11887 var keys = Object.keys(tempObj); 11888 for (var i = 0; i < keys.length; ++i) { 11889 var key = keys[i]; 11890 var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); 11891 obj = utils.merge(obj, newObj, options); 11892 } 11893 11894 if (options.allowSparse === true) { 11895 return obj; 11896 } 11897 11898 return utils.compact(obj); 11899}; 11900 11901},{"./utils":140}],139:[function(require,module,exports){ 11902'use strict'; 11903 11904var getSideChannel = require('side-channel'); 11905var utils = require('./utils'); 11906var formats = require('./formats'
vendor: 11,350 bytes, lines 11906-12258
11906); 11907var has = Object.prototype.hasOwnProperty; 11908 11909var arrayPrefixGenerators = { 11910 brackets: function brackets(prefix) { 11911 return prefix + '[]'; 11912 }, 11913 comma: 'comma', 11914 indices: function indices(prefix, key) { 11915 return prefix + '[' + key + ']'; 11916 }, 11917 repeat: function repeat(prefix) { 11918 return prefix; 11919 } 11920}; 11921 11922var isArray = Array.isArray; 11923var push = Array.prototype.push; 11924var pushToArray = function (arr, valueOrArray) { 11925 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 11926}; 11927 11928var toISO = Date.prototype.toISOString; 11929 11930var defaultFormat = formats['default']; 11931var defaults = { 11932 addQueryPrefix: false, 11933 allowDots: false, 11934 allowEmptyArrays: false, 11935 arrayFormat: 'indices', 11936 charset: 'utf-8', 11937 charsetSentinel: false, 11938 commaRoundTrip: false, 11939 delimiter: '&', 11940 encode: true, 11941 encodeDotInKeys: false, 11942 encoder: utils.encode, 11943 encodeValuesOnly: false, 11944 filter: void undefined, 11945 format: defaultFormat, 11946 formatter: formats.formatters[defaultFormat], 11947 // deprecated 11948 indices: false, 11949 serializeDate: function serializeDate(date) { 11950 return toISO.call(date); 11951 }, 11952 skipNulls: false, 11953 strictNullHandling: false 11954}; 11955 11956var isNonNullishPrimitive = function isNonNullishPrimitive(v) { 11957 return typeof v === 'string' 11958 || typeof v === 'number' 11959 || typeof v === 'boolean' 11960 || typeof v === 'symbol' 11961 || typeof v === 'bigint'; 11962}; 11963 11964var sentinel = {}; 11965 11966var stringify = function stringify( 11967 object, 11968 prefix, 11969 generateArrayPrefix, 11970 commaRoundTrip, 11971 allowEmptyArrays, 11972 strictNullHandling, 11973 skipNulls, 11974 encodeDotInKeys, 11975 encoder, 11976 filter, 11977 sort, 11978 allowDots, 11979 serializeDate, 11980 format, 11981 formatter, 11982 encodeValuesOnly, 11983 charset, 11984 sideChannel 11985) { 11986 var obj = object; 11987 11988 var tmpSc = sideChannel; 11989 var step = 0; 11990 var findFlag = false; 11991 while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { 11992 // Where object last appeared in the ref tree 11993 var pos = tmpSc.get(object); 11994 step += 1; 11995 if (typeof pos !== 'undefined') { 11996 if (pos === step) { 11997 throw new RangeError('Cyclic object value'); 11998 } else { 11999 findFlag = true; // Break while 12000 } 12001 } 12002 if (typeof tmpSc.get(sentinel) === 'undefined') { 12003 step = 0; 12004 } 12005 } 12006 12007 if (typeof filter === 'function') { 12008 obj = filter(prefix, obj); 12009 } else if (obj instanceof Date) { 12010 obj = serializeDate(obj); 12011 } else if (generateArrayPrefix === 'comma' && isArray(obj)) { 12012 obj = utils.maybeMap(obj, function (value) { 12013 if (value instanceof Date) { 12014 return serializeDate(value); 12015 } 12016 return value; 12017 }); 12018 } 12019 12020 if (obj === null) { 12021 if (strictNullHandling) { 12022 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; 12023 } 12024 12025 obj = ''; 12026 } 12027 12028 if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { 12029 if (encoder) { 12030 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); 12031 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; 12032 } 12033 return [formatter(prefix) + '=' + formatter(String(obj))]; 12034 } 12035 12036 var values = []; 12037 12038 if (typeof obj === 'undefined') { 12039 return values; 12040 } 12041 12042 var objKeys; 12043 if (generateArrayPrefix === 'comma' && isArray(obj)) { 12044 // we need to join elements in 12045 if (encodeValuesOnly && encoder) { 12046 obj = utils.maybeMap(obj, encoder); 12047 } 12048 objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; 12049 } else if (isArray(filter)) { 12050 objKeys = filter; 12051 } else { 12052 var keys = Object.keys(obj); 12053 objKeys = sort ? keys.sort(sort) : keys; 12054 } 12055 12056 var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); 12057 12058 var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; 12059 12060 if (allowEmptyArrays && isArray(obj) && obj.length === 0) { 12061 return adjustedPrefix + '[]'; 12062 } 12063 12064 for (var j = 0; j < objKeys.length; ++j) { 12065 var key = objKeys[j]; 12066 var value = typeof key === 'object' && key && typeof key.value !== 'undefined' 12067 ? key.value 12068 : obj[key]; 12069 12070 if (skipNulls && value === null) { 12071 continue; 12072 } 12073 12074 var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); 12075 var keyPrefix = isArray(obj) 12076 ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix 12077 : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); 12078 12079 sideChannel.set(object, step); 12080 var valueSideChannel = getSideChannel(); 12081 valueSideChannel.set(sentinel, sideChannel); 12082 pushToArray(values, stringify( 12083 value, 12084 keyPrefix, 12085 generateArrayPrefix, 12086 commaRoundTrip, 12087 allowEmptyArrays, 12088 strictNullHandling, 12089 skipNulls, 12090 encodeDotInKeys, 12091 generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, 12092 filter, 12093 sort, 12094 allowDots, 12095 serializeDate, 12096 format, 12097 formatter, 12098 encodeValuesOnly, 12099 charset, 12100 valueSideChannel 12101 )); 12102 } 12103 12104 return values; 12105}; 12106 12107var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { 12108 if (!opts) { 12109 return defaults; 12110 } 12111 12112 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 12113 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 12114 } 12115 12116 if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { 12117 throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); 12118 } 12119 12120 if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { 12121 throw new TypeError('Encoder has to be a function.'); 12122 } 12123 12124 var charset = opts.charset || defaults.charset; 12125 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 12126 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 12127 } 12128 12129 var format = formats['default']; 12130 if (typeof opts.format !== 'undefined') { 12131 if (!has.call(formats.formatters, opts.format)) { 12132 throw new TypeError('Unknown format option provided.'); 12133 } 12134 format = opts.format; 12135 } 12136 var formatter = formats.formatters[format]; 12137 12138 var filter = defaults.filter; 12139 if (typeof opts.filter === 'function' || isArray(opts.filter)) { 12140 filter = opts.filter; 12141 } 12142 12143 var arrayFormat; 12144 if (opts.arrayFormat in arrayPrefixGenerators) { 12145 arrayFormat = opts.arrayFormat; 12146 } else if ('indices' in opts) { 12147 arrayFormat = opts.indices ? 'indices' : 'repeat'; 12148 } else { 12149 arrayFormat = defaults.arrayFormat; 12150 } 12151 12152 if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { 12153 throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); 12154 } 12155 12156 var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 12157 12158 return { 12159 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, 12160 allowDots: allowDots, 12161 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 12162 arrayFormat: arrayFormat, 12163 charset: charset, 12164 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 12165 commaRoundTrip: !!opts.commaRoundTrip, 12166 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, 12167 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, 12168 encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, 12169 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, 12170 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, 12171 filter: filter, 12172 format: format, 12173 formatter: formatter, 12174 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, 12175 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, 12176 sort: typeof opts.sort === 'function' ? opts.sort : null, 12177 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling 12178 }; 12179}; 12180 12181module.exports = function (object, opts) { 12182 var obj = object; 12183 var options = normalizeStringifyOptions(opts); 12184 12185 var objKeys; 12186 var filter; 12187 12188 if (typeof options.filter === 'function') { 12189 filter = options.filter; 12190 obj = filter('', obj); 12191 } else if (isArray(options.filter)) { 12192 filter = options.filter; 12193 objKeys = filter; 12194 } 12195 12196 var keys = []; 12197 12198 if (typeof obj !== 'object' || obj === null) { 12199 return ''; 12200 } 12201 12202 var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; 12203 var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; 12204 12205 if (!objKeys) { 12206 objKeys = Object.keys(obj); 12207 } 12208 12209 if (options.sort) { 12210 objKeys.sort(options.sort); 12211 } 12212 12213 var sideChannel = getSideChannel(); 12214 for (var i = 0; i < objKeys.length; ++i) { 12215 var key = objKeys[i]; 12216 var value = obj[key]; 12217 12218 if (options.skipNulls && value === null) { 12219 continue; 12220 } 12221 pushToArray(keys, stringify( 12222 value, 12223 key, 12224 generateArrayPrefix, 12225 commaRoundTrip, 12226 options.allowEmptyArrays, 12227 options.strictNullHandling, 12228 options.skipNulls, 12229 options.encodeDotInKeys, 12230 options.encode ? options.encoder : null, 12231 options.filter, 12232 options.sort, 12233 options.allowDots, 12234 options.serializeDate, 12235 options.format, 12236 options.formatter, 12237 options.encodeValuesOnly, 12238 options.charset, 12239 sideChannel 12240 )); 12241 } 12242 12243 var joined = keys.join(options.delimiter); 12244 var prefix = options.addQueryPrefix === true ? '?' : ''; 12245 12246 if (options.charsetSentinel) { 12247 if (options.charset === 'iso-8859-1') { 12248 // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark 12249 prefix += 'utf8=%26%2310003%3B&'; 12250 } else { 12251 // encodeURIComponent('â') 12252 prefix += 'utf8=%E2%9C%93&'; 12253 } 12254 } 12255 12256 return joined.length > 0 ? prefix + joined : ''; 12257}; 12258
12259},{"./formats":136,"./utils":140,"side-channel":135}],140:[function(require,module,exports){ 12260'use strict'; 12261 12262var formats = require('./formats'); 12263var getSideChannel = require('side-channel'); 12264 12265var has = Object.prototype.hasOwnProperty; 12266var isArray = Array.isArray; 12267 12268// Track objects created from arrayLimit overflow using side-channel 12269// Stores the current max numeric index for O(1) lookup 12270var overflowChannel = getSideChannel(); 12271 12272var markOverflow = function markOverflow(obj, maxIndex) { 12273 overflowChannel.set(obj, maxIndex); 12274 return obj; 12275}; 12276 12277var isOverflow = function isOverflow(obj) { 12278 return overflowChannel.has(obj); 12279}; 12280 12281var getMaxIndex = function getMaxIndex(obj) { 12282 return overflowChannel.get(obj); 12283}; 12284 12285var setMaxIndex = function setMaxIndex(obj, maxIndex) { 12286 overflowChannel.set(obj, maxIndex); 12287}; 12288 12289var hexTable = (function () { 12290 var array = []; 12291 for (var i = 0; i < 256; ++i) { 12292 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); 12293 } 12294 12295 return array; 12296}()); 12297
vendor: 4,308 bytes, lines 12298-12438
12298var compactQueue = function compactQueue(queue) { 12299 while (queue.length > 1) { 12300 var item = queue.pop(); 12301 var obj = item.obj[item.prop]; 12302 12303 if (isArray(obj)) { 12304 var compacted = []; 12305 12306 for (var j = 0; j < obj.length; ++j) { 12307 if (typeof obj[j] !== 'undefined') { 12308 compacted.push(obj[j]); 12309 } 12310 } 12311 12312 item.obj[item.prop] = compacted; 12313 } 12314 } 12315}; 12316 12317var arrayToObject = function arrayToObject(source, options) { 12318 var obj = options && options.plainObjects ? { __proto__: null } : {}; 12319 for (var i = 0; i < source.length; ++i) { 12320 if (typeof source[i] !== 'undefined') { 12321 obj[i] = source[i]; 12322 } 12323 } 12324 12325 return obj; 12326}; 12327 12328var merge = function merge(target, source, options) { 12329 /* eslint no-param-reassign: 0 */ 12330 if (!source) { 12331 return target; 12332 } 12333 12334 if (typeof source !== 'object' && typeof source !== 'function') { 12335 if (isArray(target)) { 12336 target.push(source); 12337 } else if (target && typeof target === 'object') { 12338 if (isOverflow(target)) { 12339 // Add at next numeric index for overflow objects 12340 var newIndex = getMaxIndex(target) + 1; 12341 target[newIndex] = source; 12342 setMaxIndex(target, newIndex); 12343 } else if ( 12344 (options && (options.plainObjects || options.allowPrototypes)) 12345 || !has.call(Object.prototype, source) 12346 ) { 12347 target[source] = true; 12348 } 12349 } else { 12350 return [target, source]; 12351 } 12352 12353 return target; 12354 } 12355 12356 if (!target || typeof target !== 'object') { 12357 if (isOverflow(source)) { 12358 // Create new object with target at 0, source values shifted by 1 12359 var sourceKeys = Object.keys(source); 12360 var result = options && options.plainObjects 12361 ? { __proto__: null, 0: target } 12362 : { 0: target }; 12363 for (var m = 0; m < sourceKeys.length; m++) { 12364 var oldKey = parseInt(sourceKeys[m], 10); 12365 result[oldKey + 1] = source[sourceKeys[m]]; 12366 } 12367 return markOverflow(result, getMaxIndex(source) + 1); 12368 } 12369 return [target].concat(source); 12370 } 12371 12372 var mergeTarget = target; 12373 if (isArray(target) && !isArray(source)) { 12374 mergeTarget = arrayToObject(target, options); 12375 } 12376 12377 if (isArray(target) && isArray(source)) { 12378 source.forEach(function (item, i) { 12379 if (has.call(target, i)) { 12380 var targetItem = target[i]; 12381 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { 12382 target[i] = merge(targetItem, item, options); 12383 } else { 12384 target.push(item); 12385 } 12386 } else { 12387 target[i] = item; 12388 } 12389 }); 12390 return target; 12391 } 12392 12393 return Object.keys(source).reduce(function (acc, key) { 12394 var value = source[key]; 12395 12396 if (has.call(acc, key)) { 12397 acc[key] = merge(acc[key], value, options); 12398 } else { 12399 acc[key] = value; 12400 } 12401 return acc; 12402 }, mergeTarget); 12403}; 12404 12405var assign = function assignSingleSource(target, source) { 12406 return Object.keys(source).reduce(function (acc, key) { 12407 acc[key] = source[key]; 12408 return acc; 12409 }, target); 12410}; 12411 12412var decode = function (str, defaultDecoder, charset) { 12413 var strWithoutPlus = str.replace(/\+/g, ' '); 12414 if (charset === 'iso-8859-1') { 12415 // unescape never throws, no try...catch needed: 12416 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); 12417 } 12418 // utf-8 12419 try { 12420 return decodeURIComponent(strWithoutPlus); 12421 } catch (e) { 12422 return strWithoutPlus; 12423 } 12424}; 12425 12426var limit = 1024; 12427 12428/* eslint operator-linebreak: [2, "before"] */ 12429 12430var encode = function encode(str, defaultEncoder, charset, kind, format) { 12431 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 12432 // It has been adapted here for stricter adherence to RFC 3986 12433 if (str.length === 0) { 12434 return str; 12435 } 12436 12437 var string = str; 12438 if (typeof str === 'symbol') {
vendor: 4,022 bytes, lines 12439-12581
12439 string = Symbol.prototype.toString.call(str); 12440 } else if (typeof str !== 'string') { 12441 string = String(str); 12442 } 12443 12444 if (charset === 'iso-8859-1') { 12445 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { 12446 return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; 12447 }); 12448 } 12449 12450 var out = ''; 12451 for (var j = 0; j < string.length; j += limit) { 12452 var segment = string.length >= limit ? string.slice(j, j + limit) : string; 12453 var arr = []; 12454 12455 for (var i = 0; i < segment.length; ++i) { 12456 var c = segment.charCodeAt(i); 12457 if ( 12458 c === 0x2D // - 12459 || c === 0x2E // . 12460 || c === 0x5F // _ 12461 || c === 0x7E // ~ 12462 || (c >= 0x30 && c <= 0x39) // 0-9 12463 || (c >= 0x41 && c <= 0x5A) // a-z 12464 || (c >= 0x61 && c <= 0x7A) // A-Z 12465 || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) 12466 ) { 12467 arr[arr.length] = segment.charAt(i); 12468 continue; 12469 } 12470 12471 if (c < 0x80) { 12472 arr[arr.length] = hexTable[c]; 12473 continue; 12474 } 12475 12476 if (c < 0x800) { 12477 arr[arr.length] = hexTable[0xC0 | (c >> 6)] 12478 + hexTable[0x80 | (c & 0x3F)]; 12479 continue; 12480 } 12481 12482 if (c < 0xD800 || c >= 0xE000) { 12483 arr[arr.length] = hexTable[0xE0 | (c >> 12)] 12484 + hexTable[0x80 | ((c >> 6) & 0x3F)] 12485 + hexTable[0x80 | (c & 0x3F)]; 12486 continue; 12487 } 12488 12489 i += 1; 12490 c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); 12491 12492 arr[arr.length] = hexTable[0xF0 | (c >> 18)] 12493 + hexTable[0x80 | ((c >> 12) & 0x3F)] 12494 + hexTable[0x80 | ((c >> 6) & 0x3F)] 12495 + hexTable[0x80 | (c & 0x3F)]; 12496 } 12497 12498 out += arr.join(''); 12499 } 12500 12501 return out; 12502}; 12503 12504var compact = function compact(value) { 12505 var queue = [{ obj: { o: value }, prop: 'o' }]; 12506 var refs = []; 12507 12508 for (var i = 0; i < queue.length; ++i) { 12509 var item = queue[i]; 12510 var obj = item.obj[item.prop]; 12511 12512 var keys = Object.keys(obj); 12513 for (var j = 0; j < keys.length; ++j) { 12514 var key = keys[j]; 12515 var val = obj[key]; 12516 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { 12517 queue.push({ obj: obj, prop: key }); 12518 refs.push(val); 12519 } 12520 } 12521 } 12522 12523 compactQueue(queue); 12524 12525 return value; 12526}; 12527 12528var isRegExp = function isRegExp(obj) { 12529 return Object.prototype.toString.call(obj) === '[object RegExp]'; 12530}; 12531 12532var isBuffer = function isBuffer(obj) { 12533 if (!obj || typeof obj !== 'object') { 12534 return false; 12535 } 12536 12537 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 12538}; 12539 12540var combine = function combine(a, b, arrayLimit, plainObjects) { 12541 // If 'a' is already an overflow object, add to it 12542 if (isOverflow(a)) { 12543 var newIndex = getMaxIndex(a) + 1; 12544 a[newIndex] = b; 12545 setMaxIndex(a, newIndex); 12546 return a; 12547 } 12548 12549 var result = [].concat(a, b); 12550 if (result.length > arrayLimit) { 12551 return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); 12552 } 12553 return result; 12554}; 12555 12556var maybeMap = function maybeMap(val, fn) { 12557 if (isArray(val)) { 12558 var mapped = []; 12559 for (var i = 0; i < val.length; i += 1) { 12560 mapped.push(fn(val[i])); 12561 } 12562 return mapped; 12563 } 12564 return fn(val); 12565}; 12566 12567module.exports = { 12568 arrayToObject: arrayToObject, 12569 assign: assign, 12570 combine: combine, 12571 compact: compact, 12572 decode: decode, 12573 encode: encode, 12574 isBuffer: isBuffer, 12575 isOverflow: isOverflow, 12576 isRegExp: isRegExp, 12577 maybeMap: maybeMap, 12578 merge: merge 12579}; 12580 12581},{"./formats":136,"side-channel":135}],141
vendor: 23,586 bytes, lines 12581-13359
12581:[function(require,module,exports){ 12582/* 12583 * Copyright Joyent, Inc. and other Node contributors. 12584 * 12585 * Permission is hereby granted, free of charge, to any person obtaining a 12586 * copy of this software and associated documentation files (the 12587 * "Software"), to deal in the Software without restriction, including 12588 * without limitation the rights to use, copy, modify, merge, publish, 12589 * distribute, sublicense, and/or sell copies of the Software, and to permit 12590 * persons to whom the Software is furnished to do so, subject to the 12591 * following conditions: 12592 * 12593 * The above copyright notice and this permission notice shall be included 12594 * in all copies or substantial portions of the Software. 12595 * 12596 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 12597 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 12598 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 12599 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 12600 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 12601 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 12602 * USE OR OTHER DEALINGS IN THE SOFTWARE. 12603 */ 12604 12605'use strict'; 12606 12607var punycode = require('punycode/'); 12608 12609function Url() { 12610 this.protocol = null; 12611 this.slashes = null; 12612 this.auth = null; 12613 this.host = null; 12614 this.port = null; 12615 this.hostname = null; 12616 this.hash = null; 12617 this.search = null; 12618 this.query = null; 12619 this.pathname = null; 12620 this.path = null; 12621 this.href = null; 12622} 12623 12624// Reference: RFC 3986, RFC 1808, RFC 2396 12625 12626/* 12627 * define these here so at least they only have to be 12628 * compiled once on the first module load. 12629 */ 12630var protocolPattern = /^([a-z0-9.+-]+:)/i, 12631 portPattern = /:[0-9]*$/, 12632 12633 // Special case for a simple path URL 12634 simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, 12635 12636 /* 12637 * RFC 2396: characters reserved for delimiting URLs. 12638 * We actually just auto-escape these. 12639 */ 12640 delims = [ 12641 '<', '>', '"', '`', ' ', '\r', '\n', '\t' 12642 ], 12643 12644 // RFC 2396: characters not allowed for various reasons. 12645 unwise = [ 12646 '{', '}', '|', '\\', '^', '`' 12647 ].concat(delims), 12648 12649 // Allowed by RFCs, but cause of XSS attacks. Always escape these. 12650 autoEscape = ['\''].concat(unwise), 12651 /* 12652 * Characters that are never ever allowed in a hostname. 12653 * Note that any invalid chars are also handled, but these 12654 * are the ones that are *expected* to be seen, so we fast-path 12655 * them. 12656 */ 12657 nonHostChars = [ 12658 '%', '/', '?', ';', '#' 12659 ].concat(autoEscape), 12660 hostEndingChars = [ 12661 '/', '?', '#' 12662 ], 12663 hostnameMaxLen = 255, 12664 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, 12665 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, 12666 // protocols that can allow "unsafe" and "unwise" chars. 12667 unsafeProtocol = { 12668 javascript: true, 12669 'javascript:': true 12670 }, 12671 // protocols that never have a hostname. 12672 hostlessProtocol = { 12673 javascript: true, 12674 'javascript:': true 12675 }, 12676 // protocols that always contain a // bit. 12677 slashedProtocol = { 12678 http: true, 12679 https: true, 12680 ftp: true, 12681 gopher: true, 12682 file: true, 12683 'http:': true, 12684 'https:': true, 12685 'ftp:': true, 12686 'gopher:': true, 12687 'file:': true 12688 }, 12689 querystring = require('qs'); 12690 12691function urlParse(url, parseQueryString, slashesDenoteHost) { 12692 if (url && typeof url === 'object' && url instanceof Url) { return url; } 12693 12694 var u = new Url(); 12695 u.parse(url, parseQueryString, slashesDenoteHost); 12696 return u; 12697} 12698 12699Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { 12700 if (typeof url !== 'string') { 12701 throw new TypeError("Parameter 'url' must be a string, not " + typeof url); 12702 } 12703 12704 /* 12705 * Copy chrome, IE, opera backslash-handling behavior. 12706 * Back slashes before the query string get converted to forward slashes 12707 * See: https://code.google.com/p/chromium/issues/detail?id=25916 12708 */ 12709 var queryIndex = url.indexOf('?'), 12710 splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', 12711 uSplit = url.split(splitter), 12712 slashRegex = /\\/g; 12713 uSplit[0] = uSplit[0].replace(slashRegex, '/'); 12714 url = uSplit.join(splitter); 12715 12716 var rest = url; 12717 12718 /* 12719 * trim before proceeding. 12720 * This is to support parse stuff like " http://foo.com \n" 12721 */ 12722 rest = rest.trim(); 12723 12724 if (!slashesDenoteHost && url.split('#').length === 1) { 12725 // Try fast path regexp 12726 var simplePath = simplePathPattern.exec(rest); 12727 if (simplePath) { 12728 this.path = rest; 12729 this.href = rest; 12730 this.pathname = simplePath[1]; 12731 if (simplePath[2]) { 12732 this.search = simplePath[2]; 12733 if (parseQueryString) { 12734 this.query = querystring.parse(this.search.substr(1)); 12735 } else { 12736 this.query = this.search.substr(1); 12737 } 12738 } else if (parseQueryString) { 12739 this.search = ''; 12740 this.query = {}; 12741 } 12742 return this; 12743 } 12744 } 12745 12746 var proto = protocolPattern.exec(rest); 12747 if (proto) { 12748 proto = proto[0]; 12749 var lowerProto = proto.toLowerCase(); 12750 this.protocol = lowerProto; 12751 rest = rest.substr(proto.length); 12752 } 12753 12754 /* 12755 * figure out if it's got a host 12756 * user@server is *always* interpreted as a hostname, and url 12757 * resolution will treat //foo/bar as host=foo,path=bar because that's 12758 * how the browser resolves relative URLs. 12759 */ 12760 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@/]+@[^@/]+/)) { 12761 var slashes = rest.substr(0, 2) === '//'; 12762 if (slashes && !(proto && hostlessProtocol[proto])) { 12763 rest = rest.substr(2); 12764 this.slashes = true; 12765 } 12766 } 12767 12768 if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { 12769 12770 /* 12771 * there's a hostname. 12772 * the first instance of /, ?, ;, or # ends the host. 12773 * 12774 * If there is an @ in the hostname, then non-host chars *are* allowed 12775 * to the left of the last @ sign, unless some host-ending character 12776 * comes *before* the @-sign. 12777 * URLs are obnoxious. 12778 * 12779 * ex: 12780 * http://a@b@c/ => user:a@b host:c 12781 * http://a@b?@c => user:a host:c path:/?@c 12782 */ 12783 12784 /* 12785 * v0.12 TODO(isaacs): This is not quite how Chrome does things. 12786 * Review our test case against browsers more comprehensively. 12787 */ 12788 12789 // find the first instance of any hostEndingChars 12790 var hostEnd = -1; 12791 for (var i = 0; i < hostEndingChars.length; i++) { 12792 var hec = rest.indexOf(hostEndingChars[i]); 12793 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } 12794 } 12795 12796 /* 12797 * at this point, either we have an explicit point where the 12798 * auth portion cannot go past, or the last @ char is the decider. 12799 */ 12800 var auth, atSign; 12801 if (hostEnd === -1) { 12802 // atSign can be anywhere. 12803 atSign = rest.lastIndexOf('@'); 12804 } else { 12805 /* 12806 * atSign must be in auth portion. 12807 * http://a@b/c@d => host:b auth:a path:/c@d 12808 */ 12809 atSign = rest.lastIndexOf('@', hostEnd); 12810 } 12811 12812 /* 12813 * Now we have a portion which is definitely the auth. 12814 * Pull that off. 12815 */ 12816 if (atSign !== -1) { 12817 auth = rest.slice(0, atSign); 12818 rest = rest.slice(atSign + 1); 12819 this.auth = decodeURIComponent(auth); 12820 } 12821 12822 // the host is the remaining to the left of the first non-host char 12823 hostEnd = -1; 12824 for (var i = 0; i < nonHostChars.length; i++) { 12825 var hec = rest.indexOf(nonHostChars[i]); 12826 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } 12827 } 12828 // if we still have not hit it, then the entire thing is a host. 12829 if (hostEnd === -1) { hostEnd = rest.length; } 12830 12831 this.host = rest.slice(0, hostEnd); 12832 rest = rest.slice(hostEnd); 12833 12834 // pull out port. 12835 this.parseHost(); 12836 12837 /* 12838 * we've indicated that there is a hostname, 12839 * so even if it's empty, it has to be present. 12840 */ 12841 this.hostname = this.hostname || ''; 12842 12843 /* 12844 * if hostname begins with [ and ends with ] 12845 * assume that it's an IPv6 address. 12846 */ 12847 var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; 12848 12849 // validate a little. 12850 if (!ipv6Hostname) { 12851 var hostparts = this.hostname.split(/\./); 12852 for (var i = 0, l = hostparts.length; i < l; i++) { 12853 var part = hostparts[i]; 12854 if (!part) { continue; } 12855 if (!part.match(hostnamePartPattern)) { 12856 var newpart = ''; 12857 for (var j = 0, k = part.length; j < k; j++) { 12858 if (part.charCodeAt(j) > 127) { 12859 /* 12860 * we replace non-ASCII char with a temporary placeholder 12861 * we need this to make sure size of hostname is not 12862 * broken by replacing non-ASCII by nothing 12863 */ 12864 newpart += 'x'; 12865 } else { 12866 newpart += part[j]; 12867 } 12868 } 12869 // we test again with ASCII char only 12870 if (!newpart.match(hostnamePartPattern)) { 12871 var validParts = hostparts.slice(0, i); 12872 var notHost = hostparts.slice(i + 1); 12873 var bit = part.match(hostnamePartStart); 12874 if (bit) { 12875 validParts.push(bit[1]); 12876 notHost.unshift(bit[2]); 12877 } 12878 if (notHost.length) { 12879 rest = '/' + notHost.join('.') + rest; 12880 } 12881 this.hostname = validParts.join('.'); 12882 break; 12883 } 12884 } 12885 } 12886 } 12887 12888 if (this.hostname.length > hostnameMaxLen) { 12889 this.hostname = ''; 12890 } else { 12891 // hostnames are always lower case. 12892 this.hostname = this.hostname.toLowerCase(); 12893 } 12894 12895 if (!ipv6Hostname) { 12896 /* 12897 * IDNA Support: Returns a punycoded representation of "domain". 12898 * It only converts parts of the domain name that 12899 * have non-ASCII characters, i.e. it doesn't matter if 12900 * you call it with a domain that already is ASCII-only. 12901 */ 12902 this.hostname = punycode.toASCII(this.hostname); 12903 } 12904 12905 var p = this.port ? ':' + this.port : ''; 12906 var h = this.hostname || ''; 12907 this.host = h + p; 12908 this.href += this.host; 12909 12910 /* 12911 * strip [ and ] from the hostname 12912 * the host field still retains them, though 12913 */ 12914 if (ipv6Hostname) { 12915 this.hostname = this.hostname.substr(1, this.hostname.length - 2); 12916 if (rest[0] !== '/') { 12917 rest = '/' + rest; 12918 } 12919 } 12920 } 12921 12922 /* 12923 * now rest is set to the post-host stuff. 12924 * chop off any delim chars. 12925 */ 12926 if (!unsafeProtocol[lowerProto]) { 12927 12928 /* 12929 * First, make 100% sure that any "autoEscape" chars get 12930 * escaped, even if encodeURIComponent doesn't think they 12931 * need to be. 12932 */ 12933 for (var i = 0, l = autoEscape.length; i < l; i++) { 12934 var ae = autoEscape[i]; 12935 if (rest.indexOf(ae) === -1) { continue; } 12936 var esc = encodeURIComponent(ae); 12937 if (esc === ae) { 12938 esc = escape(ae); 12939 } 12940 rest = rest.split(ae).join(esc); 12941 } 12942 } 12943 12944 // chop off from the tail first. 12945 var hash = rest.indexOf('#'); 12946 if (hash !== -1) { 12947 // got a fragment string. 12948 this.hash = rest.substr(hash); 12949 rest = rest.slice(0, hash); 12950 } 12951 var qm = rest.indexOf('?'); 12952 if (qm !== -1) { 12953 this.search = rest.substr(qm); 12954 this.query = rest.substr(qm + 1); 12955 if (parseQueryString) { 12956 this.query = querystring.parse(this.query); 12957 } 12958 rest = rest.slice(0, qm); 12959 } else if (parseQueryString) { 12960 // no query string, but parseQueryString still requested 12961 this.search = ''; 12962 this.query = {}; 12963 } 12964 if (rest) { this.pathname = rest; } 12965 if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { 12966 this.pathname = '/'; 12967 } 12968 12969 // to support http.request 12970 if (this.pathname || this.search) { 12971 var p = this.pathname || ''; 12972 var s = this.search || ''; 12973 this.path = p + s; 12974 } 12975 12976 // finally, reconstruct the href based on what has been validated. 12977 this.href = this.format(); 12978 return this; 12979}; 12980 12981// format a parsed object into a url string 12982function urlFormat(obj) { 12983 /* 12984 * ensure it's an object, and not a string url. 12985 * If it's an obj, this is a no-op. 12986 * this way, you can call url_format() on strings 12987 * to clean up potentially wonky urls. 12988 */ 12989 if (typeof obj === 'string') { obj = urlParse(obj); } 12990 if (!(obj instanceof Url)) { return Url.prototype.format.call(obj); } 12991 return obj.format(); 12992} 12993 12994Url.prototype.format = function () { 12995 var auth = this.auth || ''; 12996 if (auth) { 12997 auth = encodeURIComponent(auth); 12998 auth = auth.replace(/%3A/i, ':'); 12999 auth += '@'; 13000 } 13001 13002 var protocol = this.protocol || '', 13003 pathname = this.pathname || '', 13004 hash = this.hash || '', 13005 host = false, 13006 query = ''; 13007 13008 if (this.host) { 13009 host = auth + this.host; 13010 } else if (this.hostname) { 13011 host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); 13012 if (this.port) { 13013 host += ':' + this.port; 13014 } 13015 } 13016 13017 if (this.query && typeof this.query === 'object' && Object.keys(this.query).length) { 13018 query = querystring.stringify(this.query, { 13019 arrayFormat: 'repeat', 13020 addQueryPrefix: false 13021 }); 13022 } 13023 13024 var search = this.search || (query && ('?' + query)) || ''; 13025 13026 if (protocol && protocol.substr(-1) !== ':') { protocol += ':'; } 13027 13028 /* 13029 * only the slashedProtocols get the //. Not mailto:, xmpp:, etc. 13030 * unless they had them to begin with. 13031 */ 13032 if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { 13033 host = '//' + (host || ''); 13034 if (pathname && pathname.charAt(0) !== '/') { pathname = '/' + pathname; } 13035 } else if (!host) { 13036 host = ''; 13037 } 13038 13039 if (hash && hash.charAt(0) !== '#') { hash = '#' + hash; } 13040 if (search && search.charAt(0) !== '?') { search = '?' + search; } 13041 13042 pathname = pathname.replace(/[?#]/g, function (match) { 13043 return encodeURIComponent(match); 13044 }); 13045 search = search.replace('#', '%23'); 13046 13047 return protocol + host + pathname + search + hash; 13048}; 13049 13050function urlResolve(source, relative) { 13051 return urlParse(source, false, true).resolve(relative); 13052} 13053 13054Url.prototype.resolve = function (relative) { 13055 return this.resolveObject(urlParse(relative, false, true)).format(); 13056}; 13057 13058function urlResolveObject(source, relative) { 13059 if (!source) { return relative; } 13060 return urlParse(source, false, true).resolveObject(relative); 13061} 13062 13063Url.prototype.resolveObject = function (relative) { 13064 if (typeof relative === 'string') { 13065 var rel = new Url(); 13066 rel.parse(relative, false, true); 13067 relative = rel; 13068 } 13069 13070 var result = new Url(); 13071 var tkeys = Object.keys(this); 13072 for (var tk = 0; tk < tkeys.length; tk++) { 13073 var tkey = tkeys[tk]; 13074 result[tkey] = this[tkey]; 13075 } 13076 13077 /* 13078 * hash is always overridden, no matter what. 13079 * even href="" will remove it. 13080 */ 13081 result.hash = relative.hash; 13082 13083 // if the relative url is empty, then there's nothing left to do here. 13084 if (relative.href === '') { 13085 result.href = result.format(); 13086 return result; 13087 } 13088 13089 // hrefs like //foo/bar always cut to the protocol. 13090 if (relative.slashes && !relative.protocol) { 13091 // take everything except the protocol from relative 13092 var rkeys = Object.keys(relative); 13093 for (var rk = 0; rk < rkeys.length; rk++) { 13094 var rkey = rkeys[rk]; 13095 if (rkey !== 'protocol') { result[rkey] = relative[rkey]; } 13096 } 13097 13098 // urlParse appends trailing / to urls like http://www.example.com 13099 if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { 13100 result.pathname = '/'; 13101 result.path = result.pathname; 13102 } 13103 13104 result.href = result.format(); 13105 return result; 13106 } 13107 13108 if (relative.protocol && relative.protocol !== result.protocol) { 13109 /* 13110 * if it's a known url protocol, then changing 13111 * the protocol does weird things 13112 * first, if it's not file:, then we MUST have a host, 13113 * and if there was a path 13114 * to begin with, then we MUST have a path. 13115 * if it is file:, then the host is dropped, 13116 * because that's known to be hostless. 13117 * anything else is assumed to be absolute. 13118 */ 13119 if (!slashedProtocol[relative.protocol]) { 13120 var keys = Object.keys(relative); 13121 for (var v = 0; v < keys.length; v++) { 13122 var k = keys[v]; 13123 result[k] = relative[k]; 13124 } 13125 result.href = result.format(); 13126 return result; 13127 } 13128 13129 result.protocol = relative.protocol; 13130 if (!relative.host && !hostlessProtocol[relative.protocol]) { 13131 var relPath = (relative.pathname || '').split('/'); 13132 while (relPath.length && !(relative.host = relPath.shift())) { } 13133 if (!relative.host) { relative.host = ''; } 13134 if (!relative.hostname) { relative.hostname = ''; } 13135 if (relPath[0] !== '') { relPath.unshift(''); } 13136 if (relPath.length < 2) { relPath.unshift(''); } 13137 result.pathname = relPath.join('/'); 13138 } else { 13139 result.pathname = relative.pathname; 13140 } 13141 result.search = relative.search; 13142 result.query = relative.query; 13143 result.host = relative.host || ''; 13144 result.auth = relative.auth; 13145 result.hostname = relative.hostname || relative.host; 13146 result.port = relative.port; 13147 // to support http.request 13148 if (result.pathname || result.search) { 13149 var p = result.pathname || ''; 13150 var s = result.search || ''; 13151 result.path = p + s; 13152 } 13153 result.slashes = result.slashes || relative.slashes; 13154 result.href = result.format(); 13155 return result; 13156 } 13157 13158 var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/', 13159 isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/', 13160 mustEndAbs = isRelAbs || isSourceAbs || (result.host && relative.pathname), 13161 removeAllDots = mustEndAbs, 13162 srcPath = result.pathname && result.pathname.split('/') || [], 13163 relPath = relative.pathname && relative.pathname.split('/') || [], 13164 psychotic = result.protocol && !slashedProtocol[result.protocol]; 13165 13166 /* 13167 * if the url is a non-slashed url, then relative 13168 * links like ../.. should be able 13169 * to crawl up to the hostname, as well. This is strange. 13170 * result.protocol has already been set by now. 13171 * Later on, put the first path part into the host field. 13172 */ 13173 if (psychotic) { 13174 result.hostname = ''; 13175 result.port = null; 13176 if (result.host) { 13177 if (srcPath[0] === '') { srcPath[0] = result.host; } else { srcPath.unshift(result.host); } 13178 } 13179 result.host = ''; 13180 if (relative.protocol) { 13181 relative.hostname = null; 13182 relative.port = null; 13183 if (relative.host) { 13184 if (relPath[0] === '') { relPath[0] = relative.host; } else { relPath.unshift(relative.host); } 13185 } 13186 relative.host = null; 13187 } 13188 mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); 13189 } 13190 13191 if (isRelAbs) { 13192 // it's absolute. 13193 result.host = relative.host || relative.host === '' ? relative.host : result.host; 13194 result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname; 13195 result.search = relative.search; 13196 result.query = relative.query; 13197 srcPath = relPath; 13198 // fall through to the dot-handling below. 13199 } else if (relPath.length) { 13200 /* 13201 * it's relative 13202 * throw away the existing file, and take the new path instead. 13203 */ 13204 if (!srcPath) { srcPath = []; } 13205 srcPath.pop(); 13206 srcPath = srcPath.concat(relPath); 13207 result.search = relative.search; 13208 result.query = relative.query; 13209 } else if (relative.search != null) { 13210 /* 13211 * just pull out the search. 13212 * like href='?foo'. 13213 * Put this after the other two cases because it simplifies the booleans 13214 */ 13215 if (psychotic) { 13216 result.host = srcPath.shift(); 13217 result.hostname = result.host; 13218 /* 13219 * occationaly the auth can get stuck only in host 13220 * this especially happens in cases like 13221 * url.resolveObject('mailto:local1@domain1', 'local2@domain2') 13222 */ 13223 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; 13224 if (authInHost) { 13225 result.auth = authInHost.shift(); 13226 result.hostname = authInHost.shift(); 13227 result.host = result.hostname; 13228 } 13229 } 13230 result.search = relative.search; 13231 result.query = relative.query; 13232 // to support http.request 13233 if (result.pathname !== null || result.search !== null) { 13234 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); 13235 } 13236 result.href = result.format(); 13237 return result; 13238 } 13239 13240 if (!srcPath.length) { 13241 /* 13242 * no path at all. easy. 13243 * we've already handled the other stuff above. 13244 */ 13245 result.pathname = null; 13246 // to support http.request 13247 if (result.search) { 13248 result.path = '/' + result.search; 13249 } else { 13250 result.path = null; 13251 } 13252 result.href = result.format(); 13253 return result; 13254 } 13255 13256 /* 13257 * if a url ENDs in . or .., then it must get a trailing slash. 13258 * however, if it ends in anything else non-slashy, 13259 * then it must NOT get a trailing slash. 13260 */ 13261 var last = srcPath.slice(-1)[0]; 13262 var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''; 13263 13264 /* 13265 * strip single dots, resolve double dots to parent dir 13266 * if the path tries to go above the root, `up` ends up > 0 13267 */ 13268 var up = 0; 13269 for (var i = srcPath.length; i >= 0; i--) { 13270 last = srcPath[i]; 13271 if (last === '.') { 13272 srcPath.splice(i, 1); 13273 } else if (last === '..') { 13274 srcPath.splice(i, 1); 13275 up++; 13276 } else if (up) { 13277 srcPath.splice(i, 1); 13278 up--; 13279 } 13280 } 13281 13282 // if the path is allowed to go above the root, restore leading ..s 13283 if (!mustEndAbs && !removeAllDots) { 13284 for (; up--; up) { 13285 srcPath.unshift('..'); 13286 } 13287 } 13288 13289 if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { 13290 srcPath.unshift(''); 13291 } 13292 13293 if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { 13294 srcPath.push(''); 13295 } 13296 13297 var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); 13298 13299 // put the host back 13300 if (psychotic) { 13301 result.hostname = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; 13302 result.host = result.hostname; 13303 /* 13304 * occationaly the auth can get stuck only in host 13305 * this especially happens in cases like 13306 * url.resolveObject('mailto:local1@domain1', 'local2@domain2') 13307 */ 13308 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; 13309 if (authInHost) { 13310 result.auth = authInHost.shift(); 13311 result.hostname = authInHost.shift(); 13312 result.host = result.hostname; 13313 } 13314 } 13315 13316 mustEndAbs = mustEndAbs || (result.host && srcPath.length); 13317 13318 if (mustEndAbs && !isAbsolute) { 13319 srcPath.unshift(''); 13320 } 13321 13322 if (srcPath.length > 0) { 13323 result.pathname = srcPath.join('/'); 13324 } else { 13325 result.pathname = null; 13326 result.path = null; 13327 } 13328 13329 // to support request.http 13330 if (result.pathname !== null || result.search !== null) { 13331 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); 13332 } 13333 result.auth = relative.auth || result.auth; 13334 result.slashes = result.slashes || relative.slashes; 13335 result.href = result.format(); 13336 return result; 13337}; 13338 13339Url.prototype.parseHost = function () { 13340 var host = this.host; 13341 var port = portPattern.exec(host); 13342 if (port) { 13343 port = port[0]; 13344 if (port !== ':') { 13345 this.port = port.substr(1); 13346 } 13347 host = host.substr(0, host.length - port.length); 13348 } 13349 if (host) { this.hostname = host; } 13350}; 13351 13352exports.parse = urlParse; 13353exports.resolve = urlResolve; 13354exports.resolveObject = urlResolveObject; 13355exports.format = urlFormat; 13356 13357exports.Url = Url; 13358 13359},{"punycode/":
13359131,"qs":137}]},{},[1]);
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.