/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("56d7"); /***/ }), /***/ "0048": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "010e": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Uzbek Latin [uz-latn] //! author : Rasulbek Mirzayev : github.com/Rasulbeeek ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var uzLatn = moment.defineLocale('uz-latn', { months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split( '_' ), monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'), weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split( '_' ), weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'), weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'D MMMM YYYY, dddd HH:mm', }, calendar: { sameDay: '[Bugun soat] LT [da]', nextDay: '[Ertaga] LT [da]', nextWeek: 'dddd [kuni soat] LT [da]', lastDay: '[Kecha soat] LT [da]', lastWeek: "[O'tgan] dddd [kuni soat] LT [da]", sameElse: 'L', }, relativeTime: { future: 'Yaqin %s ichida', past: 'Bir necha %s oldin', s: 'soniya', ss: '%d soniya', m: 'bir daqiqa', mm: '%d daqiqa', h: 'bir soat', hh: '%d soat', d: 'bir kun', dd: '%d kun', M: 'bir oy', MM: '%d oy', y: 'bir yil', yy: '%d yil', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return uzLatn; }))); /***/ }), /***/ "01f9": /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__("2d00"); var $export = __webpack_require__("5ca1"); var redefine = __webpack_require__("2aba"); var hide = __webpack_require__("32e9"); var Iterators = __webpack_require__("84f2"); var $iterCreate = __webpack_require__("41a0"); var setToStringTag = __webpack_require__("7f20"); var getPrototypeOf = __webpack_require__("38fd"); var ITERATOR = __webpack_require__("2b4c")('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /***/ "02f4": /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__("4588"); var defined = __webpack_require__("be13"); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /***/ "02fb": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malayalam [ml] //! author : Floyd Pink : https://github.com/floydpink ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ml = moment.defineLocale('ml', { months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split( '_' ), monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split( '_' ), monthsParseExact: true, weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split( '_' ), weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), longDateFormat: { LT: 'A h:mm -നു', LTS: 'A h:mm:ss -നു', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm -നു', LLLL: 'dddd, D MMMM YYYY, A h:mm -നു', }, calendar: { sameDay: '[ഇന്ന്] LT', nextDay: '[നാളെ] LT', nextWeek: 'dddd, LT', lastDay: '[ഇന്നലെ] LT', lastWeek: '[കഴിഞ്ഞ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s കഴിഞ്ഞ്', past: '%s മുൻപ്', s: 'അൽപ നിമിഷങ്ങൾ', ss: '%d സെക്കൻഡ്', m: 'ഒരു മിനിറ്റ്', mm: '%d മിനിറ്റ്', h: 'ഒരു മണിക്കൂർ', hh: '%d മണിക്കൂർ', d: 'ഒരു ദിവസം', dd: '%d ദിവസം', M: 'ഒരു മാസം', MM: '%d മാസം', y: 'ഒരു വർഷം', yy: '%d വർഷം', }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'രാത്രി' && hour >= 4) || meridiem === 'ഉച്ച കഴിഞ്ഞ്' || meridiem === 'വൈകുന്നേരം' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'രാത്രി'; } else if (hour < 12) { return 'രാവിലെ'; } else if (hour < 17) { return 'ഉച്ച കഴിഞ്ഞ്'; } else if (hour < 20) { return 'വൈകുന്നേരം'; } else { return 'രാത്രി'; } }, }); return ml; }))); /***/ }), /***/ "0390": /***/ (function(module, exports, __webpack_require__) { "use strict"; var at = __webpack_require__("02f4")(true); // `AdvanceStringIndex` abstract operation // https://tc39.github.io/ecma262/#sec-advancestringindex module.exports = function (S, index, unicode) { return index + (unicode ? at(S, index).length : 1); }; /***/ }), /***/ "03ec": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Chuvash [cv] //! author : Anatoly Mironov : https://github.com/mirontoli ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var cv = moment.defineLocale('cv', { months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split( '_' ), monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split( '_' ), weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD-MM-YYYY', LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', }, calendar: { sameDay: '[Паян] LT [сехетре]', nextDay: '[Ыран] LT [сехетре]', lastDay: '[Ӗнер] LT [сехетре]', nextWeek: '[Ҫитес] dddd LT [сехетре]', lastWeek: '[Иртнӗ] dddd LT [сехетре]', sameElse: 'L', }, relativeTime: { future: function (output) { var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран'; return output + affix; }, past: '%s каялла', s: 'пӗр-ик ҫеккунт', ss: '%d ҫеккунт', m: 'пӗр минут', mm: '%d минут', h: 'пӗр сехет', hh: '%d сехет', d: 'пӗр кун', dd: '%d кун', M: 'пӗр уйӑх', MM: '%d уйӑх', y: 'пӗр ҫул', yy: '%d ҫул', }, dayOfMonthOrdinalParse: /\d{1,2}-мӗш/, ordinal: '%d-мӗш', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return cv; }))); /***/ }), /***/ "0418": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5445b184-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Header.vue?vue&type=template&id=3a0c67dc& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('header',[_c('div',{staticClass:"container"},[_c('nav',{staticClass:"navbar navbar-light amber lighten-4 navbar-expand-lg"},[_c('router-link',{staticClass:"navbar-brand",attrs:{"to":"/"}},[_c('img',{staticClass:"img-fluid",attrs:{"src":__webpack_require__("d01e"),"alt":"","width":"250"}})]),_vm._m(0),_c('div',{staticClass:"collapse navbar-collapse",attrs:{"id":"menu"}},[_c('ul',{staticClass:"navbar-nav ml-auto"},[_c('li',{staticClass:"nav-item"},[_c('router-link',{staticClass:"nav-link",attrs:{"to":"/testimonials"}},[_vm._v("Testimonials")])],1),(!_vm.accountInfo)?_c('li',{staticClass:"nav-item"},[_c('router-link',{staticClass:"nav-link",attrs:{"to":"/signup"}},[_vm._v("Signup")])],1):_vm._e(),(!_vm.accountInfo)?_c('li',{staticClass:"nav-item"},[_c('router-link',{staticClass:"nav-link",attrs:{"to":"/login"}},[_vm._v("Login")])],1):_vm._e(),(_vm.accountInfo)?_c('li',{staticClass:"nav-item"},[_c('router-link',{staticClass:"nav-link",attrs:{"to":"/edit/profile"}},[_vm._v("My account")])],1):_vm._e(),(_vm.accountInfo)?_c('li',{staticClass:"nav-item",on:{"click":_vm.logout}},[_c('router-link',{staticClass:"nav-link",attrs:{"to":"#"}},[_vm._v("Sign Out")])],1):_vm._e()])])],1)])])} var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{staticClass:"navbar-toggler first-button",attrs:{"type":"button","data-toggle":"collapse","data-target":"#menu","aria-controls":"menu","aria-expanded":"false","aria-label":"Toggle navigation"}},[_c('div',{staticClass:"animated-icon1"},[_c('span'),_c('span'),_c('span')])])}] // CONCATENATED MODULE: ./src/components/Header.vue?vue&type=template&id=3a0c67dc& // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js var es7_object_get_own_property_descriptors = __webpack_require__("8e6e"); // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js var web_dom_iterable = __webpack_require__("ac6a"); // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js var es6_object_keys = __webpack_require__("456d"); // EXTERNAL MODULE: ./node_modules/regenerator-runtime/runtime.js var runtime = __webpack_require__("96cf"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js var asyncToGenerator = __webpack_require__("1da1"); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__("ade3"); // EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm.js var vuex_esm = __webpack_require__("2f62"); // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Header.vue?vue&type=script&lang=js& function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var Headervue_type_script_lang_js_ = ({ name: "Header", data: function data() { return { accountInfo: false }; }, computed: _objectSpread({}, Object(vuex_esm["b" /* mapState */])({ loginState: function loginState(state) { return state.auth.loginState; } })), methods: { logout: function () { var _logout = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this = this; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.$store.dispatch("auth/logout", { resetStore: function resetStore() { _this.$store.dispatch("user/resetState"); _this.$store.dispatch("profile/resetState"); _this.$store.dispatch("auth/resetState"); }, callBack: function callBack() { _this.$router.push("/login"); } }); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function logout() { return _logout.apply(this, arguments); } return logout; }(), checkLogin: function () { var _checkLogin = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return this.$store.dispatch("auth/checkLogin", { email: JSON.parse(localStorage.getItem('user')).email }); case 2: this.accountInfo = this.loginState; case 3: case "end": return _context2.stop(); } } }, _callee2, this); })); function checkLogin() { return _checkLogin.apply(this, arguments); } return checkLogin; }() }, mounted: function mounted() { if (localStorage.getItem('user')) { this.checkLogin(); } } }); // CONCATENATED MODULE: ./src/components/Header.vue?vue&type=script&lang=js& /* harmony default export */ var components_Headervue_type_script_lang_js_ = (Headervue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__("2877"); // CONCATENATED MODULE: ./src/components/Header.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( components_Headervue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* harmony default export */ var Header = __webpack_exports__["a"] = (component.exports); /***/ }), /***/ "044b": /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ module.exports = function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } /***/ }), /***/ "0539": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7514"); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("53ca"); ; // jQuery toast plugin created by Kamran Ahmed copyright MIT license 2015 if (typeof Object.create !== 'function') { Object.create = function (obj) { function F() {} F.prototype = obj; return new F(); }; } (function ($, window, document, undefined) { "use strict"; var Toast = { _positionClasses: ['bottom-left', 'bottom-right', 'top-right', 'top-left', 'bottom-center', 'top-center', 'mid-center'], _defaultIcons: ['success', 'error', 'info', 'warning'], init: function init(options, elem) { this.prepareOptions(options, $.toast.options); this.process(); }, prepareOptions: function prepareOptions(options, options_to_extend) { var _options = {}; if (typeof options === 'string' || options instanceof Array) { _options.text = options; } else { _options = options; } this.options = $.extend({}, options_to_extend, _options); }, process: function process() { this.setup(); this.addToDom(); this.position(); this.bindToast(); this.animate(); }, setup: function setup() { var _toastContent = ''; this._toastEl = this._toastEl || $('
', { class: 'jq-toast-single' }); // For the loader on top _toastContent += ''; if (this.options.allowToastClose) { _toastContent += '×'; } ; if (this.options.text instanceof Array) { if (this.options.heading) { _toastContent += '

' + this.options.heading + '

'; } ; _toastContent += ''; } else { if (this.options.heading) { _toastContent += '

' + this.options.heading + '

'; } ; _toastContent += this.options.text; } this._toastEl.html(_toastContent); if (this.options.bgColor !== false) { this._toastEl.css("background-color", this.options.bgColor); } ; if (this.options.textColor !== false) { this._toastEl.css("color", this.options.textColor); } ; if (this.options.textAlign) { this._toastEl.css('text-align', this.options.textAlign); } if (this.options.icon !== false) { this._toastEl.addClass('jq-has-icon'); if ($.inArray(this.options.icon, this._defaultIcons) !== -1) { this._toastEl.addClass('jq-icon-' + this.options.icon); } ; } ; }, position: function position() { if (typeof this.options.position === 'string' && $.inArray(this.options.position, this._positionClasses) !== -1) { if (this.options.position === 'bottom-center') { this._container.css({ left: $(window).outerWidth() / 2 - this._container.outerWidth() / 2, bottom: 20 }); } else if (this.options.position === 'top-center') { this._container.css({ left: $(window).outerWidth() / 2 - this._container.outerWidth() / 2, top: 20 }); } else if (this.options.position === 'mid-center') { this._container.css({ left: $(window).outerWidth() / 2 - this._container.outerWidth() / 2, top: $(window).outerHeight() / 2 - this._container.outerHeight() / 2 }); } else { this._container.addClass(this.options.position); } } else if (Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this.options.position) === 'object') { this._container.css({ top: this.options.position.top ? this.options.position.top : 'auto', bottom: this.options.position.bottom ? this.options.position.bottom : 'auto', left: this.options.position.left ? this.options.position.left : 'auto', right: this.options.position.right ? this.options.position.right : 'auto' }); } else { this._container.addClass('bottom-left'); } }, bindToast: function bindToast() { var that = this; this._toastEl.on('afterShown', function () { that.processLoader(); }); this._toastEl.find('.close-jq-toast-single').on('click', function (e) { e.preventDefault(); if (that.options.showHideTransition === 'fade') { that._toastEl.trigger('beforeHide'); that._toastEl.fadeOut(function () { that._toastEl.trigger('afterHidden'); }); } else if (that.options.showHideTransition === 'slide') { that._toastEl.trigger('beforeHide'); that._toastEl.slideUp(function () { that._toastEl.trigger('afterHidden'); }); } else { that._toastEl.trigger('beforeHide'); that._toastEl.hide(function () { that._toastEl.trigger('afterHidden'); }); } }); if (typeof this.options.beforeShow == 'function') { this._toastEl.on('beforeShow', function () { that.options.beforeShow(); }); } ; if (typeof this.options.afterShown == 'function') { this._toastEl.on('afterShown', function () { that.options.afterShown(); }); } ; if (typeof this.options.beforeHide == 'function') { this._toastEl.on('beforeHide', function () { that.options.beforeHide(); }); } ; if (typeof this.options.afterHidden == 'function') { this._toastEl.on('afterHidden', function () { that.options.afterHidden(); }); } ; }, addToDom: function addToDom() { var _container = $('.jq-toast-wrap'); if (_container.length === 0) { _container = $('
', { class: "jq-toast-wrap" }); $('body').append(_container); } else if (!this.options.stack || isNaN(parseInt(this.options.stack, 10))) { _container.empty(); } _container.find('.jq-toast-single:hidden').remove(); _container.append(this._toastEl); if (this.options.stack && !isNaN(parseInt(this.options.stack), 10)) { var _prevToastCount = _container.find('.jq-toast-single').length, _extToastCount = _prevToastCount - this.options.stack; if (_extToastCount > 0) { $('.jq-toast-wrap').find('.jq-toast-single').slice(0, _extToastCount).remove(); } ; } this._container = _container; }, canAutoHide: function canAutoHide() { return this.options.hideAfter !== false && !isNaN(parseInt(this.options.hideAfter, 10)); }, processLoader: function processLoader() { // Show the loader only, if auto-hide is on and loader is demanded if (!this.canAutoHide() || this.options.loader === false) { return false; } var loader = this._toastEl.find('.jq-toast-loader'); // 400 is the default time that jquery uses for fade/slide // Divide by 1000 for milliseconds to seconds conversion var transitionTime = (this.options.hideAfter - 400) / 1000 + 's'; var loaderBg = this.options.loaderBg; var style = loader.attr('style') || ''; style = style.substring(0, style.indexOf('-webkit-transition')); // Remove the last transition definition style += '-webkit-transition: width ' + transitionTime + ' ease-in; \ -o-transition: width ' + transitionTime + ' ease-in; \ transition: width ' + transitionTime + ' ease-in; \ background-color: ' + loaderBg + ';'; loader.attr('style', style).addClass('jq-toast-loaded'); }, animate: function animate() { var that = this; this._toastEl.hide(); this._toastEl.trigger('beforeShow'); if (this.options.showHideTransition.toLowerCase() === 'fade') { this._toastEl.fadeIn(function () { that._toastEl.trigger('afterShown'); }); } else if (this.options.showHideTransition.toLowerCase() === 'slide') { this._toastEl.slideDown(function () { that._toastEl.trigger('afterShown'); }); } else { this._toastEl.show(function () { that._toastEl.trigger('afterShown'); }); } if (this.canAutoHide()) { var that = this; window.setTimeout(function () { if (that.options.showHideTransition.toLowerCase() === 'fade') { that._toastEl.trigger('beforeHide'); that._toastEl.fadeOut(function () { that._toastEl.trigger('afterHidden'); }); } else if (that.options.showHideTransition.toLowerCase() === 'slide') { that._toastEl.trigger('beforeHide'); that._toastEl.slideUp(function () { that._toastEl.trigger('afterHidden'); }); } else { that._toastEl.trigger('beforeHide'); that._toastEl.hide(function () { that._toastEl.trigger('afterHidden'); }); } }, this.options.hideAfter); } ; }, reset: function reset(resetWhat) { if (resetWhat === 'all') { $('.jq-toast-wrap').remove(); } else { this._toastEl.remove(); } }, update: function update(options) { this.prepareOptions(options, this.options); this.setup(); this.bindToast(); } }; $.toast = function (options) { var toast = Object.create(Toast); toast.init(options, this); return { reset: function reset(what) { toast.reset(what); }, update: function update(options) { toast.update(options); } }; }; $.toast.options = { text: '', heading: '', showHideTransition: 'fade', allowToastClose: true, hideAfter: 3000, loader: true, loaderBg: '#9EC600', stack: 5, position: 'bottom-left', bgColor: false, textColor: false, textAlign: 'left', icon: false, beforeShow: function beforeShow() {}, afterShown: function afterShown() {}, beforeHide: function beforeHide() {}, afterHidden: function afterHidden() {} }; })(jQuery, window, document); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "0558": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Icelandic [is] //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(n) { if (n % 100 === 11) { return true; } else if (n % 10 === 1) { return false; } return true; } function translate(number, withoutSuffix, key, isFuture) { var result = number + ' '; switch (key) { case 's': return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; case 'ss': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum') ); } return result + 'sekúnda'; case 'm': return withoutSuffix ? 'mínúta' : 'mínútu'; case 'mm': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum') ); } else if (withoutSuffix) { return result + 'mínúta'; } return result + 'mínútu'; case 'hh': if (plural(number)) { return ( result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum') ); } return result + 'klukkustund'; case 'd': if (withoutSuffix) { return 'dagur'; } return isFuture ? 'dag' : 'degi'; case 'dd': if (plural(number)) { if (withoutSuffix) { return result + 'dagar'; } return result + (isFuture ? 'daga' : 'dögum'); } else if (withoutSuffix) { return result + 'dagur'; } return result + (isFuture ? 'dag' : 'degi'); case 'M': if (withoutSuffix) { return 'mánuður'; } return isFuture ? 'mánuð' : 'mánuði'; case 'MM': if (plural(number)) { if (withoutSuffix) { return result + 'mánuðir'; } return result + (isFuture ? 'mánuði' : 'mánuðum'); } else if (withoutSuffix) { return result + 'mánuður'; } return result + (isFuture ? 'mánuð' : 'mánuði'); case 'y': return withoutSuffix || isFuture ? 'ár' : 'ári'; case 'yy': if (plural(number)) { return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); } return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); } } var is = moment.defineLocale('is', { months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split( '_' ), monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split( '_' ), weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'), weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY [kl.] H:mm', LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm', }, calendar: { sameDay: '[í dag kl.] LT', nextDay: '[á morgun kl.] LT', nextWeek: 'dddd [kl.] LT', lastDay: '[í gær kl.] LT', lastWeek: '[síðasta] dddd [kl.] LT', sameElse: 'L', }, relativeTime: { future: 'eftir %s', past: 'fyrir %s síðan', s: translate, ss: translate, m: translate, mm: translate, h: 'klukkustund', hh: translate, d: translate, dd: translate, M: translate, MM: translate, y: translate, yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return is; }))); /***/ }), /***/ "05e4": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "063a": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "0719": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6b54"); /* harmony import */ var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("c5f6"); /* harmony import */ var core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_number_constructor__WEBPACK_IMPORTED_MODULE_1__); /* * Bootstrap TouchSpin - v3.0.1 * A mobile and touch friendly input spinner component for Bootstrap 3. * http://www.virtuosoft.eu/code/bootstrap-touchspin/ * * Made by István Ujj-Mészáros * Under Apache License v2.0 License */ !function (a) { "use strict"; function b(a, b) { return a + ".touchspin_" + b; } function c(c, d) { return a.map(c, function (a) { return b(a, d); }); } var d = 0; a.fn.TouchSpin = function (b) { if ("destroy" === b) return void this.each(function () { var b = a(this), d = b.data(); a(document).off(c(["mouseup", "touchend", "touchcancel", "mousemove", "touchmove", "scroll", "scrollstart"], d.spinnerid).join(" ")); }); var e = { min: 0, max: 100, initval: "", step: 1, decimals: 0, stepinterval: 100, forcestepdivisibility: "round", stepintervaldelay: 500, verticalbuttons: !1, verticalupclass: "glyphicon glyphicon-chevron-up", verticaldownclass: "glyphicon glyphicon-chevron-down", prefix: "", postfix: "", prefix_extraclass: "", postfix_extraclass: "", booster: !0, boostat: 10, maxboostedstep: !1, mousewheel: !0, buttondown_class: "btn btn-default", buttonup_class: "btn btn-default" }, f = { min: "min", max: "max", initval: "init-val", step: "step", decimals: "decimals", stepinterval: "step-interval", verticalbuttons: "vertical-buttons", verticalupclass: "vertical-up-class", verticaldownclass: "vertical-down-class", forcestepdivisibility: "force-step-divisibility", stepintervaldelay: "step-interval-delay", prefix: "prefix", postfix: "postfix", prefix_extraclass: "prefix-extra-class", postfix_extraclass: "postfix-extra-class", booster: "booster", boostat: "boostat", maxboostedstep: "max-boosted-step", mousewheel: "mouse-wheel", buttondown_class: "button-down-class", buttonup_class: "button-up-class" }; return this.each(function () { function g() { if (!J.data("alreadyinitialized")) { if (J.data("alreadyinitialized", !0), d += 1, J.data("spinnerid", d), !J.is("input")) return void console.log("Must be an input."); j(), h(), u(), m(), p(), q(), r(), s(), D.input.css("display", "block"); } } function h() { "" !== B.initval && "" === J.val() && J.val(B.initval); } function i(a) { l(a), u(); var b = D.input.val(); "" !== b && (b = Number(D.input.val()), D.input.val(b.toFixed(B.decimals))); } function j() { B = a.extend({}, e, K, k(), b); } function k() { var b = {}; return a.each(f, function (a, c) { var d = "bts-" + c; J.is("[data-" + d + "]") && (b[a] = J.data(d)); }), b; } function l(b) { B = a.extend({}, B, b); } function m() { var a = J.val(), b = J.parent(); "" !== a && (a = Number(a).toFixed(B.decimals)), J.data("initvalue", a).val(a), J.addClass("form-control"), b.hasClass("input-group") ? n(b) : o(); } function n(b) { b.addClass("bootstrap-touchspin"); var c, d, e = J.prev(), f = J.next(), g = '' + B.prefix + "", h = '' + B.postfix + ""; e.hasClass("input-group-btn") ? (c = '', e.append(c)) : (c = '', a(c).insertBefore(J)), f.hasClass("input-group-btn") ? (d = '', f.prepend(d)) : (d = '', a(d).insertAfter(J)), a(g).insertBefore(J), a(h).insertAfter(J), C = b; } function o() { var b; b = B.verticalbuttons ? '
' + B.prefix + '' + B.postfix + '
' : '
' + B.prefix + '' + B.postfix + '
', C = a(b).insertBefore(J), a(".bootstrap-touchspin-prefix", C).after(J), J.hasClass("input-sm") ? C.addClass("input-group-sm") : J.hasClass("input-lg") && C.addClass("input-group-lg"); } function p() { D = { down: a(".bootstrap-touchspin-down", C), up: a(".bootstrap-touchspin-up", C), input: a("input", C), prefix: a(".bootstrap-touchspin-prefix", C).addClass(B.prefix_extraclass), postfix: a(".bootstrap-touchspin-postfix", C).addClass(B.postfix_extraclass) }; } function q() { "" === B.prefix && D.prefix.hide(), "" === B.postfix && D.postfix.hide(); } function r() { J.on("keydown", function (a) { var b = a.keyCode || a.which; 38 === b ? ("up" !== M && (w(), z()), a.preventDefault()) : 40 === b && ("down" !== M && (x(), y()), a.preventDefault()); }), J.on("keyup", function (a) { var b = a.keyCode || a.which; 38 === b ? A() : 40 === b && A(); }), J.on("blur", function () { u(); }), D.down.on("keydown", function (a) { var b = a.keyCode || a.which; (32 === b || 13 === b) && ("down" !== M && (x(), y()), a.preventDefault()); }), D.down.on("keyup", function (a) { var b = a.keyCode || a.which; (32 === b || 13 === b) && A(); }), D.up.on("keydown", function (a) { var b = a.keyCode || a.which; (32 === b || 13 === b) && ("up" !== M && (w(), z()), a.preventDefault()); }), D.up.on("keyup", function (a) { var b = a.keyCode || a.which; (32 === b || 13 === b) && A(); }), D.down.on("mousedown.touchspin", function (a) { D.down.off("touchstart.touchspin"), J.is(":disabled") || (x(), y(), a.preventDefault(), a.stopPropagation()); }), D.down.on("touchstart.touchspin", function (a) { D.down.off("mousedown.touchspin"), J.is(":disabled") || (x(), y(), a.preventDefault(), a.stopPropagation()); }), D.up.on("mousedown.touchspin", function (a) { D.up.off("touchstart.touchspin"), J.is(":disabled") || (w(), z(), a.preventDefault(), a.stopPropagation()); }), D.up.on("touchstart.touchspin", function (a) { D.up.off("mousedown.touchspin"), J.is(":disabled") || (w(), z(), a.preventDefault(), a.stopPropagation()); }), D.up.on("mouseout touchleave touchend touchcancel", function (a) { M && (a.stopPropagation(), A()); }), D.down.on("mouseout touchleave touchend touchcancel", function (a) { M && (a.stopPropagation(), A()); }), D.down.on("mousemove touchmove", function (a) { M && (a.stopPropagation(), a.preventDefault()); }), D.up.on("mousemove touchmove", function (a) { M && (a.stopPropagation(), a.preventDefault()); }), a(document).on(c(["mouseup", "touchend", "touchcancel"], d).join(" "), function (a) { M && (a.preventDefault(), A()); }), a(document).on(c(["mousemove", "touchmove", "scroll", "scrollstart"], d).join(" "), function (a) { M && (a.preventDefault(), A()); }), J.on("mousewheel DOMMouseScroll", function (a) { if (B.mousewheel && J.is(":focus")) { var b = a.originalEvent.wheelDelta || -a.originalEvent.deltaY || -a.originalEvent.detail; a.stopPropagation(), a.preventDefault(), 0 > b ? x() : w(); } }); } function s() { J.on("touchspin.uponce", function () { A(), w(); }), J.on("touchspin.downonce", function () { A(), x(); }), J.on("touchspin.startupspin", function () { z(); }), J.on("touchspin.startdownspin", function () { y(); }), J.on("touchspin.stopspin", function () { A(); }), J.on("touchspin.updatesettings", function (a, b) { i(b); }); } function t(a) { switch (B.forcestepdivisibility) { case "round": return (Math.round(a / B.step) * B.step).toFixed(B.decimals); case "floor": return (Math.floor(a / B.step) * B.step).toFixed(B.decimals); case "ceil": return (Math.ceil(a / B.step) * B.step).toFixed(B.decimals); default: return a; } } function u() { var a, b, c; a = J.val(), "" !== a && (B.decimals > 0 && "." === a || (b = parseFloat(a), isNaN(b) && (b = 0), c = b, b.toString() !== a && (c = b), b < B.min && (c = B.min), b > B.max && (c = B.max), c = t(c), Number(a).toString() !== c.toString() && (J.val(c), J.trigger("change")))); } function v() { if (B.booster) { var a = Math.pow(2, Math.floor(L / B.boostat)) * B.step; return B.maxboostedstep && a > B.maxboostedstep && (a = B.maxboostedstep, E = Math.round(E / a) * a), Math.max(B.step, a); } return B.step; } function w() { u(), E = parseFloat(D.input.val()), isNaN(E) && (E = 0); var a = E, b = v(); E += b, E > B.max && (E = B.max, J.trigger("touchspin.on.max"), A()), D.input.val(Number(E).toFixed(B.decimals)), a !== E && J.trigger("change"); } function x() { u(), E = parseFloat(D.input.val()), isNaN(E) && (E = 0); var a = E, b = v(); E -= b, E < B.min && (E = B.min, J.trigger("touchspin.on.min"), A()), D.input.val(E.toFixed(B.decimals)), a !== E && J.trigger("change"); } function y() { A(), L = 0, M = "down", J.trigger("touchspin.on.startspin"), J.trigger("touchspin.on.startdownspin"), H = setTimeout(function () { F = setInterval(function () { L++, x(); }, B.stepinterval); }, B.stepintervaldelay); } function z() { A(), L = 0, M = "up", J.trigger("touchspin.on.startspin"), J.trigger("touchspin.on.startupspin"), I = setTimeout(function () { G = setInterval(function () { L++, w(); }, B.stepinterval); }, B.stepintervaldelay); } function A() { switch (clearTimeout(H), clearTimeout(I), clearInterval(F), clearInterval(G), M) { case "up": J.trigger("touchspin.on.stopupspin"), J.trigger("touchspin.on.stopspin"); break; case "down": J.trigger("touchspin.on.stopdownspin"), J.trigger("touchspin.on.stopspin"); } L = 0, M = !1; } var B, C, D, E, F, G, H, I, J = a(this), K = J.data(), L = 0, M = !1; g(); }); }; }(jQuery); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "0721": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Faroese [fo] //! author : Ragnar Johannesen : https://github.com/ragnar123 //! author : Kristian Sakarisson : https://github.com/sakarisson ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var fo = moment.defineLocale('fo', { months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split( '_' ), monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split( '_' ), weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'), weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D. MMMM, YYYY HH:mm', }, calendar: { sameDay: '[Í dag kl.] LT', nextDay: '[Í morgin kl.] LT', nextWeek: 'dddd [kl.] LT', lastDay: '[Í gjár kl.] LT', lastWeek: '[síðstu] dddd [kl] LT', sameElse: 'L', }, relativeTime: { future: 'um %s', past: '%s síðani', s: 'fá sekund', ss: '%d sekundir', m: 'ein minuttur', mm: '%d minuttir', h: 'ein tími', hh: '%d tímar', d: 'ein dagur', dd: '%d dagar', M: 'ein mánaður', MM: '%d mánaðir', y: 'eitt ár', yy: '%d ár', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fo; }))); /***/ }), /***/ "079e": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Japanese [ja] //! author : LI Long : https://github.com/baryon ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ja = moment.defineLocale('ja', { eras: [ { since: '2019-05-01', offset: 1, name: '令和', narrow: '㋿', abbr: 'R', }, { since: '1989-01-08', until: '2019-04-30', offset: 1, name: '平成', narrow: '㍻', abbr: 'H', }, { since: '1926-12-25', until: '1989-01-07', offset: 1, name: '昭和', narrow: '㍼', abbr: 'S', }, { since: '1912-07-30', until: '1926-12-24', offset: 1, name: '大正', narrow: '㍽', abbr: 'T', }, { since: '1873-01-01', until: '1912-07-29', offset: 6, name: '明治', narrow: '㍾', abbr: 'M', }, { since: '0001-01-01', until: '1873-12-31', offset: 1, name: '西暦', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: '紀元前', narrow: 'BC', abbr: 'BC', }, ], eraYearOrdinalRegex: /(元|\d+)年/, eraYearOrdinalParse: function (input, match) { return match[1] === '元' ? 1 : parseInt(match[1] || input, 10); }, months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( '_' ), weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), weekdaysShort: '日_月_火_水_木_金_土'.split('_'), weekdaysMin: '日_月_火_水_木_金_土'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY年M月D日', LLL: 'YYYY年M月D日 HH:mm', LLLL: 'YYYY年M月D日 dddd HH:mm', l: 'YYYY/MM/DD', ll: 'YYYY年M月D日', lll: 'YYYY年M月D日 HH:mm', llll: 'YYYY年M月D日(ddd) HH:mm', }, meridiemParse: /午前|午後/i, isPM: function (input) { return input === '午後'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return '午前'; } else { return '午後'; } }, calendar: { sameDay: '[今日] LT', nextDay: '[明日] LT', nextWeek: function (now) { if (now.week() !== this.week()) { return '[来週]dddd LT'; } else { return 'dddd LT'; } }, lastDay: '[昨日] LT', lastWeek: function (now) { if (this.week() !== now.week()) { return '[先週]dddd LT'; } else { return 'dddd LT'; } }, sameElse: 'L', }, dayOfMonthOrdinalParse: /\d{1,2}日/, ordinal: function (number, period) { switch (period) { case 'y': return number === 1 ? '元年' : number + '年'; case 'd': case 'D': case 'DDD': return number + '日'; default: return number; } }, relativeTime: { future: '%s後', past: '%s前', s: '数秒', ss: '%d秒', m: '1分', mm: '%d分', h: '1時間', hh: '%d時間', d: '1日', dd: '%d日', M: '1ヶ月', MM: '%dヶ月', y: '1年', yy: '%d年', }, }); return ja; }))); /***/ }), /***/ "08ba": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "097d": /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://github.com/tc39/proposal-promise-finally var $export = __webpack_require__("5ca1"); var core = __webpack_require__("8378"); var global = __webpack_require__("7726"); var speciesConstructor = __webpack_require__("ebd6"); var promiseResolve = __webpack_require__("bcaa"); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); /***/ }), /***/ "0a06": /***/ (function(module, exports, __webpack_require__) { "use strict"; var defaults = __webpack_require__("2444"); var utils = __webpack_require__("c532"); var InterceptorManager = __webpack_require__("f6b49"); var dispatchRequest = __webpack_require__("5270"); /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance */ function Axios(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new InterceptorManager(), response: new InterceptorManager() }; } /** * Dispatch a request * * @param {Object} config The config specific for this request (merged with this.defaults) */ Axios.prototype.request = function request(config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof config === 'string') { config = utils.merge({ url: arguments[0] }, arguments[1]); } config = utils.merge(defaults, {method: 'get'}, this.defaults, config); config.method = config.method.toLowerCase(); // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { chain.unshift(interceptor.fulfilled, interceptor.rejected); }); this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { chain.push(interceptor.fulfilled, interceptor.rejected); }); while (chain.length) { promise = promise.then(chain.shift(), chain.shift()); } return promise; }; // Provide aliases for supported request methods utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request(utils.merge(config || {}, { method: method, url: url })); }; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, data, config) { return this.request(utils.merge(config || {}, { method: method, url: url, data: data })); }; }); module.exports = Axios; /***/ }), /***/ "0a3c": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish (Dominican Republic) [es-do] ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( '_' ), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), monthsParse = [ /^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i, ], monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; var esDo = moment.defineLocale('es-do', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortDot; } else if (/-MMM-/.test(format)) { return monthsShort[m.month()]; } else { return monthsShortDot[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY h:mm A', LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A', }, calendar: { sameDay: function () { return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextDay: function () { return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextWeek: function () { return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastDay: function () { return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: 'en %s', past: 'hace %s', s: 'unos segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'una hora', hh: '%d horas', d: 'un día', dd: '%d días', w: 'una semana', ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', yy: '%d años', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return esDo; }))); /***/ }), /***/ "0a49": /***/ (function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__("9b43"); var IObject = __webpack_require__("626a"); var toObject = __webpack_require__("4bf8"); var toLength = __webpack_require__("9def"); var asc = __webpack_require__("cd1c"); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; var create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this); var self = IObject(O); var f = ctx(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var val, res; for (;length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }), /***/ "0a84": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Arabic (Morocco) [ar-ma] //! author : ElFadili Yassine : https://github.com/ElFadiliY //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var arMa = moment.defineLocale('ar-ma', { months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split( '_' ), weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[اليوم على الساعة] LT', nextDay: '[غدا على الساعة] LT', nextWeek: 'dddd [على الساعة] LT', lastDay: '[أمس على الساعة] LT', lastWeek: 'dddd [على الساعة] LT', sameElse: 'L', }, relativeTime: { future: 'في %s', past: 'منذ %s', s: 'ثوان', ss: '%d ثانية', m: 'دقيقة', mm: '%d دقائق', h: 'ساعة', hh: '%d ساعات', d: 'يوم', dd: '%d أيام', M: 'شهر', MM: '%d أشهر', y: 'سنة', yy: '%d سنوات', }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return arMa; }))); /***/ }), /***/ "0bfb": /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.2.5.3 get RegExp.prototype.flags var anObject = __webpack_require__("cb7c"); module.exports = function () { var that = anObject(this); var result = ''; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.unicode) result += 'u'; if (that.sticky) result += 'y'; return result; }; /***/ }), /***/ "0caa": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Konkani Latin script [gom-latn] //! author : The Discoverer : https://github.com/WikiDiscoverer ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['thoddea sekondamni', 'thodde sekond'], ss: [number + ' sekondamni', number + ' sekond'], m: ['eka mintan', 'ek minut'], mm: [number + ' mintamni', number + ' mintam'], h: ['eka voran', 'ek vor'], hh: [number + ' voramni', number + ' voram'], d: ['eka disan', 'ek dis'], dd: [number + ' disamni', number + ' dis'], M: ['eka mhoinean', 'ek mhoino'], MM: [number + ' mhoineamni', number + ' mhoine'], y: ['eka vorsan', 'ek voros'], yy: [number + ' vorsamni', number + ' vorsam'], }; return isFuture ? format[key][0] : format[key][1]; } var gomLatn = moment.defineLocale('gom-latn', { months: { standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split( '_' ), format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split( '_' ), isFormat: /MMMM(\s)+D[oD]?/, }, monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'), weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'), weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'A h:mm [vazta]', LTS: 'A h:mm:ss [vazta]', L: 'DD-MM-YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY A h:mm [vazta]', LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]', llll: 'ddd, D MMM YYYY, A h:mm [vazta]', }, calendar: { sameDay: '[Aiz] LT', nextDay: '[Faleam] LT', nextWeek: '[Fuddlo] dddd[,] LT', lastDay: '[Kal] LT', lastWeek: '[Fattlo] dddd[,] LT', sameElse: 'L', }, relativeTime: { future: '%s', past: '%s adim', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}(er)/, ordinal: function (number, period) { switch (period) { // the ordinal 'er' only applies to day of the month case 'D': return number + 'er'; default: case 'M': case 'Q': case 'DDD': case 'd': case 'w': case 'W': return number; } }, week: { dow: 0, // Sunday is the first day of the week doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4) }, meridiemParse: /rati|sokallim|donparam|sanje/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'rati') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'sokallim') { return hour; } else if (meridiem === 'donparam') { return hour > 12 ? hour : hour + 12; } else if (meridiem === 'sanje') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'rati'; } else if (hour < 12) { return 'sokallim'; } else if (hour < 16) { return 'donparam'; } else if (hour < 20) { return 'sanje'; } else { return 'rati'; } }, }); return gomLatn; }))); /***/ }), /***/ "0d58": /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__("ce10"); var enumBugKeys = __webpack_require__("e11e"); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /***/ "0df6": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; /***/ }), /***/ "0e49": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : French (Switzerland) [fr-ch] //! author : Gaspard Bucher : https://github.com/gaspard ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var frCh = moment.defineLocale('fr-ch', { months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( '_' ), monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), monthsParseExact: true, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Aujourd’hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', lastWeek: 'dddd [dernier à] LT', sameElse: 'L', }, relativeTime: { future: 'dans %s', past: 'il y a %s', s: 'quelques secondes', ss: '%d secondes', m: 'une minute', mm: '%d minutes', h: 'une heure', hh: '%d heures', d: 'un jour', dd: '%d jours', M: 'un mois', MM: '%d mois', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, ordinal: function (number, period) { switch (period) { // Words with masculine grammatical gender: mois, trimestre, jour default: case 'M': case 'Q': case 'D': case 'DDD': case 'd': return number + (number === 1 ? 'er' : 'e'); // Words with feminine grammatical gender: semaine case 'w': case 'W': return number + (number === 1 ? 're' : 'e'); } }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return frCh; }))); /***/ }), /***/ "0e6b": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Australia) [en-au] //! author : Jared Morse : https://github.com/jarcoal ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enAu = moment.defineLocale('en-au', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 0, // Sunday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enAu; }))); /***/ }), /***/ "0e81": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Turkish [tr] //! authors : Erhan Gundogan : https://github.com/erhangundogan, //! Burak Yiğit Kaya: https://github.com/BYK ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var suffixes = { 1: "'inci", 5: "'inci", 8: "'inci", 70: "'inci", 80: "'inci", 2: "'nci", 7: "'nci", 20: "'nci", 50: "'nci", 3: "'üncü", 4: "'üncü", 100: "'üncü", 6: "'ncı", 9: "'uncu", 10: "'uncu", 30: "'uncu", 60: "'ıncı", 90: "'ıncı", }; var tr = moment.defineLocale('tr', { months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split( '_' ), monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split( '_' ), weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), meridiem: function (hours, minutes, isLower) { if (hours < 12) { return isLower ? 'öö' : 'ÖÖ'; } else { return isLower ? 'ös' : 'ÖS'; } }, meridiemParse: /öö|ÖÖ|ös|ÖS/, isPM: function (input) { return input === 'ös' || input === 'ÖS'; }, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[bugün saat] LT', nextDay: '[yarın saat] LT', nextWeek: '[gelecek] dddd [saat] LT', lastDay: '[dün] LT', lastWeek: '[geçen] dddd [saat] LT', sameElse: 'L', }, relativeTime: { future: '%s sonra', past: '%s önce', s: 'birkaç saniye', ss: '%d saniye', m: 'bir dakika', mm: '%d dakika', h: 'bir saat', hh: '%d saat', d: 'bir gün', dd: '%d gün', w: 'bir hafta', ww: '%d hafta', M: 'bir ay', MM: '%d ay', y: 'bir yıl', yy: '%d yıl', }, ordinal: function (number, period) { switch (period) { case 'd': case 'D': case 'Do': case 'DD': return number; default: if (number === 0) { // special case for zero return number + "'ıncı"; } var a = number % 10, b = (number % 100) - a, c = number >= 100 ? 100 : null; return number + (suffixes[a] || suffixes[b] || suffixes[c]); } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return tr; }))); /***/ }), /***/ "0f07": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "img/avatar-default.6aadcee8.png"; /***/ }), /***/ "0f14": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Danish [da] //! author : Ulrik Nielsen : https://github.com/mrbase ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var da = moment.defineLocale('da', { months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split( '_' ), monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'), weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', }, calendar: { sameDay: '[i dag kl.] LT', nextDay: '[i morgen kl.] LT', nextWeek: 'på dddd [kl.] LT', lastDay: '[i går kl.] LT', lastWeek: '[i] dddd[s kl.] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: '%s siden', s: 'få sekunder', ss: '%d sekunder', m: 'et minut', mm: '%d minutter', h: 'en time', hh: '%d timer', d: 'en dag', dd: '%d dage', M: 'en måned', MM: '%d måneder', y: 'et år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return da; }))); /***/ }), /***/ "0f38": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tagalog (Philippines) [tl-ph] //! author : Dan Hagman : https://github.com/hagmandan ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tlPh = moment.defineLocale('tl-ph', { months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split( '_' ), monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split( '_' ), weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'MM/D/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY HH:mm', LLLL: 'dddd, MMMM DD, YYYY HH:mm', }, calendar: { sameDay: 'LT [ngayong araw]', nextDay: '[Bukas ng] LT', nextWeek: 'LT [sa susunod na] dddd', lastDay: 'LT [kahapon]', lastWeek: 'LT [noong nakaraang] dddd', sameElse: 'L', }, relativeTime: { future: 'sa loob ng %s', past: '%s ang nakalipas', s: 'ilang segundo', ss: '%d segundo', m: 'isang minuto', mm: '%d minuto', h: 'isang oras', hh: '%d oras', d: 'isang araw', dd: '%d araw', M: 'isang buwan', MM: '%d buwan', y: 'isang taon', yy: '%d taon', }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: function (number) { return number; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return tlPh; }))); /***/ }), /***/ "0ff2": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Basque [eu] //! author : Eneko Illarramendi : https://github.com/eillarra ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var eu = moment.defineLocale('eu', { months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split( '_' ), monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split( '_' ), monthsParseExact: true, weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split( '_' ), weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'), weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'YYYY[ko] MMMM[ren] D[a]', LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm', LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', l: 'YYYY-M-D', ll: 'YYYY[ko] MMM D[a]', lll: 'YYYY[ko] MMM D[a] HH:mm', llll: 'ddd, YYYY[ko] MMM D[a] HH:mm', }, calendar: { sameDay: '[gaur] LT[etan]', nextDay: '[bihar] LT[etan]', nextWeek: 'dddd LT[etan]', lastDay: '[atzo] LT[etan]', lastWeek: '[aurreko] dddd LT[etan]', sameElse: 'L', }, relativeTime: { future: '%s barru', past: 'duela %s', s: 'segundo batzuk', ss: '%d segundo', m: 'minutu bat', mm: '%d minutu', h: 'ordu bat', hh: '%d ordu', d: 'egun bat', dd: '%d egun', M: 'hilabete bat', MM: '%d hilabete', y: 'urte bat', yy: '%d urte', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return eu; }))); /***/ }), /***/ "10e8": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Thai [th] //! author : Kridsada Thanabulpong : https://github.com/sirn ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var th = moment.defineLocale('th', { months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split( '_' ), monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split( '_' ), monthsParseExact: true, weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY เวลา H:mm', LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm', }, meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, isPM: function (input) { return input === 'หลังเที่ยง'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ก่อนเที่ยง'; } else { return 'หลังเที่ยง'; } }, calendar: { sameDay: '[วันนี้ เวลา] LT', nextDay: '[พรุ่งนี้ เวลา] LT', nextWeek: 'dddd[หน้า เวลา] LT', lastDay: '[เมื่อวานนี้ เวลา] LT', lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT', sameElse: 'L', }, relativeTime: { future: 'อีก %s', past: '%sที่แล้ว', s: 'ไม่กี่วินาที', ss: '%d วินาที', m: '1 นาที', mm: '%d นาที', h: '1 ชั่วโมง', hh: '%d ชั่วโมง', d: '1 วัน', dd: '%d วัน', w: '1 สัปดาห์', ww: '%d สัปดาห์', M: '1 เดือน', MM: '%d เดือน', y: '1 ปี', yy: '%d ปี', }, }); return th; }))); /***/ }), /***/ "1157": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * jQuery JavaScript Library v2.2.4 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-05-20T17:23Z */ (function( global, factory ) { if ( true && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Support: Firefox 18+ // Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) //"use strict"; var arr = []; var document = window.document; var slice = arr.slice; var concat = arr.concat; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "2.2.4", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } // Extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = jQuery.isArray( copy ) ) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray( src ) ? src : []; } else { clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, isFunction: function( obj ) { return jQuery.type( obj ) === "function"; }, isArray: Array.isArray, isWindow: function( obj ) { return obj != null && obj === obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) var realStringObj = obj && obj.toString(); return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; }, isPlainObject: function( obj ) { var key; // Not plain objects: // - Any object or value whose internal [[Class]] property is not "[object Object]" // - DOM nodes // - window if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call( obj, "constructor" ) && !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, type: function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android<4.0, iOS<6 (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; }, // Evaluates a script in a global context globalEval: function( code ) { var script, indirect = eval; code = jQuery.trim( code ); if ( code ) { // If the code includes a valid, prologue position // strict mode pragma, execute code by injecting a // script tag into the document. if ( code.indexOf( "use strict" ) === 1 ) { script = document.createElement( "script" ); script.text = code; document.head.appendChild( script ).parentNode.removeChild( script ); } else { // Otherwise, avoid the DOM node creation, insertion // and removal by using an indirect global eval indirect( code ); } } }, // Convert dashed to camelCase; used by the css and data modules // Support: IE9-11+ // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // Support: Android<4.1 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var tmp, args, proxy; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: Date.now, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); // JSHint would error on this code due to the Symbol not being defined in ES5. // Defining this global in .jshintrc would create a danger of using the global // unguarded in another place, it seems safer to just disable JSHint for these // three lines. /* jshint ignore: start */ if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; } /* jshint ignore: end */ // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: iOS 8.2 (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.2.1 * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2015-10-17 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // http://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, nidselect, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // ID selector if ( (m = match[1]) ) { // Document context if ( nodeType === 9 ) { if ( (elem = context.getElementById( m )) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && (elem = newContext.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !compilerCache[ selector + " " ] && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { if ( nodeType !== 1 ) { newContext = context; newSelector = selector; // qSA looks outside Element context, which is not what we want // Thanks to Andrew Dupont for this workaround technique // Support: IE <=8 // Exclude object elements } else if ( context.nodeName.toLowerCase() !== "object" ) { // Capture the context ID, setting it first if necessary if ( (nid = context.getAttribute( "id" )) ) { nid = nid.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", (nid = expando) ); } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; while ( i-- ) { groups[i] = nidselect + " " + toSelector( groups[i] ); } newSelector = groups.join( "," ); // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9-11, Edge // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) if ( (parent = document.defaultView) && parent.top !== parent ) { // Support: IE 11 if ( parent.addEventListener ) { parent.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", unloadHandler ); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( document.createComment("") ); return !div.getElementsByTagName("*").length; }); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); return m ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 docElem.appendChild( div ).innerHTML = "" + ""; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibing-combinator selector` fails if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch (e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || (node[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || (outerCache[ node.uniqueID ] = {}); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[0] = null; return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); if ( (oldCache = uniqueCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; if ( !context && elem.ownerDocument !== document ) { setDocument( elem ); xml = !documentIsHTML; } while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = ""; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = ""; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; } ); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) > -1 ) !== not; } ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, len = this.length, ret = [], self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Method init() accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector[ 0 ] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); // Support: Blackberry 4.6 // gEBID returns nodes no longer in the document (#6963) if ( elem && elem.parentNode ) { // Inject the element directly into the jQuery object this.length = 1; this[ 0 ] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return root.ready !== undefined ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( pos ? pos.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // Index in selector if ( typeof elem === "string" ) { return indexOf.call( jQuery( elem ), this[ 0 ] ); } // Locate the position of the desired element return indexOf.call( this, // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { return elem.contentDocument || jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var matched = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { matched = jQuery.filter( selector, matched ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { matched.reverse(); } } return this.pushStack( matched ); }; } ); var rnotwhite = ( /\S+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( jQuery.isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = queue = []; if ( !memory ) { list = memory = ""; } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], [ "notify", "progress", jQuery.Callbacks( "memory" ) ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. // If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // Add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .progress( updateFunc( i, progressContexts, progressValues ) ) .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ); } else { --remaining; } } } // If we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } } ); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } } ); /** * The ready event handler and self cleanup method */ function completed() { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); jQuery.ready(); } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE9-10 only // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); } else { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); } } return readyList.promise( obj ); }; // Kick off the DOM ready check even if the user does not jQuery.ready.promise(); // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < len; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : len ? fn( elems[ 0 ], key ) : emptyGet; }; var acceptData = function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any /* jshint -W018 */ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; Data.prototype = { register: function( owner, initial ) { var value = initial || {}; // If it is a node unlikely to be stringify-ed or looped over // use plain assignment if ( owner.nodeType ) { owner[ this.expando ] = value; // Otherwise secure it in a non-enumerable, non-writable property // configurability must be true to allow the property to be // deleted with the delete operator } else { Object.defineProperty( owner, this.expando, { value: value, writable: true, configurable: true } ); } return owner[ this.expando ]; }, cache: function( owner ) { // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. if ( !acceptData( owner ) ) { return {}; } // Check if the owner object already has a cache var value = owner[ this.expando ]; // If not, create one if ( !value ) { value = {}; // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. if ( acceptData( owner ) ) { // If it is a node unlikely to be stringify-ed or looped over // use plain assignment if ( owner.nodeType ) { owner[ this.expando ] = value; // Otherwise secure it in a non-enumerable property // configurable must be true to allow the property to be // deleted when data is removed } else { Object.defineProperty( owner, this.expando, { value: value, configurable: true } ); } } } return value; }, set: function( owner, data, value ) { var prop, cache = this.cache( owner ); // Handle: [ owner, key, value ] args if ( typeof data === "string" ) { cache[ data ] = value; // Handle: [ owner, { properties } ] args } else { // Copy the properties one-by-one to the cache object for ( prop in data ) { cache[ prop ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { return key === undefined ? this.cache( owner ) : owner[ this.expando ] && owner[ this.expando ][ key ]; }, access: function( owner, key, value ) { var stored; // In cases where either: // // 1. No key was specified // 2. A string key was specified, but no value provided // // Take the "read" path and allow the get method to determine // which value to return, respectively either: // // 1. The entire cache object // 2. The data stored at the key // if ( key === undefined || ( ( key && typeof key === "string" ) && value === undefined ) ) { stored = this.get( owner, key ); return stored !== undefined ? stored : this.get( owner, jQuery.camelCase( key ) ); } // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties // 2. A key and value // this.set( owner, key, value ); // Since the "set" path can have two possible entry points // return the expected data based on which path was taken[*] return value !== undefined ? value : key; }, remove: function( owner, key ) { var i, name, camel, cache = owner[ this.expando ]; if ( cache === undefined ) { return; } if ( key === undefined ) { this.register( owner ); } else { // Support array or space separated string of keys if ( jQuery.isArray( key ) ) { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = key.concat( key.map( jQuery.camelCase ) ); } else { camel = jQuery.camelCase( key ); // Try the string as a key before any manipulation if ( key in cache ) { name = [ key, camel ]; } else { // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace name = camel; name = name in cache ? [ name ] : ( name.match( rnotwhite ) || [] ); } } i = name.length; while ( i-- ) { delete cache[ name[ i ] ]; } } // Remove the expando if there's no more data if ( key === undefined || jQuery.isEmptyObject( cache ) ) { // Support: Chrome <= 35-45+ // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://code.google.com/p/chromium/issues/detail?id=378607 if ( owner.nodeType ) { owner[ this.expando ] = undefined; } else { delete owner[ this.expando ]; } } }, hasData: function( owner ) { var cache = owner[ this.expando ]; return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; var dataPriv = new Data(); var dataUser = new Data(); // Implementation Summary // // 1. Enforce API surface and semantic compatibility with 1.9.x branch // 2. Improve the module's maintainability by reducing the storage // paths to a single mechanism. // 3. Use the same single mechanism to support "private" and "user" data. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) // 5. Avoid exposing implementation details on user objects (eg. expando properties) // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; function dataAttr( elem, key, data ) { var name; // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch ( e ) {} // Make sure we set the data so it isn't changed later dataUser.set( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend( { hasData: function( elem ) { return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { dataPriv.remove( elem, name ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Gets all values if ( key === undefined ) { if ( this.length ) { data = dataUser.get( elem ); if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } dataPriv.set( elem, "hasDataAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { dataUser.set( this, key ); } ); } return access( this, function( value ) { var data, camelKey; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the // `value` parameter was not undefined. An empty jQuery object // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { // Attempt to get data from the cache // with the key as-is data = dataUser.get( elem, key ) || // Try to find dashed key if it exists (gh-2779) // This is for 2.2.x only dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); if ( data !== undefined ) { return data; } camelKey = jQuery.camelCase( key ); // Attempt to get data from the cache // with the key camelized data = dataUser.get( elem, camelKey ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs data = dataAttr( elem, camelKey, undefined ); if ( data !== undefined ) { return data; } // We tried really hard, but the data doesn't exist. return; } // Set the data... camelKey = jQuery.camelCase( key ); this.each( function() { // First, attempt to store a copy or reference of any // data that might've been store with a camelCased key. var data = dataUser.get( this, camelKey ); // For HTML5 data-* attribute interop, we have to // store property names with dashes in a camelCase form. // This might not apply to all properties...* dataUser.set( this, camelKey, value ); // *... In the case of properties that might _actually_ // have dashes, we need to also store a copy of that // unchanged property. if ( key.indexOf( "-" ) > -1 && data !== undefined ) { dataUser.set( this, key, value ); } } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each( function() { dataUser.remove( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray( data ) ) { queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // Clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { dataPriv.remove( elem, [ type + "queue", key ] ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Make sure we update the tween properties later on valueParts = valueParts || []; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; do { // If previous iteration zeroed out, double until we get *something*. // Use string for doubling so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply initialInUnit = initialInUnit / scale; jQuery.style( elem, prop, initialInUnit + unit ); // Update scale, tolerating zero or NaN from tween.cur() // Break the loop if scale is unchanged or perfect, or if we've just had enough. } while ( scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations ); } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([\w:-]+)/ ); var rscriptType = ( /^$|\/(?:java|ecma)script/i ); // We have to close these tags to support XHTML (#13200) var wrapMap = { // Support: IE9 option: [ 1, "" ], // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting or other required elements. thead: [ 1, "", "
" ], col: [ 2, "", "
" ], tr: [ 2, "", "
" ], td: [ 3, "", "
" ], _default: [ 0, "", "" ] }; // Support: IE9 wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { // Support: IE9-11+ // Use typeof to avoid zero-argument method invocation on host objects (#15151) var ret = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) : []; return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], ret ) : ret; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { var elem, tmp, tag, wrap, contains, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { // Support: Android<4.1, PhantomJS<2 // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Support: Android<4.1, PhantomJS<2 // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, tmp.childNodes ); // Remember the top-level container tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392) tmp.textContent = ""; } } } // Remove wrapper from fragment fragment.textContent = ""; i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } return fragment; } ( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); // Support: Android 4.0-4.3, Safari<=5.1 // Check state lost if the name is set (#11217) // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Safari<=5.1, Android<4.2 // Older WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<=11+ // Make sure textarea (and checkbox) defaultValue is properly cloned div.innerHTML = ""; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; } )(); var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE9 // See #13393 for more info function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = {}; } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove data and the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { dataPriv.remove( elem, "handle events" ); } }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, j, ret, matched, handleObj, handlerQueue = [], args = slice.call( arguments ), handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or 2) have namespace(s) // a subset or equal to those in the bound event (both can have no namespace). if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Support (at least): Chrome, IE9 // Find delegate handlers // Black-hole SVG instance trees (#13180) // // Support: Firefox<=42+ // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) if ( delegateCount && cur.nodeType && ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push( { elem: cur, handlers: matches } ); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, // Includes some event props shared by KeyEvent and MouseEvent props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split( " " ), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + "screenX screenY toElement" ).split( " " ), filter: function( event, original ) { var eventDoc, doc, body, button = original.button; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: Cordova 2.5 (WebKit) (#13255) // All events should have a target; Cordova deviceready doesn't if ( !event.target ) { event.target = document; } // Support: Safari 6.0+, Chrome<28 // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { this.focus(); return false; } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } } }; jQuery.removeEvent = function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android<4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( e && !this.isSimulated ) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://code.google.com/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); } } ); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, // Support: IE 10-11, Edge 10240+ // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /\s*$/g; // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName( "tbody" )[ 0 ] || elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[ 1 ]; } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. if ( dataPriv.hasData( src ) ) { pdataOld = dataPriv.access( src ); pdataCur = dataPriv.set( dest, pdataOld ); events = pdataOld.events; if ( events ) { delete pdataCur.handle; pdataCur.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } } // 2. Copy user data if ( dataUser.hasData( src ) ) { udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); dataUser.set( dest, udataCur ); } } // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = concat.apply( [], args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( isFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android<4.1, PhantomJS<2 // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !dataPriv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); } } } } } } return collection; } function remove( elem, selector, keepData ) { var node, nodes = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = nodes[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html.replace( rxhtmlTag, "<$1>" ); }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), inPage = jQuery.contains( elem.ownerDocument, elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); for ( i = 0, l = srcElements.length; i < l; i++ ) { fixInput( srcElements[ i ], destElements[ i ] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0, l = srcElements.length; i < l; i++ ) { cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } // Return the cloned set return clone; }, cleanData: function( elems ) { var data, elem, type, special = jQuery.event.special, i = 0; for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { if ( acceptData( elem ) ) { if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Support: Chrome <= 35-45+ // Assign undefined instead of using delete, see Data#remove elem[ dataPriv.expando ] = undefined; } if ( elem[ dataUser.expando ] ) { // Support: Chrome <= 35-45+ // Assign undefined instead of using delete, see Data#remove elem[ dataUser.expando ] = undefined; } } } } } ); jQuery.fn.extend( { // Keep domManip exposed until 3.0 (gh-2225) domManip: domManip, detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } } ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks jQuery.cleanData( getAll( elem, false ) ); // Remove any remaining nodes elem.textContent = ""; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined && elem.nodeType === 1 ) { return elem.innerHTML; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { elem = this[ i ] || {}; // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, ret = [], insert = jQuery( selector ), last = insert.length - 1, i = 0; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Support: QtWebKit // .get() because push.apply(_, arraylike) throws push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var iframe, elemdisplay = { // Support: Firefox // We have to pre-define these values for FF (#10227) HTML: "block", BODY: "block" }; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery( "');else lyr1 = $(''); if (opts.theme) lyr2 = $('');else lyr2 = $(''); if (opts.theme && full) { s = ''; } else if (opts.theme) { s = ''; } else if (full) { s = ''; } else { s = ''; } lyr3 = $(s); // if we have a message, style it if (msg) { if (opts.theme) { lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } // style the overlay if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/ ) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed' : 'absolute'); // make iframe layer transparent in IE if (msie || opts.forceIframe) lyr1.css('opacity', 0.0); //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); var layers = [lyr1, lyr2, lyr3], $par = full ? $('body') : $(el); $.each(layers, function () { this.appendTo($par); }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); if (ie6 || expr) { // give body 100% height if (full && opts.allowBodyStretch && $.support.boxModel) $('html,body').css('height', '100%'); // fix ie6 issue when blocked element has a border width if ((ie6 || !$.support.boxModel) && !full) { var t = sz(el, 'borderTopWidth'), l = sz(el, 'borderLeftWidth'); var fixT = t ? '(0 - ' + t + ')' : 0; var fixL = l ? '(0 - ' + l + ')' : 0; } // simulate fixed position $.each(layers, function (i, o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { if (full) s.setExpression('height', 'Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:' + opts.quirksmodeOffsetHack + ') + "px"');else s.setExpression('height', 'this.parentNode.offsetHeight + "px"'); if (full) s.setExpression('width', 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');else s.setExpression('width', 'this.parentNode.offsetWidth + "px"'); if (fixL) s.setExpression('left', fixL); if (fixT) s.setExpression('top', fixT); } else if (opts.centerY) { if (full) s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0; } else if (!opts.centerY && full) { var top = opts.css && opts.css.top ? parseInt(opts.css.top, 10) : 0; var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + ' + top + ') + "px"'; s.setExpression('top', expression); } }); } // show the message if (msg) { if (opts.theme) lyr3.find('.ui-widget-content').append(msg);else lyr3.append(msg); if (msg.jquery || msg.nodeType) $(msg).show(); } if ((msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { var cb = opts.onBlock ? opts.onBlock : noOp; var cb1 = opts.showOverlay && !msg ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if (msg) lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); if (opts.onBlock) opts.onBlock.bind(lyr3)(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(opts.focusableElements, pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if (opts.timeout) { // auto-unblock var to = setTimeout(function () { if (full) $.unblockUI(opts);else $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); } } // remove the block function remove(el, opts) { var count; var full = el == window; var $el = $(el); var data = $el.data('blockUI.history'); var to = $el.data('blockUI.timeout'); if (to) { clearTimeout(to); $el.removeData('blockUI.timeout'); } opts = $.extend({}, $.blockUI.defaults, opts || {}); bind(0, el, opts); // unbind events if (opts.onUnblock === null) { opts.onUnblock = $el.data('blockUI.onUnblock'); $el.removeData('blockUI.onUnblock'); } var els; if (full) // crazy selector to handle odd field errors in ie6/7 els = $('body').children().filter('.blockUI').add('body > .blockUI');else els = $el.find('>.blockUI'); // fix cursor issue if (opts.cursorReset) { if (els.length > 1) els[1].style.cursor = opts.cursorReset; if (els.length > 2) els[2].style.cursor = opts.cursorReset; } if (full) pageBlock = pageBlockEls = null; if (opts.fadeOut) { count = els.length; els.stop().fadeOut(opts.fadeOut, function () { if (--count === 0) reset(els, data, opts, el); }); } else reset(els, data, opts, el); } // move blocking element back into the DOM where it started function reset(els, data, opts, el) { var $el = $(el); if ($el.data('blockUI.isBlocked')) return; els.each(function (i, o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) this.parentNode.removeChild(this); }); if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; data.el.style.cursor = 'default'; // #59 if (data.parent) data.parent.appendChild(data.el); $el.removeData('blockUI.history'); } if ($el.data('blockUI.static')) { $el.css('position', 'static'); // #22 } if (typeof opts.onUnblock == 'function') opts.onUnblock(el, opts); // fix issue in Safari 6 where block artifacts remain until reflow var body = $(document.body), w = body.width(), cssW = body[0].style.width; body.width(w - 1).width(w); body[0].style.width = cssW; } // bind/unbind the handler function bind(b, el, opts) { var full = el == window, $el = $(el); // don't bother unbinding if there is nothing to unbind if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) return; $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false if (!full || !opts.bindEvents || b && !opts.showOverlay) return; // bind anchors and inputs for mouse and key events var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; if (b) $(document).bind(events, opts, handler);else $(document).unbind(events, handler); // former impl... // var $e = $('a,:input'); // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); } // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length - 1]; var back = e.shiftKey && e.target === els[0]; if (fwd || back) { setTimeout(function () { focus(back); }, 10); return false; } } } var opts = e.data; var target = $(e.target); if (target.hasClass('blockOverlay') && opts.onOverlayClick) opts.onOverlayClick(e); // allow events within the message content if (target.parents('div.' + opts.blockMsgClass).length > 0) return true; // allow events for content that is not being blocked return target.parents().children().filter('div.blockUI').length === 0; } function focus(back) { if (!pageBlockEls) return; var e = pageBlockEls[back === true ? pageBlockEls.length - 1 : 0]; if (e) e.focus(); } function center(el, x, y) { var p = el.parentNode, s = el.style; var l = (p.offsetWidth - el.offsetWidth) / 2 - sz(p, 'borderLeftWidth'); var t = (p.offsetHeight - el.offsetHeight) / 2 - sz(p, 'borderTopWidth'); if (x) s.left = l > 0 ? l + 'px' : '0'; if (y) s.top = t > 0 ? t + 'px' : '0'; } function sz(el, p) { return parseInt($.css(el, p), 10) || 0; } } /*global define:true */ if (typeof define === 'function' && __webpack_require__("3c35") && __webpack_require__("3c35").jQuery) { define(['jquery'], setup); } else { setup(jQuery); } })(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "ada2": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Ukrainian [uk] //! author : zemlanin : https://github.com/zemlanin //! Author : Menelion Elensúle : https://github.com/Oire ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]; } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд', mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин', dd: 'день_дні_днів', MM: 'місяць_місяці_місяців', yy: 'рік_роки_років', }; if (key === 'm') { return withoutSuffix ? 'хвилина' : 'хвилину'; } else if (key === 'h') { return withoutSuffix ? 'година' : 'годину'; } else { return number + ' ' + plural(format[key], +number); } } function weekdaysCaseReplace(m, format) { var weekdays = { nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split( '_' ), accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split( '_' ), genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split( '_' ), }, nounCase; if (m === true) { return weekdays['nominative'] .slice(1, 7) .concat(weekdays['nominative'].slice(0, 1)); } if (!m) { return weekdays['nominative']; } nounCase = /(\[[ВвУу]\]) ?dddd/.test(format) ? 'accusative' : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format) ? 'genitive' : 'nominative'; return weekdays[nounCase][m.day()]; } function processHoursFunction(str) { return function () { return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; }; } var uk = moment.defineLocale('uk', { months: { format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split( '_' ), standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split( '_' ), }, monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split( '_' ), weekdays: weekdaysCaseReplace, weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY р.', LLL: 'D MMMM YYYY р., HH:mm', LLLL: 'dddd, D MMMM YYYY р., HH:mm', }, calendar: { sameDay: processHoursFunction('[Сьогодні '), nextDay: processHoursFunction('[Завтра '), lastDay: processHoursFunction('[Вчора '), nextWeek: processHoursFunction('[У] dddd ['), lastWeek: function () { switch (this.day()) { case 0: case 3: case 5: case 6: return processHoursFunction('[Минулої] dddd [').call(this); case 1: case 2: case 4: return processHoursFunction('[Минулого] dddd [').call(this); } }, sameElse: 'L', }, relativeTime: { future: 'за %s', past: '%s тому', s: 'декілька секунд', ss: relativeTimeWithPlural, m: relativeTimeWithPlural, mm: relativeTimeWithPlural, h: 'годину', hh: relativeTimeWithPlural, d: 'день', dd: relativeTimeWithPlural, M: 'місяць', MM: relativeTimeWithPlural, y: 'рік', yy: relativeTimeWithPlural, }, // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason meridiemParse: /ночі|ранку|дня|вечора/, isPM: function (input) { return /^(дня|вечора)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ночі'; } else if (hour < 12) { return 'ранку'; } else if (hour < 17) { return 'дня'; } else { return 'вечора'; } }, dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/, ordinal: function (number, period) { switch (period) { case 'M': case 'd': case 'DDD': case 'w': case 'W': return number + '-й'; case 'D': return number + '-го'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return uk; }))); /***/ }), /***/ "ade3": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ "b089": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "b090": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { if (true) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("ba48")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (Chartist) { return (root.returnExportsGlobal = factory(Chartist)); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(this, function (Chartist) { /** * Chartist.js plugin to display a data label on top of the points in a line chart. * */ /* global Chartist */ (function (window, document, Chartist) { 'use strict'; var defaultOptions = { currency: undefined, currencyFormatCallback: undefined, tooltipOffset: { x: 0, y: -20 }, anchorToPoint: false, appendToBody: false, class: undefined, pointClass: 'ct-point' }; Chartist.plugins = Chartist.plugins || {}; Chartist.plugins.tooltip = function (options) { options = Chartist.extend({}, defaultOptions, options); return function tooltip(chart) { var tooltipSelector = options.pointClass; if (chart instanceof Chartist.Bar) { tooltipSelector = 'ct-bar'; } else if (chart instanceof Chartist.Pie) { // Added support for donut graph if (chart.options.donut) { tooltipSelector = 'ct-slice-donut'; } else { tooltipSelector = 'ct-slice-pie'; } } var $chart = chart.container; var $toolTip = $chart.querySelector('.chartist-tooltip'); if (!$toolTip) { $toolTip = document.createElement('div'); $toolTip.className = (!options.class) ? 'chartist-tooltip' : 'chartist-tooltip ' + options.class; if (!options.appendToBody) { $chart.appendChild($toolTip); } else { document.body.appendChild($toolTip); } } var height = $toolTip.offsetHeight; var width = $toolTip.offsetWidth; hide($toolTip); function on(event, selector, callback) { $chart.addEventListener(event, function (e) { if (!selector || hasClass(e.target, selector)) callback(e); }); } on('mouseover', tooltipSelector, function (event) { var $point = event.target; var tooltipText = ''; var isPieChart = (chart instanceof Chartist.Pie) ? $point : $point.parentNode; var seriesName = (isPieChart) ? $point.parentNode.getAttribute('ct:meta') || $point.parentNode.getAttribute('ct:series-name') : ''; var meta = $point.getAttribute('ct:meta') || seriesName || ''; var hasMeta = !!meta; var value = $point.getAttribute('ct:value'); if (options.transformTooltipTextFnc && typeof options.transformTooltipTextFnc === 'function') { value = options.transformTooltipTextFnc(value); } if (options.tooltipFnc && typeof options.tooltipFnc === 'function') { tooltipText = options.tooltipFnc(meta, value); } else { if (options.metaIsHTML) { var txt = document.createElement('textarea'); txt.innerHTML = meta; meta = txt.value; } meta = '' + meta + ''; if (hasMeta) { tooltipText += meta + '
'; } else { // For Pie Charts also take the labels into account // Could add support for more charts here as well! if (chart instanceof Chartist.Pie) { var label = next($point, 'ct-label'); if (label) { tooltipText += text(label) + '
'; } } } if (value) { if (options.currency) { if (options.currencyFormatCallback != undefined) { value = options.currencyFormatCallback(value, options); } else { value = options.currency + value.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, '$1,'); } } value = '' + value + ''; tooltipText += value; } } if(tooltipText) { $toolTip.innerHTML = tooltipText; setPosition(event); show($toolTip); // Remember height and width to avoid wrong position in IE height = $toolTip.offsetHeight; width = $toolTip.offsetWidth; } }); on('mouseout', tooltipSelector, function () { hide($toolTip); }); on('mousemove', null, function (event) { if (false === options.anchorToPoint) setPosition(event); }); function setPosition(event) { height = height || $toolTip.offsetHeight; width = width || $toolTip.offsetWidth; var offsetX = - width / 2 + options.tooltipOffset.x var offsetY = - height + options.tooltipOffset.y; var anchorX, anchorY; if (!options.appendToBody) { var box = $chart.getBoundingClientRect(); var left = event.pageX - box.left - window.pageXOffset ; var top = event.pageY - box.top - window.pageYOffset ; if (true === options.anchorToPoint && event.target.x2 && event.target.y2) { anchorX = parseInt(event.target.x2.baseVal.value); anchorY = parseInt(event.target.y2.baseVal.value); } $toolTip.style.top = (anchorY || top) + offsetY + 'px'; $toolTip.style.left = (anchorX || left) + offsetX + 'px'; } else { $toolTip.style.top = event.pageY + offsetY + 'px'; $toolTip.style.left = event.pageX + offsetX + 'px'; } } } }; function show(element) { if(!hasClass(element, 'tooltip-show')) { element.className = element.className + ' tooltip-show'; } } function hide(element) { var regex = new RegExp('tooltip-show' + '\\s*', 'gi'); element.className = element.className.replace(regex, '').trim(); } function hasClass(element, className) { return (' ' + element.getAttribute('class') + ' ').indexOf(' ' + className + ' ') > -1; } function next(element, className) { do { element = element.nextSibling; } while (element && !hasClass(element, className)); return element; } function text(element) { return element.innerText || element.textContent; } } (window, document, Chartist)); return Chartist.plugins.tooltips; })); /***/ }), /***/ "b0c5": /***/ (function(module, exports, __webpack_require__) { "use strict"; var regexpExec = __webpack_require__("520a"); __webpack_require__("5ca1")({ target: 'RegExp', proto: true, forced: regexpExec !== /./.exec }, { exec: regexpExec }); /***/ }), /***/ "b29d": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Lao [lo] //! author : Ryan Hart : https://github.com/ryanhart2 ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var lo = moment.defineLocale('lo', { months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split( '_' ), monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split( '_' ), weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'ວັນdddd D MMMM YYYY HH:mm', }, meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, isPM: function (input) { return input === 'ຕອນແລງ'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ຕອນເຊົ້າ'; } else { return 'ຕອນແລງ'; } }, calendar: { sameDay: '[ມື້ນີ້ເວລາ] LT', nextDay: '[ມື້ອື່ນເວລາ] LT', nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT', lastDay: '[ມື້ວານນີ້ເວລາ] LT', lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', sameElse: 'L', }, relativeTime: { future: 'ອີກ %s', past: '%sຜ່ານມາ', s: 'ບໍ່ເທົ່າໃດວິນາທີ', ss: '%d ວິນາທີ', m: '1 ນາທີ', mm: '%d ນາທີ', h: '1 ຊົ່ວໂມງ', hh: '%d ຊົ່ວໂມງ', d: '1 ມື້', dd: '%d ມື້', M: '1 ເດືອນ', MM: '%d ເດືອນ', y: '1 ປີ', yy: '%d ປີ', }, dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/, ordinal: function (number) { return 'ທີ່' + number; }, }); return lo; }))); /***/ }), /***/ "b2f6": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("96cf"); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("1da1"); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: "ChangeEmail", head: { title: function title() { return { inner: "Change Email", separator: " " }; } }, data: function data() { return { // validate isError: false, isNotMatch: false, isInvalidEmail: false, errorMessage: "", // input newEmail: "", confirmNewEmail: "", password: "" }; }, methods: { compareEmail: function compareEmail() { if (this.newEmail.trim() === "" || this.confirmNewEmail.trim() === "" || this.password.trim() === "") { this.isError = true; this.errorMessage = "New email field is required"; return false; } else if (!this.$validateEmail(this.newEmail)) { this.isInvalidEmail = true; this.errorMessage = "Your email is invalid."; } else { this.isError = false; this.isInvalidEmail = false; if (this.newEmail !== this.confirmNewEmail) { this.isNotMatch = true; this.errorMessage = "Email and confirm email does not match."; return false; } else { this.isNotMatch = false; return true; } } }, changeEmail: function () { var _changeEmail = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!this.compareEmail()) { _context.next = 5; break; } $("#btn-save").button("loading"); _context.next = 4; return this.$store.dispatch("user/changeEmail", { newEmail: this.newEmail, confirmNewEmail: this.confirmNewEmail, password: this.password }); case 4: $("#btn-save").button("reset"); case 5: case "end": return _context.stop(); } } }, _callee, this); })); function changeEmail() { return _changeEmail.apply(this, arguments); } return changeEmail; }() }, mounted: function mounted() { // Changes Takes Place On Body Resize Event this.$autoSetHeight(); } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "b3eb": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German (Austria) [de-at] //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Martin Groller : https://github.com/MadMG //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], w: ['eine Woche', 'einer Woche'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var deAt = moment.defineLocale('de-at', { months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, w: processRelativeTime, ww: '%d Wochen', M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return deAt; }))); /***/ }), /***/ "b469": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German [de] //! author : lluchs : https://github.com/lluchs //! author: Menelion Elensúle: https://github.com/Oire //! author : Mikolaj Dadela : https://github.com/mik01aj ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], w: ['eine Woche', 'einer Woche'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var de = moment.defineLocale('de', { months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, w: processRelativeTime, ww: '%d Wochen', M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return de; }))); /***/ }), /***/ "b4bc": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "b50d": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("c532"); var settle = __webpack_require__("467f"); var buildURL = __webpack_require__("30b5"); var parseHeaders = __webpack_require__("c345"); var isURLSameOrigin = __webpack_require__("3934"); var createError = __webpack_require__("2d83"); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password || ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; // Listen for ready state request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(createError('Network Error', config, null, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { var cookies = __webpack_require__("7aac"); // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (config.withCredentials) { request.withCredentials = true; } // Add responseType to request if needed if (config.responseType) { try { request.responseType = config.responseType; } catch (e) { // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. if (config.responseType !== 'json') { throw e; } } } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken) { // Handle cancellation config.cancelToken.promise.then(function onCanceled(cancel) { if (!request) { return; } request.abort(); reject(cancel); // Clean up request request = null; }); } if (requestData === undefined) { requestData = null; } // Send the request request.send(requestData); }); }; /***/ }), /***/ "b53d": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Central Atlas Tamazight Latin [tzm-latn] //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tzmLatn = moment.defineLocale('tzm-latn', { months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split( '_' ), monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split( '_' ), weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[asdkh g] LT', nextDay: '[aska g] LT', nextWeek: 'dddd [g] LT', lastDay: '[assant g] LT', lastWeek: 'dddd [g] LT', sameElse: 'L', }, relativeTime: { future: 'dadkh s yan %s', past: 'yan %s', s: 'imik', ss: '%d imik', m: 'minuḍ', mm: '%d minuḍ', h: 'saɛa', hh: '%d tassaɛin', d: 'ass', dd: '%d ossan', M: 'ayowr', MM: '%d iyyirn', y: 'asgas', yy: '%d isgasn', }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return tzmLatn; }))); /***/ }), /***/ "b540": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Javanese [jv] //! author : Rony Lantip : https://github.com/lantip //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var jv = moment.defineLocale('jv', { months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'), weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /enjing|siyang|sonten|ndalu/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'enjing') { return hour; } else if (meridiem === 'siyang') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'sonten' || meridiem === 'ndalu') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'enjing'; } else if (hours < 15) { return 'siyang'; } else if (hours < 19) { return 'sonten'; } else { return 'ndalu'; } }, calendar: { sameDay: '[Dinten puniko pukul] LT', nextDay: '[Mbenjang pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kala wingi pukul] LT', lastWeek: 'dddd [kepengker pukul] LT', sameElse: 'L', }, relativeTime: { future: 'wonten ing %s', past: '%s ingkang kepengker', s: 'sawetawis detik', ss: '%d detik', m: 'setunggal menit', mm: '%d menit', h: 'setunggal jam', hh: '%d jam', d: 'sedinten', dd: '%d dinten', M: 'sewulan', MM: '%d wulan', y: 'setaun', yy: '%d taun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return jv; }))); /***/ }), /***/ "b5b7": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Spanish (Mexico) [es-mx] //! author : JC Franco : https://github.com/jcfranco ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split( '_' ), monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), monthsParse = [ /^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i, ], monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; var esMx = moment.defineLocale('es-mx', { months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortDot; } else if (/-MMM-/.test(format)) { return monthsShort[m.month()]; } else { return monthsShortDot[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY H:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm', }, calendar: { sameDay: function () { return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextDay: function () { return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, nextWeek: function () { return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastDay: function () { return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: 'en %s', past: 'hace %s', s: 'unos segundos', ss: '%d segundos', m: 'un minuto', mm: '%d minutos', h: 'una hora', hh: '%d horas', d: 'un día', dd: '%d días', w: 'una semana', ww: '%d semanas', M: 'un mes', MM: '%d meses', y: 'un año', yy: '%d años', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 0, // Sunday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, invalidDate: 'Fecha inválida', }); return esMx; }))); /***/ }), /***/ "b639": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ var base64 = __webpack_require__("1fb5") var ieee754 = __webpack_require__("9152") var isArray = __webpack_require__("e3db") exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Use Object implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * Due to various browser bugs, sometimes the Object implementation will be used even * when the browser supports typed arrays. * * Note: * * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of * incorrect length in some situations. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport() /* * Export kMaxLength after typed array support is determined. */ exports.kMaxLength = kMaxLength() function typedArraySupport () { try { var arr = new Uint8Array(1) arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } } function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff } function createBuffer (that, length) { if (kMaxLength() < length) { throw new RangeError('Invalid typed array length') } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = new Uint8Array(length) that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class if (that === null) { that = new Buffer(length) } that.length = length } return that } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length) } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error( 'If encoding is specified then the first argument must be a string' ) } return allocUnsafe(this, arg) } return from(this, arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation // TODO: Legacy, not needed anymore. Remove in next major version. Buffer._augment = function (arr) { arr.__proto__ = Buffer.prototype return arr } function from (that, value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('"value" argument must not be a number') } if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { return fromArrayBuffer(that, value, encodingOrOffset, length) } if (typeof value === 'string') { return fromString(that, value, encodingOrOffset) } return fromObject(that, value) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(null, value, encodingOrOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { Buffer.prototype.__proto__ = Uint8Array.prototype Buffer.__proto__ = Uint8Array if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) { // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 Object.defineProperty(Buffer, Symbol.species, { value: null, configurable: true }) } } function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') } else if (size < 0) { throw new RangeError('"size" argument must not be negative') } } function alloc (that, size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(that, size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpretted as a start offset. return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill) } return createBuffer(that, size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(null, size, fill, encoding) } function allocUnsafe (that, size) { assertSize(size) that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { for (var i = 0; i < size; ++i) { that[i] = 0 } } return that } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(null, size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(null, size) } function fromString (that, string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('"encoding" must be a valid string encoding') } var length = byteLength(string, encoding) | 0 that = createBuffer(that, length) var actual = that.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') that = that.slice(0, actual) } return that } function fromArrayLike (that, array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that } function fromArrayBuffer (that, array, byteOffset, length) { array.byteLength // this throws if `array` is not a valid ArrayBuffer if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('\'offset\' is out of bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('\'length\' is out of bounds') } if (byteOffset === undefined && length === undefined) { array = new Uint8Array(array) } else if (length === undefined) { array = new Uint8Array(array, byteOffset) } else { array = new Uint8Array(array, byteOffset, length) } if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance that = array that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class that = fromArrayLike(that, array) } return that } function fromObject (that, obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 that = createBuffer(that, len) if (that.length === 0) { return that } obj.copy(that, 0, 0, len) return that } if (obj) { if ((typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer) || 'length' in obj) { if (typeof obj.length !== 'number' || isnan(obj.length)) { return createBuffer(that, 0) } return fromArrayLike(that, obj) } if (obj.type === 'Buffer' && isArray(obj.data)) { return fromArrayLike(that, obj.data) } } throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } function checked (length) { // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return !!(b != null && b._isBuffer) } Buffer.compare = function compare (a, b) { if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('Arguments must be Buffers') } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } buf.copy(buffer, pos) pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { string = '' + string } var len = string.length if (len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) return utf8ToBytes(string).length // assume utf8 encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coersion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect // Buffer instances. Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { var len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES if (this.length > 0) { str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') if (this.length > max) str += ' ... ' } return '' } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (!Buffer.isBuffer(target)) { throw new TypeError('Argument must be a Buffer') } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var i if (dir) { var foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { var found = true for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = string.length if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (isNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function latin1Write (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset | 0 if (isFinite(length)) { length = length | 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': return asciiWrite(this, string, offset, length) case 'latin1': case 'binary': return latin1Write(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { out += toHex(buf[i]) } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf if (Buffer.TYPED_ARRAY_SUPPORT) { newBuf = this.subarray(start, end) newBuf.__proto__ = Buffer.prototype } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined) for (var i = 0; i < sliceLen; ++i) { newBuf[i] = this[i + start] } } return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) this[offset] = (value & 0xff) return offset + 1 } function objectWriteUInt16 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> (littleEndian ? i : 1 - i) * 8 } } Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } function objectWriteUInt32 (buf, value, offset, littleEndian) { if (value < 0) value = 0xffffffff + value + 1 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff } } Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 if (!noAssert) { var limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) } return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) } else { objectWriteUInt32(this, value, offset, true) } return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start var i if (this === target && start < targetStart && targetStart < end) { // descending copy from end for (i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start] } } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { // ascending copy from start for (i = 0; i < len; ++i) { target[i + targetStart] = this[i + start] } } else { Uint8Array.prototype.set.call( target, this.subarray(start, start + len), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (val.length === 1) { var code = val.charCodeAt(0) if (code < 256) { val = code } } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } } else if (typeof val === 'number') { val = val & 255 } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()) var len = bytes.length for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g function base64clean (str) { // Node strips out invalid characters like \n and \t from the string, base64-js does not str = stringtrim(str).replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function stringtrim (str) { if (str.trim) return str.trim() return str.replace(/^\s+|\s+$/g, '') } function toHex (n) { if (n < 16) return '0' + n.toString(16) return n.toString(16) } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } function isnan (val) { return val !== val // eslint-disable-line no-self-compare } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"))) /***/ }), /***/ "b7e9": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Singapore) [en-sg] //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enSg = moment.defineLocale('en-sg', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enSg; }))); /***/ }), /***/ "b84c": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Nynorsk [nn] //! authors : https://github.com/mechuwind //! Stephen Ramthun : https://github.com/stephenramthun ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var nn = moment.defineLocale('nn', { months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split( '_' ), monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split( '_' ), monthsParseExact: true, weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'), weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY [kl.] H:mm', LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm', }, calendar: { sameDay: '[I dag klokka] LT', nextDay: '[I morgon klokka] LT', nextWeek: 'dddd [klokka] LT', lastDay: '[I går klokka] LT', lastWeek: '[Føregåande] dddd [klokka] LT', sameElse: 'L', }, relativeTime: { future: 'om %s', past: '%s sidan', s: 'nokre sekund', ss: '%d sekund', m: 'eit minutt', mm: '%d minutt', h: 'ein time', hh: '%d timar', d: 'ein dag', dd: '%d dagar', w: 'ei veke', ww: '%d veker', M: 'ein månad', MM: '%d månader', y: 'eit år', yy: '%d år', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nn; }))); /***/ }), /***/ "b8b5": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "b97c": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Latvian [lv] //! author : Kristaps Karlsons : https://github.com/skakri //! author : Jānis Elmeris : https://github.com/JanisE ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var units = { ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'), m: 'minūtes_minūtēm_minūte_minūtes'.split('_'), mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'), h: 'stundas_stundām_stunda_stundas'.split('_'), hh: 'stundas_stundām_stunda_stundas'.split('_'), d: 'dienas_dienām_diena_dienas'.split('_'), dd: 'dienas_dienām_diena_dienas'.split('_'), M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), y: 'gada_gadiem_gads_gadi'.split('_'), yy: 'gada_gadiem_gads_gadi'.split('_'), }; /** * @param withoutSuffix boolean true = a length of time; false = before/after a period of time. */ function format(forms, number, withoutSuffix) { if (withoutSuffix) { // E.g. "21 minūte", "3 minūtes". return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3]; } else { // E.g. "21 minūtes" as in "pēc 21 minūtes". // E.g. "3 minūtēm" as in "pēc 3 minūtēm". return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1]; } } function relativeTimeWithPlural(number, withoutSuffix, key) { return number + ' ' + format(units[key], number, withoutSuffix); } function relativeTimeWithSingular(number, withoutSuffix, key) { return format(units[key], number, withoutSuffix); } function relativeSeconds(number, withoutSuffix) { return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; } var lv = moment.defineLocale('lv', { months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split( '_' ), monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split( '_' ), weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'), weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY.', LL: 'YYYY. [gada] D. MMMM', LLL: 'YYYY. [gada] D. MMMM, HH:mm', LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm', }, calendar: { sameDay: '[Šodien pulksten] LT', nextDay: '[Rīt pulksten] LT', nextWeek: 'dddd [pulksten] LT', lastDay: '[Vakar pulksten] LT', lastWeek: '[Pagājušā] dddd [pulksten] LT', sameElse: 'L', }, relativeTime: { future: 'pēc %s', past: 'pirms %s', s: relativeSeconds, ss: relativeTimeWithPlural, m: relativeTimeWithSingular, mm: relativeTimeWithPlural, h: relativeTimeWithSingular, hh: relativeTimeWithPlural, d: relativeTimeWithSingular, dd: relativeTimeWithPlural, M: relativeTimeWithSingular, MM: relativeTimeWithPlural, y: relativeTimeWithSingular, yy: relativeTimeWithPlural, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return lv; }))); /***/ }), /***/ "ba48": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { if (true) { // AMD. Register as an anonymous module unless amdModuleId is set !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return (root['Chartist'] = factory()); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(this, function () { /* Chartist.js 0.11.4 * Copyright © 2019 Gion Kunz * Free to use under either the WTFPL license or the MIT license. * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT */ /** * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. * * @module Chartist.Core */ var Chartist = { version: '0.11.4' }; (function (globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; /** * This object contains all namespaces used within Chartist. * * @memberof Chartist.Core * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}} */ Chartist.namespaces = { svg: 'http://www.w3.org/2000/svg', xmlns: 'http://www.w3.org/2000/xmlns/', xhtml: 'http://www.w3.org/1999/xhtml', xlink: 'http://www.w3.org/1999/xlink', ct: 'http://gionkunz.github.com/chartist-js/ct' }; /** * Helps to simplify functional style code * * @memberof Chartist.Core * @param {*} n This exact value will be returned by the noop function * @return {*} The same value that was provided to the n parameter */ Chartist.noop = function (n) { return n; }; /** * Generates a-z from a number 0 to 26 * * @memberof Chartist.Core * @param {Number} n A number from 0 to 26 that will result in a letter a-z * @return {String} A character from a-z based on the input number n */ Chartist.alphaNumerate = function (n) { // Limit to a-z return String.fromCharCode(97 + n % 26); }; /** * Simple recursive object extend * * @memberof Chartist.Core * @param {Object} target Target object where the source will be merged into * @param {Object...} sources This object (objects) will be merged into target and then target is returned * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source */ Chartist.extend = function (target) { var i, source, sourceProp; target = target || {}; for (i = 1; i < arguments.length; i++) { source = arguments[i]; for (var prop in source) { sourceProp = source[prop]; if (typeof sourceProp === 'object' && sourceProp !== null && !(sourceProp instanceof Array)) { target[prop] = Chartist.extend(target[prop], sourceProp); } else { target[prop] = sourceProp; } } } return target; }; /** * Replaces all occurrences of subStr in str with newSubStr and returns a new string. * * @memberof Chartist.Core * @param {String} str * @param {String} subStr * @param {String} newSubStr * @return {String} */ Chartist.replaceAll = function(str, subStr, newSubStr) { return str.replace(new RegExp(subStr, 'g'), newSubStr); }; /** * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified. * * @memberof Chartist.Core * @param {Number} value * @param {String} unit * @return {String} Returns the passed number value with unit. */ Chartist.ensureUnit = function(value, unit) { if(typeof value === 'number') { value = value + unit; } return value; }; /** * Converts a number or string to a quantity object. * * @memberof Chartist.Core * @param {String|Number} input * @return {Object} Returns an object containing the value as number and the unit as string. */ Chartist.quantity = function(input) { if (typeof input === 'string') { var match = (/^(\d+)\s*(.*)$/g).exec(input); return { value : +match[1], unit: match[2] || undefined }; } return { value: input }; }; /** * This is a wrapper around document.querySelector that will return the query if it's already of type Node * * @memberof Chartist.Core * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly * @return {Node} */ Chartist.querySelector = function(query) { return query instanceof Node ? query : document.querySelector(query); }; /** * Functional style helper to produce array with given length initialized with undefined values * * @memberof Chartist.Core * @param length * @return {Array} */ Chartist.times = function(length) { return Array.apply(null, new Array(length)); }; /** * Sum helper to be used in reduce functions * * @memberof Chartist.Core * @param previous * @param current * @return {*} */ Chartist.sum = function(previous, current) { return previous + (current ? current : 0); }; /** * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor. * * @memberof Chartist.Core * @param {Number} factor * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array */ Chartist.mapMultiply = function(factor) { return function(num) { return num * factor; }; }; /** * Add helper to be used in `Array.map` for adding a addend to each value of an array. * * @memberof Chartist.Core * @param {Number} addend * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array */ Chartist.mapAdd = function(addend) { return function(num) { return num + addend; }; }; /** * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values). * * @memberof Chartist.Core * @param arr * @param cb * @return {Array} */ Chartist.serialMap = function(arr, cb) { var result = [], length = Math.max.apply(null, arr.map(function(e) { return e.length; })); Chartist.times(length).forEach(function(e, index) { var args = arr.map(function(e) { return e[index]; }); result[index] = cb.apply(null, args); }); return result; }; /** * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit. * * @memberof Chartist.Core * @param {Number} value The value that should be rounded with precision * @param {Number} [digits] The number of digits after decimal used to do the rounding * @returns {number} Rounded value */ Chartist.roundWithPrecision = function(value, digits) { var precision = Math.pow(10, digits || Chartist.precision); return Math.round(value * precision) / precision; }; /** * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. * * @memberof Chartist.Core * @type {number} */ Chartist.precision = 8; /** * A map with characters to escape for strings to be safely used as attribute values. * * @memberof Chartist.Core * @type {Object} */ Chartist.escapingMap = { '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''' }; /** * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap. * If called with null or undefined the function will return immediately with null or undefined. * * @memberof Chartist.Core * @param {Number|String|Object} data * @return {String} */ Chartist.serialize = function(data) { if(data === null || data === undefined) { return data; } else if(typeof data === 'number') { data = ''+data; } else if(typeof data === 'object') { data = JSON.stringify({data: data}); } return Object.keys(Chartist.escapingMap).reduce(function(result, key) { return Chartist.replaceAll(result, key, Chartist.escapingMap[key]); }, data); }; /** * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success. * * @memberof Chartist.Core * @param {String} data * @return {String|Number|Object} */ Chartist.deserialize = function(data) { if(typeof data !== 'string') { return data; } data = Object.keys(Chartist.escapingMap).reduce(function(result, key) { return Chartist.replaceAll(result, Chartist.escapingMap[key], key); }, data); try { data = JSON.parse(data); data = data.data !== undefined ? data.data : data; } catch(e) {} return data; }; /** * Create or reinitialize the SVG element for the chart * * @memberof Chartist.Core * @param {Node} container The containing DOM Node object that will be used to plant the SVG element * @param {String} width Set the width of the SVG element. Default is 100% * @param {String} height Set the height of the SVG element. Default is 100% * @param {String} className Specify a class to be added to the SVG element * @return {Object} The created/reinitialized SVG element */ Chartist.createSvg = function (container, width, height, className) { var svg; width = width || '100%'; height = height || '100%'; // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/ Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) { return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct'); }).forEach(function removePreviousElement(svg) { container.removeChild(svg); }); // Create svg object with width and height or use 100% as default svg = new Chartist.Svg('svg').attr({ width: width, height: height }).addClass(className); svg._node.style.width = width; svg._node.style.height = height; // Add the DOM node to our container container.appendChild(svg._node); return svg; }; /** * Ensures that the data object passed as second argument to the charts is present and correctly initialized. * * @param {Object} data The data object that is passed as second argument to the charts * @return {Object} The normalized data object */ Chartist.normalizeData = function(data, reverse, multi) { var labelCount; var output = { raw: data, normalized: {} }; // Check if we should generate some labels based on existing series data output.normalized.series = Chartist.getDataArray({ series: data.series || [] }, reverse, multi); // If all elements of the normalized data array are arrays we're dealing with // multi series data and we need to find the largest series if they are un-even if (output.normalized.series.every(function(value) { return value instanceof Array; })) { // Getting the series with the the most elements labelCount = Math.max.apply(null, output.normalized.series.map(function(series) { return series.length; })); } else { // We're dealing with Pie data so we just take the normalized array length labelCount = output.normalized.series.length; } output.normalized.labels = (data.labels || []).slice(); // Padding the labels to labelCount with empty strings Array.prototype.push.apply( output.normalized.labels, Chartist.times(Math.max(0, labelCount - output.normalized.labels.length)).map(function() { return ''; }) ); if(reverse) { Chartist.reverseData(output.normalized); } return output; }; /** * This function safely checks if an objects has an owned property. * * @param {Object} object The object where to check for a property * @param {string} property The property name * @returns {boolean} Returns true if the object owns the specified property */ Chartist.safeHasProperty = function(object, property) { return object !== null && typeof object === 'object' && object.hasOwnProperty(property); }; /** * Checks if a value is considered a hole in the data series. * * @param {*} value * @returns {boolean} True if the value is considered a data hole */ Chartist.isDataHoleValue = function(value) { return value === null || value === undefined || (typeof value === 'number' && isNaN(value)); }; /** * Reverses the series, labels and series data arrays. * * @memberof Chartist.Core * @param data */ Chartist.reverseData = function(data) { data.labels.reverse(); data.series.reverse(); for (var i = 0; i < data.series.length; i++) { if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) { data.series[i].data.reverse(); } else if(data.series[i] instanceof Array) { data.series[i].reverse(); } } }; /** * Convert data series into plain array * * @memberof Chartist.Core * @param {Object} data The series object that contains the data to be visualized in the chart * @param {Boolean} [reverse] If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too. * @param {Boolean} [multi] Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created. * @return {Array} A plain array that contains the data to be visualized in the chart */ Chartist.getDataArray = function(data, reverse, multi) { // Recursively walks through nested arrays and convert string values to numbers and objects with value properties // to values. Check the tests in data core -> data normalization for a detailed specification of expected values function recursiveConvert(value) { if(Chartist.safeHasProperty(value, 'value')) { // We are dealing with value object notation so we need to recurse on value property return recursiveConvert(value.value); } else if(Chartist.safeHasProperty(value, 'data')) { // We are dealing with series object notation so we need to recurse on data property return recursiveConvert(value.data); } else if(value instanceof Array) { // Data is of type array so we need to recurse on the series return value.map(recursiveConvert); } else if(Chartist.isDataHoleValue(value)) { // We're dealing with a hole in the data and therefore need to return undefined // We're also returning undefined for multi value output return undefined; } else { // We need to prepare multi value output (x and y data) if(multi) { var multiValue = {}; // Single series value arrays are assumed to specify the Y-Axis value // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}] // If multi is a string then it's assumed that it specified which dimension should be filled as default if(typeof multi === 'string') { multiValue[multi] = Chartist.getNumberOrUndefined(value); } else { multiValue.y = Chartist.getNumberOrUndefined(value); } multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x; multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y; return multiValue; } else { // We can return simple data return Chartist.getNumberOrUndefined(value); } } } return data.series.map(recursiveConvert); }; /** * Converts a number into a padding object. * * @memberof Chartist.Core * @param {Object|Number} padding * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned. */ Chartist.normalizePadding = function(padding, fallback) { fallback = fallback || 0; return typeof padding === 'number' ? { top: padding, right: padding, bottom: padding, left: padding } : { top: typeof padding.top === 'number' ? padding.top : fallback, right: typeof padding.right === 'number' ? padding.right : fallback, bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback, left: typeof padding.left === 'number' ? padding.left : fallback }; }; Chartist.getMetaData = function(series, index) { var value = series.data ? series.data[index] : series[index]; return value ? value.meta : undefined; }; /** * Calculate the order of magnitude for the chart scale * * @memberof Chartist.Core * @param {Number} value The value Range of the chart * @return {Number} The order of magnitude */ Chartist.orderOfMagnitude = function (value) { return Math.floor(Math.log(Math.abs(value)) / Math.LN10); }; /** * Project a data length into screen coordinates (pixels) * * @memberof Chartist.Core * @param {Object} axisLength The svg element for the chart * @param {Number} length Single data value from a series array * @param {Object} bounds All the values to set the bounds of the chart * @return {Number} The projected data length in pixels */ Chartist.projectLength = function (axisLength, length, bounds) { return length / bounds.range * axisLength; }; /** * Get the height of the area in the chart for the data series * * @memberof Chartist.Core * @param {Object} svg The svg element for the chart * @param {Object} options The Object that contains all the optional values for the chart * @return {Number} The height of the area in the chart for the data series */ Chartist.getAvailableHeight = function (svg, options) { return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0); }; /** * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. * * @memberof Chartist.Core * @param {Array} data The array that contains the data to be visualized in the chart * @param {Object} options The Object that contains the chart options * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart. */ Chartist.getHighLow = function (data, options, dimension) { // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {}); var highLow = { high: options.high === undefined ? -Number.MAX_VALUE : +options.high, low: options.low === undefined ? Number.MAX_VALUE : +options.low }; var findHigh = options.high === undefined; var findLow = options.low === undefined; // Function to recursively walk through arrays and find highest and lowest number function recursiveHighLow(data) { if(data === undefined) { return undefined; } else if(data instanceof Array) { for (var i = 0; i < data.length; i++) { recursiveHighLow(data[i]); } } else { var value = dimension ? +data[dimension] : +data; if (findHigh && value > highLow.high) { highLow.high = value; } if (findLow && value < highLow.low) { highLow.low = value; } } } // Start to find highest and lowest number recursively if(findHigh || findLow) { recursiveHighLow(data); } // Overrides of high / low based on reference value, it will make sure that the invisible reference value is // used to generate the chart. This is useful when the chart always needs to contain the position of the // invisible reference value in the view i.e. for bipolar scales. if (options.referenceValue || options.referenceValue === 0) { highLow.high = Math.max(options.referenceValue, highLow.high); highLow.low = Math.min(options.referenceValue, highLow.low); } // If high and low are the same because of misconfiguration or flat data (only the same value) we need // to set the high or low to 0 depending on the polarity if (highLow.high <= highLow.low) { // If both values are 0 we set high to 1 if (highLow.low === 0) { highLow.high = 1; } else if (highLow.low < 0) { // If we have the same negative value for the bounds we set bounds.high to 0 highLow.high = 0; } else if (highLow.high > 0) { // If we have the same positive value for the bounds we set bounds.low to 0 highLow.low = 0; } else { // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors highLow.high = 1; highLow.low = 0; } } return highLow; }; /** * Checks if a value can be safely coerced to a number. This includes all values except null which result in finite numbers when coerced. This excludes NaN, since it's not finite. * * @memberof Chartist.Core * @param value * @returns {Boolean} */ Chartist.isNumeric = function(value) { return value === null ? false : isFinite(value); }; /** * Returns true on all falsey values except the numeric value 0. * * @memberof Chartist.Core * @param value * @returns {boolean} */ Chartist.isFalseyButZero = function(value) { return !value && value !== 0; }; /** * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined. * * @memberof Chartist.Core * @param value * @returns {*} */ Chartist.getNumberOrUndefined = function(value) { return Chartist.isNumeric(value) ? +value : undefined; }; /** * Checks if provided value object is multi value (contains x or y properties) * * @memberof Chartist.Core * @param value */ Chartist.isMultiValue = function(value) { return typeof value === 'object' && ('x' in value || 'y' in value); }; /** * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return `defaultValue`. * * @memberof Chartist.Core * @param value * @param dimension * @param defaultValue * @returns {*} */ Chartist.getMultiValue = function(value, dimension) { if(Chartist.isMultiValue(value)) { return Chartist.getNumberOrUndefined(value[dimension || 'y']); } else { return Chartist.getNumberOrUndefined(value); } }; /** * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex. * * @memberof Chartist.Core * @param {Number} num An integer number where the smallest factor should be searched for * @returns {Number} The smallest integer factor of the parameter num. */ Chartist.rho = function(num) { if(num === 1) { return num; } function gcd(p, q) { if (p % q === 0) { return q; } else { return gcd(q, p % q); } } function f(x) { return x * x + 1; } var x1 = 2, x2 = 2, divisor; if (num % 2 === 0) { return 2; } do { x1 = f(x1) % num; x2 = f(f(x2)) % num; divisor = gcd(Math.abs(x1 - x2), num); } while (divisor === 1); return divisor; }; /** * Calculate and retrieve all the bounds for the chart and return them in one array * * @memberof Chartist.Core * @param {Number} axisLength The length of the Axis used for * @param {Object} highLow An object containing a high and low property indicating the value range of the chart. * @param {Number} scaleMinSpace The minimum projected length a step should result in * @param {Boolean} onlyInteger * @return {Object} All the values to set the bounds of the chart */ Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) { var i, optimizationCounter = 0, newMin, newMax, bounds = { high: highLow.high, low: highLow.low }; bounds.valueRange = bounds.high - bounds.low; bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange); bounds.step = Math.pow(10, bounds.oom); bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step; bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step; bounds.range = bounds.max - bounds.min; bounds.numberOfSteps = Math.round(bounds.range / bounds.step); // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace // If we are already below the scaleMinSpace value we will scale up var length = Chartist.projectLength(axisLength, bounds.step, bounds); var scaleUp = length < scaleMinSpace; var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0; // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1 if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) { bounds.step = 1; } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) { // If step 1 was too small, we can try the smallest factor of range // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor // is larger than the scaleMinSpace we should go for it. bounds.step = smallestFactor; } else { // Trying to divide or multiply by 2 and find the best step value while (true) { if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) { bounds.step *= 2; } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) { bounds.step /= 2; if(onlyInteger && bounds.step % 1 !== 0) { bounds.step *= 2; break; } } else { break; } if(optimizationCounter++ > 1000) { throw new Error('Exceeded maximum number of iterations while optimizing scale step!'); } } } var EPSILON = 2.221E-16; bounds.step = Math.max(bounds.step, EPSILON); function safeIncrement(value, increment) { // If increment is too small use *= (1+EPSILON) as a simple nextafter if (value === (value += increment)) { value *= (1 + (increment > 0 ? EPSILON : -EPSILON)); } return value; } // Narrow min and max based on new step newMin = bounds.min; newMax = bounds.max; while (newMin + bounds.step <= bounds.low) { newMin = safeIncrement(newMin, bounds.step); } while (newMax - bounds.step >= bounds.high) { newMax = safeIncrement(newMax, -bounds.step); } bounds.min = newMin; bounds.max = newMax; bounds.range = bounds.max - bounds.min; var values = []; for (i = bounds.min; i <= bounds.max; i = safeIncrement(i, bounds.step)) { var value = Chartist.roundWithPrecision(i); if (value !== values[values.length - 1]) { values.push(value); } } bounds.values = values; return bounds; }; /** * Calculate cartesian coordinates of polar coordinates * * @memberof Chartist.Core * @param {Number} centerX X-axis coordinates of center point of circle segment * @param {Number} centerY X-axis coordinates of center point of circle segment * @param {Number} radius Radius of circle segment * @param {Number} angleInDegrees Angle of circle segment in degrees * @return {{x:Number, y:Number}} Coordinates of point on circumference */ Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) { var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; return { x: centerX + (radius * Math.cos(angleInRadians)), y: centerY + (radius * Math.sin(angleInRadians)) }; }; /** * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right * * @memberof Chartist.Core * @param {Object} svg The svg element for the chart * @param {Object} options The Object that contains all the optional values for the chart * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements */ Chartist.createChartRect = function (svg, options, fallbackPadding) { var hasAxis = !!(options.axisX || options.axisY); var yAxisOffset = hasAxis ? options.axisY.offset : 0; var xAxisOffset = hasAxis ? options.axisX.offset : 0; // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0 var width = svg.width() || Chartist.quantity(options.width).value || 0; var height = svg.height() || Chartist.quantity(options.height).value || 0; var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding); // If settings were to small to cope with offset (legacy) and padding, we'll adjust width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right); height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom); var chartRect = { padding: normalizedPadding, width: function () { return this.x2 - this.x1; }, height: function () { return this.y1 - this.y2; } }; if(hasAxis) { if (options.axisX.position === 'start') { chartRect.y2 = normalizedPadding.top + xAxisOffset; chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); } else { chartRect.y2 = normalizedPadding.top; chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1); } if (options.axisY.position === 'start') { chartRect.x1 = normalizedPadding.left + yAxisOffset; chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); } else { chartRect.x1 = normalizedPadding.left; chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1); } } else { chartRect.x1 = normalizedPadding.left; chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); chartRect.y2 = normalizedPadding.top; chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); } return chartRect; }; /** * Creates a grid line based on a projected value. * * @memberof Chartist.Core * @param position * @param index * @param axis * @param offset * @param length * @param group * @param classes * @param eventEmitter */ Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) { var positionalData = {}; positionalData[axis.units.pos + '1'] = position; positionalData[axis.units.pos + '2'] = position; positionalData[axis.counterUnits.pos + '1'] = offset; positionalData[axis.counterUnits.pos + '2'] = offset + length; var gridElement = group.elem('line', positionalData, classes.join(' ')); // Event for grid draw eventEmitter.emit('draw', Chartist.extend({ type: 'grid', axis: axis, index: index, group: group, element: gridElement }, positionalData) ); }; /** * Creates a grid background rect and emits the draw event. * * @memberof Chartist.Core * @param gridGroup * @param chartRect * @param className * @param eventEmitter */ Chartist.createGridBackground = function (gridGroup, chartRect, className, eventEmitter) { var gridBackground = gridGroup.elem('rect', { x: chartRect.x1, y: chartRect.y2, width: chartRect.width(), height: chartRect.height(), }, className, true); // Event for grid background draw eventEmitter.emit('draw', { type: 'gridBackground', group: gridGroup, element: gridBackground }); }; /** * Creates a label based on a projected value and an axis. * * @memberof Chartist.Core * @param position * @param length * @param index * @param labels * @param axis * @param axisOffset * @param labelOffset * @param group * @param classes * @param useForeignObject * @param eventEmitter */ Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) { var labelElement; var positionalData = {}; positionalData[axis.units.pos] = position + labelOffset[axis.units.pos]; positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos]; positionalData[axis.units.len] = length; positionalData[axis.counterUnits.len] = Math.max(0, axisOffset - 10); if(useForeignObject) { // We need to set width and height explicitly to px as span will not expand with width and height being // 100% in all browsers var content = document.createElement('span'); content.className = classes.join(' '); content.setAttribute('xmlns', Chartist.namespaces.xhtml); content.innerText = labels[index]; content.style[axis.units.len] = Math.round(positionalData[axis.units.len]) + 'px'; content.style[axis.counterUnits.len] = Math.round(positionalData[axis.counterUnits.len]) + 'px'; labelElement = group.foreignObject(content, Chartist.extend({ style: 'overflow: visible;' }, positionalData)); } else { labelElement = group.elem('text', positionalData, classes.join(' ')).text(labels[index]); } eventEmitter.emit('draw', Chartist.extend({ type: 'label', axis: axis, index: index, group: group, element: labelElement, text: labels[index] }, positionalData)); }; /** * Helper to read series specific options from options object. It automatically falls back to the global option if * there is no option in the series options. * * @param {Object} series Series object * @param {Object} options Chartist options object * @param {string} key The options key that should be used to obtain the options * @returns {*} */ Chartist.getSeriesOption = function(series, options, key) { if(series.name && options.series && options.series[series.name]) { var seriesOptions = options.series[series.name]; return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key]; } else { return options[key]; } }; /** * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches * * @memberof Chartist.Core * @param {Object} options Options set by user * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events * @return {Object} The consolidated options object from the defaults, base and matching responsive options */ Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) { var baseOptions = Chartist.extend({}, options), currentOptions, mediaQueryListeners = [], i; function updateCurrentOptions(mediaEvent) { var previousOptions = currentOptions; currentOptions = Chartist.extend({}, baseOptions); if (responsiveOptions) { for (i = 0; i < responsiveOptions.length; i++) { var mql = window.matchMedia(responsiveOptions[i][0]); if (mql.matches) { currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]); } } } if(eventEmitter && mediaEvent) { eventEmitter.emit('optionsChanged', { previousOptions: previousOptions, currentOptions: currentOptions }); } } function removeMediaQueryListeners() { mediaQueryListeners.forEach(function(mql) { mql.removeListener(updateCurrentOptions); }); } if (!window.matchMedia) { throw 'window.matchMedia not found! Make sure you\'re using a polyfill.'; } else if (responsiveOptions) { for (i = 0; i < responsiveOptions.length; i++) { var mql = window.matchMedia(responsiveOptions[i][0]); mql.addListener(updateCurrentOptions); mediaQueryListeners.push(mql); } } // Execute initially without an event argument so we get the correct options updateCurrentOptions(); return { removeMediaQueryListeners: removeMediaQueryListeners, getCurrentOptions: function getCurrentOptions() { return Chartist.extend({}, currentOptions); } }; }; /** * Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates * valueData property describing the segment. * * With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any * points with undefined values are discarded. * * **Options** * The following options are used to determine how segments are formed * ```javascript * var options = { * // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment. * fillHoles: false, * // If increasingX is true, the coordinates in all segments have strictly increasing x-values. * increasingX: false * }; * ``` * * @memberof Chartist.Core * @param {Array} pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn] * @param {Array} values List of associated point values in the form [v1, v2 .. vn] * @param {Object} options Options set by user * @return {Array} List of segments, each containing a pathCoordinates and valueData property. */ Chartist.splitIntoSegments = function(pathCoordinates, valueData, options) { var defaultOptions = { increasingX: false, fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); var segments = []; var hole = true; for(var i = 0; i < pathCoordinates.length; i += 2) { // If this value is a "hole" we set the hole flag if(Chartist.getMultiValue(valueData[i / 2].value) === undefined) { // if(valueData[i / 2].value === undefined) { if(!options.fillHoles) { hole = true; } } else { if(options.increasingX && i >= 2 && pathCoordinates[i] <= pathCoordinates[i-2]) { // X is not increasing, so we need to make sure we start a new segment hole = true; } // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment if(hole) { segments.push({ pathCoordinates: [], valueData: [] }); // As we have a valid value now, we are not in a "hole" anymore hole = false; } // Add to the segment pathCoordinates and valueData segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); segments[segments.length - 1].valueData.push(valueData[i / 2]); } } return segments; }; }(this || global, Chartist)); ;/** * Chartist path interpolation functions. * * @module Chartist.Interpolation */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; Chartist.Interpolation = {}; /** * This interpolation function does not smooth the path and the result is only containing lines and no curves. * * @example * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [[1, 2, 8, 1, 7]] * }, { * lineSmooth: Chartist.Interpolation.none({ * fillHoles: false * }) * }); * * * @memberof Chartist.Interpolation * @return {Function} */ Chartist.Interpolation.none = function(options) { var defaultOptions = { fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); return function none(pathCoordinates, valueData) { var path = new Chartist.Svg.Path(); var hole = true; for(var i = 0; i < pathCoordinates.length; i += 2) { var currX = pathCoordinates[i]; var currY = pathCoordinates[i + 1]; var currData = valueData[i / 2]; if(Chartist.getMultiValue(currData.value) !== undefined) { if(hole) { path.move(currX, currY, false, currData); } else { path.line(currX, currY, false, currData); } hole = false; } else if(!options.fillHoles) { hole = true; } } return path; }; }; /** * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. * * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point. * * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics. * * @example * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [[1, 2, 8, 1, 7]] * }, { * lineSmooth: Chartist.Interpolation.simple({ * divisor: 2, * fillHoles: false * }) * }); * * * @memberof Chartist.Interpolation * @param {Object} options The options of the simple interpolation factory function. * @return {Function} */ Chartist.Interpolation.simple = function(options) { var defaultOptions = { divisor: 2, fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); var d = 1 / Math.max(1, options.divisor); return function simple(pathCoordinates, valueData) { var path = new Chartist.Svg.Path(); var prevX, prevY, prevData; for(var i = 0; i < pathCoordinates.length; i += 2) { var currX = pathCoordinates[i]; var currY = pathCoordinates[i + 1]; var length = (currX - prevX) * d; var currData = valueData[i / 2]; if(currData.value !== undefined) { if(prevData === undefined) { path.move(currX, currY, false, currData); } else { path.curve( prevX + length, prevY, currX - length, currY, currX, currY, false, currData ); } prevX = currX; prevY = currY; prevData = currData; } else if(!options.fillHoles) { prevX = currX = prevData = undefined; } } return path; }; }; /** * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. * * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. * * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity. * * @example * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [[1, 2, 8, 1, 7]] * }, { * lineSmooth: Chartist.Interpolation.cardinal({ * tension: 1, * fillHoles: false * }) * }); * * @memberof Chartist.Interpolation * @param {Object} options The options of the cardinal factory function. * @return {Function} */ Chartist.Interpolation.cardinal = function(options) { var defaultOptions = { tension: 1, fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); var t = Math.min(1, Math.max(0, options.tension)), c = 1 - t; return function cardinal(pathCoordinates, valueData) { // First we try to split the coordinates into segments // This is necessary to treat "holes" in line charts var segments = Chartist.splitIntoSegments(pathCoordinates, valueData, { fillHoles: options.fillHoles }); if(!segments.length) { // If there were no segments return 'Chartist.Interpolation.none' return Chartist.Interpolation.none()([]); } else if(segments.length > 1) { // If the split resulted in more that one segment we need to interpolate each segment individually and join them // afterwards together into a single path. var paths = []; // For each segment we will recurse the cardinal function segments.forEach(function(segment) { paths.push(cardinal(segment.pathCoordinates, segment.valueData)); }); // Join the segment path data into a single path and return return Chartist.Svg.Path.join(paths); } else { // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first // segment pathCoordinates = segments[0].pathCoordinates; valueData = segments[0].valueData; // If less than two points we need to fallback to no smoothing if(pathCoordinates.length <= 4) { return Chartist.Interpolation.none()(pathCoordinates, valueData); } var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]), z; for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) { var p = [ {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]}, {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}, {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]}, {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]} ]; if (z) { if (!i) { p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]}; } else if (iLen - 4 === i) { p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; } else if (iLen - 2 === i) { p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]}; } } else { if (iLen - 4 === i) { p[3] = p[2]; } else if (!i) { p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}; } } path.curve( (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x), (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y), (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x), (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y), p[2].x, p[2].y, false, valueData[(i + 2) / 2] ); } return path; } }; }; /** * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points. * * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. * * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points. * * All smoothing functions within Chartist are factory functions that accept an options parameter. * * @example * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [[1, 2, 8, 1, 7]] * }, { * lineSmooth: Chartist.Interpolation.monotoneCubic({ * fillHoles: false * }) * }); * * @memberof Chartist.Interpolation * @param {Object} options The options of the monotoneCubic factory function. * @return {Function} */ Chartist.Interpolation.monotoneCubic = function(options) { var defaultOptions = { fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); return function monotoneCubic(pathCoordinates, valueData) { // First we try to split the coordinates into segments // This is necessary to treat "holes" in line charts var segments = Chartist.splitIntoSegments(pathCoordinates, valueData, { fillHoles: options.fillHoles, increasingX: true }); if(!segments.length) { // If there were no segments return 'Chartist.Interpolation.none' return Chartist.Interpolation.none()([]); } else if(segments.length > 1) { // If the split resulted in more that one segment we need to interpolate each segment individually and join them // afterwards together into a single path. var paths = []; // For each segment we will recurse the monotoneCubic fn function segments.forEach(function(segment) { paths.push(monotoneCubic(segment.pathCoordinates, segment.valueData)); }); // Join the segment path data into a single path and return return Chartist.Svg.Path.join(paths); } else { // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first // segment pathCoordinates = segments[0].pathCoordinates; valueData = segments[0].valueData; // If less than three points we need to fallback to no smoothing if(pathCoordinates.length <= 4) { return Chartist.Interpolation.none()(pathCoordinates, valueData); } var xs = [], ys = [], i, n = pathCoordinates.length / 2, ms = [], ds = [], dys = [], dxs = [], path; // Populate x and y coordinates into separate arrays, for readability for(i = 0; i < n; i++) { xs[i] = pathCoordinates[i * 2]; ys[i] = pathCoordinates[i * 2 + 1]; } // Calculate deltas and derivative for(i = 0; i < n - 1; i++) { dys[i] = ys[i + 1] - ys[i]; dxs[i] = xs[i + 1] - xs[i]; ds[i] = dys[i] / dxs[i]; } // Determine desired slope (m) at each point using Fritsch-Carlson method // See: http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation ms[0] = ds[0]; ms[n - 1] = ds[n - 2]; for(i = 1; i < n - 1; i++) { if(ds[i] === 0 || ds[i - 1] === 0 || (ds[i - 1] > 0) !== (ds[i] > 0)) { ms[i] = 0; } else { ms[i] = 3 * (dxs[i - 1] + dxs[i]) / ( (2 * dxs[i] + dxs[i - 1]) / ds[i - 1] + (dxs[i] + 2 * dxs[i - 1]) / ds[i]); if(!isFinite(ms[i])) { ms[i] = 0; } } } // Now build a path from the slopes path = new Chartist.Svg.Path().move(xs[0], ys[0], false, valueData[0]); for(i = 0; i < n - 1; i++) { path.curve( // First control point xs[i] + dxs[i] / 3, ys[i] + ms[i] * dxs[i] / 3, // Second control point xs[i + 1] - dxs[i] / 3, ys[i + 1] - ms[i + 1] * dxs[i] / 3, // End point xs[i + 1], ys[i + 1], false, valueData[i + 1] ); } return path; } }; }; /** * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled. * * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`. * * @example * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [[1, 2, 8, 1, 7]] * }, { * lineSmooth: Chartist.Interpolation.step({ * postpone: true, * fillHoles: false * }) * }); * * @memberof Chartist.Interpolation * @param options * @returns {Function} */ Chartist.Interpolation.step = function(options) { var defaultOptions = { postpone: true, fillHoles: false }; options = Chartist.extend({}, defaultOptions, options); return function step(pathCoordinates, valueData) { var path = new Chartist.Svg.Path(); var prevX, prevY, prevData; for (var i = 0; i < pathCoordinates.length; i += 2) { var currX = pathCoordinates[i]; var currY = pathCoordinates[i + 1]; var currData = valueData[i / 2]; // If the current point is also not a hole we can draw the step lines if(currData.value !== undefined) { if(prevData === undefined) { path.move(currX, currY, false, currData); } else { if(options.postpone) { // If postponed we should draw the step line with the value of the previous value path.line(currX, prevY, false, prevData); } else { // If not postponed we should draw the step line with the value of the current value path.line(prevX, currY, false, currData); } // Line to the actual point (this should only be a Y-Axis movement path.line(currX, currY, false, currData); } prevX = currX; prevY = currY; prevData = currData; } else if(!options.fillHoles) { prevX = prevY = prevData = undefined; } } return path; }; }; }(this || global, Chartist)); ;/** * A very basic event module that helps to generate and catch events. * * @module Chartist.Event */ /* global Chartist */ (function (globalRoot, Chartist) { 'use strict'; Chartist.EventEmitter = function () { var handlers = []; /** * Add an event handler for a specific event * * @memberof Chartist.Event * @param {String} event The event name * @param {Function} handler A event handler function */ function addEventHandler(event, handler) { handlers[event] = handlers[event] || []; handlers[event].push(handler); } /** * Remove an event handler of a specific event name or remove all event handlers for a specific event. * * @memberof Chartist.Event * @param {String} event The event name where a specific or all handlers should be removed * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. */ function removeEventHandler(event, handler) { // Only do something if there are event handlers with this name existing if(handlers[event]) { // If handler is set we will look for a specific handler and only remove this if(handler) { handlers[event].splice(handlers[event].indexOf(handler), 1); if(handlers[event].length === 0) { delete handlers[event]; } } else { // If no handler is specified we remove all handlers for this event delete handlers[event]; } } } /** * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. * * @memberof Chartist.Event * @param {String} event The event name that should be triggered * @param {*} data Arbitrary data that will be passed to the event handler callback functions */ function emit(event, data) { // Only do something if there are event handlers with this name existing if(handlers[event]) { handlers[event].forEach(function(handler) { handler(data); }); } // Emit event to star event handlers if(handlers['*']) { handlers['*'].forEach(function(starHandler) { starHandler(event, data); }); } } return { addEventHandler: addEventHandler, removeEventHandler: removeEventHandler, emit: emit }; }; }(this || global, Chartist)); ;/** * This module provides some basic prototype inheritance utilities. * * @module Chartist.Class */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; function listToArray(list) { var arr = []; if (list.length) { for (var i = 0; i < list.length; i++) { arr.push(list[i]); } } return arr; } /** * Method to extend from current prototype. * * @memberof Chartist.Class * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. * @return {Function} Constructor function of the new class * * @example * var Fruit = Class.extend({ * color: undefined, * sugar: undefined, * * constructor: function(color, sugar) { * this.color = color; * this.sugar = sugar; * }, * * eat: function() { * this.sugar = 0; * return this; * } * }); * * var Banana = Fruit.extend({ * length: undefined, * * constructor: function(length, sugar) { * Banana.super.constructor.call(this, 'Yellow', sugar); * this.length = length; * } * }); * * var banana = new Banana(20, 40); * console.log('banana instanceof Fruit', banana instanceof Fruit); * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); * console.log(banana.sugar); * console.log(banana.eat().sugar); * console.log(banana.color); */ function extend(properties, superProtoOverride) { var superProto = superProtoOverride || this.prototype || Chartist.Class; var proto = Object.create(superProto); Chartist.Class.cloneDefinitions(proto, properties); var constr = function() { var fn = proto.constructor || function () {}, instance; // If this is linked to the Chartist namespace the constructor was not called with new // To provide a fallback we will instantiate here and return the instance instance = this === Chartist ? Object.create(proto) : this; fn.apply(instance, Array.prototype.slice.call(arguments, 0)); // If this constructor was not called with new we need to return the instance // This will not harm when the constructor has been called with new as the returned value is ignored return instance; }; constr.prototype = proto; constr.super = superProto; constr.extend = this.extend; return constr; } // Variable argument list clones args > 0 into args[0] and retruns modified args[0] function cloneDefinitions() { var args = listToArray(arguments); var target = args[0]; args.splice(1, args.length - 1).forEach(function (source) { Object.getOwnPropertyNames(source).forEach(function (propName) { // If this property already exist in target we delete it first delete target[propName]; // Define the property with the descriptor from source Object.defineProperty(target, propName, Object.getOwnPropertyDescriptor(source, propName)); }); }); return target; } Chartist.Class = { extend: extend, cloneDefinitions: cloneDefinitions }; }(this || global, Chartist)); ;/** * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. * * @module Chartist.Base */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj // The problem is with the label offsets that can't be converted into percentage and affecting the chart container /** * Updates the chart which currently does a full reconstruction of the SVG DOM * * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart. * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart. * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base * @memberof Chartist.Base */ function update(data, options, override) { if(data) { this.data = data || {}; this.data.labels = this.data.labels || []; this.data.series = this.data.series || []; // Event for data transformation that allows to manipulate the data before it gets rendered in the charts this.eventEmitter.emit('data', { type: 'update', data: this.data }); } if(options) { this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options); // If chartist was not initialized yet, we just set the options and leave the rest to the initialization // Otherwise we re-create the optionsProvider at this point if(!this.initializeTimeoutId) { this.optionsProvider.removeMediaQueryListeners(); this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); } } // Only re-created the chart if it has been initialized yet if(!this.initializeTimeoutId) { this.createChart(this.optionsProvider.getCurrentOptions()); } // Return a reference to the chart object to chain up calls return this; } /** * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. * * @memberof Chartist.Base */ function detach() { // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout if(!this.initializeTimeoutId) { window.removeEventListener('resize', this.resizeListener); this.optionsProvider.removeMediaQueryListeners(); } else { window.clearTimeout(this.initializeTimeoutId); } return this; } /** * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. * * @memberof Chartist.Base * @param {String} event Name of the event. Check the examples for supported events. * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. */ function on(event, handler) { this.eventEmitter.addEventHandler(event, handler); return this; } /** * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. * * @memberof Chartist.Base * @param {String} event Name of the event for which a handler should be removed * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. */ function off(event, handler) { this.eventEmitter.removeEventHandler(event, handler); return this; } function initialize() { // Add window resize listener that re-creates the chart window.addEventListener('resize', this.resizeListener); // Obtain current options based on matching media queries (if responsive options are given) // This will also register a listener that is re-creating the chart based on media changes this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); // Register options change listener that will trigger a chart update this.eventEmitter.addEventHandler('optionsChanged', function() { this.update(); }.bind(this)); // Before the first chart creation we need to register us with all plugins that are configured // Initialize all relevant plugins with our chart object and the plugin options specified in the config if(this.options.plugins) { this.options.plugins.forEach(function(plugin) { if(plugin instanceof Array) { plugin[0](this, plugin[1]); } else { plugin(this); } }.bind(this)); } // Event for data transformation that allows to manipulate the data before it gets rendered in the charts this.eventEmitter.emit('data', { type: 'initial', data: this.data }); // Create the first chart this.createChart(this.optionsProvider.getCurrentOptions()); // As chart is initialized from the event loop now we can reset our timeout reference // This is important if the chart gets initialized on the same element twice this.initializeTimeoutId = undefined; } /** * Constructor of chart base class. * * @param query * @param data * @param defaultOptions * @param options * @param responsiveOptions * @constructor */ function Base(query, data, defaultOptions, options, responsiveOptions) { this.container = Chartist.querySelector(query); this.data = data || {}; this.data.labels = this.data.labels || []; this.data.series = this.data.series || []; this.defaultOptions = defaultOptions; this.options = options; this.responsiveOptions = responsiveOptions; this.eventEmitter = Chartist.EventEmitter(); this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility'); this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute'); this.resizeListener = function resizeListener(){ this.update(); }.bind(this); if(this.container) { // If chartist was already initialized in this container we are detaching all event listeners first if(this.container.__chartist__) { this.container.__chartist__.detach(); } this.container.__chartist__ = this; } // Using event loop for first draw to make it possible to register event listeners in the same call stack where // the chart was created. this.initializeTimeoutId = setTimeout(initialize.bind(this), 0); } // Creating the chart base class Chartist.Base = Chartist.Class.extend({ constructor: Base, optionsProvider: undefined, container: undefined, svg: undefined, eventEmitter: undefined, createChart: function() { throw new Error('Base chart type can\'t be instantiated!'); }, update: update, detach: detach, on: on, off: off, version: Chartist.version, supportsForeignObject: false }); }(this || global, Chartist)); ;/** * Chartist SVG module for simple SVG DOM abstraction * * @module Chartist.Svg */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; var document = globalRoot.document; /** * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. * * @memberof Chartist.Svg * @constructor * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. * @param {String} className This class or class list will be added to the SVG element * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element */ function Svg(name, attributes, className, parent, insertFirst) { // If Svg is getting called with an SVG element we just return the wrapper if(name instanceof Element) { this._node = name; } else { this._node = document.createElementNS(Chartist.namespaces.svg, name); // If this is an SVG element created then custom namespace if(name === 'svg') { this.attr({ 'xmlns:ct': Chartist.namespaces.ct }); } } if(attributes) { this.attr(attributes); } if(className) { this.addClass(className); } if(parent) { if (insertFirst && parent._node.firstChild) { parent._node.insertBefore(this._node, parent._node.firstChild); } else { parent._node.appendChild(this._node); } } } /** * Set attributes on the current SVG element of the wrapper you're currently working on. * * @memberof Chartist.Svg * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value. * @param {String} [ns] If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object. * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function. */ function attr(attributes, ns) { if(typeof attributes === 'string') { if(ns) { return this._node.getAttributeNS(ns, attributes); } else { return this._node.getAttribute(attributes); } } Object.keys(attributes).forEach(function(key) { // If the attribute value is undefined we can skip this one if(attributes[key] === undefined) { return; } if (key.indexOf(':') !== -1) { var namespacedAttribute = key.split(':'); this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]); } else { this._node.setAttribute(key, attributes[key]); } }.bind(this)); return this; } /** * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. * * @memberof Chartist.Svg * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. * @param {String} [className] This class or class list will be added to the SVG element * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data */ function elem(name, attributes, className, insertFirst) { return new Chartist.Svg(name, attributes, className, this, insertFirst); } /** * Returns the parent Chartist.SVG wrapper object * * @memberof Chartist.Svg * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null. */ function parent() { return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null; } /** * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. * * @memberof Chartist.Svg * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element */ function root() { var node = this._node; while(node.nodeName !== 'svg') { node = node.parentNode; } return new Chartist.Svg(node); } /** * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. * * @memberof Chartist.Svg * @param {String} selector A CSS selector that is used to query for child SVG elements * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found */ function querySelector(selector) { var foundNode = this._node.querySelector(selector); return foundNode ? new Chartist.Svg(foundNode) : null; } /** * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. * * @memberof Chartist.Svg * @param {String} selector A CSS selector that is used to query for child SVG elements * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found */ function querySelectorAll(selector) { var foundNodes = this._node.querySelectorAll(selector); return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null; } /** * Returns the underlying SVG node for the current element. * * @memberof Chartist.Svg * @returns {Node} */ function getNode() { return this._node; } /** * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. * * @memberof Chartist.Svg * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. * @param {String} [className] This class or class list will be added to the SVG element * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element */ function foreignObject(content, attributes, className, insertFirst) { // If content is string then we convert it to DOM // TODO: Handle case where content is not a string nor a DOM Node if(typeof content === 'string') { var container = document.createElement('div'); container.innerHTML = content; content = container.firstChild; } // Adding namespace to content element content.setAttribute('xmlns', Chartist.namespaces.xmlns); // Creating the foreignObject without required extension attribute (as described here // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) var fnObj = this.elem('foreignObject', attributes, className, insertFirst); // Add content to foreignObjectElement fnObj._node.appendChild(content); return fnObj; } /** * This method adds a new text element to the current Chartist.Svg wrapper. * * @memberof Chartist.Svg * @param {String} t The text that should be added to the text element that is created * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element */ function text(t) { this._node.appendChild(document.createTextNode(t)); return this; } /** * This method will clear all child nodes of the current wrapper object. * * @memberof Chartist.Svg * @return {Chartist.Svg} The same wrapper object that got emptied */ function empty() { while (this._node.firstChild) { this._node.removeChild(this._node.firstChild); } return this; } /** * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. * * @memberof Chartist.Svg * @return {Chartist.Svg} The parent wrapper object of the element that got removed */ function remove() { this._node.parentNode.removeChild(this._node); return this.parent(); } /** * This method will replace the element with a new element that can be created outside of the current DOM. * * @memberof Chartist.Svg * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object * @return {Chartist.Svg} The wrapper of the new element */ function replace(newElement) { this._node.parentNode.replaceChild(newElement._node, this._node); return newElement; } /** * This method will append an element to the current element as a child. * * @memberof Chartist.Svg * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child * @return {Chartist.Svg} The wrapper of the appended object */ function append(element, insertFirst) { if(insertFirst && this._node.firstChild) { this._node.insertBefore(element._node, this._node.firstChild); } else { this._node.appendChild(element._node); } return this; } /** * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. * * @memberof Chartist.Svg * @return {Array} A list of classes or an empty array if there are no classes on the current element */ function classes() { return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : []; } /** * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. * * @memberof Chartist.Svg * @param {String} names A white space separated list of class names * @return {Chartist.Svg} The wrapper of the current element */ function addClass(names) { this._node.setAttribute('class', this.classes(this._node) .concat(names.trim().split(/\s+/)) .filter(function(elem, pos, self) { return self.indexOf(elem) === pos; }).join(' ') ); return this; } /** * Removes one or a space separated list of classes from the current element. * * @memberof Chartist.Svg * @param {String} names A white space separated list of class names * @return {Chartist.Svg} The wrapper of the current element */ function removeClass(names) { var removedClasses = names.trim().split(/\s+/); this._node.setAttribute('class', this.classes(this._node).filter(function(name) { return removedClasses.indexOf(name) === -1; }).join(' ')); return this; } /** * Removes all classes from the current element. * * @memberof Chartist.Svg * @return {Chartist.Svg} The wrapper of the current element */ function removeAllClasses() { this._node.setAttribute('class', ''); return this; } /** * Get element height using `getBoundingClientRect` * * @memberof Chartist.Svg * @return {Number} The elements height in pixels */ function height() { return this._node.getBoundingClientRect().height; } /** * Get element width using `getBoundingClientRect` * * @memberof Chartist.Core * @return {Number} The elements width in pixels */ function width() { return this._node.getBoundingClientRect().width; } /** * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve. * **An animations object could look like this:** * ```javascript * element.animate({ * opacity: { * dur: 1000, * from: 0, * to: 1 * }, * x1: { * dur: '1000ms', * from: 100, * to: 200, * easing: 'easeOutQuart' * }, * y1: { * dur: '2s', * from: 0, * to: 100 * } * }); * ``` * **Automatic unit conversion** * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds. * **Guided mode** * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it. * If guided mode is enabled the following behavior is added: * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation) * - The animate element will be forced to use `fill="freeze"` * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately. * - After the animation the element attribute value will be set to the `to` value of the animation * - The animate element is deleted from the DOM * * @memberof Chartist.Svg * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode. * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated. * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends. * @return {Chartist.Svg} The current element where the animation was added */ function animate(animations, guided, eventEmitter) { if(guided === undefined) { guided = true; } Object.keys(animations).forEach(function createAnimateForAttributes(attribute) { function createAnimate(animationDefinition, guided) { var attributeProperties = {}, animate, timeout, easing; // Check if an easing is specified in the definition object and delete it from the object as it will not // be part of the animate element attributes. if(animationDefinition.easing) { // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object easing = animationDefinition.easing instanceof Array ? animationDefinition.easing : Chartist.Svg.Easing[animationDefinition.easing]; delete animationDefinition.easing; } // If numeric dur or begin was provided we assume milli seconds animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms'); animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms'); if(easing) { animationDefinition.calcMode = 'spline'; animationDefinition.keySplines = easing.join(' '); animationDefinition.keyTimes = '0;1'; } // Adding "fill: freeze" if we are in guided mode and set initial attribute values if(guided) { animationDefinition.fill = 'freeze'; // Animated property on our element should already be set to the animation from value in guided mode attributeProperties[attribute] = animationDefinition.from; this.attr(attributeProperties); // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin // which needs to be in ms aside timeout = Chartist.quantity(animationDefinition.begin || 0).value; animationDefinition.begin = 'indefinite'; } animate = this.elem('animate', Chartist.extend({ attributeName: attribute }, animationDefinition)); if(guided) { // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout setTimeout(function() { // If beginElement fails we set the animated attribute to the end position and remove the animate element // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in // the browser. (Currently FF 34 does not support animate elements in foreignObjects) try { animate._node.beginElement(); } catch(err) { // Set animated attribute to current animated value attributeProperties[attribute] = animationDefinition.to; this.attr(attributeProperties); // Remove the animate element as it's no longer required animate.remove(); } }.bind(this), timeout); } if(eventEmitter) { animate._node.addEventListener('beginEvent', function handleBeginEvent() { eventEmitter.emit('animationBegin', { element: this, animate: animate._node, params: animationDefinition }); }.bind(this)); } animate._node.addEventListener('endEvent', function handleEndEvent() { if(eventEmitter) { eventEmitter.emit('animationEnd', { element: this, animate: animate._node, params: animationDefinition }); } if(guided) { // Set animated attribute to current animated value attributeProperties[attribute] = animationDefinition.to; this.attr(attributeProperties); // Remove the animate element as it's no longer required animate.remove(); } }.bind(this)); } // If current attribute is an array of definition objects we create an animate for each and disable guided mode if(animations[attribute] instanceof Array) { animations[attribute].forEach(function(animationDefinition) { createAnimate.bind(this)(animationDefinition, false); }.bind(this)); } else { createAnimate.bind(this)(animations[attribute], guided); } }.bind(this)); return this; } Chartist.Svg = Chartist.Class.extend({ constructor: Svg, attr: attr, elem: elem, parent: parent, root: root, querySelector: querySelector, querySelectorAll: querySelectorAll, getNode: getNode, foreignObject: foreignObject, text: text, empty: empty, remove: remove, replace: replace, append: append, classes: classes, addClass: addClass, removeClass: removeClass, removeAllClasses: removeAllClasses, height: height, width: width, animate: animate }); /** * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. * * @memberof Chartist.Svg * @param {String} feature The SVG 1.1 feature that should be checked for support. * @return {Boolean} True of false if the feature is supported or not */ Chartist.Svg.isSupported = function(feature) { return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1'); }; /** * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions. * * @memberof Chartist.Svg */ var easingCubicBeziers = { easeInSine: [0.47, 0, 0.745, 0.715], easeOutSine: [0.39, 0.575, 0.565, 1], easeInOutSine: [0.445, 0.05, 0.55, 0.95], easeInQuad: [0.55, 0.085, 0.68, 0.53], easeOutQuad: [0.25, 0.46, 0.45, 0.94], easeInOutQuad: [0.455, 0.03, 0.515, 0.955], easeInCubic: [0.55, 0.055, 0.675, 0.19], easeOutCubic: [0.215, 0.61, 0.355, 1], easeInOutCubic: [0.645, 0.045, 0.355, 1], easeInQuart: [0.895, 0.03, 0.685, 0.22], easeOutQuart: [0.165, 0.84, 0.44, 1], easeInOutQuart: [0.77, 0, 0.175, 1], easeInQuint: [0.755, 0.05, 0.855, 0.06], easeOutQuint: [0.23, 1, 0.32, 1], easeInOutQuint: [0.86, 0, 0.07, 1], easeInExpo: [0.95, 0.05, 0.795, 0.035], easeOutExpo: [0.19, 1, 0.22, 1], easeInOutExpo: [1, 0, 0, 1], easeInCirc: [0.6, 0.04, 0.98, 0.335], easeOutCirc: [0.075, 0.82, 0.165, 1], easeInOutCirc: [0.785, 0.135, 0.15, 0.86], easeInBack: [0.6, -0.28, 0.735, 0.045], easeOutBack: [0.175, 0.885, 0.32, 1.275], easeInOutBack: [0.68, -0.55, 0.265, 1.55] }; Chartist.Svg.Easing = easingCubicBeziers; /** * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements. * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`. * * @memberof Chartist.Svg * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll) * @constructor */ function SvgList(nodeList) { var list = this; this.svgElements = []; for(var i = 0; i < nodeList.length; i++) { this.svgElements.push(new Chartist.Svg(nodeList[i])); } // Add delegation methods for Chartist.Svg Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) { return ['constructor', 'parent', 'querySelector', 'querySelectorAll', 'replace', 'append', 'classes', 'height', 'width'].indexOf(prototypeProperty) === -1; }).forEach(function(prototypeProperty) { list[prototypeProperty] = function() { var args = Array.prototype.slice.call(arguments, 0); list.svgElements.forEach(function(element) { Chartist.Svg.prototype[prototypeProperty].apply(element, args); }); return list; }; }); } Chartist.Svg.List = Chartist.Class.extend({ constructor: SvgList }); }(this || global, Chartist)); ;/** * Chartist SVG path module for SVG path description creation and modification. * * @module Chartist.Svg.Path */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; /** * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported. * * @memberof Chartist.Svg.Path * @type {Object} */ var elementDescriptions = { m: ['x', 'y'], l: ['x', 'y'], c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y'] }; /** * Default options for newly created SVG path objects. * * @memberof Chartist.Svg.Path * @type {Object} */ var defaultOptions = { // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed. accuracy: 3 }; function element(command, params, pathElements, pos, relative, data) { var pathElement = Chartist.extend({ command: relative ? command.toLowerCase() : command.toUpperCase() }, params, data ? { data: data } : {} ); pathElements.splice(pos, 0, pathElement); } function forEachParam(pathElements, cb) { pathElements.forEach(function(pathElement, pathElementIndex) { elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) { cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements); }); }); } /** * Used to construct a new path object. * * @memberof Chartist.Svg.Path * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end) * @param {Object} options Options object that overrides the default objects. See default options for more details. * @constructor */ function SvgPath(close, options) { this.pathElements = []; this.pos = 0; this.close = close; this.options = Chartist.extend({}, defaultOptions, options); } /** * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor. * * @memberof Chartist.Svg.Path * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array. * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned. */ function position(pos) { if(pos !== undefined) { this.pos = Math.max(0, Math.min(this.pathElements.length, pos)); return this; } else { return this.pos; } } /** * Removes elements from the path starting at the current position. * * @memberof Chartist.Svg.Path * @param {Number} count Number of path elements that should be removed from the current position. * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function remove(count) { this.pathElements.splice(this.pos, count); return this; } /** * Use this function to add a new move SVG path element. * * @memberof Chartist.Svg.Path * @param {Number} x The x coordinate for the move element. * @param {Number} y The y coordinate for the move element. * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter) * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function move(x, y, relative, data) { element('M', { x: +x, y: +y }, this.pathElements, this.pos++, relative, data); return this; } /** * Use this function to add a new line SVG path element. * * @memberof Chartist.Svg.Path * @param {Number} x The x coordinate for the line element. * @param {Number} y The y coordinate for the line element. * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter) * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function line(x, y, relative, data) { element('L', { x: +x, y: +y }, this.pathElements, this.pos++, relative, data); return this; } /** * Use this function to add a new curve SVG path element. * * @memberof Chartist.Svg.Path * @param {Number} x1 The x coordinate for the first control point of the bezier curve. * @param {Number} y1 The y coordinate for the first control point of the bezier curve. * @param {Number} x2 The x coordinate for the second control point of the bezier curve. * @param {Number} y2 The y coordinate for the second control point of the bezier curve. * @param {Number} x The x coordinate for the target point of the curve element. * @param {Number} y The y coordinate for the target point of the curve element. * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function curve(x1, y1, x2, y2, x, y, relative, data) { element('C', { x1: +x1, y1: +y1, x2: +x2, y2: +y2, x: +x, y: +y }, this.pathElements, this.pos++, relative, data); return this; } /** * Use this function to add a new non-bezier curve SVG path element. * * @memberof Chartist.Svg.Path * @param {Number} rx The radius to be used for the x-axis of the arc. * @param {Number} ry The radius to be used for the y-axis of the arc. * @param {Number} xAr Defines the orientation of the arc * @param {Number} lAf Large arc flag * @param {Number} sf Sweep flag * @param {Number} x The x coordinate for the target point of the curve element. * @param {Number} y The y coordinate for the target point of the curve element. * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) { element('A', { rx: +rx, ry: +ry, xAr: +xAr, lAf: +lAf, sf: +sf, x: +x, y: +y }, this.pathElements, this.pos++, relative, data); return this; } /** * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object. * * @memberof Chartist.Svg.Path * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components. * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function parse(path) { // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']] var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2') .replace(/([0-9])([A-Za-z])/g, '$1 $2') .split(/[\s,]+/) .reduce(function(result, element) { if(element.match(/[A-Za-z]/)) { result.push([]); } result[result.length - 1].push(element); return result; }, []); // If this is a closed path we remove the Z at the end because this is determined by the close option if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') { chunks.pop(); } // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters // For example {command: 'M', x: '10', y: '10'} var elements = chunks.map(function(chunk) { var command = chunk.shift(), description = elementDescriptions[command.toLowerCase()]; return Chartist.extend({ command: command }, description.reduce(function(result, paramName, index) { result[paramName] = +chunk[index]; return result; }, {})); }); // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position var spliceArgs = [this.pos, 0]; Array.prototype.push.apply(spliceArgs, elements); Array.prototype.splice.apply(this.pathElements, spliceArgs); // Increase the internal position by the element count this.pos += elements.length; return this; } /** * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string. * * @memberof Chartist.Svg.Path * @return {String} */ function stringify() { var accuracyMultiplier = Math.pow(10, this.options.accuracy); return this.pathElements.reduce(function(path, pathElement) { var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) { return this.options.accuracy ? (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) : pathElement[paramName]; }.bind(this)); return path + pathElement.command + params.join(','); }.bind(this), '') + (this.close ? 'Z' : ''); } /** * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate. * * @memberof Chartist.Svg.Path * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements. * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements. * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function scale(x, y) { forEachParam(this.pathElements, function(pathElement, paramName) { pathElement[paramName] *= paramName[0] === 'x' ? x : y; }); return this; } /** * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate. * * @memberof Chartist.Svg.Path * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements. * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements. * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function translate(x, y) { forEachParam(this.pathElements, function(pathElement, paramName) { pathElement[paramName] += paramName[0] === 'x' ? x : y; }); return this; } /** * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path. * The method signature of the callback function looks like this: * ```javascript * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) * ``` * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate. * * @memberof Chartist.Svg.Path * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description. * @return {Chartist.Svg.Path} The current path object for easy call chaining. */ function transform(transformFnc) { forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) { var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements); if(transformed || transformed === 0) { pathElement[paramName] = transformed; } }); return this; } /** * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned. * * @memberof Chartist.Svg.Path * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used. * @return {Chartist.Svg.Path} */ function clone(close) { var c = new Chartist.Svg.Path(close || this.close); c.pos = this.pos; c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) { return Chartist.extend({}, pathElement); }); c.options = Chartist.extend({}, this.options); return c; } /** * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings. * * @memberof Chartist.Svg.Path * @param {String} command The command you'd like to use to split the path * @return {Array} */ function splitByCommand(command) { var split = [ new Chartist.Svg.Path() ]; this.pathElements.forEach(function(pathElement) { if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) { split.push(new Chartist.Svg.Path()); } split[split.length - 1].pathElements.push(pathElement); }); return split; } /** * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths. * * @memberof Chartist.Svg.Path * @param {Array} paths A list of paths to be joined together. The order is important. * @param {boolean} close If the newly created path should be a closed path * @param {Object} options Path options for the newly created path. * @return {Chartist.Svg.Path} */ function join(paths, close, options) { var joinedPath = new Chartist.Svg.Path(close, options); for(var i = 0; i < paths.length; i++) { var path = paths[i]; for(var j = 0; j < path.pathElements.length; j++) { joinedPath.pathElements.push(path.pathElements[j]); } } return joinedPath; } Chartist.Svg.Path = Chartist.Class.extend({ constructor: SvgPath, position: position, remove: remove, move: move, line: line, curve: curve, arc: arc, scale: scale, translate: translate, transform: transform, parse: parse, stringify: stringify, clone: clone, splitByCommand: splitByCommand }); Chartist.Svg.Path.elementDescriptions = elementDescriptions; Chartist.Svg.Path.join = join; }(this || global, Chartist)); ;/* global Chartist */ (function (globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; var axisUnits = { x: { pos: 'x', len: 'width', dir: 'horizontal', rectStart: 'x1', rectEnd: 'x2', rectOffset: 'y2' }, y: { pos: 'y', len: 'height', dir: 'vertical', rectStart: 'y2', rectEnd: 'y1', rectOffset: 'x1' } }; function Axis(units, chartRect, ticks, options) { this.units = units; this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x; this.chartRect = chartRect; this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart]; this.gridOffset = chartRect[units.rectOffset]; this.ticks = ticks; this.options = options; } function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) { var axisOptions = chartOptions['axis' + this.units.pos.toUpperCase()]; var projectedValues = this.ticks.map(this.projectValue.bind(this)); var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc); projectedValues.forEach(function(projectedValue, index) { var labelOffset = { x: 0, y: 0 }; // TODO: Find better solution for solving this problem // Calculate how much space we have available for the label var labelLength; if(projectedValues[index + 1]) { // If we still have one label ahead, we can calculate the distance to the next tick / label labelLength = projectedValues[index + 1] - projectedValue; } else { // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will // still be visible inside of the chart padding. labelLength = Math.max(this.axisLength - projectedValue, 30); } // Skip grid lines and labels where interpolated label values are falsey (execpt for 0) if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') { return; } // Transform to global coordinates using the chartRect // We also need to set the label offset for the createLabel function if(this.units.pos === 'x') { projectedValue = this.chartRect.x1 + projectedValue; labelOffset.x = chartOptions.axisX.labelOffset.x; // If the labels should be positioned in start position (top side for vertical axis) we need to set a // different offset as for positioned with end (bottom) if(chartOptions.axisX.position === 'start') { labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); } else { labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); } } else { projectedValue = this.chartRect.y1 - projectedValue; labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0); // If the labels should be positioned in start position (left side for horizontal axis) we need to set a // different offset as for positioned with end (right side) if(chartOptions.axisY.position === 'start') { labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10; } else { labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10; } } if(axisOptions.showGrid) { Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [ chartOptions.classNames.grid, chartOptions.classNames[this.units.dir] ], eventEmitter); } if(axisOptions.showLabel) { Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [ chartOptions.classNames.label, chartOptions.classNames[this.units.dir], (axisOptions.position === 'start' ? chartOptions.classNames[axisOptions.position] : chartOptions.classNames['end']) ], useForeignObject, eventEmitter); } }.bind(this)); } Chartist.Axis = Chartist.Class.extend({ constructor: Axis, createGridAndLabels: createGridAndLabels, projectValue: function(value, index, data) { throw new Error('Base axis can\'t be instantiated!'); } }); Chartist.Axis.units = axisUnits; }(this || global, Chartist)); ;/** * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart. * **Options** * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. * ```javascript * var options = { * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored * high: 100, * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored * low: 0, * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel). * scaleMinSpace: 20, * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only. * onlyInteger: true, * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart. * referenceValue: 5 * }; * ``` * * @module Chartist.AutoScaleAxis */ /* global Chartist */ (function (globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; function AutoScaleAxis(axisUnit, data, chartRect, options) { // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options var highLow = options.highLow || Chartist.getHighLow(data, options, axisUnit.pos); this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger); this.range = { min: this.bounds.min, max: this.bounds.max }; Chartist.AutoScaleAxis.super.constructor.call(this, axisUnit, chartRect, this.bounds.values, options); } function projectValue(value) { return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range; } Chartist.AutoScaleAxis = Chartist.Axis.extend({ constructor: AutoScaleAxis, projectValue: projectValue }); }(this || global, Chartist)); ;/** * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum. * **Options** * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. * ```javascript * var options = { * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored * high: 100, * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored * low: 0, * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1. * divisor: 4, * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated. * ticks: [1, 10, 20, 30] * }; * ``` * * @module Chartist.FixedScaleAxis */ /* global Chartist */ (function (globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; function FixedScaleAxis(axisUnit, data, chartRect, options) { var highLow = options.highLow || Chartist.getHighLow(data, options, axisUnit.pos); this.divisor = options.divisor || 1; this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) { return highLow.low + (highLow.high - highLow.low) / this.divisor * index; }.bind(this)); this.ticks.sort(function(a, b) { return a - b; }); this.range = { min: highLow.low, max: highLow.high }; Chartist.FixedScaleAxis.super.constructor.call(this, axisUnit, chartRect, this.ticks, options); this.stepLength = this.axisLength / this.divisor; } function projectValue(value) { return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min); } Chartist.FixedScaleAxis = Chartist.Axis.extend({ constructor: FixedScaleAxis, projectValue: projectValue }); }(this || global, Chartist)); ;/** * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose. * **Options** * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. * ```javascript * var options = { * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks. * ticks: ['One', 'Two', 'Three'], * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead. * stretch: true * }; * ``` * * @module Chartist.StepAxis */ /* global Chartist */ (function (globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; function StepAxis(axisUnit, data, chartRect, options) { Chartist.StepAxis.super.constructor.call(this, axisUnit, chartRect, options.ticks, options); var calc = Math.max(1, options.ticks.length - (options.stretch ? 1 : 0)); this.stepLength = this.axisLength / calc; } function projectValue(value, index) { return this.stepLength * index; } Chartist.StepAxis = Chartist.Axis.extend({ constructor: StepAxis, projectValue: projectValue }); }(this || global, Chartist)); ;/** * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. * * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. * * @module Chartist.Line */ /* global Chartist */ (function(globalRoot, Chartist){ 'use strict'; var window = globalRoot.window; var document = globalRoot.document; /** * Default options in line charts. Expand the code view to see a detailed list of options with comments. * * @memberof Chartist.Line */ var defaultOptions = { // Options for X-Axis axisX: { // The offset of the labels to the chart area offset: 30, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. position: 'end', // Allows you to correct label positioning on this axis by positive or negative x and y offset. labelOffset: { x: 0, y: 0 }, // If labels should be shown or not showLabel: true, // If the axis grid should be drawn or not showGrid: true, // Interpolation function that allows you to intercept the value from the axis label labelInterpolationFnc: Chartist.noop, // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. type: undefined }, // Options for Y-Axis axisY: { // The offset of the labels to the chart area offset: 40, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. position: 'start', // Allows you to correct label positioning on this axis by positive or negative x and y offset. labelOffset: { x: 0, y: 0 }, // If labels should be shown or not showLabel: true, // If the axis grid should be drawn or not showGrid: true, // Interpolation function that allows you to intercept the value from the axis label labelInterpolationFnc: Chartist.noop, // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. type: undefined, // This value specifies the minimum height in pixel of the scale steps scaleMinSpace: 20, // Use only integer values (whole numbers) for the scale steps onlyInteger: false }, // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') width: undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') height: undefined, // If the line should be drawn or not showLine: true, // If dots should be drawn or not showPoint: true, // If the line chart should draw an area showArea: false, // The base for the area chart that will be used to close the area shape (is normally 0) areaBase: 0, // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description. lineSmooth: true, // If the line chart should add a background fill to the .ct-grids group. showGridBackground: false, // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value low: undefined, // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value high: undefined, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. fullWidth: false, // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. reverseData: false, // Override the class names that get used to generate the SVG structure of the chart classNames: { chart: 'ct-chart-line', label: 'ct-label', labelGroup: 'ct-labels', series: 'ct-series', line: 'ct-line', point: 'ct-point', area: 'ct-area', grid: 'ct-grid', gridGroup: 'ct-grids', gridBackground: 'ct-grid-background', vertical: 'ct-vertical', horizontal: 'ct-horizontal', start: 'ct-start', end: 'ct-end' } }; /** * Creates a new chart * */ function createChart(options) { var data = Chartist.normalizeData(this.data, options.reverseData, true); // Create new svg object this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); // Create groups for labels, grid and series var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); var seriesGroup = this.svg.elem('g'); var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); var axisX, axisY; if(options.axisX.type === undefined) { axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, { ticks: data.normalized.labels, stretch: options.fullWidth })); } else { axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX); } if(options.axisY.type === undefined) { axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, { high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high, low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low })); } else { axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY); } axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); if (options.showGridBackground) { Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter); } // Draw the series data.raw.series.forEach(function(series, seriesIndex) { var seriesElement = seriesGroup.elem('g'); // Write attributes to series group element. If series name or meta is undefined the attributes will not be written seriesElement.attr({ 'ct:series-name': series.name, 'ct:meta': Chartist.serialize(series.meta) }); // Use series class from series data or if not set generate one seriesElement.addClass([ options.classNames.series, (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) ].join(' ')); var pathCoordinates = [], pathData = []; data.normalized.series[seriesIndex].forEach(function(value, valueIndex) { var p = { x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]), y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex]) }; pathCoordinates.push(p.x, p.y); pathData.push({ value: value, valueIndex: valueIndex, meta: Chartist.getMetaData(series, valueIndex) }); }.bind(this)); var seriesOptions = { lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'), showPoint: Chartist.getSeriesOption(series, options, 'showPoint'), showLine: Chartist.getSeriesOption(series, options, 'showLine'), showArea: Chartist.getSeriesOption(series, options, 'showArea'), areaBase: Chartist.getSeriesOption(series, options, 'areaBase') }; var smoothing = typeof seriesOptions.lineSmooth === 'function' ? seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none()); // Interpolating path where pathData will be used to annotate each path element so we can trace back the original // index, value and meta data var path = smoothing(pathCoordinates, pathData); // If we should show points we need to create them now to avoid secondary loop // Points are drawn from the pathElements returned by the interpolation function // Small offset for Firefox to render squares correctly if (seriesOptions.showPoint) { path.pathElements.forEach(function(pathElement) { var point = seriesElement.elem('line', { x1: pathElement.x, y1: pathElement.y, x2: pathElement.x + 0.01, y2: pathElement.y }, options.classNames.point).attr({ 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','), 'ct:meta': Chartist.serialize(pathElement.data.meta) }); this.eventEmitter.emit('draw', { type: 'point', value: pathElement.data.value, index: pathElement.data.valueIndex, meta: pathElement.data.meta, series: series, seriesIndex: seriesIndex, axisX: axisX, axisY: axisY, group: seriesElement, element: point, x: pathElement.x, y: pathElement.y }); }.bind(this)); } if(seriesOptions.showLine) { var line = seriesElement.elem('path', { d: path.stringify() }, options.classNames.line, true); this.eventEmitter.emit('draw', { type: 'line', values: data.normalized.series[seriesIndex], path: path.clone(), chartRect: chartRect, index: seriesIndex, series: series, seriesIndex: seriesIndex, seriesMeta: series.meta, axisX: axisX, axisY: axisY, group: seriesElement, element: line }); } // Area currently only works with axes that support a range! if(seriesOptions.showArea && axisY.range) { // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that // the area is not drawn outside the chart area. var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min); // We project the areaBase value into screen coordinates var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase); // In order to form the area we'll first split the path by move commands so we can chunk it up into segments path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) { // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area return pathSegment.pathElements.length > 1; }).map(function convertToArea(solidPathSegments) { // Receiving the filtered solid path segments we can now convert those segments into fill areas var firstElement = solidPathSegments.pathElements[0]; var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; // Cloning the solid path segment with closing option and removing the first move command from the clone // We then insert a new move that should start at the area base and draw a straight line up or down // at the end of the path we add an additional straight line to the projected area base value // As the closing option is set our path will be automatically closed return solidPathSegments.clone(true) .position(0) .remove(1) .move(firstElement.x, areaBaseProjected) .line(firstElement.x, firstElement.y) .position(solidPathSegments.pathElements.length + 1) .line(lastElement.x, areaBaseProjected); }).forEach(function createArea(areaPath) { // For each of our newly created area paths, we'll now create path elements by stringifying our path objects // and adding the created DOM elements to the correct series group var area = seriesElement.elem('path', { d: areaPath.stringify() }, options.classNames.area, true); // Emit an event for each area that was drawn this.eventEmitter.emit('draw', { type: 'area', values: data.normalized.series[seriesIndex], path: areaPath.clone(), series: series, seriesIndex: seriesIndex, axisX: axisX, axisY: axisY, chartRect: chartRect, index: seriesIndex, group: seriesElement, element: area }); }.bind(this)); } }.bind(this)); this.eventEmitter.emit('created', { bounds: axisY.bounds, chartRect: chartRect, axisX: axisX, axisY: axisY, svg: this.svg, options: options }); } /** * This method creates a new line chart. * * @memberof Chartist.Line * @param {String|Node} query A selector query string or directly a DOM element * @param {Object} data The data object that needs to consist of a labels and a series array * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] * @return {Object} An object which exposes the API for the created chart * * @example * // Create a simple line chart * var data = { * // A labels array that can contain any sort of values * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], * // Our series array that contains series objects or in this case series data arrays * series: [ * [5, 2, 4, 2, 0] * ] * }; * * // As options we currently only set a static size of 300x200 px * var options = { * width: '300px', * height: '200px' * }; * * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options * new Chartist.Line('.ct-chart', data, options); * * @example * // Use specific interpolation function with configuration from the Chartist.Interpolation module * * var chart = new Chartist.Line('.ct-chart', { * labels: [1, 2, 3, 4, 5], * series: [ * [1, 1, 8, 1, 7] * ] * }, { * lineSmooth: Chartist.Interpolation.cardinal({ * tension: 0.2 * }) * }); * * @example * // Create a line chart with responsive options * * var data = { * // A labels array that can contain any sort of values * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], * // Our series array that contains series objects or in this case series data arrays * series: [ * [5, 2, 4, 2, 0] * ] * }; * * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. * var responsiveOptions = [ * ['screen and (min-width: 641px) and (max-width: 1024px)', { * showPoint: false, * axisX: { * labelInterpolationFnc: function(value) { * // Will return Mon, Tue, Wed etc. on medium screens * return value.slice(0, 3); * } * } * }], * ['screen and (max-width: 640px)', { * showLine: false, * axisX: { * labelInterpolationFnc: function(value) { * // Will return M, T, W etc. on small screens * return value[0]; * } * } * }] * ]; * * new Chartist.Line('.ct-chart', data, null, responsiveOptions); * */ function Line(query, data, options, responsiveOptions) { Chartist.Line.super.constructor.call(this, query, data, defaultOptions, Chartist.extend({}, defaultOptions, options), responsiveOptions); } // Creating line chart type in Chartist namespace Chartist.Line = Chartist.Base.extend({ constructor: Line, createChart: createChart }); }(this || global, Chartist)); ;/** * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. * * @module Chartist.Bar */ /* global Chartist */ (function(globalRoot, Chartist){ 'use strict'; var window = globalRoot.window; var document = globalRoot.document; /** * Default options in bar charts. Expand the code view to see a detailed list of options with comments. * * @memberof Chartist.Bar */ var defaultOptions = { // Options for X-Axis axisX: { // The offset of the chart drawing area to the border of the container offset: 30, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. position: 'end', // Allows you to correct label positioning on this axis by positive or negative x and y offset. labelOffset: { x: 0, y: 0 }, // If labels should be shown or not showLabel: true, // If the axis grid should be drawn or not showGrid: true, // Interpolation function that allows you to intercept the value from the axis label labelInterpolationFnc: Chartist.noop, // This value specifies the minimum width in pixel of the scale steps scaleMinSpace: 30, // Use only integer values (whole numbers) for the scale steps onlyInteger: false }, // Options for Y-Axis axisY: { // The offset of the chart drawing area to the border of the container offset: 40, // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. position: 'start', // Allows you to correct label positioning on this axis by positive or negative x and y offset. labelOffset: { x: 0, y: 0 }, // If labels should be shown or not showLabel: true, // If the axis grid should be drawn or not showGrid: true, // Interpolation function that allows you to intercept the value from the axis label labelInterpolationFnc: Chartist.noop, // This value specifies the minimum height in pixel of the scale steps scaleMinSpace: 20, // Use only integer values (whole numbers) for the scale steps onlyInteger: false }, // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') width: undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') height: undefined, // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value high: undefined, // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value low: undefined, // Unless low/high are explicitly set, bar chart will be centered at zero by default. Set referenceValue to null to auto scale. referenceValue: 0, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, // Specify the distance in pixel of bars in a group seriesBarDistance: 15, // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options. stackBars: false, // If set to 'overlap' this property will force the stacked bars to draw from the zero line. // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. stackMode: 'accumulate', // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values. horizontalBars: false, // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time. distributeSeries: false, // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. reverseData: false, // If the bar chart should add a background fill to the .ct-grids group. showGridBackground: false, // Override the class names that get used to generate the SVG structure of the chart classNames: { chart: 'ct-chart-bar', horizontalBars: 'ct-horizontal-bars', label: 'ct-label', labelGroup: 'ct-labels', series: 'ct-series', bar: 'ct-bar', grid: 'ct-grid', gridGroup: 'ct-grids', gridBackground: 'ct-grid-background', vertical: 'ct-vertical', horizontal: 'ct-horizontal', start: 'ct-start', end: 'ct-end' } }; /** * Creates a new chart * */ function createChart(options) { var data; var highLow; if(options.distributeSeries) { data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y'); data.normalized.series = data.normalized.series.map(function(value) { return [value]; }); } else { data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y'); } // Create new svg element this.svg = Chartist.createSvg( this.container, options.width, options.height, options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '') ); // Drawing groups in correct order var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); var seriesGroup = this.svg.elem('g'); var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); if(options.stackBars && data.normalized.series.length !== 0) { // If stacked bars we need to calculate the high low from stacked values from each series var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() { return Array.prototype.slice.call(arguments).map(function(value) { return value; }).reduce(function(prev, curr) { return { x: prev.x + (curr && curr.x) || 0, y: prev.y + (curr && curr.y) || 0 }; }, {x: 0, y: 0}); }); highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y'); } else { highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y'); } // Overrides of high / low from settings highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high); highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low); var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); var valueAxis, labelAxisTicks, labelAxis, axisX, axisY; // We need to set step count based on some options combinations if(options.distributeSeries && options.stackBars) { // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should // use only the first label for the step axis labelAxisTicks = data.normalized.labels.slice(0, 1); } else { // If distributed series are enabled but stacked bars aren't, we should use the series labels // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array // as the bars are normalized labelAxisTicks = data.normalized.labels; } // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary. if(options.horizontalBars) { if(options.axisX.type === undefined) { valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, { highLow: highLow, referenceValue: 0 })); } else { valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, { highLow: highLow, referenceValue: 0 })); } if(options.axisY.type === undefined) { labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, { ticks: labelAxisTicks }); } else { labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY); } } else { if(options.axisX.type === undefined) { labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, { ticks: labelAxisTicks }); } else { labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX); } if(options.axisY.type === undefined) { valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, { highLow: highLow, referenceValue: 0 })); } else { valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, { highLow: highLow, referenceValue: 0 })); } } // Projected 0 point var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0)); // Used to track the screen coordinates of stacked bars var stackedBarValues = []; labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); if (options.showGridBackground) { Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter); } // Draw the series data.raw.series.forEach(function(series, seriesIndex) { // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. var biPol = seriesIndex - (data.raw.series.length - 1) / 2; // Half of the period width between vertical grid lines used to position bars var periodHalfLength; // Current series SVG element var seriesElement; // We need to set periodHalfLength based on some options combinations if(options.distributeSeries && !options.stackBars) { // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array // which is the series count and divide by 2 periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2; } else if(options.distributeSeries && options.stackBars) { // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis // length by 2 periodHalfLength = labelAxis.axisLength / 2; } else { // On regular bar charts we should just use the series length periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2; } // Adding the series group to the series element seriesElement = seriesGroup.elem('g'); // Write attributes to series group element. If series name or meta is undefined the attributes will not be written seriesElement.attr({ 'ct:series-name': series.name, 'ct:meta': Chartist.serialize(series.meta) }); // Use series class from series data or if not set generate one seriesElement.addClass([ options.classNames.series, (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) ].join(' ')); data.normalized.series[seriesIndex].forEach(function(value, valueIndex) { var projected, bar, previousStack, labelAxisValueIndex; // We need to set labelAxisValueIndex based on some options combinations if(options.distributeSeries && !options.stackBars) { // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection // on the step axis for label positioning labelAxisValueIndex = seriesIndex; } else if(options.distributeSeries && options.stackBars) { // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use // 0 for projection on the label step axis labelAxisValueIndex = 0; } else { // On regular bar charts we just use the value index to project on the label step axis labelAxisValueIndex = valueIndex; } // We need to transform coordinates differently based on the chart layout if(options.horizontalBars) { projected = { x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]), y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]) }; } else { projected = { x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]), y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex]) } } // If the label axis is a step based axis we will offset the bar into the middle of between two steps using // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not // add any automated positioning. if(labelAxis instanceof Chartist.StepAxis) { // Offset to center bar between grid lines, but only if the step axis is not stretched if(!labelAxis.options.stretch) { projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1); } // Using bi-polar offset for multiple series if no stacked bars or series distribution is used projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1); } // Enter value in stacked bar values used to remember previous screen value for stacking up bars previousStack = stackedBarValues[valueIndex] || zeroPoint; stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); // Skip if value is undefined if(value === undefined) { return; } var positions = {}; positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos]; positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos]; if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) { // Stack mode: accumulate (default) // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line // We want backwards compatibility, so the expected fallback without the 'stackMode' option // to be the original behaviour (accumulate) positions[labelAxis.counterUnits.pos + '1'] = previousStack; positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex]; } else { // Draw from the zero line normally // This is also the same code for Stack mode: overlap positions[labelAxis.counterUnits.pos + '1'] = zeroPoint; positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos]; } // Limit x and y so that they are within the chart rect positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2); positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2); positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1); positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1); var metaData = Chartist.getMetaData(series, valueIndex); // Create bar element bar = seriesElement.elem('line', positions, options.classNames.bar).attr({ 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','), 'ct:meta': Chartist.serialize(metaData) }); this.eventEmitter.emit('draw', Chartist.extend({ type: 'bar', value: value, index: valueIndex, meta: metaData, series: series, seriesIndex: seriesIndex, axisX: axisX, axisY: axisY, chartRect: chartRect, group: seriesElement, element: bar }, positions)); }.bind(this)); }.bind(this)); this.eventEmitter.emit('created', { bounds: valueAxis.bounds, chartRect: chartRect, axisX: axisX, axisY: axisY, svg: this.svg, options: options }); } /** * This method creates a new bar chart and returns API object that you can use for later changes. * * @memberof Chartist.Bar * @param {String|Node} query A selector query string or directly a DOM element * @param {Object} data The data object that needs to consist of a labels and a series array * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] * @return {Object} An object which exposes the API for the created chart * * @example * // Create a simple bar chart * var data = { * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], * series: [ * [5, 2, 4, 2, 0] * ] * }; * * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. * new Chartist.Bar('.ct-chart', data); * * @example * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 * new Chartist.Bar('.ct-chart', { * labels: [1, 2, 3, 4, 5, 6, 7], * series: [ * [1, 3, 2, -5, -3, 1, -6], * [-5, -2, -4, -1, 2, -3, 1] * ] * }, { * seriesBarDistance: 12, * low: -10, * high: 10 * }); * */ function Bar(query, data, options, responsiveOptions) { Chartist.Bar.super.constructor.call(this, query, data, defaultOptions, Chartist.extend({}, defaultOptions, options), responsiveOptions); } // Creating bar chart type in Chartist namespace Chartist.Bar = Chartist.Base.extend({ constructor: Bar, createChart: createChart }); }(this || global, Chartist)); ;/** * The pie chart module of Chartist that can be used to draw pie, donut or gauge charts * * @module Chartist.Pie */ /* global Chartist */ (function(globalRoot, Chartist) { 'use strict'; var window = globalRoot.window; var document = globalRoot.document; /** * Default options in line charts. Expand the code view to see a detailed list of options with comments. * * @memberof Chartist.Pie */ var defaultOptions = { // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') width: undefined, // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') height: undefined, // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} chartPadding: 5, // Override the class names that are used to generate the SVG structure of the chart classNames: { chartPie: 'ct-chart-pie', chartDonut: 'ct-chart-donut', series: 'ct-series', slicePie: 'ct-slice-pie', sliceDonut: 'ct-slice-donut', sliceDonutSolid: 'ct-slice-donut-solid', label: 'ct-label' }, // The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. startAngle: 0, // An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. total: undefined, // If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. donut: false, // If specified the donut segments will be drawn as shapes instead of strokes. donutSolid: false, // Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. // This option can be set as number or string to specify a relative width (i.e. 100 or '30%'). donutWidth: 60, // If a label should be shown or not showLabel: true, // Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. labelOffset: 0, // This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option. labelPosition: 'inside', // An interpolation function for the label value labelInterpolationFnc: Chartist.noop, // Label direction can be 'neutral', 'explode' or 'implode'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. labelDirection: 'neutral', // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. reverseData: false, // If true empty values will be ignored to avoid drawing unncessary slices and labels ignoreEmptyValues: false }; /** * Determines SVG anchor position based on direction and center parameter * * @param center * @param label * @param direction * @return {string} */ function determineAnchorPosition(center, label, direction) { var toTheRight = label.x > center.x; if(toTheRight && direction === 'explode' || !toTheRight && direction === 'implode') { return 'start'; } else if(toTheRight && direction === 'implode' || !toTheRight && direction === 'explode') { return 'end'; } else { return 'middle'; } } /** * Creates the pie chart * * @param options */ function createChart(options) { var data = Chartist.normalizeData(this.data); var seriesGroups = [], labelsGroup, chartRect, radius, labelRadius, totalDataSum, startAngle = options.startAngle; // Create SVG.js draw this.svg = Chartist.createSvg(this.container, options.width, options.height,options.donut ? options.classNames.chartDonut : options.classNames.chartPie); // Calculate charting rect chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); // Get biggest circle radius possible within chartRect radius = Math.min(chartRect.width() / 2, chartRect.height() / 2); // Calculate total of all series to get reference value or use total reference from optional options totalDataSum = options.total || data.normalized.series.reduce(function(previousValue, currentValue) { return previousValue + currentValue; }, 0); var donutWidth = Chartist.quantity(options.donutWidth); if (donutWidth.unit === '%') { donutWidth.value *= radius / 100; } // If this is a donut chart we need to adjust our radius to enable strokes to be drawn inside // Unfortunately this is not possible with the current SVG Spec // See this proposal for more details: http://lists.w3.org/Archives/Public/www-svg/2003Oct/0000.html radius -= options.donut && !options.donutSolid ? donutWidth.value / 2 : 0; // If labelPosition is set to `outside` or a donut chart is drawn then the label position is at the radius, // if regular pie chart it's half of the radius if(options.labelPosition === 'outside' || options.donut && !options.donutSolid) { labelRadius = radius; } else if(options.labelPosition === 'center') { // If labelPosition is center we start with 0 and will later wait for the labelOffset labelRadius = 0; } else if(options.donutSolid) { labelRadius = radius - donutWidth.value / 2; } else { // Default option is 'inside' where we use half the radius so the label will be placed in the center of the pie // slice labelRadius = radius / 2; } // Add the offset to the labelRadius where a negative offset means closed to the center of the chart labelRadius += options.labelOffset; // Calculate end angle based on total sum and current data value and offset with padding var center = { x: chartRect.x1 + chartRect.width() / 2, y: chartRect.y2 + chartRect.height() / 2 }; // Check if there is only one non-zero value in the series array. var hasSingleValInSeries = data.raw.series.filter(function(val) { return val.hasOwnProperty('value') ? val.value !== 0 : val !== 0; }).length === 1; // Creating the series groups data.raw.series.forEach(function(series, index) { seriesGroups[index] = this.svg.elem('g', null, null); }.bind(this)); //if we need to show labels we create the label group now if(options.showLabel) { labelsGroup = this.svg.elem('g', null, null); } // Draw the series // initialize series groups data.raw.series.forEach(function(series, index) { // If current value is zero and we are ignoring empty values then skip to next value if (data.normalized.series[index] === 0 && options.ignoreEmptyValues) return; // If the series is an object and contains a name or meta data we add a custom attribute seriesGroups[index].attr({ 'ct:series-name': series.name }); // Use series class from series data or if not set generate one seriesGroups[index].addClass([ options.classNames.series, (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(index)) ].join(' ')); // If the whole dataset is 0 endAngle should be zero. Can't divide by 0. var endAngle = (totalDataSum > 0 ? startAngle + data.normalized.series[index] / totalDataSum * 360 : 0); // Use slight offset so there are no transparent hairline issues var overlappigStartAngle = Math.max(0, startAngle - (index === 0 || hasSingleValInSeries ? 0 : 0.2)); // If we need to draw the arc for all 360 degrees we need to add a hack where we close the circle // with Z and use 359.99 degrees if(endAngle - overlappigStartAngle >= 359.99) { endAngle = overlappigStartAngle + 359.99; } var start = Chartist.polarToCartesian(center.x, center.y, radius, overlappigStartAngle), end = Chartist.polarToCartesian(center.x, center.y, radius, endAngle); var innerStart, innerEnd, donutSolidRadius; // Create a new path element for the pie chart. If this isn't a donut chart we should close the path for a correct stroke var path = new Chartist.Svg.Path(!options.donut || options.donutSolid) .move(end.x, end.y) .arc(radius, radius, 0, endAngle - startAngle > 180, 0, start.x, start.y); // If regular pie chart (no donut) we add a line to the center of the circle for completing the pie if(!options.donut) { path.line(center.x, center.y); } else if (options.donutSolid) { donutSolidRadius = radius - donutWidth.value; innerStart = Chartist.polarToCartesian(center.x, center.y, donutSolidRadius, startAngle - (index === 0 || hasSingleValInSeries ? 0 : 0.2)); innerEnd = Chartist.polarToCartesian(center.x, center.y, donutSolidRadius, endAngle); path.line(innerStart.x, innerStart.y); path.arc(donutSolidRadius, donutSolidRadius, 0, endAngle - startAngle > 180, 1, innerEnd.x, innerEnd.y); } // Create the SVG path // If this is a donut chart we add the donut class, otherwise just a regular slice var pathClassName = options.classNames.slicePie; if (options.donut) { pathClassName = options.classNames.sliceDonut; if (options.donutSolid) { pathClassName = options.classNames.sliceDonutSolid; } } var pathElement = seriesGroups[index].elem('path', { d: path.stringify() }, pathClassName); // Adding the pie series value to the path pathElement.attr({ 'ct:value': data.normalized.series[index], 'ct:meta': Chartist.serialize(series.meta) }); // If this is a donut, we add the stroke-width as style attribute if(options.donut && !options.donutSolid) { pathElement._node.style.strokeWidth = donutWidth.value + 'px'; } // Fire off draw event this.eventEmitter.emit('draw', { type: 'slice', value: data.normalized.series[index], totalDataSum: totalDataSum, index: index, meta: series.meta, series: series, group: seriesGroups[index], element: pathElement, path: path.clone(), center: center, radius: radius, startAngle: startAngle, endAngle: endAngle }); // If we need to show labels we need to add the label for this slice now if(options.showLabel) { var labelPosition; if(data.raw.series.length === 1) { // If we have only 1 series, we can position the label in the center of the pie labelPosition = { x: center.x, y: center.y }; } else { // Position at the labelRadius distance from center and between start and end angle labelPosition = Chartist.polarToCartesian( center.x, center.y, labelRadius, startAngle + (endAngle - startAngle) / 2 ); } var rawValue; if(data.normalized.labels && !Chartist.isFalseyButZero(data.normalized.labels[index])) { rawValue = data.normalized.labels[index]; } else { rawValue = data.normalized.series[index]; } var interpolatedValue = options.labelInterpolationFnc(rawValue, index); if(interpolatedValue || interpolatedValue === 0) { var labelElement = labelsGroup.elem('text', { dx: labelPosition.x, dy: labelPosition.y, 'text-anchor': determineAnchorPosition(center, labelPosition, options.labelDirection) }, options.classNames.label).text('' + interpolatedValue); // Fire off draw event this.eventEmitter.emit('draw', { type: 'label', index: index, group: labelsGroup, element: labelElement, text: '' + interpolatedValue, x: labelPosition.x, y: labelPosition.y }); } } // Set next startAngle to current endAngle. // (except for last slice) startAngle = endAngle; }.bind(this)); this.eventEmitter.emit('created', { chartRect: chartRect, svg: this.svg, options: options }); } /** * This method creates a new pie chart and returns an object that can be used to redraw the chart. * * @memberof Chartist.Pie * @param {String|Node} query A selector query string or directly a DOM element * @param {Object} data The data object in the pie chart needs to have a series property with a one dimensional data array. The values will be normalized against each other and don't necessarily need to be in percentage. The series property can also be an array of value objects that contain a value property and a className property to override the CSS class name for the series group. * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] * @return {Object} An object with a version and an update method to manually redraw the chart * * @example * // Simple pie chart example with four series * new Chartist.Pie('.ct-chart', { * series: [10, 2, 4, 3] * }); * * @example * // Drawing a donut chart * new Chartist.Pie('.ct-chart', { * series: [10, 2, 4, 3] * }, { * donut: true * }); * * @example * // Using donut, startAngle and total to draw a gauge chart * new Chartist.Pie('.ct-chart', { * series: [20, 10, 30, 40] * }, { * donut: true, * donutWidth: 20, * startAngle: 270, * total: 200 * }); * * @example * // Drawing a pie chart with padding and labels that are outside the pie * new Chartist.Pie('.ct-chart', { * series: [20, 10, 30, 40] * }, { * chartPadding: 30, * labelOffset: 50, * labelDirection: 'explode' * }); * * @example * // Overriding the class names for individual series as well as a name and meta data. * // The name will be written as ct:series-name attribute and the meta data will be serialized and written * // to a ct:meta attribute. * new Chartist.Pie('.ct-chart', { * series: [{ * value: 20, * name: 'Series 1', * className: 'my-custom-class-one', * meta: 'Meta One' * }, { * value: 10, * name: 'Series 2', * className: 'my-custom-class-two', * meta: 'Meta Two' * }, { * value: 70, * name: 'Series 3', * className: 'my-custom-class-three', * meta: 'Meta Three' * }] * }); */ function Pie(query, data, options, responsiveOptions) { Chartist.Pie.super.constructor.call(this, query, data, defaultOptions, Chartist.extend({}, defaultOptions, options), responsiveOptions); } // Creating pie chart type in Chartist namespace Chartist.Pie = Chartist.Base.extend({ constructor: Pie, createChart: createChart, determineAnchorPosition: determineAnchorPosition }); }(this || global, Chartist)); return Chartist; })); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"))) /***/ }), /***/ "bb71": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : German (Switzerland) [de-ch] //! author : sschueller : https://github.com/sschueller ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { m: ['eine Minute', 'einer Minute'], h: ['eine Stunde', 'einer Stunde'], d: ['ein Tag', 'einem Tag'], dd: [number + ' Tage', number + ' Tagen'], w: ['eine Woche', 'einer Woche'], M: ['ein Monat', 'einem Monat'], MM: [number + ' Monate', number + ' Monaten'], y: ['ein Jahr', 'einem Jahr'], yy: [number + ' Jahre', number + ' Jahren'], }; return withoutSuffix ? format[key][0] : format[key][1]; } var deCh = moment.defineLocale('de-ch', { months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split( '_' ), monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split( '_' ), monthsParseExact: true, weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split( '_' ), weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY HH:mm', LLLL: 'dddd, D. MMMM YYYY HH:mm', }, calendar: { sameDay: '[heute um] LT [Uhr]', sameElse: 'L', nextDay: '[morgen um] LT [Uhr]', nextWeek: 'dddd [um] LT [Uhr]', lastDay: '[gestern um] LT [Uhr]', lastWeek: '[letzten] dddd [um] LT [Uhr]', }, relativeTime: { future: 'in %s', past: 'vor %s', s: 'ein paar Sekunden', ss: '%d Sekunden', m: processRelativeTime, mm: '%d Minuten', h: processRelativeTime, hh: '%d Stunden', d: processRelativeTime, dd: processRelativeTime, w: processRelativeTime, ww: '%d Wochen', M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return deCh; }))); /***/ }), /***/ "bc0a": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "bc3a": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("cee4"); /***/ }), /***/ "bc48": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "bcaa": /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__("cb7c"); var isObject = __webpack_require__("d3f4"); var newPromiseCapability = __webpack_require__("a5b8"); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; /***/ }), /***/ "be13": /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ "c0d4": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "img/nophoto.5eda24d4.gif"; /***/ }), /***/ "c109": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Central Atlas Tamazight [tzm] //! author : Abdel Said : https://github.com/abdelsaid ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var tzm = moment.defineLocale('tzm', { months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split( '_' ), monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split( '_' ), weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[ⴰⵙⴷⵅ ⴴ] LT', nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', nextWeek: 'dddd [ⴴ] LT', lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', lastWeek: 'dddd [ⴴ] LT', sameElse: 'L', }, relativeTime: { future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', past: 'ⵢⴰⵏ %s', s: 'ⵉⵎⵉⴽ', ss: '%d ⵉⵎⵉⴽ', m: 'ⵎⵉⵏⵓⴺ', mm: '%d ⵎⵉⵏⵓⴺ', h: 'ⵙⴰⵄⴰ', hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', d: 'ⴰⵙⵙ', dd: '%d oⵙⵙⴰⵏ', M: 'ⴰⵢoⵓⵔ', MM: '%d ⵉⵢⵢⵉⵔⵏ', y: 'ⴰⵙⴳⴰⵙ', yy: '%d ⵉⵙⴳⴰⵙⵏ', }, week: { dow: 6, // Saturday is the first day of the week. doy: 12, // The week that contains Jan 12th is the first week of the year. }, }); return tzm; }))); /***/ }), /***/ "c1b2": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "img/beyondandabove.e8458908.png"; /***/ }), /***/ "c1df": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js //! version : 2.29.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { true ? module.exports = factory() : undefined }(this, (function () { 'use strict'; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return ( input instanceof Array || Object.prototype.toString.call(input) === '[object Array]' ); } function isObject(input) { // IE8 will treat undefined and null as object if it wasn't for // input != null return ( input != null && Object.prototype.toString.call(input) === '[object Object]' ); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return ( typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]' ); } function isDate(input) { return ( input instanceof Date || Object.prototype.toString.call(input) === '[object Date]' ); } function map(arr, fn) { var res = [], i; for (i = 0; i < arr.length; ++i) { res.push(fn(arr[i], i)); } return res; } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false, }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m), parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }), isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } } return m._isValid; } function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = (hooks.momentProperties = []), updateInProgress = false; function copyConfig(to, from) { var i, prop, val; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentProperties.length > 0) { for (i = 0; i < momentProperties.length; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return ( obj instanceof Moment || (obj != null && obj._isAMomentObject != null) ); } function warn(msg) { if ( hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn ) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key; for (i = 0; i < arguments.length; i++) { arg = ''; if (typeof arguments[i] === 'object') { arg += '\n[' + i + '] '; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ': ' + arguments[0][key] + ', '; } } arg = arg.slice(0, -2); // Remove trailing comma and space } else { arg = arguments[i]; } args.push(arg); } warn( msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } function set(config) { var prop, i; for (i in config) { if (hasOwnProp(config, i)) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. // TODO: Remove "ordinalParse" fallback in next major release. this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if ( hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) ) { // make sure changes to properties don't modify parent config res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } var defaultCalendar = { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }; function calendar(key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return ( (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber ); } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken(token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal( func.apply(this, arguments), token ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var defaultLongDateFormat = { LTS: 'h:mm:ss A', LT: 'h:mm A', L: 'MM/DD/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY h:mm A', LLLL: 'dddd, MMMM D, YYYY h:mm A', }; function longDateFormat(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper .match(formattingTokens) .map(function (tok) { if ( tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd' ) { return tok.slice(1); } return tok; }) .join(''); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate() { return this._invalidDate; } var defaultOrdinal = '%d', defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace('%d', number); } var defaultRelativeTime = { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', w: 'a week', ww: '%d weeks', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var aliases = {}; function addUnitAlias(unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; } function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = {}; function addUnitPriority(unit, priority) { priorities[unit] = priority; } function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function (a, b) { return a.priority - b.priority; }); return units; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } function absFloor(number) { if (number < 0) { // -0 -> 0 return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } function makeGetSet(unit, keepTime) { return function (value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function set$1(mom, unit, value) { if (mom.isValid() && !isNaN(value)) { if ( unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29 ) { value = toInt(value); mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit]( value, mom.month(), daysInMonth(value, mom.month()) ); } else { mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } } } // MOMENTS function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i; for (i = 0; i < prioritized.length; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } var match1 = /\d/, // 0 - 9 match2 = /\d\d/, // 00 - 99 match3 = /\d{3}/, // 000 - 999 match4 = /\d{4}/, // 0000 - 9999 match6 = /[+-]?\d{6}/, // -999999 - 999999 match1to2 = /\d\d?/, // 0 - 99 match3to4 = /\d\d\d\d?/, // 999 - 9999 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 match1to3 = /\d{1,3}/, // 0 - 999 match1to4 = /\d{1,4}/, // 0 - 9999 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 matchUnsigned = /\d+/, // 0 - inf matchSigned = /[+-]?\d+/, // -inf - inf matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes; regexes = {}; function addRegexToken(token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape( s .replace('\\', '') .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function ( matched, p1, p2, p3, p4 ) { return p1 || p2 || p3 || p4; }) ); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; function addParseToken(token, callback) { var i, func = callback; if (typeof token === 'string') { token = [token]; } if (isNumber(callback)) { func = function (input, array) { array[callback] = toInt(input); }; } for (i = 0; i < token.length; i++) { tokens[token[i]] = func; } } function addWeekParseToken(token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; function mod(n, x) { return ((n % x) + x) % x; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - ((modMonth % 7) % 2); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // ALIASES addUnitAlias('month', 'M'); // PRIORITY addUnitPriority('month', 8); // PARSING addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split( '_' ), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format) { if (!m) { return isArray(this._months) ? this._months : this._months['standalone']; } return isArray(this._months) ? this._months[m.month()] : this._months[ (this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone' ][m.month()]; } function localeMonthsShort(m, format) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[ MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' ][m.month()]; } function handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort( mom, '' ).toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp( '^' + this.months(mom, '').replace('.', '') + '$', 'i' ); this._shortMonthsParse[i] = new RegExp( '^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i' ); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName) ) { return i; } else if ( strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName) ) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth(mom, value) { var dayOfMonth; if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (!isNumber(value)) { return mom; } } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, 'Month'); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, '_monthsShortRegex')) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, '_monthsRegex')) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); shortPieces.push(this.monthsShort(mom, '')); longPieces.push(this.months(mom, '')); mixedPieces.push(this.months(mom, '')); mixedPieces.push(this.monthsShort(mom, '')); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); for (i = 0; i < 12; i++) { shortPieces[i] = regexEscape(shortPieces[i]); longPieces[i] = regexEscape(longPieces[i]); } for (i = 0; i < 24; i++) { mixedPieces[i] = regexEscape(mixedPieces[i]); } this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._monthsShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : '+' + y; }); addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES addUnitAlias('year', 'y'); // PRIORITIES addUnitPriority('year', 1); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } // HOOKS hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear() { return isLeapYear(this.year()); } function createDate(y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date; // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } function createUTCDate(y) { var date, args; // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear, }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear, }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES addUnitAlias('week', 'w'); addUnitAlias('isoWeek', 'W'); // PRIORITIES addUnitPriority('week', 5); addUnitPriority('isoWeek', 5); // PARSING addRegexToken('w', match1to2); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2); addRegexToken('WW', match1to2, match2); addWeekParseToken(['w', 'ww', 'W', 'WW'], function ( input, week, config, token ) { week[token.substr(0, 1)] = toInt(input); }); // HELPERS // LOCALES function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } // MOMENTS function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES addUnitAlias('day', 'd'); addUnitAlias('weekday', 'e'); addUnitAlias('isoWeekday', 'E'); // PRIORITY addUnitPriority('day', 11); addUnitPriority('weekday', 11); addUnitPriority('isoWeekday', 11); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } function parseIsoWeekday(input, locale) { if (typeof input === 'string') { return locale.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } // LOCALES function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[ m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone' ]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin( mom, '' ).toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort( mom, '' ).toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp( '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i' ); this._shortWeekdaysParse[i] = new RegExp( '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i' ); this._minWeekdaysParse[i] = new RegExp( '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i' ); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName) ) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, '_weekdaysRegex')) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, '_weekdaysShortRegex')) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, '_weekdaysMinRegex')) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, '')); shortp = regexEscape(this.weekdaysShort(mom, '')); longp = regexEscape(this.weekdays(mom, '')); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._weekdaysShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); this._weekdaysMinStrictRegex = new RegExp( '^(' + minPieces.join('|') + ')', 'i' ); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return ( '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return ( '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem( this.hours(), this.minutes(), lowercase ); }); } meridiem('a', true); meridiem('A', false); // ALIASES addUnitAlias('hour', 'h'); // PRIORITY addUnitPriority('hour', 13); // PARSING function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2); addRegexToken('h', match1to2); addRegexToken('k', match1to2); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('kk', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['k', 'kk'], function (input, array, config) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM(input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return (input + '').toLowerCase().charAt(0) === 'p'; } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, // Setting the hour should keep the time, because the user explicitly // specified which hour they want. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. getSetHour = makeGetSet('Hours', true); function localeMeridiem(hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse, }; // internal storage for locale config files var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if ( next && next.length >= j && commonPrefix(split, next) >= j - 1 ) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; } function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; __webpack_require__("4678")("./" + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if (typeof console !== 'undefined' && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn( 'Locale ' + key + ' not found. Did you forget to load it?' ); } } } return globalLocale._abbr; } function defineLocale(name, config) { if (config !== null) { var locale, parentConfig = baseConfig; config.abbr = name; if (locales[name] != null) { deprecateSimple( 'defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' ); parentConfig = locales[name]._config; } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { parentConfig = locales[config.parentLocale]._config; } else { locale = loadLocale(config.parentLocale); if (locale != null) { parentConfig = locale._config; } else { if (!localeFamilies[config.parentLocale]) { localeFamilies[config.parentLocale] = []; } localeFamilies[config.parentLocale].push({ name: name, config: config, }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config)); if (localeFamilies[name]) { localeFamilies[name].forEach(function (x) { defineLocale(x.name, x.config); }); } // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { // Update existing child locale in-place to avoid memory-leaks locales[name].set(mergeConfigs(locales[name]._config, config)); } else { // MERGE tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); if (tmpLocale == null) { // updateLocale is called for creating a new locale // Set abbr so it will have a name (getters return // undefined otherwise). config.abbr = name; } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; } // backwards compat for now: also set the locale getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function getLocale(key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function listLocales() { return keys(locales); } function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if ( getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE) ) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false], ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/], ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60, }; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } function extractFromRFC2822Strings( yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr ) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10), ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2000 + year; } else if (year <= 999) { return 1900 + year; } return year; } function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^)]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { if (weekdayStr) { // TODO: Replace the vanilla JS Date object with an independent day-of-week check. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date( parsedInput[0], parsedInput[1], parsedInput[2] ).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config).weekdayMismatch = true; config._isValid = false; return false; } } return true; } function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { // the only allowed military tz is Z return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } // date and time from ref 2822 format function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings( match[4], match[3], match[2], match[5], match[6], match[7] ); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } } // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } if (config._strict) { config._isValid = false; } else { // Final attempt, use Input Fallback hooks.createFromInputFallback(config); } } hooks.createFromInputFallback = deprecate( 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(hooks.now()); if (config._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate(), ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray(config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if ( config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0 ) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if ( config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0 ) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply( null, input ); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if ( config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday ) { getParsingFlags(config).weekdayMismatch = true; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults( w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year ); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. week = defaults(w.w, curWeek.week); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from beginning of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to beginning of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form hooks.RFC_2822 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice( string.indexOf(parsedInput) + parsedInput.length ); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if ( config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0 ) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap( config._locale, config._a[HOUR], config._meridiem ); // handle era era = getParsingFlags(config).era; if (era !== null) { config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); } configFromArray(config); checkOverflow(config); } function meridiemFixWrap(locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if ( scoreToBeat == null || currentScore < scoreToBeat || validFormatFound ) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i), dayOrDate = i.day === undefined ? i.date : i.day; config._a = map( [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); } ); configFromArray(config); } function createFromConfig(config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig(config) { var input = config._i, format = config._f; config._locale = config._locale || getLocale(config._l); if (input === null || (format === undefined && input === '')) { return createInvalid({ nullInput: true }); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config._d = input; } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else { configFromInput(config); } if (!isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (isUndefined(input)) { config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (isObject(input)) { configFromObject(config); } else if (isNumber(input)) { // from milliseconds config._d = new Date(input); } else { hooks.createFromInputFallback(config); } } function createLocalOrUTC(input, format, locale, strict, isUTC) { var c = {}; if (format === true || format === false) { strict = format; format = undefined; } if (locale === true || locale === false) { strict = locale; locale = undefined; } if ( (isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0) ) { input = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } } ), prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min() { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max() { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +new Date(); }; var ordering = [ 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', ]; function isDurationValid(m) { var key, unitHasDecimal = false, i; for (key in m) { if ( hasOwnProp(m, key) && !( indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])) ) ) { return false; } } for (i = 0; i < ordering.length; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; // only allow non-integers for smallest unit } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } function isValid$1() { return this._isValid; } function createInvalid$1() { return createDuration(NaN); } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ( (dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) ) { diffs++; } } return diffs + lengthDiff; } // FORMATTING function offset(token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(), sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return ( sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2) ); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || '').match(matcher), chunk, parts, minutes; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; minutes = +(parts[1] * 60) + toInt(parts[2]); return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } function getDateOffset(m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset()); } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset(input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract( this, createDuration(input - offset, 'm'), 1, false ); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === 'string') { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime() { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal() { return this.isValid() ? !this._isUTC : false; } function isUtcOffset() { return this.isValid() ? this._isUTC : false; } function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months, }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if ((match = aspNetRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match }; } else if ((match = isoRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), w: parseIso(match[4], sign), d: parseIso(match[5], sign), h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign), }; } else if (duration == null) { // checks for null or undefined duration = {}; } else if ( typeof duration === 'object' && ('from' in duration || 'to' in duration) ) { diffRes = momentsDifference( createLocal(duration.from), createLocal(duration.to) ); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, '_isValid')) { ret._isValid = input._isValid; } return ret; } createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, 'M'); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple( name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' ); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (months) { setMonth(mom, get(mom, 'Month') + months * isAdding); } if (days) { set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); } if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days || months); } } var add = createAdder(1, 'add'), subtract = createAdder(-1, 'subtract'); function isString(input) { return typeof input === 'string' || input instanceof String; } // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined function isMomentInput(input) { return ( isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined ); } function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function (item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function getCalendarFormat(myMoment, now) { var diff = myMoment.diff(now, 'days', true); return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; } function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { if (!arguments[0]) { time = undefined; formats = undefined; } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = undefined; } } // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf('day'), format = hooks.calendarFormat(this, sod) || 'sameElse', output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); return this.format( output || this.localeData().calendar(format, this, createLocal(now)) ); } function clone() { return new Moment(this); } function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween(from, to, units, inclusivity) { var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || '()'; return ( (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)) ); } function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return ( this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf() ); } } function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case 'year': output = monthDiff(this, that) / 12; break; case 'month': output = monthDiff(this, that); break; case 'quarter': output = monthDiff(this, that) / 3; break; case 'second': output = (this - that) / 1e3; break; // 1000 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst default: output = this - that; } return asFloat ? output : absFloor(output); } function monthDiff(a, b) { if (a.date() < b.date()) { // end-of-month calculations work correct when the start month has more // days than the end month. return -monthDiff(b, a); } // difference in months var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString() { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment( m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) .toISOString() .replace('Z', formatMoment(m, 'Z')); } } return formatMoment( m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } /** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function inspect() { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment', zone = '', prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } prefix = '[' + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; datetime = '-MM-DD[T]HH:mm:ss.SSS'; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ to: this, from: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData() { return this._locale; } var MS_PER_SECOND = 1000, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; } function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year(), 0, 1); break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3), 1 ); break; case 'month': time = startOfDate(this.year(), this.month(), 1); break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() ); break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) ); break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date()); break; case 'hour': time = this._d.valueOf(); time -= mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ); break; case 'minute': time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case 'second': time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year() + 1, 0, 1) - 1; break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3) + 3, 1 ) - 1; break; case 'month': time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() + 7 ) - 1; break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7 ) - 1; break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case 'hour': time = this._d.valueOf(); time += MS_PER_HOUR - mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ) - 1; break; case 'minute': time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case 'second': time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; } function unix() { return Math.floor(this.valueOf() / 1000); } function toDate() { return new Date(this.valueOf()); } function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; } function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds(), }; } function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function isValid$2() { return isValid(this); } function parsingFlags() { return extend({}, getParsingFlags(this)); } function invalidAt() { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; } addFormatToken('N', 0, 0, 'eraAbbr'); addFormatToken('NN', 0, 0, 'eraAbbr'); addFormatToken('NNN', 0, 0, 'eraAbbr'); addFormatToken('NNNN', 0, 0, 'eraName'); addFormatToken('NNNNN', 0, 0, 'eraNarrow'); addFormatToken('y', ['y', 1], 'yo', 'eraYear'); addFormatToken('y', ['yy', 2], 0, 'eraYear'); addFormatToken('y', ['yyy', 3], 0, 'eraYear'); addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); addRegexToken('N', matchEraAbbr); addRegexToken('NN', matchEraAbbr); addRegexToken('NNN', matchEraAbbr); addRegexToken('NNNN', matchEraName); addRegexToken('NNNNN', matchEraNarrow); addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function ( input, array, config, token ) { var era = config._locale.erasParse(input, token, config._strict); if (era) { getParsingFlags(config).era = era; } else { getParsingFlags(config).invalidEra = input; } }); addRegexToken('y', matchUnsigned); addRegexToken('yy', matchUnsigned); addRegexToken('yyy', matchUnsigned); addRegexToken('yyyy', matchUnsigned); addRegexToken('yo', matchEraYearOrdinal); addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); addParseToken(['yo'], function (input, array, config, token) { var match; if (config._locale._eraYearOrdinalRegex) { match = input.match(config._locale._eraYearOrdinalRegex); } if (config._locale.eraYearOrdinalParse) { array[YEAR] = config._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time date = hooks(eras[i].since).startOf('day'); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case 'undefined': eras[i].until = +Infinity; break; case 'string': // truncate time date = hooks(eras[i].until).startOf('day').valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format) { case 'N': case 'NN': case 'NNN': if (abbr === eraName) { return eras[i]; } break; case 'NNNN': if (name === eraName) { return eras[i]; } break; case 'NNNNN': if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } } function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ''; } function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ''; } function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ''; } function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.clone().startOf('day').valueOf(); if ( (eras[i].since <= val && val <= eras[i].until) || (eras[i].until <= val && val <= eras[i].since) ) { return ( (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset ); } } return this.year(); } function erasNameRegex(isStrict) { if (!hasOwnProp(this, '_erasNameRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, '_erasAbbrRegex')) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, '_erasNarrowRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } function matchEraAbbr(isStrict, locale) { return locale.erasAbbrRegex(isStrict); } function matchEraName(isStrict, locale) { return locale.erasNameRegex(isStrict); } function matchEraNarrow(isStrict, locale) { return locale.erasNarrowRegex(isStrict); } function matchEraYearOrdinal(isStrict, locale) { return locale._eraYearOrdinalRegex || matchUnsigned; } function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { namePieces.push(regexEscape(eras[i].name)); abbrPieces.push(regexEscape(eras[i].abbr)); narrowPieces.push(regexEscape(eras[i].narrow)); mixedPieces.push(regexEscape(eras[i].name)); mixedPieces.push(regexEscape(eras[i].abbr)); mixedPieces.push(regexEscape(eras[i].narrow)); } this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); this._erasNarrowRegex = new RegExp( '^(' + narrowPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES addUnitAlias('weekYear', 'gg'); addUnitAlias('isoWeekYear', 'GG'); // PRIORITY addUnitPriority('weekYear', 1); addUnitPriority('isoWeekYear', 1); // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function ( input, week, config, token ) { week[token.substr(0, 2)] = toInt(input); }); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy ); } function getSetISOWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.isoWeek(), this.isoWeekday(), 1, 4 ); } function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES addUnitAlias('quarter', 'Q'); // PRIORITY addUnitPriority('quarter', 7); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + (this.month() % 3)); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES addUnitAlias('date', 'D'); // PRIORITY addUnitPriority('date', 9); // PARSING addRegexToken('D', match1to2); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { // TODO: Remove "ordinalParse" fallback in next major release. return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES addUnitAlias('dayOfYear', 'DDD'); // PRIORITY addUnitPriority('dayOfYear', 4); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); } // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES addUnitAlias('minute', 'm'); // PRIORITY addUnitPriority('minute', 14); // PARSING addRegexToken('m', match1to2); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES addUnitAlias('second', 's'); // PRIORITY addUnitPriority('second', 15); // PARSING addRegexToken('s', match1to2); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // ALIASES addUnitAlias('millisecond', 'ms'); // PRIORITY addUnitPriority('millisecond', 16); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token, getSetMillisecond; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr() { return this._isUTC ? 'UTC' : ''; } function getZoneName() { return this._isUTC ? 'Coordinated Universal Time' : ''; } var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== 'undefined' && Symbol.for != null) { proto[Symbol.for('nodejs.util.inspect.custom')] = function () { return 'Moment<' + this.format() + '>'; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate( 'dates accessor is deprecated. Use date instead.', getSetDayOfMonth ); proto.months = deprecate( 'months accessor is deprecated. Use month instead', getSetMonth ); proto.years = deprecate( 'years accessor is deprecated. Use year instead', getSetYear ); proto.zone = deprecate( 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone ); proto.isDSTShifted = deprecate( 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted ); function createUnix(input) { return createLocal(input * 1000); } function createInZone() { return createLocal.apply(null, arguments).parseZone(); } function preParsePostFormat(string) { return string; } var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = []; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; } function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); } function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } getSetGlobalLocale('en', { eras: [ { since: '0001-01-01', until: +Infinity, offset: 1, name: 'Anno Domini', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: 'Before Christ', narrow: 'BC', abbr: 'BC', }, ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = toInt((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); // Side effect imports hooks.lang = deprecate( 'moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale ); hooks.langData = deprecate( 'moment.langData is deprecated. Use moment.localeData instead.', getLocale ); var mathAbs = Math.abs; function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function add$1(input, value) { return addSubtract$1(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if ( !( (milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0) ) ) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths(days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return (days * 4800) / 146097; } function monthsToDays(months) { // the reverse of daysToMonths return (months * 146097) / 4800; } function as(units) { if (!this.isValid()) { return NaN; } var days, months, milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'quarter' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); switch (units) { case 'month': return months; case 'quarter': return months / 3; case 'year': return months / 12; } } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week': return days / 7 + milliseconds / 6048e5; case 'day': return days + milliseconds / 864e5; case 'hour': return days * 24 + milliseconds / 36e5; case 'minute': return days * 1440 + milliseconds / 6e4; case 'second': return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } // TODO: Use this.as('ms')? function valueOf$1() { if (!this.isValid()) { return NaN; } return ( this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6 ); } function makeAs(alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'), asSeconds = makeAs('s'), asMinutes = makeAs('m'), asHours = makeAs('h'), asDays = makeAs('d'), asWeeks = makeAs('w'), asMonths = makeAs('M'), asQuarters = makeAs('Q'), asYears = makeAs('y'); function clone$1() { return createDuration(this); } function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + 's']() : NaN; } function makeGetter(name) { return function () { return this.isValid() ? this._data[name] : NaN; }; } var milliseconds = makeGetter('milliseconds'), seconds = makeGetter('seconds'), minutes = makeGetter('minutes'), hours = makeGetter('hours'), days = makeGetter('days'), months = makeGetter('months'), years = makeGetter('years'); function weeks() { return absFloor(this.days() / 7); } var round = Math.round, thresholds = { ss: 44, // a few seconds to seconds s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month/week w: null, // weeks to month M: 11, // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { var duration = createDuration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = (seconds <= thresholds.ss && ['s', seconds]) || (seconds < thresholds.s && ['ss', seconds]) || (minutes <= 1 && ['m']) || (minutes < thresholds.m && ['mm', minutes]) || (hours <= 1 && ['h']) || (hours < thresholds.h && ['hh', hours]) || (days <= 1 && ['d']) || (days < thresholds.d && ['dd', days]); if (thresholds.w != null) { a = a || (weeks <= 1 && ['w']) || (weeks < thresholds.w && ['ww', weeks]); } a = a || (months <= 1 && ['M']) || (months < thresholds.M && ['MM', months]) || (years <= 1 && ['y']) || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set the rounding function for relative time strings function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof roundingFunction === 'function') { round = roundingFunction; return true; } return false; } // This function allows you to set a threshold for relative time strings function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; } function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale, output; if (typeof argWithSuffix === 'object') { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === 'boolean') { withSuffix = argWithSuffix; } if (typeof argThresholds === 'object') { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } function toISOString$1() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; totalSign = total < 0 ? '-' : ''; ymSign = sign(this._months) !== sign(total) ? '-' : ''; daysSign = sign(this._days) !== sign(total) ? '-' : ''; hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; return ( totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '') ); } var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate( 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1 ); proto$2.lang = lang; // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); //! moment.js hooks.version = '2.29.1'; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats hooks.HTML5_FMT = { DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // DATE: 'YYYY-MM-DD', // TIME: 'HH:mm', // TIME_SECONDS: 'HH:mm:ss', // TIME_MS: 'HH:mm:ss.SSS', // WEEK: 'GGGG-[W]WW', // MONTH: 'YYYY-MM', // }; return hooks; }))); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("62e4")(module))) /***/ }), /***/ "c345": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("c532"); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers var ignoreDuplicateOf = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} headers Headers needing to be parsed * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { var parsed = {}; var key; var val; var i; if (!headers) { return parsed; } utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { return; } if (key === 'set-cookie') { parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } } }); return parsed; }; /***/ }), /***/ "c366": /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__("6821"); var toLength = __webpack_require__("9def"); var toAbsoluteIndex = __webpack_require__("77f1"); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }), /***/ "c401": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("c532"); /** * Transform the data for a request or a response * * @param {Object|String} data The data to be transformed * @param {Array} headers The headers for the request or response * @param {Array|Function} fns A single function or Array of functions * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { /*eslint no-param-reassign:0*/ utils.forEach(fns, function transform(fn) { data = fn(data, headers); }); return data; }; /***/ }), /***/ "c532": /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__("1d2b"); var isBuffer = __webpack_require__("044b"); /*global toString:true*/ // utils is a library of generic helper functions non-specific to axios var toString = Object.prototype.toString; /** * Determine if a value is an Array * * @param {Object} val The value to test * @returns {boolean} True if value is an Array, otherwise false */ function isArray(val) { return toString.call(val) === '[object Array]'; } /** * Determine if a value is an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ function isArrayBuffer(val) { return toString.call(val) === '[object ArrayBuffer]'; } /** * Determine if a value is a FormData * * @param {Object} val The value to test * @returns {boolean} True if value is an FormData, otherwise false */ function isFormData(val) { return (typeof FormData !== 'undefined') && (val instanceof FormData); } /** * Determine if a value is a view on an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); } return result; } /** * Determine if a value is a String * * @param {Object} val The value to test * @returns {boolean} True if value is a String, otherwise false */ function isString(val) { return typeof val === 'string'; } /** * Determine if a value is a Number * * @param {Object} val The value to test * @returns {boolean} True if value is a Number, otherwise false */ function isNumber(val) { return typeof val === 'number'; } /** * Determine if a value is undefined * * @param {Object} val The value to test * @returns {boolean} True if the value is undefined, otherwise false */ function isUndefined(val) { return typeof val === 'undefined'; } /** * Determine if a value is an Object * * @param {Object} val The value to test * @returns {boolean} True if value is an Object, otherwise false */ function isObject(val) { return val !== null && typeof val === 'object'; } /** * Determine if a value is a Date * * @param {Object} val The value to test * @returns {boolean} True if value is a Date, otherwise false */ function isDate(val) { return toString.call(val) === '[object Date]'; } /** * Determine if a value is a File * * @param {Object} val The value to test * @returns {boolean} True if value is a File, otherwise false */ function isFile(val) { return toString.call(val) === '[object File]'; } /** * Determine if a value is a Blob * * @param {Object} val The value to test * @returns {boolean} True if value is a Blob, otherwise false */ function isBlob(val) { return toString.call(val) === '[object Blob]'; } /** * Determine if a value is a Function * * @param {Object} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ function isFunction(val) { return toString.call(val) === '[object Function]'; } /** * Determine if a value is a Stream * * @param {Object} val The value to test * @returns {boolean} True if value is a Stream, otherwise false */ function isStream(val) { return isObject(val) && isFunction(val.pipe); } /** * Determine if a value is a URLSearchParams object * * @param {Object} val The value to test * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ function isURLSearchParams(val) { return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; } /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * @returns {String} The String freed of excess whitespace */ function trim(str) { return str.replace(/^\s*/, '').replace(/\s*$/, ''); } /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' */ function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); } /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item */ function forEach(obj, fn) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj); } } } } /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { var result = {}; function assignValue(val, key) { if (typeof result[key] === 'object' && typeof val === 'object') { result[key] = merge(result[key], val); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * @return {Object} The resulting value of object a */ function extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === 'function') { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } module.exports = { isArray: isArray, isArrayBuffer: isArrayBuffer, isBuffer: isBuffer, isFormData: isFormData, isArrayBufferView: isArrayBufferView, isString: isString, isNumber: isNumber, isObject: isObject, isUndefined: isUndefined, isDate: isDate, isFile: isFile, isBlob: isBlob, isFunction: isFunction, isStream: isStream, isURLSearchParams: isURLSearchParams, isStandardBrowserEnv: isStandardBrowserEnv, forEach: forEach, merge: merge, extend: extend, trim: trim }; /***/ }), /***/ "c5f6": /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__("7726"); var has = __webpack_require__("69a8"); var cof = __webpack_require__("2d95"); var inheritIfRequired = __webpack_require__("5dbc"); var toPrimitive = __webpack_require__("6a99"); var fails = __webpack_require__("79e5"); var gOPN = __webpack_require__("9093").f; var gOPD = __webpack_require__("11e9").f; var dP = __webpack_require__("86cc").f; var $trim = __webpack_require__("aa77").trim; var NUMBER = 'Number'; var $Number = global[NUMBER]; var Base = $Number; var proto = $Number.prototype; // Opera ~12 has broken Object#toString var BROKEN_COF = cof(__webpack_require__("2aeb")(proto)) == NUMBER; var TRIM = 'trim' in String.prototype; // 7.1.3 ToNumber(argument) var toNumber = function (argument) { var it = toPrimitive(argument, false); if (typeof it == 'string' && it.length > 2) { it = TRIM ? it.trim() : $trim(it, 3); var first = it.charCodeAt(0); var third, radix, maxCode; if (first === 43 || first === 45) { third = it.charCodeAt(2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (it.charCodeAt(1)) { case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i default: return +it; } for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { code = digits.charCodeAt(i); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN; } return parseInt(digits, radix); } } return +it; }; if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { $Number = function Number(value) { var it = arguments.length < 1 ? 0 : value; var that = this; return that instanceof $Number // check on 1..constructor(foo) case && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); }; for (var keys = __webpack_require__("9e1e") ? gOPN(Base) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES6 (in case, if modules with ES6 Number statics required before): 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' ).split(','), j = 0, key; keys.length > j; j++) { if (has(Base, key = keys[j]) && !has($Number, key)) { dP($Number, key, gOPD(Base, key)); } } $Number.prototype = proto; proto.constructor = $Number; __webpack_require__("2aba")(global, NUMBER, $Number); } /***/ }), /***/ "c69a": /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () { return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /***/ "c7aa": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Hebrew [he] //! author : Tomer Cohen : https://github.com/tomer //! author : Moshe Simantov : https://github.com/DevelopmentIL //! author : Tal Ater : https://github.com/TalAter ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var he = moment.defineLocale('he', { months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split( '_' ), monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split( '_' ), weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [ב]MMMM YYYY', LLL: 'D [ב]MMMM YYYY HH:mm', LLLL: 'dddd, D [ב]MMMM YYYY HH:mm', l: 'D/M/YYYY', ll: 'D MMM YYYY', lll: 'D MMM YYYY HH:mm', llll: 'ddd, D MMM YYYY HH:mm', }, calendar: { sameDay: '[היום ב־]LT', nextDay: '[מחר ב־]LT', nextWeek: 'dddd [בשעה] LT', lastDay: '[אתמול ב־]LT', lastWeek: '[ביום] dddd [האחרון בשעה] LT', sameElse: 'L', }, relativeTime: { future: 'בעוד %s', past: 'לפני %s', s: 'מספר שניות', ss: '%d שניות', m: 'דקה', mm: '%d דקות', h: 'שעה', hh: function (number) { if (number === 2) { return 'שעתיים'; } return number + ' שעות'; }, d: 'יום', dd: function (number) { if (number === 2) { return 'יומיים'; } return number + ' ימים'; }, M: 'חודש', MM: function (number) { if (number === 2) { return 'חודשיים'; } return number + ' חודשים'; }, y: 'שנה', yy: function (number) { if (number === 2) { return 'שנתיים'; } else if (number % 10 === 0 && number !== 10) { return number + ' שנה'; } return number + ' שנים'; }, }, meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, isPM: function (input) { return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); }, meridiem: function (hour, minute, isLower) { if (hour < 5) { return 'לפנות בוקר'; } else if (hour < 10) { return 'בבוקר'; } else if (hour < 12) { return isLower ? 'לפנה"צ' : 'לפני הצהריים'; } else if (hour < 18) { return isLower ? 'אחה"צ' : 'אחרי הצהריים'; } else { return 'בערב'; } }, }); return he; }))); /***/ }), /***/ "c8af": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("c532"); module.exports = function normalizeHeaderName(headers, normalizedName) { utils.forEach(headers, function processHeader(value, name) { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = value; delete headers[name]; } }); }; /***/ }), /***/ "c8ba": /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "c8d1": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8e6e"); /* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ac6a"); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("456d"); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6762"); /* harmony import */ var core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("96cf"); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("1da1"); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("ade3"); /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("2f62"); /* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("3d20"); /* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_8__); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: "Album", head: { title: function title() { return { inner: "Album", separator: " " }; } }, computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[/* mapState */ "b"])({ albums: function albums(state) { return state.profile.albums; } })), data: function data() { return {}; }, methods: { getAlbum: function () { var _getAlbum = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.$store.dispatch("profile/getAlbum"); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function getAlbum() { return _getAlbum.apply(this, arguments); } return getAlbum; }(), uploadAlbum: function () { var _uploadAlbum = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(image) { return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return this.$store.dispatch("profile/uploadAlbum", { file: image }); case 2: case "end": return _context2.stop(); } } }, _callee2, this); })); function uploadAlbum(_x) { return _uploadAlbum.apply(this, arguments); } return uploadAlbum; }(), deleteImage: function () { var _deleteImage = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(imgId) { return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; return this.$store.dispatch("profile/deleteImage", { id: imgId }); case 2: case "end": return _context3.stop(); } } }, _callee3, this); })); function deleteImage(_x2) { return _deleteImage.apply(this, arguments); } return deleteImage; }(), upload: function upload(event) { var image = event.target.files[0]; var fileType = image["type"]; var validImageTypes = ["image/jpeg"]; if (!validImageTypes.includes(fileType)) { sweetalert2__WEBPACK_IMPORTED_MODULE_8___default.a.fire({ title: "File is invalid.", type: "error" }); } else { this.uploadAlbum(image); } } }, mounted: function mounted() { // Changes Takes Place On Body Resize Event this.$autoSetHeight(); this.getAlbum(); $(function () { $("#btn-upload").on("click", function (e) { e.preventDefault(); $("#upload-file:hidden").trigger("click"); }); }); }, watch: { albums: function albums() {// this.albums = this.albums; } } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "c8f3": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Albanian [sq] //! author : Flakërim Ismani : https://github.com/flakerimi //! author : Menelion Elensúle : https://github.com/Oire //! author : Oerd Cukalla : https://github.com/oerd ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var sq = moment.defineLocale('sq', { months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split( '_' ), monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split( '_' ), weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'), weekdaysParseExact: true, meridiemParse: /PD|MD/, isPM: function (input) { return input.charAt(0) === 'M'; }, meridiem: function (hours, minutes, isLower) { return hours < 12 ? 'PD' : 'MD'; }, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Sot në] LT', nextDay: '[Nesër në] LT', nextWeek: 'dddd [në] LT', lastDay: '[Dje në] LT', lastWeek: 'dddd [e kaluar në] LT', sameElse: 'L', }, relativeTime: { future: 'në %s', past: '%s më parë', s: 'disa sekonda', ss: '%d sekonda', m: 'një minutë', mm: '%d minuta', h: 'një orë', hh: '%d orë', d: 'një ditë', dd: '%d ditë', M: 'një muaj', MM: '%d muaj', y: 'një vit', yy: '%d vite', }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return sq; }))); /***/ }), /***/ "ca5a": /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /***/ "cadf": /***/ (function(module, exports, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__("9c6c"); var step = __webpack_require__("d53b"); var Iterators = __webpack_require__("84f2"); var toIObject = __webpack_require__("6821"); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /***/ "cb7c": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("d3f4"); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /***/ "cd1c": /***/ (function(module, exports, __webpack_require__) { // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = __webpack_require__("e853"); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; /***/ }), /***/ "ce10": /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__("69a8"); var toIObject = __webpack_require__("6821"); var arrayIndexOf = __webpack_require__("c366")(false); var IE_PROTO = __webpack_require__("613b")('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }), /***/ "cee4": /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__("c532"); var bind = __webpack_require__("1d2b"); var Axios = __webpack_require__("0a06"); var defaults = __webpack_require__("2444"); /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * @return {Axios} A new instance of Axios */ function createInstance(defaultConfig) { var context = new Axios(defaultConfig); var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance utils.extend(instance, Axios.prototype, context); // Copy context to instance utils.extend(instance, context); return instance; } // Create the default instance to be exported var axios = createInstance(defaults); // Expose Axios class to allow class inheritance axios.Axios = Axios; // Factory for creating new instances axios.create = function create(instanceConfig) { return createInstance(utils.merge(defaults, instanceConfig)); }; // Expose Cancel & CancelToken axios.Cancel = __webpack_require__("7a77"); axios.CancelToken = __webpack_require__("8df4b"); axios.isCancel = __webpack_require__("2e67"); // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = __webpack_require__("0df6"); module.exports = axios; // Allow use of default import syntax in TypeScript module.exports.default = axios; /***/ }), /***/ "cf1e": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Serbian [sr] //! author : Milan Janačković : https://github.com/milan-j //! author : Stefan Crnjaković : https://github.com/crnjakovic ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var translator = { words: { //Different grammatical cases ss: ['sekunda', 'sekunde', 'sekundi'], m: ['jedan minut', 'jedne minute'], mm: ['minut', 'minute', 'minuta'], h: ['jedan sat', 'jednog sata'], hh: ['sat', 'sata', 'sati'], dd: ['dan', 'dana', 'dana'], MM: ['mesec', 'meseca', 'meseci'], yy: ['godina', 'godine', 'godina'], }, correctGrammaticalCase: function (number, wordKey) { return number === 1 ? wordKey[0] : number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]; }, translate: function (number, withoutSuffix, key) { var wordKey = translator.words[key]; if (key.length === 1) { return withoutSuffix ? wordKey[0] : wordKey[1]; } else { return ( number + ' ' + translator.correctGrammaticalCase(number, wordKey) ); } }, }; var sr = moment.defineLocale('sr', { months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split( '_' ), monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split( '_' ), monthsParseExact: true, weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split( '_' ), weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'), weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'D. M. YYYY.', LL: 'D. MMMM YYYY.', LLL: 'D. MMMM YYYY. H:mm', LLLL: 'dddd, D. MMMM YYYY. H:mm', }, calendar: { sameDay: '[danas u] LT', nextDay: '[sutra u] LT', nextWeek: function () { switch (this.day()) { case 0: return '[u] [nedelju] [u] LT'; case 3: return '[u] [sredu] [u] LT'; case 6: return '[u] [subotu] [u] LT'; case 1: case 2: case 4: case 5: return '[u] dddd [u] LT'; } }, lastDay: '[juče u] LT', lastWeek: function () { var lastWeekDays = [ '[prošle] [nedelje] [u] LT', '[prošlog] [ponedeljka] [u] LT', '[prošlog] [utorka] [u] LT', '[prošle] [srede] [u] LT', '[prošlog] [četvrtka] [u] LT', '[prošlog] [petka] [u] LT', '[prošle] [subote] [u] LT', ]; return lastWeekDays[this.day()]; }, sameElse: 'L', }, relativeTime: { future: 'za %s', past: 'pre %s', s: 'nekoliko sekundi', ss: translator.translate, m: translator.translate, mm: translator.translate, h: translator.translate, hh: translator.translate, d: 'dan', dd: translator.translate, M: 'mesec', MM: translator.translate, y: 'godinu', yy: translator.translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return sr; }))); /***/ }), /***/ "cf51": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Talossan [tzl] //! author : Robin van der Vliet : https://github.com/robin0van0der0v //! author : Iustì Canun ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. // This is currently too difficult (maybe even impossible) to add. var tzl = moment.defineLocale('tzl', { months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split( '_' ), monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'), weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD.MM.YYYY', LL: 'D. MMMM [dallas] YYYY', LLL: 'D. MMMM [dallas] YYYY HH.mm', LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm', }, meridiemParse: /d\'o|d\'a/i, isPM: function (input) { return "d'o" === input.toLowerCase(); }, meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? "d'o" : "D'O"; } else { return isLower ? "d'a" : "D'A"; } }, calendar: { sameDay: '[oxhi à] LT', nextDay: '[demà à] LT', nextWeek: 'dddd [à] LT', lastDay: '[ieiri à] LT', lastWeek: '[sür el] dddd [lasteu à] LT', sameElse: 'L', }, relativeTime: { future: 'osprei %s', past: 'ja%s', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: processRelativeTime, M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['viensas secunds', "'iensas secunds"], ss: [number + ' secunds', '' + number + ' secunds'], m: ["'n míut", "'iens míut"], mm: [number + ' míuts', '' + number + ' míuts'], h: ["'n þora", "'iensa þora"], hh: [number + ' þoras', '' + number + ' þoras'], d: ["'n ziua", "'iensa ziua"], dd: [number + ' ziuas', '' + number + ' ziuas'], M: ["'n mes", "'iens mes"], MM: [number + ' mesen', '' + number + ' mesen'], y: ["'n ar", "'iens ar"], yy: [number + ' ars', '' + number + ' ars'], }; return isFuture ? format[key][0] : withoutSuffix ? format[key][0] : format[key][1]; } return tzl; }))); /***/ }), /***/ "cf69": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["jQuery"] = __webpack_require__("1157"); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"))) /***/ }), /***/ "cf75": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Klingon [tlh] //! author : Dominika Kruk : https://github.com/amaranthrose ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); function translateFuture(output) { var time = output; time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'leS' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'waQ' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'nem' : time + ' pIq'; return time; } function translatePast(output) { var time = output; time = output.indexOf('jaj') !== -1 ? time.slice(0, -3) + 'Hu’' : output.indexOf('jar') !== -1 ? time.slice(0, -3) + 'wen' : output.indexOf('DIS') !== -1 ? time.slice(0, -3) + 'ben' : time + ' ret'; return time; } function translate(number, withoutSuffix, string, isFuture) { var numberNoun = numberAsNoun(number); switch (string) { case 'ss': return numberNoun + ' lup'; case 'mm': return numberNoun + ' tup'; case 'hh': return numberNoun + ' rep'; case 'dd': return numberNoun + ' jaj'; case 'MM': return numberNoun + ' jar'; case 'yy': return numberNoun + ' DIS'; } } function numberAsNoun(number) { var hundred = Math.floor((number % 1000) / 100), ten = Math.floor((number % 100) / 10), one = number % 10, word = ''; if (hundred > 0) { word += numbersNouns[hundred] + 'vatlh'; } if (ten > 0) { word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH'; } if (one > 0) { word += (word !== '' ? ' ' : '') + numbersNouns[one]; } return word === '' ? 'pagh' : word; } var tlh = moment.defineLocale('tlh', { months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split( '_' ), monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split( '_' ), monthsParseExact: true, weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split( '_' ), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, calendar: { sameDay: '[DaHjaj] LT', nextDay: '[wa’leS] LT', nextWeek: 'LLL', lastDay: '[wa’Hu’] LT', lastWeek: 'LLL', sameElse: 'L', }, relativeTime: { future: translateFuture, past: translatePast, s: 'puS lup', ss: translate, m: 'wa’ tup', mm: translate, h: 'wa’ rep', hh: translate, d: 'wa’ jaj', dd: translate, M: 'wa’ jar', MM: translate, y: 'wa’ DIS', yy: translate, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return tlh; }))); /***/ }), /***/ "d01e": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "img/FC-Logo.93e11488.png"; /***/ }), /***/ "d178": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5445b184-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Navbar.vue?vue&type=template&id=ff3ac930&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)} var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{staticClass:"navbar navbar-default navbar-static-top m-b-0 p-0"},[_c('div',{staticClass:"navbar-header"},[_c('a',{staticClass:"navbar-toggle font-20 hidden-sm hidden-md hidden-lg",attrs:{"href":"javascript:void(0)","data-toggle":"collapse","data-target":".navbar-collapse"}},[_c('i',{staticClass:"fa fa-bars"})]),_c('div',{staticClass:"top-left-part"},[_c('a',{staticClass:"logo",attrs:{"href":"/"}},[_c('b',[_c('img',{staticStyle:{"height":"30px"},attrs:{"src":__webpack_require__("fdd9"),"alt":"home"}})]),_c('span',{staticStyle:{"text-transform":"none","font-weight":"600","font-size":"20px"}},[_vm._v("FlyContract")])])]),_c('ul',{staticClass:"nav navbar-top-links navbar-left hidden-xs"},[_c('li',[_c('a',{staticClass:"sidebartoggler font-20 waves-effect waves-light",attrs:{"href":"javascript:void(0)"}},[_c('i',{staticClass:"icon-arrow-left-circle"})])])])])])}] // CONCATENATED MODULE: ./src/components/Navbar.vue?vue&type=template&id=ff3ac930&scoped=true& // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Navbar.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var Navbarvue_type_script_lang_js_ = ({ name: "Navbar" }); // CONCATENATED MODULE: ./src/components/Navbar.vue?vue&type=script&lang=js& /* harmony default export */ var components_Navbarvue_type_script_lang_js_ = (Navbarvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__("2877"); // CONCATENATED MODULE: ./src/components/Navbar.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( components_Navbarvue_type_script_lang_js_, render, staticRenderFns, false, null, "ff3ac930", null ) /* harmony default export */ var Navbar = __webpack_exports__["a"] = (component.exports); /***/ }), /***/ "d1cf": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a481"); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__); /* * jQuery Idle Timeout 1.2 * Copyright (c) 2011 Eric Hynds * * http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/ * * Depends: * - jQuery 1.4.2+ * - jQuery Idle Timer (by Paul Irish, http://paulirish.com/2009/jquery-idletimer-plugin/) * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ (function ($, win) { var idleTimeout = { init: function init(element, resume, options) { var self = this, elem; this.warning = elem = $(element); this.resume = $(resume); this.options = options; this.countdownOpen = false; this.failedRequests = options.failedRequests; this._startTimer(); this.title = document.title; // expose obj to data cache so peeps can call internal methods $.data(elem[0], 'idletimeout', this); // start the idle timer $.idleTimer(options.idleAfter * 1000); // once the user becomes idle $(document).bind("idle.idleTimer", function () { // if the user is idle and a countdown isn't already running if ($.data(document, 'idleTimer') === 'idle' && !self.countdownOpen) { self._stopTimer(); self.countdownOpen = true; self._idle(); } }); // bind continue link this.resume.bind("click", function (e) { e.preventDefault(); win.clearInterval(self.countdown); // stop the countdown self.countdownOpen = false; // stop countdown self._startTimer(); // start up the timer again self._keepAlive(false); // ping server options.onResume.call(self.warning); // call the resume callback }); }, _idle: function _idle() { var self = this, options = this.options, warning = this.warning[0], counter = options.warningLength; // fire the onIdle function options.onIdle.call(warning); // set inital value in the countdown placeholder options.onCountdown.call(warning, counter); // create a timer that runs every second this.countdown = win.setInterval(function () { if (--counter === 0) { window.clearInterval(self.countdown); options.onTimeout.call(warning); } else { options.onCountdown.call(warning, counter); document.title = options.titleMessage.replace('%s', counter) + self.title; } }, 1000); }, _startTimer: function _startTimer() { var self = this; this.timer = win.setTimeout(function () { self._keepAlive(); }, this.options.pollingInterval * 1000); }, _stopTimer: function _stopTimer() { // reset the failed requests counter this.failedRequests = this.options.failedRequests; win.clearTimeout(this.timer); }, _keepAlive: function _keepAlive(recurse) { var self = this, options = this.options; //Reset the title to what it was. document.title = self.title; // assume a startTimer/keepAlive loop unless told otherwise if (typeof recurse === "undefined") { recurse = true; } // if too many requests failed, abort if (!this.failedRequests) { this._stopTimer(); options.onAbort.call(this.warning[0]); return; } $.ajax({ timeout: options.AJAXTimeout, url: options.keepAliveURL, error: function error() { self.failedRequests--; }, success: function success(response) { if ($.trim(response) !== options.serverResponseEquals) { self.failedRequests--; } }, complete: function complete() { if (recurse) { self._startTimer(); } } }); } }; // expose $.idleTimeout = function (element, resume, options) { idleTimeout.init(element, resume, $.extend($.idleTimeout.options, options)); return this; }; // options $.idleTimeout.options = { // number of seconds after user is idle to show the warning warningLength: 30, // url to call to keep the session alive while the user is active keepAliveURL: "", // the response from keepAliveURL must equal this text: serverResponseEquals: "OK", // user is considered idle after this many seconds. 10 minutes default idleAfter: 600, // a polling request will be sent to the server every X seconds pollingInterval: 60, // number of failed polling requests until we abort this script failedRequests: 5, // the $.ajax timeout in MILLISECONDS! AJAXTimeout: 250, // %s will be replaced by the counter value titleMessage: 'Warning: %s seconds until log out | ', /* Callbacks "this" refers to the element found by the first selector passed to $.idleTimeout. */ // callback to fire when the session times out onTimeout: $.noop, // fires when the user becomes idle onIdle: $.noop, // fires during each second of warningLength onCountdown: $.noop, // fires when the user resumes the session onResume: $.noop, // callback to fire when the script is aborted due to too many failed requests onAbort: $.noop }; })(jQuery, window); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "d21d": /***/ (function(module, exports, __webpack_require__) { (function(e,o){ true?module.exports=o():undefined})("undefined"!==typeof self?self:this,(function(){return function(e){var o={};function a(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=e,a.c=o,a.d=function(e,o,n){a.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,o){if(1&o&&(e=a(e)),8&o)return e;if(4&o&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)a.d(n,r,function(o){return e[o]}.bind(null,r));return n},a.n=function(e){var o=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(o,"a",o),o},a.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},a.p="",a(a.s="fb15")}({"01f9":function(e,o,a){"use strict";var n=a("2d00"),r=a("5ca1"),t=a("2aba"),s=a("32e9"),d=a("84f2"),h=a("41a0"),m=a("7f20"),C=a("38fd"),i=a("2b4c")("iterator"),u=!([].keys&&"next"in[].keys()),l="@@iterator",c="keys",S="values",g=function(){return this};e.exports=function(e,o,a,y,A,N,M){h(a,o,y);var b,B,k,K=function(e){if(!u&&e in T)return T[e];switch(e){case c:return function(){return new a(this,e)};case S:return function(){return new a(this,e)}}return function(){return new a(this,e)}},v=o+" Iterator",p=A==S,f=!1,T=e.prototype,L=T[i]||T[l]||A&&T[A],P=L||K(A),R=A?p?K("entries"):P:void 0,O="Array"==o&&T.entries||L;if(O&&(k=C(O.call(new e)),k!==Object.prototype&&k.next&&(m(k,v,!0),n||"function"==typeof k[i]||s(k,i,g))),p&&L&&L.name!==S&&(f=!0,P=function(){return L.call(this)}),n&&!M||!u&&!f&&T[i]||s(T,i,P),d[o]=P,d[v]=g,A)if(b={values:p?P:K(S),keys:N?P:K(c),entries:R},M)for(B in b)B in T||t(T,B,b[B]);else r(r.P+r.F*(u||f),o,b);return b}},"0a49":function(e,o,a){var n=a("9b43"),r=a("626a"),t=a("4bf8"),s=a("9def"),d=a("cd1c");e.exports=function(e,o){var a=1==e,h=2==e,m=3==e,C=4==e,i=6==e,u=5==e||i,l=o||d;return function(o,d,c){for(var S,g,y=t(o),A=r(y),N=n(d,c,3),M=s(A.length),b=0,B=a?l(o,M):h?l(o,0):void 0;M>b;b++)if((u||b in A)&&(S=A[b],g=N(S,b,y),e))if(a)B[b]=g;else if(g)switch(e){case 3:return!0;case 5:return S;case 6:return b;case 2:B.push(S)}else if(C)return!1;return i?-1:m||C?C:B}}},"0d58":function(e,o,a){var n=a("ce10"),r=a("e11e");e.exports=Object.keys||function(e){return n(e,r)}},1169:function(e,o,a){var n=a("2d95");e.exports=Array.isArray||function(e){return"Array"==n(e)}},1495:function(e,o,a){var n=a("86cc"),r=a("cb7c"),t=a("0d58");e.exports=a("9e1e")?Object.defineProperties:function(e,o){r(e);var a,s=t(o),d=s.length,h=0;while(d>h)n.f(e,a=s[h++],o[a]);return e}},"230e":function(e,o,a){var n=a("d3f4"),r=a("7726").document,t=n(r)&&n(r.createElement);e.exports=function(e){return t?r.createElement(e):{}}},2621:function(e,o){o.f=Object.getOwnPropertySymbols},"2aba":function(e,o,a){var n=a("7726"),r=a("32e9"),t=a("69a8"),s=a("ca5a")("src"),d=a("fa5b"),h="toString",m=(""+d).split(h);a("8378").inspectSource=function(e){return d.call(e)},(e.exports=function(e,o,a,d){var h="function"==typeof a;h&&(t(a,"name")||r(a,"name",o)),e[o]!==a&&(h&&(t(a,s)||r(a,s,e[o]?""+e[o]:m.join(String(o)))),e===n?e[o]=a:d?e[o]?e[o]=a:r(e,o,a):(delete e[o],r(e,o,a)))})(Function.prototype,h,(function(){return"function"==typeof this&&this[s]||d.call(this)}))},"2aeb":function(e,o,a){var n=a("cb7c"),r=a("1495"),t=a("e11e"),s=a("613b")("IE_PROTO"),d=function(){},h="prototype",m=function(){var e,o=a("230e")("iframe"),n=t.length,r="<",s=">";o.style.display="none",a("fab2").appendChild(o),o.src="javascript:",e=o.contentWindow.document,e.open(),e.write(r+"script"+s+"document.F=Object"+r+"/script"+s),e.close(),m=e.F;while(n--)delete m[h][t[n]];return m()};e.exports=Object.create||function(e,o){var a;return null!==e?(d[h]=n(e),a=new d,d[h]=null,a[s]=e):a=m(),void 0===o?a:r(a,o)}},"2b4c":function(e,o,a){var n=a("5537")("wks"),r=a("ca5a"),t=a("7726").Symbol,s="function"==typeof t,d=e.exports=function(e){return n[e]||(n[e]=s&&t[e]||(s?t:r)("Symbol."+e))};d.store=n},"2d00":function(e,o){e.exports=!1},"2d95":function(e,o){var a={}.toString;e.exports=function(e){return a.call(e).slice(8,-1)}},"2f21":function(e,o,a){"use strict";var n=a("79e5");e.exports=function(e,o){return!!e&&n((function(){o?e.call(null,(function(){}),1):e.call(null)}))}},"2fdb":function(e,o,a){"use strict";var n=a("5ca1"),r=a("d2c8"),t="includes";n(n.P+n.F*a("5147")(t),"String",{includes:function(e){return!!~r(this,e,t).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(e,o,a){var n=a("86cc"),r=a("4630");e.exports=a("9e1e")?function(e,o,a){return n.f(e,o,r(1,a))}:function(e,o,a){return e[o]=a,e}},"38fd":function(e,o,a){var n=a("69a8"),r=a("4bf8"),t=a("613b")("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),n(e,t)?e[t]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},"41a0":function(e,o,a){"use strict";var n=a("2aeb"),r=a("4630"),t=a("7f20"),s={};a("32e9")(s,a("2b4c")("iterator"),(function(){return this})),e.exports=function(e,o,a){e.prototype=n(s,{next:r(1,a)}),t(e,o+" Iterator")}},"456d":function(e,o,a){var n=a("4bf8"),r=a("0d58");a("5eda")("keys",(function(){return function(e){return r(n(e))}}))},4588:function(e,o){var a=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:a)(e)}},4630:function(e,o){e.exports=function(e,o){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:o}}},"4bf8":function(e,o,a){var n=a("be13");e.exports=function(e){return Object(n(e))}},5147:function(e,o,a){var n=a("2b4c")("match");e.exports=function(e){var o=/./;try{"/./"[e](o)}catch(a){try{return o[n]=!1,!"/./"[e](o)}catch(r){}}return!0}},"52a7":function(e,o){o.f={}.propertyIsEnumerable},5537:function(e,o,a){var n=a("8378"),r=a("7726"),t="__core-js_shared__",s=r[t]||(r[t]={});(e.exports=function(e,o){return s[e]||(s[e]=void 0!==o?o:{})})("versions",[]).push({version:n.version,mode:a("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"55dd":function(e,o,a){"use strict";var n=a("5ca1"),r=a("d8e8"),t=a("4bf8"),s=a("79e5"),d=[].sort,h=[1,2,3];n(n.P+n.F*(s((function(){h.sort(void 0)}))||!s((function(){h.sort(null)}))||!a("2f21")(d)),"Array",{sort:function(e){return void 0===e?d.call(t(this)):d.call(t(this),r(e))}})},"5ca1":function(e,o,a){var n=a("7726"),r=a("8378"),t=a("32e9"),s=a("2aba"),d=a("9b43"),h="prototype",m=function(e,o,a){var C,i,u,l,c=e&m.F,S=e&m.G,g=e&m.S,y=e&m.P,A=e&m.B,N=S?n:g?n[o]||(n[o]={}):(n[o]||{})[h],M=S?r:r[o]||(r[o]={}),b=M[h]||(M[h]={});for(C in S&&(a=o),a)i=!c&&N&&void 0!==N[C],u=(i?N:a)[C],l=A&&i?d(u,n):y&&"function"==typeof u?d(Function.call,u):u,N&&s(N,C,u,e&m.U),M[C]!=u&&t(M,C,l),y&&b[C]!=u&&(b[C]=u)};n.core=r,m.F=1,m.G=2,m.S=4,m.P=8,m.B=16,m.W=32,m.U=64,m.R=128,e.exports=m},"5eda":function(e,o,a){var n=a("5ca1"),r=a("8378"),t=a("79e5");e.exports=function(e,o){var a=(r.Object||{})[e]||Object[e],s={};s[e]=o(a),n(n.S+n.F*t((function(){a(1)})),"Object",s)}},"613b":function(e,o,a){var n=a("5537")("keys"),r=a("ca5a");e.exports=function(e){return n[e]||(n[e]=r(e))}},"626a":function(e,o,a){var n=a("2d95");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},6762:function(e,o,a){"use strict";var n=a("5ca1"),r=a("c366")(!0);n(n.P,"Array",{includes:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),a("9c6c")("includes")},6821:function(e,o,a){var n=a("626a"),r=a("be13");e.exports=function(e){return n(r(e))}},"69a8":function(e,o){var a={}.hasOwnProperty;e.exports=function(e,o){return a.call(e,o)}},"6a99":function(e,o,a){var n=a("d3f4");e.exports=function(e,o){if(!n(e))return e;var a,r;if(o&&"function"==typeof(a=e.toString)&&!n(r=a.call(e)))return r;if("function"==typeof(a=e.valueOf)&&!n(r=a.call(e)))return r;if(!o&&"function"==typeof(a=e.toString)&&!n(r=a.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},7333:function(e,o,a){"use strict";var n=a("9e1e"),r=a("0d58"),t=a("2621"),s=a("52a7"),d=a("4bf8"),h=a("626a"),m=Object.assign;e.exports=!m||a("79e5")((function(){var e={},o={},a=Symbol(),n="abcdefghijklmnopqrst";return e[a]=7,n.split("").forEach((function(e){o[e]=e})),7!=m({},e)[a]||Object.keys(m({},o)).join("")!=n}))?function(e,o){var a=d(e),m=arguments.length,C=1,i=t.f,u=s.f;while(m>C){var l,c=h(arguments[C++]),S=i?r(c).concat(i(c)):r(c),g=S.length,y=0;while(g>y)l=S[y++],n&&!u.call(c,l)||(a[l]=c[l])}return a}:m},7514:function(e,o,a){"use strict";var n=a("5ca1"),r=a("0a49")(5),t="find",s=!0;t in[]&&Array(1)[t]((function(){s=!1})),n(n.P+n.F*s,"Array",{find:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),a("9c6c")(t)},7726:function(e,o){var a=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=a)},"77f1":function(e,o,a){var n=a("4588"),r=Math.max,t=Math.min;e.exports=function(e,o){return e=n(e),e<0?r(e+o,0):t(e,o)}},"79e5":function(e,o){e.exports=function(e){try{return!!e()}catch(o){return!0}}},"7f20":function(e,o,a){var n=a("86cc").f,r=a("69a8"),t=a("2b4c")("toStringTag");e.exports=function(e,o,a){e&&!r(e=a?e:e.prototype,t)&&n(e,t,{configurable:!0,value:o})}},"7f7f":function(e,o,a){var n=a("86cc").f,r=Function.prototype,t=/^\s*function ([^ (]*)/,s="name";s in r||a("9e1e")&&n(r,s,{configurable:!0,get:function(){try{return(""+this).match(t)[1]}catch(e){return""}}})},8378:function(e,o){var a=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=a)},"84f2":function(e,o){e.exports={}},"86cc":function(e,o,a){var n=a("cb7c"),r=a("c69a"),t=a("6a99"),s=Object.defineProperty;o.f=a("9e1e")?Object.defineProperty:function(e,o,a){if(n(e),o=t(o,!0),n(a),r)try{return s(e,o,a)}catch(d){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");return"value"in a&&(e[o]=a.value),e}},"9b43":function(e,o,a){var n=a("d8e8");e.exports=function(e,o,a){if(n(e),void 0===o)return e;switch(a){case 1:return function(a){return e.call(o,a)};case 2:return function(a,n){return e.call(o,a,n)};case 3:return function(a,n,r){return e.call(o,a,n,r)}}return function(){return e.apply(o,arguments)}}},"9c6c":function(e,o,a){var n=a("2b4c")("unscopables"),r=Array.prototype;void 0==r[n]&&a("32e9")(r,n,{}),e.exports=function(e){r[n][e]=!0}},"9def":function(e,o,a){var n=a("4588"),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},"9e1e":function(e,o,a){e.exports=!a("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},aae3:function(e,o,a){var n=a("d3f4"),r=a("2d95"),t=a("2b4c")("match");e.exports=function(e){var o;return n(e)&&(void 0!==(o=e[t])?!!o:"RegExp"==r(e))}},ac6a:function(e,o,a){for(var n=a("cadf"),r=a("0d58"),t=a("2aba"),s=a("7726"),d=a("32e9"),h=a("84f2"),m=a("2b4c"),C=m("iterator"),i=m("toStringTag"),u=h.Array,l={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},c=r(l),S=0;SC)if(d=h[C++],d!=d)return!0}else for(;m>C;C++)if((e||C in h)&&h[C]===a)return e||C||0;return!e&&-1}}},c69a:function(e,o,a){e.exports=!a("9e1e")&&!a("79e5")((function(){return 7!=Object.defineProperty(a("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(e,o){var a=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++a+n).toString(36))}},cadf:function(e,o,a){"use strict";var n=a("9c6c"),r=a("d53b"),t=a("84f2"),s=a("6821");e.exports=a("01f9")(Array,"Array",(function(e,o){this._t=s(e),this._i=0,this._k=o}),(function(){var e=this._t,o=this._k,a=this._i++;return!e||a>=e.length?(this._t=void 0,r(1)):r(0,"keys"==o?a:"values"==o?e[a]:[a,e[a]])}),"values"),t.Arguments=t.Array,n("keys"),n("values"),n("entries")},cb7c:function(e,o,a){var n=a("d3f4");e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},cd1c:function(e,o,a){var n=a("e853");e.exports=function(e,o){return new(n(e))(o)}},ce10:function(e,o,a){var n=a("69a8"),r=a("6821"),t=a("c366")(!1),s=a("613b")("IE_PROTO");e.exports=function(e,o){var a,d=r(e),h=0,m=[];for(a in d)a!=s&&n(d,a)&&m.push(a);while(o.length>h)n(d,a=o[h++])&&(~t(m,a)||m.push(a));return m}},d2c8:function(e,o,a){var n=a("aae3"),r=a("be13");e.exports=function(e,o,a){if(n(o))throw TypeError("String#"+a+" doesn't accept regex!");return String(r(e))}},d3f4:function(e,o){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},d53b:function(e,o){e.exports=function(e,o){return{value:o,done:!!e}}},d8e8:function(e,o){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},e11e:function(e,o){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e853:function(e,o,a){var n=a("d3f4"),r=a("1169"),t=a("2b4c")("species");e.exports=function(e){var o;return r(e)&&(o=e.constructor,"function"!=typeof o||o!==Array&&!r(o.prototype)||(o=void 0),n(o)&&(o=o[t],null===o&&(o=void 0))),void 0===o?Array:o}},f6fd:function(e,o){(function(e){var o="currentScript",a=e.getElementsByTagName("script");o in e||Object.defineProperty(e,o,{get:function(){try{throw new Error}catch(n){var e,o=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(e in a)if(a[e].src==o||"interactive"==a[e].readyState)return a[e];return null}}})})(document)},f751:function(e,o,a){var n=a("5ca1");n(n.S+n.F,"Object",{assign:a("7333")})},fa5b:function(e,o,a){e.exports=a("5537")("native-function-to-string",Function.toString)},fab2:function(e,o,a){var n=a("7726").document;e.exports=n&&n.documentElement},fb15:function(e,o,a){"use strict";var n;(a.r(o),a.d(o,"CountrySelect",(function(){return i})),a.d(o,"RegionSelect",(function(){return y})),"undefined"!==typeof window)&&(a("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(a.p=n[1]));a("7f7f"),a("cadf"),a("456d"),a("ac6a");var r=function(){var e=this,o=e.$createElement,a=e._self._c||o;return a("select",{class:e.className,attrs:{autocomplete:e.autocompleteAttr},on:{change:function(o){return e.onChange(o.target.value)}}},[e.disablePlaceholder||e.removePlaceholder?e._e():a("option",{attrs:{value:""}},[e._v(e._s(e.placeholder))]),e.disablePlaceholder&&!e.removePlaceholder?a("option",{attrs:{value:"",disabled:"",selected:""}},[e._v(e._s(e.placeholder))]):e._e(),e.topCountry?a("option",{domProps:{value:e.firstCountry,selected:e.country===e.firstCountry}},[e._v(e._s(e.topCountryName()))]):e._e(),e._l(e.countries,(function(o,n){return a("option",{key:n,domProps:{value:o[e.valueType],selected:e.country===o[e.valueType]}},[e._v(e._s(e.shortCodeDropdown?o.countryShortCode:o.countryName))])}))],2)},t=[],s=(a("7514"),a("55dd"),a("f751"),a("6762"),a("2fdb"),[{countryName:"Afghanistan",countryShortCode:"AF",regions:[{name:"Badakhshan",shortCode:"BDS"},{name:"Badghis",shortCode:"BDG"},{name:"Baghlan",shortCode:"BGL"},{name:"Balkh",shortCode:"BAL"},{name:"Bamyan",shortCode:"BAM"},{name:"Daykundi",shortCode:"DAY"},{name:"Farah",shortCode:"FRA"},{name:"Faryab",shortCode:"FYB"},{name:"Ghazni",shortCode:"GHA"},{name:"Ghor",shortCode:"GHO"},{name:"Helmand",shortCode:"HEL"},{name:"Herat",shortCode:"HER"},{name:"Jowzjan",shortCode:"JOW"},{name:"Kabul",shortCode:"KAB"},{name:"Kandahar",shortCode:"KAN"},{name:"Kapisa",shortCode:"KAP"},{name:"Khost",shortCode:"KHO"},{name:"Kunar",shortCode:"KNR"},{name:"Kunduz",shortCode:"KDZ"},{name:"Laghman",shortCode:"LAG"},{name:"Logar",shortCode:"LOW"},{name:"Maidan Wardak",shortCode:"WAR"},{name:"Nangarhar",shortCode:"NAN"},{name:"Nimruz",shortCode:"NIM"},{name:"Nuristan",shortCode:"NUR"},{name:"Paktia",shortCode:"PIA"},{name:"Paktika",shortCode:"PKA"},{name:"Panjshir",shortCode:"PAN"},{name:"Parwan",shortCode:"PAR"},{name:"Samangan",shortCode:"SAM"},{name:"Sar-e Pol",shortCode:"SAR"},{name:"Takhar",shortCode:"TAK"},{name:"Urozgan",shortCode:"ORU"},{name:"Zabul",shortCode:"ZAB"}]},{countryName:"Åland Islands",countryShortCode:"AX",regions:[{name:"Brändö",shortCode:"BR"},{name:"Eckerö",shortCode:"EC"},{name:"Finström",shortCode:"FN"},{name:"Föglö",shortCode:"FG"},{name:"Geta",shortCode:"GT"},{name:"Hammarland",shortCode:"HM"},{name:"Jomala",shortCode:"JM"},{name:"Kumlinge",shortCode:"KM"},{name:"Kökar",shortCode:"KK"},{name:"Lemland",shortCode:"LE"},{name:"Lumparland",shortCode:"LU"},{name:"Mariehamn",shortCode:"MH"},{name:"Saltvik",shortCode:"SV"},{name:"Sottunga",shortCode:"ST"},{name:"Sund",shortCode:"SD"},{name:"Vårdö",shortCode:"VR"}]},{countryName:"Albania",countryShortCode:"AL",regions:[{name:"Berat",shortCode:"01"},{name:"Dibër",shortCode:"09"},{name:"Durrës",shortCode:"02"},{name:"Elbasan",shortCode:"03"},{name:"Fier",shortCode:"04"},{name:"Gjirokastër",shortCode:"05"},{name:"Korçë",shortCode:"06"},{name:"Kukës",shortCode:"07"},{name:"Lezhë",shortCode:"08"},{name:"Shkodër",shortCode:"10"},{name:"Tirana",shortCode:"11"},{name:"Vlorë",shortCode:"12"}]},{countryName:"Algeria",countryShortCode:"DZ",regions:[{name:"Adrar",shortCode:"01"},{name:"Aïn Defla",shortCode:"44"},{name:"Aïn Témouchent",shortCode:"46"},{name:"Algiers",shortCode:"16"},{name:"Annaba",shortCode:"23"},{name:"Batna",shortCode:"05"},{name:"Béchar",shortCode:"08"},{name:"Béjaïa",shortCode:"06"},{name:"Biskra",shortCode:"07"},{name:"Blida",shortCode:"09"},{name:"Bordj Bou Arréridj",shortCode:"34"},{name:"Bouïra",shortCode:"10"},{name:"Boumerdès",shortCode:"35"},{name:"Chlef",shortCode:"02"},{name:"Constantine",shortCode:"25"},{name:"Djelfa",shortCode:"17"},{name:"El Bayadh",shortCode:"32"},{name:"El Oued",shortCode:"39"},{name:"El Tarf",shortCode:"36"},{name:"Ghardaïa",shortCode:"47"},{name:"Guelma",shortCode:"24"},{name:"Illizi",shortCode:"33"},{name:"Jijel",shortCode:"18"},{name:"Khenchela",shortCode:"40"},{name:"Laghouat",shortCode:"03"},{name:"Mascara",shortCode:"29"},{name:"Médéa",shortCode:"26"},{name:"Mila",shortCode:"43"},{name:"Mostaganem",shortCode:"27"},{name:"Msila",shortCode:"28"},{name:"Naâma",shortCode:"45"},{name:"Oran",shortCode:"31"},{name:"Ouargla",shortCode:"30"},{name:"Oum el Bouaghi",shortCode:"04"},{name:"Relizane",shortCode:"48"},{name:"Saïda",shortCode:"20"},{name:"Sétif",shortCode:"19"},{name:"Sidi Bel Abbès",shortCode:"22"},{name:"Skikda",shortCode:"21"},{name:"Souk Ahras",shortCode:"41"},{name:"Tamanghasset",shortCode:"11"},{name:"Tébessa",shortCode:"12"},{name:"Tiaret",shortCode:"14"},{name:"Tindouf",shortCode:"37"},{name:"Tipaza",shortCode:"42"},{name:"Tissemsilt",shortCode:"38"},{name:"Tizi Ouzou",shortCode:"15"},{name:"Tlemcen",shortCode:"13"}]},{countryName:"American Samoa",countryShortCode:"AS",regions:[{name:"Tutuila",shortCode:"01"},{name:"Aunu'u",shortCode:"02"},{name:"Ta'ū",shortCode:"03"},{name:"Ofu‑Olosega",shortCode:"04"},{name:"Rose Atoll",shortCode:"21"},{name:"Swains Island",shortCode:"22"}]},{countryName:"Andorra",countryShortCode:"AD",regions:[{name:"Andorra la Vella",shortCode:"07"},{name:"Canillo",shortCode:"02"},{name:"Encamp",shortCode:"03"},{name:"Escaldes-Engordany",shortCode:"08"},{name:"La Massana",shortCode:"04"},{name:"Ordino",shortCode:"05"},{name:"Sant Julià de Lòria",shortCode:"06"}]},{countryName:"Angola",countryShortCode:"AO",regions:[{name:"Bengo",shortCode:"BGO"},{name:"Benguela",shortCode:"BGU"},{name:"Bié",shortCode:"BIE"},{name:"Cabinda",shortCode:"CAB"},{name:"Cuando Cubango",shortCode:"CCU"},{name:"Cuanza Norte",shortCode:"CNO"},{name:"Cuanza Sul",shortCode:"CUS"},{name:"Cunene",shortCode:"CNN"},{name:"Huambo",shortCode:"HUA"},{name:"Huíla",shortCode:"HUI"},{name:"Luanda",shortCode:"LUA"},{name:"Lunda Norte",shortCode:"LNO"},{name:"Lunda Sul",shortCode:"LSU"},{name:"Malanje",shortCode:"MAL"},{name:"Moxico",shortCode:"MOX"},{name:"Namibe",shortCode:"NAM"},{name:"Uíge",shortCode:"UIG"},{name:"Zaire",shortCode:"ZAI"}]},{countryName:"Anguilla",countryShortCode:"AI",regions:[{name:"Anguilla",shortCode:"01"},{name:"Anguillita Island",shortCode:"02"},{name:"Blowing Rock",shortCode:"03"},{name:"Cove Cay",shortCode:"04"},{name:"Crocus Cay",shortCode:"05"},{name:"Deadman's Cay",shortCode:"06"},{name:"Dog Island",shortCode:"07"},{name:"East Cay",shortCode:"08"},{name:"Little Island",shortCode:"09"},{name:"Little Scrub Island",shortCode:"10"},{name:"Mid Cay",shortCode:"11"},{name:"North Cay",shortCode:"12"},{name:"Prickly Pear Cays",shortCode:"13"},{name:"Rabbit Island",shortCode:"14"},{name:"Sandy Island/Sand Island",shortCode:"15"},{name:"Scilly Cay",shortCode:"16"},{name:"Scrub Island",shortCode:"17"},{name:"Seal Island",shortCode:"18"},{name:"Sombrero/Hat Island",shortCode:"19"},{name:"South Cay",shortCode:"20"},{name:"South Wager Island",shortCode:"21"},{name:"West Cay",shortCode:"22"}]},{countryName:"Antarctica",countryShortCode:"AQ",regions:[{name:"Antarctica",shortCode:"AQ"}]},{countryName:"Antigua and Barbuda",countryShortCode:"AG",regions:[{name:"Antigua Island",shortCode:"01"},{name:"Barbuda Island",shortCode:"02"},{name:"Bird Island",shortCode:"04"},{name:"Bishop Island",shortCode:"05"},{name:"Blake Island",shortCode:"06"},{name:"Crump Island",shortCode:"09"},{name:"Dulcina Island",shortCode:"10"},{name:"Exchange Island",shortCode:"11"},{name:"Five Islands",shortCode:"12"},{name:"Great Bird Island",shortCode:"13"},{name:"Green Island",shortCode:"14"},{name:"Guiana Island",shortCode:"15"},{name:"Hawes Island",shortCode:"17"},{name:"Hells Gate Island",shortCode:"16"},{name:"Henry Island",shortCode:"18"},{name:"Johnson Island",shortCode:"19"},{name:"Kid Island",shortCode:"20"},{name:"Lobster Island",shortCode:"22"},{name:"Maiden Island",shortCode:"24"},{name:"Moor Island",shortCode:"25"},{name:"Nanny Island",shortCode:"26"},{name:"Pelican Island",shortCode:"27"},{name:"Prickly Pear Island",shortCode:"28"},{name:"Rabbit Island",shortCode:"29"},{name:"Red Head Island",shortCode:"31"},{name:"Redonda Island",shortCode:"03"},{name:"Sandy Island",shortCode:"32"},{name:"Smith Island",shortCode:"33"},{name:"The Sisters",shortCode:"34"},{name:"Vernon Island",shortCode:"35"},{name:"Wicked Will Island",shortCode:"36"},{name:"York Island",shortCode:"37"}]},{countryName:"Argentina",countryShortCode:"AR",regions:[{name:"Buenos Aires",shortCode:"B"},{name:"Capital Federal",shortCode:"C"},{name:"Catamarca",shortCode:"K"},{name:"Chaco",shortCode:"H"},{name:"Chubut",shortCode:"U"},{name:"Córdoba",shortCode:"X"},{name:"Corrientes",shortCode:"W"},{name:"Entre Ríos",shortCode:"E"},{name:"Formosa",shortCode:"P"},{name:"Jujuy",shortCode:"Y"},{name:"La Pampa",shortCode:"L"},{name:"La Rioja",shortCode:"F"},{name:"Mendoza",shortCode:"M"},{name:"Misiones",shortCode:"N"},{name:"Neuquén",shortCode:"Q"},{name:"Río Negro",shortCode:"R"},{name:"Salta",shortCode:"A"},{name:"San Juan",shortCode:"J"},{name:"San Luis",shortCode:"D"},{name:"Santa Cruz",shortCode:"Z"},{name:"Santa Fe",shortCode:"S"},{name:"Santiago del Estero",shortCode:"G"},{name:"Tierra del Fuego",shortCode:"V"},{name:"Tucumán",shortCode:"T"}]},{countryName:"Armenia",countryShortCode:"AM",regions:[{name:"Aragatsotn",shortCode:"AG"},{name:"Ararat",shortCode:"AR"},{name:"Armavir",shortCode:"AV"},{name:"Gegharkunik",shortCode:"GR"},{name:"Kotayk",shortCode:"KT"},{name:"Lori",shortCode:"LO"},{name:"Shirak",shortCode:"SH"},{name:"Syunik",shortCode:"SU"},{name:"Tavush",shortCode:"TV"},{name:"Vayots Dzor",shortCode:"VD"},{name:"Yerevan",shortCode:"ER"}]},{countryName:"Aruba",countryShortCode:"AW",regions:[{name:"Aruba",shortCode:"AW"}]},{countryName:"Australia",countryShortCode:"AU",regions:[{name:"Australian Capital Territory",shortCode:"ACT"},{name:"New South Wales",shortCode:"NSW"},{name:"Northern Territory",shortCode:"NT"},{name:"Queensland",shortCode:"QLD"},{name:"South Australia",shortCode:"SA"},{name:"Tasmania",shortCode:"TAS"},{name:"Victoria",shortCode:"VIC"},{name:"Western Australia",shortCode:"WA"}]},{countryName:"Austria",countryShortCode:"AT",regions:[{name:"Burgenland",shortCode:"1"},{name:"Kärnten",shortCode:"2"},{name:"Niederösterreich",shortCode:"3"},{name:"Oberösterreich",shortCode:"4"},{name:"Salzburg",shortCode:"5"},{name:"Steiermark",shortCode:"6"},{name:"Tirol",shortCode:"7"},{name:"Vorarlberg",shortCode:"8"},{name:"Wien",shortCode:"9"}]},{countryName:"Azerbaijan",countryShortCode:"AZ",regions:[{name:"Abşeron",shortCode:"ABS"},{name:"Ağcabədi",shortCode:"AGC"},{name:"Ağdam",shortCode:"AGM"},{name:"Ağdaş",shortCode:"AGS"},{name:"Ağstafa",shortCode:"AGA"},{name:"Ağsu",shortCode:"AGU"},{name:"Astara",shortCode:"AST"},{name:"Bakı",shortCode:"BAK"},{name:"Babək",shortCode:"BAB"},{name:"Balakən",shortCode:"BAL"},{name:"Bərdə",shortCode:"BAR"},{name:"Beyləqan",shortCode:"BEY"},{name:"Biləsuvar",shortCode:"BIL"},{name:"Cəbrayıl",shortCode:"CAB"},{name:"Cəlilabad",shortCode:"CAL"},{name:"Culfa",shortCode:"CUL"},{name:"Daşkəsən",shortCode:"DAS"},{name:"Füzuli",shortCode:"FUZ"},{name:"Gədəbəy",shortCode:"GAD"},{name:"Goranboy",shortCode:"GOR"},{name:"Göyçay",shortCode:"GOY"},{name:"Göygöl",shortCode:"GYG"},{name:"Hacıqabul",shortCode:"HAC"},{name:"İmişli",shortCode:"IMI"},{name:"İsmayıllı",shortCode:"ISM"},{name:"Kəlbəcər",shortCode:"KAL"},{name:"Kǝngǝrli",shortCode:"KAN"},{name:"Kürdəmir",shortCode:"KUR"},{name:"Laçın",shortCode:"LAC"},{name:"Lənkəran",shortCode:"LAN"},{name:"Lerik",shortCode:"LER"},{name:"Masallı",shortCode:"MAS"},{name:"Neftçala",shortCode:"NEF"},{name:"Oğuz",shortCode:"OGU"},{name:"Ordubad",shortCode:"ORD"},{name:"Qəbələ",shortCode:"QAB"},{name:"Qax",shortCode:"QAX"},{name:"Qazax",shortCode:"QAZ"},{name:"Qobustan",shortCode:"QOB"},{name:"Quba",shortCode:"QBA"},{name:"Qubadli",shortCode:"QBI"},{name:"Qusar",shortCode:"QUS"},{name:"Saatlı",shortCode:"SAT"},{name:"Sabirabad",shortCode:"SAB"},{name:"Şabran",shortCode:"SBN"},{name:"Sədərək",shortCode:"SAD"},{name:"Şahbuz",shortCode:"SAH"},{name:"Şəki",shortCode:"SAK"},{name:"Salyan",shortCode:"SAL"},{name:"Şamaxı",shortCode:"SMI"},{name:"Şəmkir",shortCode:"SKR"},{name:"Samux",shortCode:"SMX"},{name:"Şərur",shortCode:"SAR"},{name:"Siyəzən",shortCode:"SIY"},{name:"Şuşa",shortCode:"SUS"},{name:"Tərtər",shortCode:"TAR"},{name:"Tovuz",shortCode:"TOV"},{name:"Ucar",shortCode:"UCA"},{name:"Xaçmaz",shortCode:"XAC"},{name:"Xızı",shortCode:"XIZ"},{name:"Xocalı",shortCode:"XCI"},{name:"Xocavənd",shortCode:"XVD"},{name:"Yardımlı",shortCode:"YAR"},{name:"Yevlax",shortCode:"YEV"},{name:"Zəngilan",shortCode:"ZAN"},{name:"Zaqatala",shortCode:"ZAQ"},{name:"Zərdab",shortCode:"ZAR"}]},{countryName:"Bahamas",countryShortCode:"BS",regions:[{name:"Acklins Island",shortCode:"01"},{name:"Berry Islands",shortCode:"22"},{name:"Bimini",shortCode:"02"},{name:"Black Point",shortCode:"23"},{name:"Cat Island",shortCode:"03"},{name:"Central Abaco",shortCode:"24"},{name:"Crooked Island and Long Cay",shortCode:"28"},{name:"East Grand Bahama",shortCode:"29"},{name:"Exuma",shortCode:"04"},{name:"Freeport",shortCode:"05"},{name:"Fresh Creek",shortCode:"06"},{name:"Governor's Harbour",shortCode:"07"},{name:"Green Turtle Cay",shortCode:"08"},{name:"Harbour Island",shortCode:"09"},{name:"High Rock",shortCode:"10"},{name:"Inagua",shortCode:"11"},{name:"Kemps Bay",shortCode:"12"},{name:"Long Island",shortCode:"13"},{name:"Marsh Harbour",shortCode:"14"},{name:"Mayaguana",shortCode:"15"},{name:"Moore’s Island",shortCode:"40"},{name:"New Providence",shortCode:"16"},{name:"Nichollstown and Berry Islands",shortCode:"17"},{name:"North Abaco",shortCode:"42"},{name:"North Andros",shortCode:"41"},{name:"North Eleuthera",shortCode:"33"},{name:"Ragged Island",shortCode:"18"},{name:"Rock Sound",shortCode:"19"},{name:"San Salvador and Rum Cay",shortCode:"20"},{name:"Sandy Point",shortCode:"21"},{name:"South Abaco",shortCode:"35"},{name:"South Andros",shortCode:"36"},{name:"South Eleuthera",shortCode:"37"},{name:"West Grand Bahama",shortCode:"39"}]},{countryName:"Bahrain",countryShortCode:"BH",regions:[{name:"Al Janūbīyah",shortCode:"14"},{name:"Al Manāmah",shortCode:"13"},{name:"Al Muḩarraq",shortCode:"15"},{name:"Al Wusţá",shortCode:"16"},{name:"Ash Shamālīyah",shortCode:"17"}]},{countryName:"Bangladesh",countryShortCode:"BD",regions:[{name:"Barisal",shortCode:"A"},{name:"Chittagong",shortCode:"B"},{name:"Dhaka",shortCode:"C"},{name:"Khulna",shortCode:"D"},{name:"Mymensingh",shortCode:"M"},{name:"Rajshahi",shortCode:"E"},{name:"Rangpur",shortCode:"F"},{name:"Sylhet",shortCode:"G"}]},{countryName:"Barbados",countryShortCode:"BB",regions:[{name:"Christ Church",shortCode:"01"},{name:"Saint Andrew",shortCode:"02"},{name:"Saint George",shortCode:"03"},{name:"Saint James",shortCode:"04"},{name:"Saint John",shortCode:"05"},{name:"Saint Joseph",shortCode:"06"},{name:"Saint Lucy",shortCode:"07"},{name:"Saint Michael",shortCode:"08"},{name:"Saint Peter",shortCode:"09"},{name:"Saint Philip",shortCode:"10"},{name:"Saint Thomas",shortCode:"11"}]},{countryName:"Belarus",countryShortCode:"BY",regions:[{name:"Brest voblast",shortCode:"BR"},{name:"Gorod Minsk",shortCode:"HM"},{name:"Homiel voblast",shortCode:"HO"},{name:"Hrodna voblast",shortCode:"HR"},{name:"Mahilyow voblast",shortCode:"MA"},{name:"Minsk voblast",shortCode:"MI"},{name:"Vitsebsk voblast",shortCode:"VI"}]},{countryName:"Belgium",countryShortCode:"BE",regions:[{name:"Bruxelles-Capitale",shortCode:"BRU"},{name:"Région Flamande",shortCode:"VLG"},{name:"Région Wallonië",shortCode:"WAL"}]},{countryName:"Belize",countryShortCode:"BZ",regions:[{name:"Belize District",shortCode:"BZ"},{name:"Cayo District",shortCode:"CY"},{name:"Corozal District",shortCode:"CZL"},{name:"Orange Walk District",shortCode:"OW"},{name:"Stann Creek District",shortCode:"SC"},{name:"Toledo District",shortCode:"TOL"}]},{countryName:"Benin",countryShortCode:"BJ",regions:[{name:"Alibori",shortCode:"AL"},{name:"Atakora",shortCode:"AK"},{name:"Atlantique",shortCode:"AQ"},{name:"Borgou",shortCode:"BO"},{name:"Collines Department",shortCode:"CO"},{name:"Donga",shortCode:"DO"},{name:"Kouffo",shortCode:"KO"},{name:"Littoral Department",shortCode:"LI"},{name:"Mono Department",shortCode:"MO"},{name:"Ouémé",shortCode:"OU"},{name:"Plateau",shortCode:"PL"},{name:"Zou",shortCode:"ZO"}]},{countryName:"Bermuda",countryShortCode:"BM",regions:[{name:"City of Hamilton",shortCode:"03"},{name:"Devonshire Parish",shortCode:"01"},{name:"Hamilton Parish",shortCode:"02"},{name:"Paget Parish",shortCode:"04"},{name:"Pembroke Parish",shortCode:"05"},{name:"Sandys Parish",shortCode:"08"},{name:"Smith's Parish",shortCode:"09"},{name:"Southampton Parish",shortCode:"10"},{name:"St. George's Parish",shortCode:"07"},{name:"Town of St. George",shortCode:"06"},{name:"Warwick Parish",shortCode:"11"}]},{countryName:"Bhutan",countryShortCode:"BT",regions:[{name:"Bumthang",shortCode:"33"},{name:"Chhukha",shortCode:"12"},{name:"Dagana",shortCode:"22"},{name:"Gasa",shortCode:"GA"},{name:"Haa",shortCode:"13"},{name:"Lhuntse",shortCode:"44"},{name:"Mongar",shortCode:"42"},{name:"Paro",shortCode:"11"},{name:"Pemagatshel",shortCode:"43"},{name:"Punakha",shortCode:"23"},{name:"Samdrup Jongkhar",shortCode:"45"},{name:"Samtse",shortCode:"14"},{name:"Sarpang",shortCode:"31"},{name:"Thimphu",shortCode:"15"},{name:"Trashigang",shortCode:"41"},{name:"Trashiyangtse",shortCode:"TY"},{name:"Trongsa",shortCode:"32"},{name:"Tsirang",shortCode:"21"},{name:"Wangdue Phodrang",shortCode:"24"},{name:"Zhemgang",shortCode:"34"}]},{countryName:"Bolivia",countryShortCode:"BO",regions:[{name:"Beni",shortCode:"B"},{name:"Chuquisaca",shortCode:"H"},{name:"Cochabamba",shortCode:"C"},{name:"La Paz",shortCode:"L"},{name:"Oruro",shortCode:"O"},{name:"Pando",shortCode:"N"},{name:"Potosí",shortCode:"P"},{name:"Santa Cruz",shortCode:"S"},{name:"Tarija",shortCode:"T"}]},{countryName:"Bonaire, Sint Eustatius and Saba",countryShortCode:"BQ",regions:[{name:"Bonaire",shortCode:"BO"},{name:"Saba Isand",shortCode:"SA"},{name:"Sint Eustatius",shortCode:"SE"}]},{countryName:"Bosnia and Herzegovina",countryShortCode:"BA",regions:[{name:"Brčko Distrikt",shortCode:"BRC"},{name:"Federacija Bosne i Hercegovine",shortCode:"BIH"},{name:"Republika Srpska",shortCode:"SRP"}]},{countryName:"Botswana",countryShortCode:"BW",regions:[{name:"Central",shortCode:"CE"},{name:"Ghanzi",shortCode:"GH"},{name:"Kgalagadi",shortCode:"KG"},{name:"Kgatleng",shortCode:"KL"},{name:"Kweneng",shortCode:"KW"},{name:"North West",shortCode:"NW"},{name:"North-East",shortCode:"NE"},{name:"South East",shortCode:"SE"},{name:"Southern",shortCode:"SO"}]},{countryName:"Bouvet Island",countryShortCode:"BV",regions:[{name:"Bouvet Island",shortCode:"BV"}]},{countryName:"Brazil",countryShortCode:"BR",regions:[{name:"Acre",shortCode:"AC"},{name:"Alagoas",shortCode:"AL"},{name:"Amapá",shortCode:"AP"},{name:"Amazonas",shortCode:"AM"},{name:"Bahia",shortCode:"BA"},{name:"Ceará",shortCode:"CE"},{name:"Distrito Federal",shortCode:"DF"},{name:"Espírito Santo",shortCode:"ES"},{name:"Goiás",shortCode:"GO"},{name:"Maranhão",shortCode:"MA"},{name:"Mato Grosso",shortCode:"MT"},{name:"Mato Grosso do Sul",shortCode:"MS"},{name:"Minas Gerais",shortCode:"MG"},{name:"Pará",shortCode:"PA"},{name:"Paraíba",shortCode:"PB"},{name:"Paraná",shortCode:"PR"},{name:"Pernambuco",shortCode:"PE"},{name:"Piauí",shortCode:"PI"},{name:"Rio de Janeiro",shortCode:"RJ"},{name:"Rio Grande do Norte",shortCode:"RN"},{name:"Rio Grande do Sul",shortCode:"RS"},{name:"Rondônia",shortCode:"RO"},{name:"Roraima",shortCode:"RR"},{name:"Santa Catarina",shortCode:"SC"},{name:"São Paulo",shortCode:"SP"},{name:"Sergipe",shortCode:"SE"},{name:"Tocantins",shortCode:"TO"}]},{countryName:"British Indian Ocean Territory",countryShortCode:"IO",regions:[{name:"British Indian Ocean Territory",shortCode:"IO"}]},{countryName:"Brunei Darussalam",countryShortCode:"BN",regions:[{name:"Belait",shortCode:"BE"},{name:"Brunei Muara",shortCode:"BM"},{name:"Temburong",shortCode:"TE"},{name:"Tutong",shortCode:"TU"}]},{countryName:"Bulgaria",countryShortCode:"BG",regions:[{name:"Blagoevgrad",shortCode:"01"},{name:"Burgas",shortCode:"02"},{name:"Dobrich",shortCode:"08"},{name:"Gabrovo",shortCode:"07"},{name:"Jambol",shortCode:"28"},{name:"Khaskovo",shortCode:"26"},{name:"Kjustendil",shortCode:"10"},{name:"Kurdzhali",shortCode:"09"},{name:"Lovech",shortCode:"11"},{name:"Montana",shortCode:"12"},{name:"Pazardzhik",shortCode:"13"},{name:"Pernik",shortCode:"14"},{name:"Pleven",shortCode:"15"},{name:"Plovdiv",shortCode:"16"},{name:"Razgrad",shortCode:"17"},{name:"Ruse",shortCode:"18"},{name:"Shumen",shortCode:"27"},{name:"Silistra",shortCode:"19"},{name:"Sliven",shortCode:"20"},{name:"Smoljan",shortCode:"21"},{name:"Sofija",shortCode:"23"},{name:"Sofija-Grad",shortCode:"22"},{name:"Stara Zagora",shortCode:"24"},{name:"Turgovishhe",shortCode:"25"},{name:"Varna",shortCode:"03"},{name:"Veliko Turnovo",shortCode:"04"},{name:"Vidin",shortCode:"05"},{name:"Vraca",shortCode:"06"}]},{countryName:"Burkina Faso",countryShortCode:"BF",regions:[{name:"Balé",shortCode:"BAL"},{name:"Bam/Lake Bam",shortCode:"BAM"},{name:"Banwa Province",shortCode:"BAN"},{name:"Bazèga",shortCode:"BAZ"},{name:"Bougouriba",shortCode:"BGR"},{name:"Boulgou Province",shortCode:"BLG"},{name:"Boulkiemdé",shortCode:"BLK"},{name:"Comoé/Komoe",shortCode:"COM"},{name:"Ganzourgou Province",shortCode:"GAN"},{name:"Gnagna",shortCode:"GNA"},{name:"Gourma Province",shortCode:"GOU"},{name:"Houet",shortCode:"HOU"},{name:"Ioba",shortCode:"IOB"},{name:"Kadiogo",shortCode:"KAD"},{name:"Kénédougou",shortCode:"KEN"},{name:"Komondjari",shortCode:"KMD"},{name:"Kompienga",shortCode:"KMP"},{name:"Kossi Province",shortCode:"KOS"},{name:"Koulpélogo",shortCode:"KOP"},{name:"Kouritenga",shortCode:"KOT"},{name:"Kourwéogo",shortCode:"KOW"},{name:"Léraba",shortCode:"LER"},{name:"Loroum",shortCode:"LOR"},{name:"Mouhoun",shortCode:"MOU"},{name:"Namentenga",shortCode:"NAM"},{name:"Naouri/Nahouri",shortCode:"NAO"},{name:"Nayala",shortCode:"NAY"},{name:"Noumbiel",shortCode:"NOU"},{name:"Oubritenga",shortCode:"OUB"},{name:"Oudalan",shortCode:"OUD"},{name:"Passoré",shortCode:"PAS"},{name:"Poni",shortCode:"PON"},{name:"Sanguié",shortCode:"SNG"},{name:"Sanmatenga",shortCode:"SMT"},{name:"Séno",shortCode:"SEN"},{name:"Sissili",shortCode:"SIS"},{name:"Soum",shortCode:"SOM"},{name:"Sourou",shortCode:"SOR"},{name:"Tapoa",shortCode:"TAP"},{name:"Tui/Tuy",shortCode:"TUI"},{name:"Yagha",shortCode:"YAG"},{name:"Yatenga",shortCode:"YAT"},{name:"Ziro",shortCode:"ZIR"},{name:"Zondoma",shortCode:"ZON"},{name:"Zoundwéogo",shortCode:"ZOU"}]},{countryName:"Burundi",countryShortCode:"BI",regions:[{name:"Bubanza",shortCode:"BB"},{name:"Bujumbura Mairie",shortCode:"BM"},{name:"Bujumbura Rural",shortCode:"BL"},{name:"Bururi",shortCode:"BR"},{name:"Cankuzo",shortCode:"CA"},{name:"Cibitoke",shortCode:"CI"},{name:"Gitega",shortCode:"GI"},{name:"Karuzi",shortCode:"KR"},{name:"Kayanza",shortCode:"KY"},{name:"Kirundo",shortCode:"KI"},{name:"Makamba",shortCode:"MA"},{name:"Muramvya",shortCode:"MU"},{name:"Muyinga",shortCode:"MY"},{name:"Mwaro",shortCode:"MW"},{name:"Ngozi",shortCode:"NG"},{name:"Rutana",shortCode:"RT"},{name:"Ruyigi",shortCode:"RY"}]},{countryName:"Cambodia",countryShortCode:"KH",regions:[{name:"Baat Dambang",shortCode:"2"},{name:"Banteay Mean Chey",shortCode:"1"},{name:"Kampong Chaam",shortCode:"3"},{name:"Kampong Chhnang",shortCode:"4"},{name:"Kampong Spueu",shortCode:"5"},{name:"Kampong Thum",shortCode:"6"},{name:"Kampot",shortCode:"7"},{name:"Kandaal",shortCode:"8"},{name:"Kaoh Kong",shortCode:"9"},{name:"Kracheh",shortCode:"10"},{name:"Krong Kaeb",shortCode:"23"},{name:"Krong Pailin",shortCode:"24"},{name:"Krong Preah Sihanouk",shortCode:"18"},{name:"Mondol Kiri",shortCode:"11"},{name:"Otdar Mean Chey",shortCode:"22"},{name:"Phnom Penh",shortCode:"12"},{name:"Pousaat",shortCode:"15"},{name:"Preah Vihear",shortCode:"13"},{name:"Prey Veaeng",shortCode:"14"},{name:"Rotanah Kiri",shortCode:"16"},{name:"Siem Reab",shortCode:"17"},{name:"Stueng Treng",shortCode:"19"},{name:"Svaay Rieng",shortCode:"20"},{name:"Taakaev",shortCode:"21"},{name:"Tbong Khmum",shortCode:"25"}]},{countryName:"Cameroon",countryShortCode:"CM",regions:[{name:"Adamaoua",shortCode:"AD"},{name:"Centre",shortCode:"CE"},{name:"Est",shortCode:"ES"},{name:"Extrême-Nord",shortCode:"EN"},{name:"Littoral",shortCode:"LT"},{name:"Nord",shortCode:"NO"},{name:"Nord-Ouest",shortCode:"NW"},{name:"Ouest",shortCode:"OU"},{name:"Sud",shortCode:"SU"},{name:"Sud-Ouest",shortCode:"SW"}]},{countryName:"Canada",countryShortCode:"CA",regions:[{name:"Alberta",shortCode:"AB"},{name:"British Columbia",shortCode:"BC"},{name:"Manitoba",shortCode:"MB"},{name:"New Brunswick",shortCode:"NB"},{name:"Newfoundland and Labrador",shortCode:"NL"},{name:"Northwest Territories",shortCode:"NT"},{name:"Nova Scotia",shortCode:"NS"},{name:"Nunavut",shortCode:"NU"},{name:"Ontario",shortCode:"ON"},{name:"Prince Edward Island",shortCode:"PE"},{name:"Quebec",shortCode:"QC"},{name:"Saskatchewan",shortCode:"SK"},{name:"Yukon",shortCode:"YT"}]},{countryName:"Cape Verde",countryShortCode:"CV",regions:[{name:"Boa Vista",shortCode:"BV"},{name:"Brava",shortCode:"BR"},{name:"Calheta de São Miguel",shortCode:"CS"},{name:"Maio",shortCode:"MA"},{name:"Mosteiros",shortCode:"MO"},{name:"Paúl",shortCode:"PA"},{name:"Porto Novo",shortCode:"PN"},{name:"Praia",shortCode:"PR"},{name:"Ribeira Brava",shortCode:"RB"},{name:"Ribeira Grande",shortCode:"RG"},{name:"Sal",shortCode:"SL"},{name:"Santa Catarina",shortCode:"CA"},{name:"Santa Cruz",shortCode:"CR"},{name:"São Domingos",shortCode:"SD"},{name:"São Filipe",shortCode:"SF"},{name:"São Nicolau",shortCode:"SN"},{name:"São Vicente",shortCode:"SV"},{name:"Tarrafal",shortCode:"TA"},{name:"Tarrafal de São Nicolau",shortCode:"TS"}]},{countryName:"Cayman Islands",countryShortCode:"KY",regions:[{name:"Creek"},{name:"Eastern"},{name:"Midland"},{name:"South Town"},{name:"Spot Bay"},{name:"Stake Bay"},{name:"West End"},{name:"Western"}]},{countryName:"Central African Republic",countryShortCode:"CF",regions:[{name:"Bamingui-Bangoran",shortCode:"BB"},{name:"Bangui",shortCode:"BGF"},{name:"Basse-Kotto",shortCode:"BK"},{name:"Haute-Kotto",shortCode:"HK"},{name:"Haut-Mbomou",shortCode:"HM"},{name:"Kémo",shortCode:"KG"},{name:"Lobaye",shortCode:"LB"},{name:"Mambéré-Kadéï",shortCode:"HS"},{name:"Mbomou",shortCode:"MB"},{name:"Nana-Grebizi",shortCode:"10"},{name:"Nana-Mambéré",shortCode:"NM"},{name:"Ombella-M'Poko",shortCode:"MP"},{name:"Ouaka",shortCode:"UK"},{name:"Ouham",shortCode:"AC"},{name:"Ouham Péndé",shortCode:"OP"},{name:"Sangha-Mbaéré",shortCode:"SE"},{name:"Vakaga",shortCode:"VK"}]},{countryName:"Chad",countryShortCode:"TD",regions:[{name:"Bahr el Ghazal",shortCode:"BG"},{name:"Batha",shortCode:"BA"},{name:"Borkou",shortCode:"BO"},{name:"Chari-Baguirmi",shortCode:"CB"},{name:"Ennedi-Est",shortCode:"EE"},{name:"Ennedi-Ouest",shortCode:"EO"},{name:"Guéra",shortCode:"GR"},{name:"Hadjer Lamis",shortCode:"HL"},{name:"Kanem",shortCode:"KA"},{name:"Lac",shortCode:"LC"},{name:"Logone Occidental",shortCode:"LO"},{name:"Logone Oriental",shortCode:"LR"},{name:"Mondoul",shortCode:"MA"},{name:"Mayo-Kébbi-Est",shortCode:"ME"},{name:"Moyen-Chari",shortCode:"MC"},{name:"Ouaddai",shortCode:"OD"},{name:"Salamat",shortCode:"SA"},{name:"Sila",shortCode:"SI"},{name:"Tandjilé",shortCode:"TA"},{name:"Tibesti",shortCode:"TI"},{name:"Ville de Ndjamena",shortCode:"ND"},{name:"Wadi Fira",shortCode:"WF"}]},{countryName:"Chile",countryShortCode:"CL",regions:[{name:"Aisén del General Carlos Ibáñez del Campo",shortCode:"AI"},{name:"Antofagasta",shortCode:"AN"},{name:"Araucanía",shortCode:"AR"},{name:"Arica y Parinacota",shortCode:"AP"},{name:"Atacama",shortCode:"AT"},{name:"Bío-Bío",shortCode:"BI"},{name:"Coquimbo",shortCode:"CO"},{name:"Libertador General Bernardo O'Higgins",shortCode:"LI"},{name:"Los Lagos",shortCode:"LL"},{name:"Los Ríos",shortCode:"LR"},{name:"Magallanes y Antartica Chilena",shortCode:"MA"},{name:"Marga-Marga",shortCode:""},{name:"Maule",shortCode:"ML"},{name:"Ñuble",shortCode:"NB"},{name:"Región Metropolitana de Santiago",shortCode:"RM"},{name:"Tarapacá",shortCode:"TA"},{name:"Valparaíso",shortCode:"VS"}]},{countryName:"China",countryShortCode:"CN",regions:[{name:"Anhui",shortCode:"34"},{name:"Beijing",shortCode:"11"},{name:"Chongqing",shortCode:"50"},{name:"Fujian",shortCode:"35"},{name:"Gansu",shortCode:"62"},{name:"Guangdong",shortCode:"44"},{name:"Guangxi",shortCode:"45"},{name:"Guizhou",shortCode:"52"},{name:"Hainan",shortCode:"46"},{name:"Hebei",shortCode:"13"},{name:"Heilongjiang",shortCode:"23"},{name:"Henan",shortCode:"41"},{name:"Hong Kong",shortCode:"91"},{name:"Hubei",shortCode:"42"},{name:"Hunan",shortCode:"43"},{name:"Inner Mongolia",shortCode:"15"},{name:"Jiangsu",shortCode:"32"},{name:"Jiangxi",shortCode:"36"},{name:"Jilin",shortCode:"22"},{name:"Liaoning",shortCode:"21"},{name:"Macau",shortCode:"92"},{name:"Ningxia",shortCode:"64"},{name:"Qinghai",shortCode:"63"},{name:"Shaanxi",shortCode:"61"},{name:"Shandong",shortCode:"37"},{name:"Shanghai",shortCode:"31"},{name:"Shanxi",shortCode:"14"},{name:"Sichuan",shortCode:"51"},{name:"Tianjin",shortCode:"12"},{name:"Tibet",shortCode:"54"},{name:"Xinjiang",shortCode:"65"},{name:"Yunnan",shortCode:"53"},{name:"Zhejiang",shortCode:"33"}]},{countryName:"Christmas Island",countryShortCode:"CX",regions:[{name:"Christmas Island",shortCode:"CX"}]},{countryName:"Cocos (Keeling) Islands",countryShortCode:"CC",regions:[{name:"Direction Island",shortCode:"DI"},{name:"Home Island",shortCode:"HM"},{name:"Horsburgh Island",shortCode:"HR"},{name:"North Keeling Island",shortCode:"NK"},{name:"South Island",shortCode:"SI"},{name:"West Island",shortCode:"WI"}]},{countryName:"Colombia",countryShortCode:"CO",regions:[{name:"Amazonas",shortCode:"AMA"},{name:"Antioquia",shortCode:"ANT"},{name:"Arauca",shortCode:"ARA"},{name:"Archipiélago de San Andrés",shortCode:"SAP"},{name:"Atlántico",shortCode:"ATL"},{name:"Bogotá D.C.",shortCode:"DC"},{name:"Bolívar",shortCode:"BOL"},{name:"Boyacá",shortCode:"BOY"},{name:"Caldas",shortCode:"CAL"},{name:"Caquetá",shortCode:"CAQ"},{name:"Casanare",shortCode:"CAS"},{name:"Cauca",shortCode:"CAU"},{name:"Cesar",shortCode:"CES"},{name:"Chocó",shortCode:"CHO"},{name:"Córdoba",shortCode:"COR"},{name:"Cundinamarca",shortCode:"CUN"},{name:"Guainía",shortCode:"GUA"},{name:"Guaviare",shortCode:"GUV"},{name:"Huila",shortCode:"HUI"},{name:"La Guajira",shortCode:"LAG"},{name:"Magdalena",shortCode:"MAG"},{name:"Meta",shortCode:"MET"},{name:"Nariño",shortCode:"NAR"},{name:"Norte de Santander",shortCode:"NSA"},{name:"Putumayo",shortCode:"PUT"},{name:"Quindío",shortCode:"QUI"},{name:"Risaralda",shortCode:"RIS"},{name:"Santander",shortCode:"SAN"},{name:"Sucre",shortCode:"SUC"},{name:"Tolima",shortCode:"TOL"},{name:"Valle del Cauca",shortCode:"VAC"},{name:"Vaupés",shortCode:"VAU"},{name:"Vichada",shortCode:"VID"}]},{countryName:"Comoros",countryShortCode:"KM",regions:[{name:"Andjazîdja",shortCode:"G"},{name:"Andjouân",shortCode:"A"},{name:"Moûhîlî",shortCode:"M"}]},{countryName:"Congo, Republic of the (Brazzaville)",countryShortCode:"CG",regions:[{name:"Bouenza",shortCode:"11"},{name:"Brazzaville",shortCode:"BZV"},{name:"Cuvette",shortCode:"8"},{name:"Cuvette-Ouest",shortCode:"15"},{name:"Kouilou",shortCode:"5"},{name:"Lékoumou",shortCode:"2"},{name:"Likouala",shortCode:"7"},{name:"Niari",shortCode:"9"},{name:"Plateaux",shortCode:"14"},{name:"Pointe-Noire",shortCode:"16"},{name:"Pool",shortCode:"12"},{name:"Sangha",shortCode:"13"}]},{countryName:"Congo, the Democratic Republic of the (Kinshasa)",countryShortCode:"CD",regions:[{name:"Bandundu",shortCode:"BN"},{name:"Bas-Congo",shortCode:"BC"},{name:"Équateur",shortCode:"EQ"},{name:"Kasaï-Occidental",shortCode:"KE"},{name:"Kasaï-Oriental",shortCode:"KW"},{name:"Katanga",shortCode:"KA"},{name:"Kinshasa",shortCode:"KN"},{name:"Maniema",shortCode:"MA"},{name:"Nord-Kivu",shortCode:"NK"},{name:"Orientale",shortCode:"OR"},{name:"Sud-Kivu",shortCode:"SK"}]},{countryName:"Cook Islands",countryShortCode:"CK",regions:[{name:"Aitutaki"},{name:"Atiu"},{name:"Avarua"},{name:"Mangaia"},{name:"Manihiki"},{name:"Ma'uke"},{name:"Mitiaro"},{name:"Nassau"},{name:"Palmerston"},{name:"Penrhyn"},{name:"Pukapuka"},{name:"Rakahanga"}]},{countryName:"Costa Rica",countryShortCode:"CR",regions:[{name:"Alajuela",shortCode:"2"},{name:"Cartago",shortCode:"3"},{name:"Guanacaste",shortCode:"5"},{name:"Heredia",shortCode:"4"},{name:"Limón",shortCode:"7"},{name:"Puntarenas",shortCode:"6"},{name:"San José",shortCode:"1"}]},{countryName:"Côte d'Ivoire, Republic of",countryShortCode:"CI",regions:[{name:"Agnéby",shortCode:"16"},{name:"Bafing",shortCode:"17"},{name:"Bas-Sassandra",shortCode:"09"},{name:"Denguélé",shortCode:"10"},{name:"Dix-Huit Montagnes",shortCode:"06"},{name:"Fromager",shortCode:"18"},{name:"Haut-Sassandra",shortCode:"02"},{name:"Lacs",shortCode:"07"},{name:"Lagunes",shortCode:"01"},{name:"Marahoué",shortCode:"12"},{name:"Moyen-Cavally",shortCode:"19"},{name:"Moyen-Comoé",shortCode:"05"},{name:"N'zi-Comoé",shortCode:"11"},{name:"Savanes",shortCode:"03"},{name:"Sud-Bandama",shortCode:"15"},{name:"Sud-Comoé",shortCode:"13"},{name:"Vallée du Bandama",shortCode:"04"},{name:"Worodougou",shortCode:"14"},{name:"Zanzan",shortCode:"08"}]},{countryName:"Croatia",countryShortCode:"HR",regions:[{name:"Bjelovarsko-Bilogorska Županija",shortCode:"07"},{name:"Brodsko-Posavska Županija",shortCode:"12"},{name:"Dubrovačko-Neretvanska Županija",shortCode:"19"},{name:"Grad Zagreb",shortCode:"21"},{name:"Istarska Županija",shortCode:"18"},{name:"Karlovačka Županija",shortCode:"04"},{name:"Koprivničko-Krizevačka Županija",shortCode:"06"},{name:"Krapinsko-Zagorska Županija",shortCode:"02"},{name:"Ličko-Senjska Županija",shortCode:"09"},{name:"Međimurska Županija",shortCode:"20"},{name:"Osječko-Baranjska Županija",shortCode:"14"},{name:"Požeško-Slavonska Županija",shortCode:"11"},{name:"Primorsko-Goranska Županija",shortCode:"08"},{name:"Sisačko-Moslavačka Županija",shortCode:"03"},{name:"Splitsko-Dalmatinska Županija",shortCode:"17"},{name:"Sibensko-Kninska Županija",shortCode:"15"},{name:"Varaždinska Županija",shortCode:"05"},{name:"Virovitičko-Podravska Županija",shortCode:"10"},{name:"Vukovarsko-Srijemska Županija",shortCode:"16"},{name:"Zadarska Županija",shortCode:"13"},{name:"Zagrebacka Zupanija",shortCode:"01"}]},{countryName:"Cuba",countryShortCode:"CU",regions:[{name:"Artemisa",shortCode:"15"},{name:"Camagüey",shortCode:"09"},{name:"Ciego de Ávila",shortCode:"08"},{name:"Cienfuegos",shortCode:"06"},{name:"Granma",shortCode:"12"},{name:"Guantánamo",shortCode:"14"},{name:"Holguín",shortCode:"11"},{name:"Isla de la Juventud",shortCode:"99"},{name:"La Habana",shortCode:"03"},{name:"Las Tunas",shortCode:"10"},{name:"Matanzas",shortCode:"04"},{name:"Mayabeque",shortCode:"16"},{name:"Pinar del Río",shortCode:"01"},{name:"Sancti Spíritus",shortCode:"07"},{name:"Santiago de Cuba",shortCode:"13"},{name:"Villa Clara",shortCode:"05"}]},{countryName:"Curaçao",countryShortCode:"CW",regions:[{name:"Curaçao",shortCode:"CW"}]},{countryName:"Cyprus",countryShortCode:"CY",regions:[{name:"Ammochostos",shortCode:"04"},{name:"Keryneia",shortCode:"05"},{name:"Larnaka",shortCode:"03"},{name:"Lefkosia",shortCode:"01"},{name:"Lemesos",shortCode:"02"},{name:"Pafos",shortCode:"05"}]},{countryName:"Czech Republic",countryShortCode:"CZ",regions:[{name:"Hlavní město Praha",shortCode:"PR"},{name:"Jihočeský kraj",shortCode:"JC"},{name:"Jihomoravský kraj",shortCode:"JM"},{name:"Karlovarský kraj",shortCode:"KA"},{name:"Královéhradecký kraj",shortCode:"KR"},{name:"Liberecký kraj",shortCode:"LI"},{name:"Moravskoslezský kraj",shortCode:"MO"},{name:"Olomoucký kraj",shortCode:"OL"},{name:"Pardubický kraj",shortCode:"PA"},{name:"Plzeňský kraj",shortCode:"PL"},{name:"Středočeský kraj",shortCode:"ST"},{name:"Ústecký kraj",shortCode:"US"},{name:"Vysočina",shortCode:"VY"},{name:"Zlínský kraj",shortCode:"ZL"}]},{countryName:"Denmark",countryShortCode:"DK",regions:[{name:"Hovedstaden",shortCode:"84"},{name:"Kujalleq",shortCode:"GL-KU"},{name:"Midtjylland",shortCode:"82"},{name:"Norderøerne",shortCode:"FO-01"},{name:"Nordjylland",shortCode:"81"},{name:"Østerø",shortCode:"FO-06"},{name:"Qaasuitsup",shortCode:"GL-QA"},{name:"Qeqqata",shortCode:"GL-QE"},{name:"Sandø",shortCode:"FO-02"},{name:"Sermersooq",shortCode:"GL-SM"},{name:"Sjælland",shortCode:"85"},{name:"Strømø",shortCode:"FO-03"},{name:"Suderø",shortCode:"FO-04"},{name:"Syddanmark",shortCode:"83"},{name:"Vågø",shortCode:"FO-05"}]},{countryName:"Djibouti",countryShortCode:"DJ",regions:[{name:"Ali Sabieh",shortCode:"AS"},{name:"Arta",shortCode:"AR"},{name:"Dikhil",shortCode:"DI"},{name:"Obock",shortCode:"OB"},{name:"Tadjourah",shortCode:"TA"}]},{countryName:"Dominica",countryShortCode:"DM",regions:[{name:"Saint Andrew Parish",shortCode:"02"},{name:"Saint David Parish",shortCode:"03"},{name:"Saint George Parish",shortCode:"04"},{name:"Saint John Parish",shortCode:"05"},{name:"Saint Joseph Parish",shortCode:"06"},{name:"Saint Luke Parish",shortCode:"07"},{name:"Saint Mark Parish",shortCode:"08"},{name:"Saint Patrick Parish",shortCode:"09"},{name:"Saint Paul Parish",shortCode:"10"},{name:"Saint Peter Parish",shortCode:"11"}]},{countryName:"Dominican Republic",countryShortCode:"DO",regions:[{name:"Cibao Central",shortCode:"02"},{name:"Del Valle",shortCode:"37"},{name:"Distrito Nacional",shortCode:"01"},{name:"Enriquillo",shortCode:"38"},{name:"Norcentral",shortCode:"04"},{name:"Nordeste",shortCode:"34"},{name:"Noroeste",shortCode:"34"},{name:"Norte",shortCode:"35"},{name:"Valdesia",shortCode:"42"}]},{countryName:"Ecuador",countryShortCode:"EC",regions:[{name:"Azuay",shortCode:"A"},{name:"Bolívar",shortCode:"B"},{name:"Cañar",shortCode:"F"},{name:"Carchi",shortCode:"C"},{name:"Chimborazo",shortCode:"H"},{name:"Cotopaxi",shortCode:"X"},{name:"El Oro",shortCode:"O"},{name:"Esmeraldas",shortCode:"E"},{name:"Galápagos",shortCode:"W"},{name:"Guayas",shortCode:"G"},{name:"Imbabura",shortCode:"I"},{name:"Loja",shortCode:"L"},{name:"Los Ríos",shortCode:"R"},{name:"Manabí",shortCode:"M"},{name:"Morona-Santiago",shortCode:"S"},{name:"Napo",shortCode:"N"},{name:"Orellana",shortCode:"D"},{name:"Pastaza",shortCode:"Y"},{name:"Pichincha",shortCode:"P"},{name:"Santa Elena",shortCode:"SE"},{name:"Santo Domingo de los Tsáchilas",shortCode:"SD"},{name:"Sucumbíos",shortCode:"U"},{name:"Tungurahua",shortCode:"T"},{name:"Zamora-Chinchipe",shortCode:"Z"}]},{countryName:"Egypt",countryShortCode:"EG",regions:[{name:"Alexandria",shortCode:"ALX"},{name:"Aswan",shortCode:"ASN"},{name:"Asyout",shortCode:"AST"},{name:"Bani Sueif",shortCode:"BNS"},{name:"Beheira",shortCode:"BH"},{name:"Cairo",shortCode:"C"},{name:"Daqahlia",shortCode:"DK"},{name:"Dumiat",shortCode:"DT"},{name:"El Bahr El Ahmar",shortCode:"BA"},{name:"El Ismailia",shortCode:"IS"},{name:"El Suez",shortCode:"SUZ"},{name:"El Wadi El Gedeed",shortCode:"WAD"},{name:"Fayoum",shortCode:"FYM"},{name:"Gharbia",shortCode:"GH"},{name:"Giza",shortCode:"SUZ"},{name:"Helwan",shortCode:"HU"},{name:"Kafr El Sheikh",shortCode:"KFS"},{name:"Luxor",shortCode:"LX"},{name:"Matrouh",shortCode:"MT"},{name:"Menia",shortCode:"MN"},{name:"Menofia",shortCode:"MNF"},{name:"North Sinai",shortCode:"SIN"},{name:"Port Said",shortCode:"PTS"},{name:"Qalubia",shortCode:"KB"},{name:"Qena",shortCode:"KN"},{name:"Sharqia",shortCode:"SHR"},{name:"Sixth of October",shortCode:"SU"},{name:"Sohag",shortCode:"SHG"},{name:"South Sinai",shortCode:"JS"}]},{countryName:"El Salvador",countryShortCode:"SV",regions:[{name:"Ahuachapán",shortCode:"AH"},{name:"Cabañas",shortCode:"CA"},{name:"Cuscatlán",shortCode:"CU"},{name:"Chalatenango",shortCode:"CH"},{name:"La Libertad",shortCode:"LI"},{name:"La Paz",shortCode:"PA"},{name:"La Unión",shortCode:"UN"},{name:"Morazán",shortCode:"MO"},{name:"San Miguel",shortCode:"SM"},{name:"San Salvador",shortCode:"SS"},{name:"Santa Ana",shortCode:"SA"},{name:"San Vicente",shortCode:"SV"},{name:"Sonsonate",shortCode:"SO"},{name:"Usulután",shortCode:"US"}]},{countryName:"Equatorial Guinea",countryShortCode:"GQ",regions:[{name:"Annobón",shortCode:"AN"},{name:"Bioko Norte",shortCode:"BN"},{name:"Bioko Sur",shortCode:"BS"},{name:"Centro Sur",shortCode:"CS"},{name:"Kié-Ntem",shortCode:"KN"},{name:"Litoral",shortCode:"LI"},{name:"Wele-Nzas",shortCode:"WN"}]},{countryName:"Eritrea",countryShortCode:"ER",regions:[{name:"Anseba",shortCode:"AN"},{name:"Debub",shortCode:"DU"},{name:"Debub-Keih-Bahri",shortCode:"DK"},{name:"Gash-Barka",shortCode:"GB"},{name:"Maekel",shortCode:"MA"},{name:"Semien-Keih-Bahri",shortCode:"SK"}]},{countryName:"Estonia",countryShortCode:"EE",regions:[{name:"Harjumaa (Tallinn)",shortCode:"37"},{name:"Hiiumaa (Kardla)",shortCode:"39"},{name:"Ida-Virumaa (Johvi)",shortCode:"44"},{name:"Järvamaa (Paide)",shortCode:"41"},{name:"Jõgevamaa (Jogeva)",shortCode:"49"},{name:"Läänemaa",shortCode:"57"},{name:"Lääne-Virumaa (Rakvere)",shortCode:"59"},{name:"Pärnumaa (Parnu)",shortCode:"67"},{name:"Põlvamaa (Polva)",shortCode:"65"},{name:"Raplamaa (Rapla)",shortCode:"70"},{name:"Saaremaa (Kuessaare)",shortCode:"74"},{name:"Tartumaa (Tartu)",shortCode:"78"},{name:"Valgamaa (Valga)",shortCode:"82"},{name:"Viljandimaa (Viljandi)",shortCode:"84"},{name:"Võrumaa (Voru)",shortCode:"86"}]},{countryName:"Ethiopia",countryShortCode:"ET",regions:[{name:"Addis Ababa",shortCode:"AA"},{name:"Afar",shortCode:"AF"},{name:"Amhara",shortCode:"AM"},{name:"Benshangul-Gumaz",shortCode:"BE"},{name:"Dire Dawa",shortCode:"DD"},{name:"Gambela",shortCode:"GA"},{name:"Harari",shortCode:"HA"},{name:"Oromia",shortCode:"OR"},{name:"Somali",shortCode:"SO"},{name:"Southern Nations Nationalities and People's Region",shortCode:"SN"},{name:"Tigray",shortCode:"TI"}]},{countryName:"Falkland Islands (Islas Malvinas)",countryShortCode:"FK",regions:[{name:"Falkland Islands (Islas Malvinas)"}]},{countryName:"Faroe Islands",countryShortCode:"FO",regions:[{name:"Bordoy"},{name:"Eysturoy"},{name:"Mykines"},{name:"Sandoy"},{name:"Skuvoy"},{name:"Streymoy"},{name:"Suduroy"},{name:"Tvoroyri"},{name:"Vagar"}]},{countryName:"Fiji",countryShortCode:"FJ",regions:[{name:"Ba",shortCode:"01"},{name:"Bua",shortCode:"01"},{name:"Cakaudrove",shortCode:"03"},{name:"Kadavu",shortCode:"04"},{name:"Lau",shortCode:"05"},{name:"Lomaiviti",shortCode:"06"},{name:"Macuata",shortCode:"07"},{name:"Nadroga and Navosa",shortCode:"08"},{name:"Naitasiri",shortCode:"09"},{name:"Namosi",shortCode:"10"},{name:"Ra",shortCode:"011"},{name:"Rewa",shortCode:"12"},{name:"Rotuma",shortCode:"R"},{name:"Serua",shortCode:"12"},{name:"Tailevu",shortCode:"14"}]},{countryName:"Finland",countryShortCode:"FI",regions:[{name:"Ahvenanmaan lääni",shortCode:"AL"},{name:"Etelä-Suomen lääni",shortCode:"ES"},{name:"Itä-Suomen lääni",shortCode:"IS"},{name:"Länsi-Suomen lääni",shortCode:"LS"},{name:"Lapin lääni",shortCode:"LL"},{name:"Oulun lääni",shortCode:"OL"}]},{countryName:"France",countryShortCode:"FR",regions:[{name:"Auvergne-Rhône-Alpes",shortCode:"ARA"},{name:"Bourgogne-Franche-Comté",shortCode:"BFC"},{name:"Bretagne",shortCode:"BRE"},{name:"Centre-Val de Loire",shortCode:"CVL"},{name:"Corse",shortCode:"COR"},{name:"Grand Est",shortCode:"GES"},{name:"Hauts-de-France",shortCode:"HDF"},{name:"Île-de-France",shortCode:"IDF"},{name:"Normandie",shortCode:"NOR"},{name:"Nouvelle-Aquitaine",shortCode:"NAQ"},{name:"Occitanie",shortCode:"OCC"},{name:"Pays de la Loire",shortCode:"PDL"},{name:"Provence-Alpes-Cote d'Azur",shortCode:"PAC"},{name:"Clipperton",shortCode:"CP"},{name:"Guadeloupe",shortCode:"GP"},{name:"Guyane",shortCode:"GF"},{name:"Martinique",shortCode:"MQ"},{name:"Mayotte",shortCode:"YT"},{name:"Novelle-Calédonie",shortCode:"NC"},{name:"Polynésie",shortCode:"PF"},{name:"Saint-Pierre-et-Miquelon",shortCode:"PM"},{name:"Saint Barthélemy",shortCode:"BL"},{name:"Saint Martin",shortCode:"MF"},{name:"Réunion",shortCode:"RE"},{name:"Terres Australes Françaises",shortCode:"TF"},{name:"Wallis-et-Futuna",shortCode:"WF"}]},{countryName:"French Guiana",countryShortCode:"GF",regions:[{name:"French Guiana"}]},{countryName:"French Polynesia",countryShortCode:"PF",regions:[{name:"Archipel des Marquises"},{name:"Archipel des Tuamotu"},{name:"Archipel des Tubuai"},{name:"Iles du Vent"},{name:"Iles Sous-le-Vent"}]},{countryName:"French Southern and Antarctic Lands",countryShortCode:"TF",regions:[{name:"Adelie Land"},{name:"Ile Crozet"},{name:"Iles Kerguelen"},{name:"Iles Saint-Paul et Amsterdam"}]},{countryName:"Gabon",countryShortCode:"GA",regions:[{name:"Estuaire",shortCode:"1"},{name:"Haut-Ogooué",shortCode:"2"},{name:"Moyen-Ogooué",shortCode:"3"},{name:"Ngounié",shortCode:"4"},{name:"Nyanga",shortCode:"5"},{name:"Ogooué-Ivindo",shortCode:"6"},{name:"Ogooué-Lolo",shortCode:"7"},{name:"Ogooué-Maritime",shortCode:"8"},{name:"Woleu-Ntem",shortCode:"9"}]},{countryName:"Gambia, The",countryShortCode:"GM",regions:[{name:"Banjul",shortCode:"B"},{name:"Central River",shortCode:"M"},{name:"Lower River",shortCode:"L"},{name:"North Bank",shortCode:"N"},{name:"Upper River",shortCode:"U"},{name:"Western",shortCode:"W"}]},{countryName:"Georgia",countryShortCode:"GE",regions:[{name:"Abkhazia (Sokhumi)",shortCode:"AB"},{name:"Ajaria (Bat'umi)",shortCode:"AJ"},{name:"Guria",shortCode:"GU"},{name:"Imereti",shortCode:"IM"},{name:"K'akheti",shortCode:"KA"},{name:"Kvemo Kartli",shortCode:"KK"},{name:"Mtshkheta-Mtianeti",shortCode:"MM"},{name:"Rach'a-Lexhkumi-KvemoSvaneti",shortCode:"RL"},{name:"Samegrelo-Zemo Svaneti",shortCode:"SZ"},{name:"Samtskhe-Javakheti",shortCode:"SJ"},{name:"Shida Kartli",shortCode:"SK"},{name:"Tbilisi",shortCode:"TB"}]},{countryName:"Germany",countryShortCode:"DE",regions:[{name:"Baden-Württemberg",shortCode:"BW"},{name:"Bayern",shortCode:"BY"},{name:"Berlin",shortCode:"BE"},{name:"Brandenburg",shortCode:"BB"},{name:"Bremen",shortCode:"HB"},{name:"Hamburg",shortCode:"HH"},{name:"Hessen",shortCode:"HE"},{name:"Mecklenburg-Vorpommern",shortCode:"MV"},{name:"Niedersachsen",shortCode:"NI"},{name:"Nordrhein-Westfalen",shortCode:"NW"},{name:"Rheinland-Pfalz",shortCode:"RP"},{name:"Saarland",shortCode:"SL"},{name:"Sachsen",shortCode:"SN"},{name:"Sachsen-Anhalt",shortCode:"ST"},{name:"Schleswig-Holstein",shortCode:"SH"},{name:"Thüringen",shortCode:"TH"}]},{countryName:"Ghana",countryShortCode:"GH",regions:[{name:"Ahafo"},{name:"Ashanti",shortCode:"AH"},{name:"Bono"},{name:"Bono East"},{name:"Central",shortCode:"CP"},{name:"Eastern",shortCode:"EP"},{name:"Greater Accra",shortCode:"AA"},{name:"Northern",shortCode:"NP"},{name:"North East"},{name:"Oti"},{name:"Savannah"},{name:"Upper East",shortCode:"UE"},{name:"Upper West",shortCode:"UW"},{name:"Volta",shortCode:"TV"},{name:"Western",shortCode:"WP"},{name:"Western North"}]},{countryName:"Gibraltar",countryShortCode:"GI",regions:[{name:"Gibraltar"}]},{countryName:"Greece",countryShortCode:"GR",regions:[{name:"Anatolikí Makedonía kai Thráki",shortCode:"A"},{name:"Attikḯ",shortCode:"I"},{name:"Dytikí Elláda",shortCode:"G"},{name:"Dytikí Makedonía",shortCode:"C"},{name:"Ionía Nísia",shortCode:"F"},{name:"Kentrikí Makedonía",shortCode:"B"},{name:"Krítí",shortCode:"M"},{name:"Notío Aigaío",shortCode:"L"},{name:"Peloponnísos",shortCode:"J"},{name:"Stereá Elláda",shortCode:"H"},{name:"Thessalía",shortCode:"E"},{name:"Voreío Aigaío",shortCode:"K"},{name:"Ípeiros",shortCode:"D"},{name:"Ágion Óros",shortCode:"69"}]},{countryName:"Greenland",countryShortCode:"GL",regions:[{name:"Kommune Kujalleq",shortCode:"KU"},{name:"Kommuneqarfik Sermersooq",shortCode:"SM"},{name:"Qaasuitsup Kommunia",shortCode:"QA"},{name:"Qeqqata Kommunia",shortCode:"QE"}]},{countryName:"Grenada",countryShortCode:"GD",regions:[{name:"Saint Andrew",shortCode:"01"},{name:"Saint David",shortCode:"02"},{name:"Saint George",shortCode:"03"},{name:"Saint John",shortCode:"04"},{name:"Saint Mark",shortCode:"05"},{name:"Saint Patrick",shortCode:"06"},{name:"Southern Grenadine Islands",shortCode:"10"}]},{countryName:"Guadeloupe",countryShortCode:"GP",regions:[{name:"Guadeloupe"}]},{countryName:"Guam",countryShortCode:"GU",regions:[{name:"Guam"}]},{countryName:"Guatemala",countryShortCode:"GT",regions:[{name:"Alta Verapaz",shortCode:"AV"},{name:"Baja Verapaz",shortCode:"BV"},{name:"Chimaltenango",shortCode:"CM"},{name:"Chiquimula",shortCode:"CQ"},{name:"El Progreso",shortCode:"PR"},{name:"Escuintla",shortCode:"ES"},{name:"Guatemala",shortCode:"GU"},{name:"Huehuetenango",shortCode:"HU"},{name:"Izabal",shortCode:"IZ"},{name:"Jalapa",shortCode:"JA"},{name:"Jutiapa",shortCode:"JU"},{name:"Petén",shortCode:"PE"},{name:"Quetzaltenango",shortCode:"QZ"},{name:"Quiché",shortCode:"QC"},{name:"Retalhuleu",shortCode:"Re"},{name:"Sacatepéquez",shortCode:"SA"},{name:"San Marcos",shortCode:"SM"},{name:"Santa Rosa",shortCode:"SR"},{name:"Sololá",shortCode:"SO"},{name:"Suchitepéquez",shortCode:"SU"},{name:"Totonicapán",shortCode:"TO"},{name:"Zacapa",shortCode:"ZA"}]},{countryName:"Guernsey",countryShortCode:"GG",regions:[{name:"Castel"},{name:"Forest"},{name:"St. Andrew"},{name:"St. Martin"},{name:"St. Peter Port"},{name:"St. Pierre du Bois"},{name:"St. Sampson"},{name:"St. Saviour"},{name:"Torteval"},{name:"Vale"}]},{countryName:"Guinea",countryShortCode:"GN",regions:[{name:"Boké",shortCode:"B"},{name:"Conakry",shortCode:"C"},{name:"Faranah",shortCode:"F"},{name:"Kankan",shortCode:"K"},{name:"Kindia",shortCode:"D"},{name:"Labé",shortCode:"L"},{name:"Mamou",shortCode:"M"},{name:"Nzérékoré",shortCode:"N"}]},{countryName:"Guinea-Bissau",countryShortCode:"GW",regions:[{name:"Bafatá",shortCode:"BA"},{name:"Biombo",shortCode:"BM"},{name:"Bissau",shortCode:"BS"},{name:"Bolama-Bijagos",shortCode:"BL"},{name:"Cacheu",shortCode:"CA"},{name:"Gabú",shortCode:"GA"},{name:"Oio",shortCode:"OI"},{name:"Quinara",shortCode:"QU"},{name:"Tombali",shortCode:"TO"}]},{countryName:"Guyana",countryShortCode:"GY",regions:[{name:"Barima-Waini",shortCode:"BA"},{name:"Cuyuni-Mazaruni",shortCode:"CU"},{name:"Demerara-Mahaica",shortCode:"DE"},{name:"East Berbice-Corentyne",shortCode:"EB"},{name:"Essequibo Islands-West Demerara",shortCode:"ES"},{name:"Mahaica-Berbice",shortCode:"MA"},{name:"Pomeroon-Supenaam",shortCode:"PM"},{name:"Potaro-Siparuni",shortCode:"PT"},{name:"Upper Demerara-Berbice",shortCode:"UD"},{name:"Upper Takutu-Upper Essequibo",shortCode:"UT"}]},{countryName:"Haiti",countryShortCode:"HT",regions:[{name:"Artibonite",shortCode:"AR"},{name:"Centre",shortCode:"CE"},{name:"Grand'Anse",shortCode:"GA"},{name:"Nippes",shortCode:"NI"},{name:"Nord",shortCode:"ND"},{name:"Nord-Est",shortCode:"NE"},{name:"Nord-Ouest",shortCode:"NO"},{name:"Ouest",shortCode:"OU"},{name:"Sud",shortCode:"SD"},{name:"Sud-Est",shortCode:"SE"}]},{countryName:"Heard Island and McDonald Islands",countryShortCode:"HM",regions:[{name:"Heard Island and McDonald Islands"}]},{countryName:"Holy See (Vatican City)",countryShortCode:"VA",regions:[{name:"Holy See (Vatican City)",shortCode:"01"}]},{countryName:"Honduras",countryShortCode:"HN",regions:[{name:"Atlántida",shortCode:"AT"},{name:"Choluteca",shortCode:"CH"},{name:"Colón",shortCode:"CL"},{name:"Comayagua",shortCode:"CM"},{name:"Copán",shortCode:"CP"},{name:"Cortés",shortCode:"CR"},{name:"El Paraíso",shortCode:"EP"},{name:"Francisco Morazan",shortCode:"FM"},{name:"Gracias a Dios",shortCode:"GD"},{name:"Intibucá",shortCode:"IN"},{name:"Islas de la Bahía",shortCode:"IB"},{name:"La Paz",shortCode:"LP"},{name:"Lempira",shortCode:"LE"},{name:"Ocotepeque",shortCode:"OC"},{name:"Olancho",shortCode:"OL"},{name:"Santa Bárbara",shortCode:"SB"},{name:"Valle",shortCode:"VA"},{name:"Yoro",shortCode:"YO"}]},{countryName:"Hong Kong",countryShortCode:"HK",regions:[{name:"Hong Kong",shortCode:"HK"}]},{countryName:"Hungary",countryShortCode:"HU",regions:[{name:"Bács-Kiskun",shortCode:"BK"},{name:"Baranya",shortCode:"BA"},{name:"Békés",shortCode:"BE"},{name:"Békéscsaba",shortCode:"BC"},{name:"Borsod-Abauj-Zemplen",shortCode:"BZ"},{name:"Budapest",shortCode:"BU"},{name:"Csongrád",shortCode:"CS"},{name:"Debrecen",shortCode:"DE"},{name:"Dunaújváros",shortCode:"DU"},{name:"Eger",shortCode:"EG"},{name:"Érd",shortCode:"ER"},{name:"Fejér",shortCode:"FE"},{name:"Győr",shortCode:"GY"},{name:"Győr-Moson-Sopron",shortCode:"GS"},{name:"Hajdú-Bihar",shortCode:"HB"},{name:"Heves",shortCode:"HE"},{name:"Hódmezővásárhely",shortCode:"HV"},{name:"Jász-Nagykun-Szolnok",shortCode:"N"},{name:"Kaposvár",shortCode:"KV"},{name:"Kecskemét",shortCode:"KM"},{name:"Komárom-Esztergom",shortCode:"KE"},{name:"Miskolc",shortCode:"MI"},{name:"Nagykanizsa",shortCode:"NK"},{name:"Nógrád",shortCode:"NO"},{name:"Nyíregyháza",shortCode:"NY"},{name:"Pécs",shortCode:"PS"},{name:"Pest",shortCode:"PE"},{name:"Salgótarján",shortCode:"ST"},{name:"Somogy",shortCode:"SO"},{name:"Sopron",shortCode:"SN"},{name:"Szabolcs-á-Bereg",shortCode:"SZ"},{name:"Szeged",shortCode:"SD"},{name:"Székesfehérvár",shortCode:"SF"},{name:"Szekszárd",shortCode:"SS"},{name:"Szolnok",shortCode:"SK"},{name:"Szombathely",shortCode:"SH"},{name:"Tatabánya",shortCode:"TB"},{name:"Tolna",shortCode:"TO"},{name:"Vas",shortCode:"VA"},{name:"Veszprém",shortCode:"VE"},{name:"Veszprém (City)",shortCode:"VM"},{name:"Zala",shortCode:"ZA"},{name:"Zalaegerszeg",shortCode:"ZE"}]},{countryName:"Iceland",countryShortCode:"IS",regions:[{name:"Austurland",shortCode:"7"},{name:"Höfuðborgarsvæði utan Reykjavíkur",shortCode:"1"},{name:"Norðurland eystra",shortCode:"6"},{name:"Norðurland vestra",shortCode:"5"},{name:"Suðurland",shortCode:"8"},{name:"Suðurnes",shortCode:"2"},{name:"Vestfirðir",shortCode:"4"},{name:"Vesturland",shortCode:"3"}]},{countryName:"India",countryShortCode:"IN",regions:[{name:"Andaman and Nicobar Islands",shortCode:"AN"},{name:"Andhra Pradesh",shortCode:"AP"},{name:"Arunachal Pradesh",shortCode:"AR"},{name:"Assam",shortCode:"AS"},{name:"Bihar",shortCode:"BR"},{name:"Chandigarh",shortCode:"CH"},{name:"Chhattisgarh",shortCode:"CT"},{name:"Dadra and Nagar Haveli",shortCode:"DN"},{name:"Daman and Diu",shortCode:"DD"},{name:"Delhi",shortCode:"DL"},{name:"Goa",shortCode:"GA"},{name:"Gujarat",shortCode:"GJ"},{name:"Haryana",shortCode:"HR"},{name:"Himachal Pradesh",shortCode:"HP"},{name:"Jammu and Kashmir",shortCode:"JK"},{name:"Jharkhand",shortCode:"JH"},{name:"Karnataka",shortCode:"KA"},{name:"Kerala",shortCode:"KL"},{name:"Ladakh",shortCode:"LA"},{name:"Lakshadweep",shortCode:"LD"},{name:"Madhya Pradesh",shortCode:"MP"},{name:"Maharashtra",shortCode:"MH"},{name:"Manipur",shortCode:"MN"},{name:"Meghalaya",shortCode:"ML"},{name:"Mizoram",shortCode:"MZ"},{name:"Nagaland",shortCode:"NL"},{name:"Odisha",shortCode:"OR"},{name:"Puducherry",shortCode:"PY"},{name:"Punjab",shortCode:"PB"},{name:"Rajasthan",shortCode:"RJ"},{name:"Sikkim",shortCode:"WK"},{name:"Tamil Nadu",shortCode:"TN"},{name:"Telangana",shortCode:"TG"},{name:"Tripura",shortCode:"TR"},{name:"Uttarakhand",shortCode:"UT"},{name:"Uttar Pradesh",shortCode:"UP"},{name:"West Bengal",shortCode:"WB"}]},{countryName:"Indonesia",countryShortCode:"ID",regions:[{name:"Aceh",shortCode:"AC"},{name:"Bali",shortCode:"BA"},{name:"Bangka Belitung",shortCode:"BB"},{name:"Banten",shortCode:"BT"},{name:"Bengkulu",shortCode:"BE"},{name:"Gorontalo",shortCode:"GO"},{name:"Jakarta Raya",shortCode:"JK"},{name:"Jambi",shortCode:"JA"},{name:"Jawa Barat",shortCode:"JB"},{name:"Jawa Tengah",shortCode:"JT"},{name:"Jawa Timur",shortCode:"JI"},{name:"Kalimantan Barat",shortCode:"KB"},{name:"Kalimantan Selatan",shortCode:"KS"},{name:"Kalimantan Tengah",shortCode:"KT"},{name:"Kalimantan Timur",shortCode:"KI"},{name:"Kalimantan Utara",shortCode:"KU"},{name:"Kepulauan Riau",shortCode:"KR"},{name:"Lampung",shortCode:"LA"},{name:"Maluku",shortCode:"MA"},{name:"Maluku Utara",shortCode:"MU"},{name:"Nusa Tenggara Barat",shortCode:"NB"},{name:"Nusa Tenggara Timur",shortCode:"NT"},{name:"Papua",shortCode:"PA"},{name:"Papua Barat",shortCode:"PB"},{name:"Riau",shortCode:"RI"},{name:"Sulawesi Selatan",shortCode:"SR"},{name:"Sulawesi Tengah",shortCode:"ST"},{name:"Sulawesi Tenggara",shortCode:"SG"},{name:"Sulawesi Utara",shortCode:"SA"},{name:"Sumatera Barat",shortCode:"SB"},{name:"Sumatera Selatan",shortCode:"SS"},{name:"Sumatera Utara",shortCode:"SU"},{name:"Yogyakarta",shortCode:"YO"}]},{countryName:"Iran, Islamic Republic of",countryShortCode:"IR",regions:[{name:"Alborz",shortCode:"32"},{name:"Ardabīl",shortCode:"03"},{name:"Āz̄arbāyjān-e Gharbī",shortCode:"02"},{name:"Āz̄arbāyjān-e Sharqī",shortCode:"01"},{name:"Būshehr",shortCode:"06"},{name:"Chahār Maḩāl va Bakhtīārī",shortCode:"08"},{name:"Eşfahān",shortCode:"04"},{name:"Fārs",shortCode:"14"},{name:"Gīlān",shortCode:"19"},{name:"Golestān",shortCode:"27"},{name:"Hamadān",shortCode:"24"},{name:"Hormozgān",shortCode:"23"},{name:"Īlām",shortCode:"05"},{name:"Kermān",shortCode:"15"},{name:"Kermānshāh",shortCode:"17"},{name:"Khorāsān-e Jonūbī",shortCode:"29"},{name:"Khorāsān-e Raẕavī",shortCode:"30"},{name:"Khorāsān-e Shomālī",shortCode:"61"},{name:"Khūzestān",shortCode:"10"},{name:"Kohgīlūyeh va Bowyer Aḩmad",shortCode:"18"},{name:"Kordestān",shortCode:"16"},{name:"Lorestān",shortCode:"20"},{name:"Markazi",shortCode:"22"},{name:"Māzandarān",shortCode:"21"},{name:"Qazvīn",shortCode:"28"},{name:"Qom",shortCode:"26"},{name:"Semnān",shortCode:"12"},{name:"Sīstān va Balūchestān",shortCode:"13"},{name:"Tehrān",shortCode:"07"},{name:"Yazd",shortCode:"25"},{name:"Zanjān",shortCode:"11"}]},{countryName:"Iraq",countryShortCode:"IQ",regions:[{name:"Al Anbār",shortCode:"AN"},{name:"Al Başrah",shortCode:"BA"},{name:"Al Muthanná",shortCode:"MU"},{name:"Al Qādisīyah",shortCode:"QA"},{name:"An Najaf",shortCode:"NA"},{name:"Arbīl",shortCode:"AR"},{name:"As Sulaymānīyah",shortCode:"SU"},{name:"Bābil",shortCode:"BB"},{name:"Baghdād",shortCode:"BG"},{name:"Dohuk",shortCode:"DA"},{name:"Dhī Qār",shortCode:"DQ"},{name:"Diyālá",shortCode:"DI"},{name:"Karbalā'",shortCode:"KA"},{name:"Kirkuk",shortCode:"KI"},{name:"Maysān",shortCode:"MA"},{name:"Nīnawá",shortCode:"NI"},{name:"Şalāḩ ad Dīn",shortCode:"SD"},{name:"Wāsiţ",shortCode:"WA"}]},{countryName:"Ireland",countryShortCode:"IE",regions:[{name:"Carlow",shortCode:"CW"},{name:"Cavan",shortCode:"CN"},{name:"Clare",shortCode:"CE"},{name:"Cork",shortCode:"CO"},{name:"Donegal",shortCode:"DL"},{name:"Dublin",shortCode:"D"},{name:"Galway",shortCode:"G"},{name:"Kerry",shortCode:"KY"},{name:"Kildare",shortCode:"KE"},{name:"Kilkenny",shortCode:"KK"},{name:"Laois",shortCode:"LS"},{name:"Leitrim",shortCode:"LM"},{name:"Limerick",shortCode:"LK"},{name:"Longford",shortCode:"LD"},{name:"Louth",shortCode:"LH"},{name:"Mayo",shortCode:"MO"},{name:"Meath",shortCode:"MH"},{name:"Monaghan",shortCode:"MN"},{name:"Offaly",shortCode:"OY"},{name:"Roscommon",shortCode:"RN"},{name:"Sligo",shortCode:"SO"},{name:"Tipperary",shortCode:"TA"},{name:"Waterford",shortCode:"WD"},{name:"Westmeath",shortCode:"WH"},{name:"Wexford",shortCode:"WX"},{name:"Wicklow",shortCode:"WW"}]},{countryName:"Isle of Man",countryShortCode:"IM",regions:[{name:"Isle of Man"}]},{countryName:"Israel",countryShortCode:"IL",regions:[{name:"HaDarom",shortCode:"D"},{name:"HaMerkaz",shortCode:"M"},{name:"HaTsafon",shortCode:"Z"},{name:"H̱efa",shortCode:"HA"},{name:"Tel-Aviv",shortCode:"TA"},{name:"Yerushalayim",shortCode:"JM"}]},{countryName:"Italy",countryShortCode:"IT",regions:[{name:"Abruzzo",shortCode:"65"},{name:"Basilicata",shortCode:"77"},{name:"Calabria",shortCode:"78"},{name:"Campania",shortCode:"72"},{name:"Emilia-Romagna",shortCode:"45"},{name:"Friuli-Venezia Giulia",shortCode:"36"},{name:"Lazio",shortCode:"62"},{name:"Liguria",shortCode:"42"},{name:"Lombardia",shortCode:"25"},{name:"Marche",shortCode:"57"},{name:"Molise",shortCode:"67"},{name:"Piemonte",shortCode:"21"},{name:"Puglia",shortCode:"75"},{name:"Sardegna",shortCode:"88"},{name:"Sicilia",shortCode:"82"},{name:"Toscana",shortCode:"52"},{name:"Trentino-Alto Adige",shortCode:"32"},{name:"Umbria",shortCode:"55"},{name:"Valle d'Aosta",shortCode:"23"},{name:"Veneto",shortCode:"34"}]},{countryName:"Jamaica",countryShortCode:"JM",regions:[{name:"Clarendon",shortCode:"13"},{name:"Hanover",shortCode:"09"},{name:"Kingston",shortCode:"01"},{name:"Manchester",shortCode:"12"},{name:"Portland",shortCode:"04"},{name:"Saint Andrew",shortCode:"02"},{name:"Saint Ann",shortCode:"06"},{name:"Saint Catherine",shortCode:"14"},{name:"Saint Elizabeth",shortCode:"11"},{name:"Saint James",shortCode:"08"},{name:"Saint Mary",shortCode:"05"},{name:"Saint Thomas",shortCode:"03"},{name:"Trelawny",shortCode:"07"},{name:"Westmoreland",shortCode:"10"}]},{countryName:"Japan",countryShortCode:"JP",regions:[{name:"Aichi",shortCode:"23"},{name:"Akita",shortCode:"05"},{name:"Aomori",shortCode:"02"},{name:"Chiba",shortCode:"12"},{name:"Ehime",shortCode:"38"},{name:"Fukui",shortCode:"18"},{name:"Fukuoka",shortCode:"40"},{name:"Fukushima",shortCode:"07"},{name:"Gifu",shortCode:"21"},{name:"Gunma",shortCode:"10"},{name:"Hiroshima",shortCode:"34"},{name:"Hokkaido",shortCode:"01"},{name:"Hyogo",shortCode:"28"},{name:"Ibaraki",shortCode:"08"},{name:"Ishikawa",shortCode:"17"},{name:"Iwate",shortCode:"03"},{name:"Kagawa",shortCode:"37"},{name:"Kagoshima",shortCode:"46"},{name:"Kanagawa",shortCode:"14"},{name:"Kochi",shortCode:"39"},{name:"Kumamoto",shortCode:"43"},{name:"Kyoto",shortCode:"26"},{name:"Mie",shortCode:"24"},{name:"Miyagi",shortCode:"04"},{name:"Miyazaki",shortCode:"45"},{name:"Nagano",shortCode:"20"},{name:"Nagasaki",shortCode:"42"},{name:"Nara",shortCode:"29"},{name:"Niigata",shortCode:"15"},{name:"Oita",shortCode:"44"},{name:"Okayama",shortCode:"33"},{name:"Okinawa",shortCode:"47"},{name:"Osaka",shortCode:"27"},{name:"Saga",shortCode:"41"},{name:"Saitama",shortCode:"11"},{name:"Shiga",shortCode:"25"},{name:"Shimane",shortCode:"32"},{name:"Shizuoka",shortCode:"22"},{name:"Tochigi",shortCode:"09"},{name:"Tokushima",shortCode:"36"},{name:"Tokyo",shortCode:"13"},{name:"Tottori",shortCode:"31"},{name:"Toyama",shortCode:"16"},{name:"Wakayama",shortCode:"30"},{name:"Yamagata",shortCode:"06"},{name:"Yamaguchi",shortCode:"35"},{name:"Yamanashi",shortCode:"19"}]},{countryName:"Jersey",countryShortCode:"JE",regions:[{name:"Jersey"}]},{countryName:"Jordan",countryShortCode:"JO",regions:[{name:"‘Ajlūn",shortCode:"AJ"},{name:"Al 'Aqabah",shortCode:"AQ"},{name:"Al Balqā’",shortCode:"BA"},{name:"Al Karak",shortCode:"KA"},{name:"Al Mafraq",shortCode:"MA"},{name:"Al ‘A̅şimah",shortCode:"AM"},{name:"Aţ Ţafīlah",shortCode:"AT"},{name:"Az Zarqā’",shortCode:"AZ"},{name:"Irbid",shortCode:"IR"},{name:"Jarash",shortCode:"JA"},{name:"Ma‘ān",shortCode:"MN"},{name:"Mādabā",shortCode:"MD"}]},{countryName:"Kazakhstan",countryShortCode:"KZ",regions:[{name:"Almaty",shortCode:"ALA"},{name:"Aqmola",shortCode:"AKM"},{name:"Aqtobe",shortCode:"AKT"},{name:"Astana",shortCode:"AST"},{name:"Atyrau",shortCode:"ATY"},{name:"Batys Qazaqstan",shortCode:"ZAP"},{name:"Bayqongyr"},{name:"Mangghystau",shortCode:"MAN"},{name:"Ongtustik Qazaqstan",shortCode:"YUZ"},{name:"Pavlodar",shortCode:"PAV"},{name:"Qaraghandy",shortCode:"KAR"},{name:"Qostanay",shortCode:"KUS"},{name:"Qyzylorda",shortCode:"KZY"},{name:"Shyghys Qazaqstan",shortCode:"VOS"},{name:"Soltustik Qazaqstan",shortCode:"SEV"},{name:"Zhambyl",shortCode:"ZHA"}]},{countryName:"Kenya",countryShortCode:"KE",regions:[{name:"Baringo",shortCode:"01"},{name:"Bomet",shortCode:"02"},{name:"Bungoma",shortCode:"03"},{name:"Busia",shortCode:"04"},{name:"Eleyo/Marakwet",shortCode:"05"},{name:"Embu",shortCode:"06"},{name:"Garissa",shortCode:"07"},{name:"Homa Bay",shortCode:"08"},{name:"Isiolo",shortCode:"09"},{name:"Kajiado",shortCode:"10"},{name:"Kakamega",shortCode:"11"},{name:"Kericho",shortCode:"12"},{name:"Kiambu",shortCode:"13"},{name:"Kilifi",shortCode:"14"},{name:"Kirinyaga",shortCode:"15"},{name:"Kisii",shortCode:"16"},{name:"Kisumu",shortCode:"17"},{name:"Kitui",shortCode:"18"},{name:"Kwale",shortCode:"19"},{name:"Laikipia",shortCode:"20"},{name:"Lamu",shortCode:"21"},{name:"Machakos",shortCode:"22"},{name:"Makueni",shortCode:"23"},{name:"Mandera",shortCode:"24"},{name:"Marsabit",shortCode:"25"},{name:"Meru",shortCode:"26"},{name:"Migori",shortCode:"27"},{name:"Mombasa",shortCode:"28"},{name:"Murang'a",shortCode:"29"},{name:"Nairobi City",shortCode:"30"},{name:"Nakuru",shortCode:"31"},{name:"Nandi",shortCode:"32"},{name:"Narok",shortCode:"33"},{name:"Nyamira",shortCode:"34"},{name:"Nyandarua",shortCode:"35"},{name:"Nyeri",shortCode:"36"},{name:"Samburu",shortCode:"37"},{name:"Siaya",shortCode:"38"},{name:"Taita/Taveta",shortCode:"39"},{name:"Tana River",shortCode:"40"},{name:"Tharaka-Nithi",shortCode:"41"},{name:"Trans Nzoia",shortCode:"42"},{name:"Turkana",shortCode:"43"},{name:"Uasin Gishu",shortCode:"44"},{name:"Vihiga",shortCode:"45"},{name:"Wajir",shortCode:"46"},{name:"West Pokot",shortCode:"47"}]},{countryName:"Kiribati",countryShortCode:"KI",regions:[{name:"Abaiang"},{name:"Abemama"},{name:"Aranuka"},{name:"Arorae"},{name:"Banaba"},{name:"Beru"},{name:"Butaritari"},{name:"Central Gilberts"},{name:"Gilbert Islands",shortCode:"G"},{name:"Kanton"},{name:"Kiritimati"},{name:"Kuria"},{name:"Line Islands",shortCode:"L"},{name:"Maiana"},{name:"Makin"},{name:"Marakei"},{name:"Nikunau"},{name:"Nonouti"},{name:"Northern Gilberts"},{name:"Onotoa"},{name:"Phoenix Islands",shortCode:"P"},{name:"Southern Gilberts"},{name:"Tabiteuea"},{name:"Tabuaeran"},{name:"Tamana"},{name:"Tarawa"},{name:"Teraina"}]},{countryName:"Korea, Democratic People's Republic of",countryShortCode:"KP",regions:[{name:"Chagang-do (Chagang Province)",shortCode:"04"},{name:"Hamgyong-bukto (North Hamgyong Province)",shortCode:"09"},{name:"Hamgyong-namdo (South Hamgyong Province)",shortCode:"08"},{name:"Hwanghae-bukto (North Hwanghae Province)",shortCode:"06"},{name:"Hwanghae-namdo (South Hwanghae Province)",shortCode:"05"},{name:"Kangwon-do (Kangwon Province)",shortCode:"07"},{name:"Nasŏn (Najin-Sŏnbong)",shortCode:"13"},{name:"P'yongan-bukto (North P'yongan Province)",shortCode:"03"},{name:"P'yongan-namdo (South P'yongan Province)",shortCode:"02"},{name:"P'yongyang-si (P'yongyang City)",shortCode:"01"},{name:"Yanggang-do (Yanggang Province)",shortCode:"10"}]},{countryName:"Korea, Republic of",countryShortCode:"KR",regions:[{name:"Ch'ungch'ongbuk-do",shortCode:"43"},{name:"Ch'ungch'ongnam-do",shortCode:"44"},{name:"Cheju-do",shortCode:"49"},{name:"Chollabuk-do",shortCode:"45"},{name:"Chollanam-do",shortCode:"46"},{name:"Inch'on-Kwangyokhi",shortCode:"28"},{name:"Kang-won-do",shortCode:"42"},{name:"Kwangju-Kwangyokshi",shortCode:"28"},{name:"Kyonggi-do",shortCode:"41"},{name:"Kyongsangbuk-do",shortCode:"47"},{name:"Kyongsangnam-do",shortCode:"48"},{name:"Pusan-Kwangyokshi",shortCode:"26"},{name:"Seoul-T'ukpyolshi",shortCode:"11"},{name:"Sejong",shortCode:"50"},{name:"Taegu-Kwangyokshi",shortCode:"27"},{name:"Taejon-Kwangyokshi",shortCode:"30"},{name:"Ulsan-Kwangyokshi",shortCode:"31"}]},{countryName:"Kuwait",countryShortCode:"KW",regions:[{name:"Al Aḩmadi",shortCode:"AH"},{name:"Al Farwānīyah",shortCode:"FA"},{name:"Al Jahrā’",shortCode:"JA"},{name:"Al ‘Āşimah",shortCode:"KU"},{name:"Ḩawallī",shortCode:"HA"},{name:"Mubārak al Kabir",shortCode:"MU"}]},{countryName:"Kyrgyzstan",countryShortCode:"KG",regions:[{name:"Batken Oblasty",shortCode:"B"},{name:"Bishkek Shaary",shortCode:"GB"},{name:"Chuy Oblasty (Bishkek)",shortCode:"C"},{name:"Jalal-Abad Oblasty",shortCode:"J"},{name:"Naryn Oblasty",shortCode:"N"},{name:"Osh Oblasty",shortCode:"O"},{name:"Talas Oblasty",shortCode:"T"},{name:"Ysyk-Kol Oblasty (Karakol)",shortCode:"Y"}]},{countryName:"Laos",countryShortCode:"LA",regions:[{name:"Attapu",shortCode:"AT"},{name:"Bokèo",shortCode:"BK"},{name:"Bolikhamxai",shortCode:"BL"},{name:"Champasak",shortCode:"CH"},{name:"Houaphan",shortCode:"HO"},{name:"Khammouan",shortCode:"KH"},{name:"Louang Namtha",shortCode:"LM"},{name:"Louangphabang",shortCode:"LP"},{name:"Oudômxai",shortCode:"OU"},{name:"Phôngsali",shortCode:"PH"},{name:"Salavan",shortCode:"SL"},{name:"Savannakhét",shortCode:"SV"},{name:"Vientiane",shortCode:"VI"},{name:"Xaignabouli",shortCode:"XA"},{name:"Xékong",shortCode:"XE"},{name:"Xaisomboun",shortCode:"XS"},{name:"Xiangkhouang",shortCode:"XI"}]},{countryName:"Latvia",countryShortCode:"LV",regions:[{name:"Aglona",shortCode:"001"},{name:"Aizkraukle",shortCode:"002"},{name:"Aizpute",shortCode:"003"},{name:"Aknīste",shortCode:"004"},{name:"Aloja",shortCode:"005"},{name:"Alsunga",shortCode:"06"},{name:"Alūksne",shortCode:"007"},{name:"Amata",shortCode:"008"},{name:"Ape",shortCode:"009"},{name:"Auce",shortCode:"010"},{name:"Ādaži",shortCode:"011"},{name:"Babīte",shortCode:"012"},{name:"Baldone",shortCode:"013"},{name:"Baltinava",shortCode:"014"},{name:"Balvi",shortCode:"015"},{name:"Bauska",shortCode:"016"},{name:"Beverīna",shortCode:"017"},{name:"Brocēni",shortCode:"018"},{name:"Burtnieki",shortCode:"019"},{name:"Carnikava",shortCode:"020"},{name:"Cesvaine",shortCode:"021"},{name:"Cēsis",shortCode:"022"},{name:"Cibla",shortCode:"023"},{name:"Dagda",shortCode:"024"},{name:"Daugavpils",shortCode:"025"},{name:"Daugavpils (City)",shortCode:"DGV"},{name:"Dobele",shortCode:"026"},{name:"Dundaga",shortCode:"027"},{name:"Durbe",shortCode:"028"},{name:"Engure",shortCode:"029"},{name:"Ērgļi",shortCode:"030"},{name:"Garkalne",shortCode:"031"},{name:"Grobiņa",shortCode:"032"},{name:"Gulbene",shortCode:"033"},{name:"Iecava",shortCode:"034"},{name:"Ikšķile",shortCode:"035"},{name:"Ilūkste",shortCode:"036"},{name:"Inčukalns",shortCode:"037"},{name:"Jaunjelgava",shortCode:"038"},{name:"Jaunpiebalga",shortCode:"039"},{name:"Jaunpils",shortCode:"040"},{name:"Jelgava",shortCode:"041"},{name:"Jelgava (City)",shortCode:"JEL"},{name:"Jēkabpils",shortCode:"042"},{name:"Jēkabpils (City)",shortCode:"JKB"},{name:"Jūrmala (City)",shortCode:"JUR"},{name:"Kandava",shortCode:"043"},{name:"Kārsava",shortCode:"044"},{name:"Kocēni",shortCode:"045"},{name:"Koknese",shortCode:"046"},{name:"Krāslava",shortCode:"047"},{name:"Krimulda",shortCode:"048"},{name:"Krustpils",shortCode:"049"},{name:"Kuldīga",shortCode:"050"},{name:"Ķegums",shortCode:"051"},{name:"Ķekava",shortCode:"052"},{name:"Lielvārde",shortCode:"053"},{name:"Liepāja",shortCode:"LPX"},{name:"Limbaži",shortCode:"054"},{name:"Līgatne",shortCode:"055"},{name:"Līvāni",shortCode:"056"},{name:"Lubāna",shortCode:"057"},{name:"Ludza",shortCode:"058"},{name:"Madona",shortCode:"059"},{name:"Mazsalaca",shortCode:"060"},{name:"Mālpils",shortCode:"061"},{name:"Mārupe",shortCode:"062"},{name:"Mērsrags",shortCode:"063"},{name:"Naukšēni",shortCode:"064"},{name:"Nereta",shortCode:"065"},{name:"Nīca",shortCode:"066"},{name:"Ogre",shortCode:"067"},{name:"Olaine",shortCode:"068"},{name:"Ozolnieki",shortCode:"069"},{name:"Pārgauja",shortCode:"070"},{name:"Pāvilosta",shortCode:"071"},{name:"Pļaviņas",shortCode:"072"},{name:"Preiļi",shortCode:"073"},{name:"Priekule",shortCode:"074"},{name:"Priekuļi",shortCode:"075"},{name:"Rauna",shortCode:"076"},{name:"Rēzekne",shortCode:"077"},{name:"Rēzekne (City)",shortCode:"REZ"},{name:"Riebiņi",shortCode:"078"},{name:"Rīga",shortCode:"RIX"},{name:"Roja",shortCode:"079"},{name:"Ropaži",shortCode:"080"},{name:"Rucava",shortCode:"081"},{name:"Rugāji",shortCode:"082"},{name:"Rundāle",shortCode:"083"},{name:"Rūjiena",shortCode:"084"},{name:"Sala",shortCode:"085"},{name:"Salacgrīva",shortCode:"086"},{name:"Salaspils",shortCode:"087"},{name:"Saldus",shortCode:"088"},{name:"Saulkrasti",shortCode:"089"},{name:"Sēja",shortCode:"090"},{name:"Sigulda",shortCode:"091"},{name:"Skrīveri",shortCode:"092"},{name:"Skrunda",shortCode:"093"},{name:"Smiltene",shortCode:"094"},{name:"Stopiņi",shortCode:"095"},{name:"Strenči",shortCode:"096"},{name:"Talsi",shortCode:"097"},{name:"Tērvete",shortCode:"098"},{name:"Tukums",shortCode:"099"},{name:"Vaiņode",shortCode:"100"},{name:"Valka",shortCode:"101"},{name:"Valmiera",shortCode:"VMR"},{name:"Varakļāni",shortCode:"102"},{name:"Vārkava",shortCode:"103"},{name:"Vecpiebalga",shortCode:"104"},{name:"Vecumnieki",shortCode:"105"},{name:"Ventspils",shortCode:"106"},{name:"Ventspils (City)",shortCode:"VEN"},{name:"Viesīte",shortCode:"107"},{name:"Viļaka",shortCode:"108"},{name:"Viļāni",shortCode:"109"},{name:"Zilupe",shortCode:"110"}]},{countryName:"Lebanon",countryShortCode:"LB",regions:[{name:"Aakkâr",shortCode:"AK"},{name:"Baalbelk-Hermel",shortCode:"BH"},{name:"Béqaa",shortCode:"BI"},{name:"Beyrouth",shortCode:"BA"},{name:"Liban-Nord",shortCode:"AS"},{name:"Liban-Sud",shortCode:"JA"},{name:"Mont-Liban",shortCode:"JL"},{name:"Nabatîyé",shortCode:"NA"}]},{countryName:"Lesotho",countryShortCode:"LS",regions:[{name:"Berea",shortCode:"D"},{name:"Butha-Buthe",shortCode:"B"},{name:"Leribe",shortCode:"C"},{name:"Mafeteng",shortCode:"E"},{name:"Maseru",shortCode:"A"},{name:"Mohales Hoek",shortCode:"F"},{name:"Mokhotlong",shortCode:"J"},{name:"Qacha's Nek",shortCode:"H"},{name:"Quthing",shortCode:"G"},{name:"Thaba-Tseka",shortCode:"K"}]},{countryName:"Liberia",countryShortCode:"LR",regions:[{name:"Bomi",shortCode:"BM"},{name:"Bong",shortCode:"BG"},{name:"Gbarpolu",shortCode:"GP"},{name:"Grand Bassa",shortCode:"GB"},{name:"Grand Cape Mount",shortCode:"CM"},{name:"Grand Gedeh",shortCode:"GG"},{name:"Grand Kru",shortCode:"GK"},{name:"Lofa",shortCode:"LO"},{name:"Margibi",shortCode:"MG"},{name:"Maryland",shortCode:"MY"},{name:"Montserrado",shortCode:"MO"},{name:"Nimba",shortCode:"NI"},{name:"River Cess",shortCode:"RI"},{name:"River Geee",shortCode:"RG"},{name:"Sinoe",shortCode:"SI"}]},{countryName:"Libya",countryShortCode:"LY",regions:[{name:"Al Buţnān",shortCode:"BU"},{name:"Al Jabal al Akhḑar",shortCode:"JA"},{name:"Al Jabal al Gharbī",shortCode:"JG"},{name:"Al Jafārah",shortCode:"JA"},{name:"Al Jufrah",shortCode:"JU"},{name:"Al Kufrah",shortCode:"FK"},{name:"Al Marj",shortCode:"MJ"},{name:"Al Marquab",shortCode:"MB"},{name:"Al Wāḩāt",shortCode:"WA"},{name:"An Nuqaţ al Khams",shortCode:"NQ"},{name:"Az Zāwiyah",shortCode:"ZA"},{name:"Banghāzī",shortCode:"BA"},{name:"Darnah",shortCode:"DR"},{name:"Ghāt",shortCode:"GH"},{name:"Mişrātah",shortCode:"MI"},{name:"Murzuq",shortCode:"MQ"},{name:"Nālūt",shortCode:"NL"},{name:"Sabhā",shortCode:"SB"},{name:"Surt",shortCode:"SR"},{name:"Ţarābulus",shortCode:"TB"},{name:"Yafran",shortCode:"WD"},{name:"Wādī ash Shāţiʾ",shortCode:"WS"}]},{countryName:"Liechtenstein",countryShortCode:"LI",regions:[{name:"Balzers",shortCode:"01"},{name:"Eschen",shortCode:"02"},{name:"Gamprin",shortCode:"03"},{name:"Mauren",shortCode:"04"},{name:"Planken",shortCode:"05"},{name:"Ruggell",shortCode:"06"},{name:"Schaan",shortCode:"07"},{name:"Schellenberg",shortCode:"08"},{name:"Triesen",shortCode:"09"},{name:"Triesenberg",shortCode:"10"},{name:"Vaduz",shortCode:"11"}]},{countryName:"Lithuania",countryShortCode:"LT",regions:[{name:"Alytaus",shortCode:"AL"},{name:"Kauno",shortCode:"KU"},{name:"Klaipėdos",shortCode:"KL"},{name:"Marijampolės",shortCode:"MR"},{name:"Panevėžio",shortCode:"PN"},{name:"Šiaulių",shortCode:"SA"},{name:"Tauragės",shortCode:"TA"},{name:"Telšių",shortCode:"TE"},{name:"Utenos",shortCode:"UT"},{name:"Vilniaus",shortCode:"VL"}]},{countryName:"Luxembourg",countryShortCode:"LU",regions:[{name:"Capellen",shortCode:"CA"},{name:"Clevaux",shortCode:"CL"},{name:"Diekirch",shortCode:"DI"},{name:"Echternach",shortCode:"EC"},{name:"Esch-sur-Alzette",shortCode:"ES"},{name:"Grevenmacher",shortCode:"GR"},{name:"Luxembourg",shortCode:"LU"},{name:"Mersch",shortCode:"ME"},{name:"Redange",shortCode:"RD"},{name:"Remich",shortCode:"RM"},{name:"Vianden",shortCode:"VD"},{name:"Wiltz",shortCode:"WI"}]},{countryName:"Macao",countryShortCode:"MO",regions:[{name:"Macao"}]},{countryName:"Macedonia, Republic of",countryShortCode:"MK",regions:[{name:"Aračinovo",shortCode:"02"},{name:"Berovo",shortCode:"03"},{name:"Bitola",shortCode:"04"},{name:"Bogdanci",shortCode:"05"},{name:"Bogovinje",shortCode:"06"},{name:"Bosilovo",shortCode:"07"},{name:"Brvenica",shortCode:"08"},{name:"Centar Župa",shortCode:"78"},{name:"Čaška",shortCode:"08"},{name:"Češinovo-Obleševo",shortCode:"81"},{name:"Čučer Sandevo",shortCode:"82"},{name:"Debar",shortCode:"21"},{name:"Debarca",shortCode:"22"},{name:"Delčevo",shortCode:"23"},{name:"Demir Hisar",shortCode:"25"},{name:"Demir Kapija",shortCode:"24"},{name:"Doran",shortCode:"26"},{name:"Dolneni",shortCode:"27"},{name:"Gevgelija",shortCode:"18"},{name:"Gostivar",shortCode:"19"},{name:"Gradsko",shortCode:"20"},{name:"Ilinden",shortCode:"34"},{name:"Jegunovce",shortCode:"35"},{name:"Karbinci",shortCode:"37"},{name:"Kavadarci",shortCode:"36"},{name:"Kičevo",shortCode:"40"},{name:"Kočani",shortCode:"42"},{name:"Konče",shortCode:"41"},{name:"Kratovo",shortCode:"43"},{name:"Kriva Palanka",shortCode:"44"},{name:"Krivogaštani",shortCode:"45"},{name:"Kruševo",shortCode:"46"},{name:"Kumanovo",shortCode:"47"},{name:"Lipkovo",shortCode:"48"},{name:"Lozovo",shortCode:"49"},{name:"Makedonska Kamenica",shortCode:"51"},{name:"Makedonski Brod",shortCode:"52"},{name:"Mavrovo i Rostuša",shortCode:"50"},{name:"Mogila",shortCode:"53"},{name:"Negotino",shortCode:"54"},{name:"Novaci",shortCode:"55"},{name:"Novo Selo",shortCode:"56"},{name:"Ohrid",shortCode:"58"},{name:"Pehčevo",shortCode:"60"},{name:"Petrovec",shortCode:"59"},{name:"Plasnica",shortCode:"61"},{name:"Prilep",shortCode:"62"},{name:"Probištip",shortCode:"63"},{name:"Radoviš",shortCode:""},{name:"Rankovce",shortCode:"65"},{name:"Resen",shortCode:"66"},{name:"Rosoman",shortCode:"67"},{name:"Skopje",shortCode:"85"},{name:"Sopište",shortCode:"70"},{name:"Staro Nagoričane",shortCode:"71"},{name:"Struga",shortCode:"72"},{name:"Strumica",shortCode:"73"},{name:"Studeničani",shortCode:"74"},{name:"Sveti Nikole",shortCode:"69"},{name:"Štip",shortCode:"83"},{name:"Tearce",shortCode:"75"},{name:"Tetovo",shortCode:"76"},{name:"Valandovo",shortCode:"10"},{name:"Vasilevo",shortCode:"11"},{name:"Veles",shortCode:"13"},{name:"Vevčani",shortCode:"12"},{name:"Vinica",shortCode:"14"},{name:"Vrapčište",shortCode:"16"},{name:"Zelenikovo",shortCode:"32"},{name:"Zrnovci",shortCode:"33"},{name:"Želino",shortCode:"30"}]},{countryName:"Madagascar",countryShortCode:"MG",regions:[{name:"Antananarivo",shortCode:"T"},{name:"Antsiranana",shortCode:"D"},{name:"Fianarantsoa",shortCode:"F"},{name:"Mahajanga",shortCode:"M"},{name:"Toamasina",shortCode:"A"},{name:"Toliara",shortCode:"U"}]},{countryName:"Malawi",countryShortCode:"MW",regions:[{name:"Balaka",shortCode:"BA"},{name:"Blantyre",shortCode:"BL"},{name:"Chikwawa",shortCode:"CK"},{name:"Chiradzulu",shortCode:"CR"},{name:"Chitipa",shortCode:"CT"},{name:"Dedza",shortCode:"DE"},{name:"Dowa",shortCode:"DO"},{name:"Karonga",shortCode:"KR"},{name:"Kasungu",shortCode:"KS"},{name:"Likoma",shortCode:"LK"},{name:"Lilongwe",shortCode:"LI"},{name:"Machinga",shortCode:"MH"},{name:"Mangochi",shortCode:"MG"},{name:"Mchinji",shortCode:"MC"},{name:"Mulanje",shortCode:"MU"},{name:"Mwanza",shortCode:"MW"},{name:"Mzimba",shortCode:"MZ"},{name:"Nkhata Bay",shortCode:"NE"},{name:"Nkhotakota",shortCode:"NB"},{name:"Nsanje",shortCode:"NS"},{name:"Ntcheu",shortCode:"NU"},{name:"Ntchisi",shortCode:"NI"},{name:"Phalombe",shortCode:"PH"},{name:"Rumphi",shortCode:"RU"},{name:"Salima",shortCode:"SA"},{name:"Thyolo",shortCode:"TH"},{name:"Zomba",shortCode:"ZO"}]},{countryName:"Malaysia",countryShortCode:"MY",regions:[{name:"Johor",shortCode:"01"},{name:"Kedah",shortCode:"02"},{name:"Kelantan",shortCode:"03"},{name:"Melaka",shortCode:"04"},{name:"Negeri Sembilan",shortCode:"05"},{name:"Pahang",shortCode:"06"},{name:"Perak",shortCode:"08"},{name:"Perlis",shortCode:"09"},{name:"Pulau Pinang",shortCode:"07"},{name:"Sabah",shortCode:"12"},{name:"Sarawak",shortCode:"13"},{name:"Selangor",shortCode:"10"},{name:"Terengganu",shortCode:"11"},{name:"Wilayah Persekutuan (Kuala Lumpur)",shortCode:"14"},{name:"Wilayah Persekutuan (Labuan)",shortCode:"15"},{name:"Wilayah Persekutuan (Putrajaya)",shortCode:"16"}]},{countryName:"Maldives",countryShortCode:"MV",regions:[{name:"Alifu Alifu",shortCode:"02"},{name:"Alifu Dhaalu",shortCode:"00"},{name:"Baa",shortCode:"20"},{name:"Dhaalu",shortCode:"17"},{name:"Faafu",shortCode:"14"},{name:"Gaafu Alifu",shortCode:"27"},{name:"Gaafu Dhaalu",shortCode:"28"},{name:"Gnaviyani",shortCode:"29"},{name:"Haa Alifu",shortCode:"07"},{name:"Haa Dhaalu",shortCode:"23"},{name:"Kaafu",shortCode:"29"},{name:"Laamu",shortCode:"05"},{name:"Lhaviyani",shortCode:"03"},{name:"Malé",shortCode:"MLE"},{name:"Meemu",shortCode:"12"},{name:"Noonu",shortCode:"25"},{name:"Raa",shortCode:"13"},{name:"Seenu",shortCode:"01"},{name:"Shaviyani",shortCode:"24"},{name:"Thaa",shortCode:"08"},{name:"Vaavu",shortCode:"04"}]},{countryName:"Mali",countryShortCode:"ML",regions:[{name:"Bamako",shortCode:"BKO"},{name:"Gao",shortCode:"7"},{name:"Kayes",shortCode:"1"},{name:"Kidal",shortCode:"8"},{name:"Koulikoro",shortCode:"2"},{name:"Mopti",shortCode:"5"},{name:"Segou",shortCode:"4"},{name:"Sikasso",shortCode:"3"},{name:"Tombouctou",shortCode:"6"}]},{countryName:"Malta",countryShortCode:"MT",regions:[{name:"Attard",shortCode:"01"},{name:"Balzan",shortCode:"02"},{name:"Birgu",shortCode:"03"},{name:"Birkirkara",shortCode:"04"},{name:"Birżebbuġa",shortCode:"05"},{name:"Bormla",shortCode:"06"},{name:"Dingli",shortCode:"07"},{name:"Fgura",shortCode:"08"},{name:"Floriana",shortCode:"09"},{name:"Fontana",shortCode:"10"},{name:"Guda",shortCode:"11"},{name:"Gżira",shortCode:"12"},{name:"Għajnsielem",shortCode:"13"},{name:"Għarb",shortCode:"14"},{name:"Għargħur",shortCode:"15"},{name:"Għasri",shortCode:"16"},{name:"Għaxaq",shortCode:"17"},{name:"Ħamrun",shortCode:"18"},{name:"Iklin",shortCode:"19"},{name:"Isla",shortCode:"20"},{name:"Kalkara",shortCode:"21"},{name:"Kerċem",shortCode:"22"},{name:"Kirkop",shortCode:"23"},{name:"Lija",shortCode:"24"},{name:"Luqa",shortCode:"25"},{name:"Marsa",shortCode:"26"},{name:"Marsaskala",shortCode:"27"},{name:"Marsaxlokk",shortCode:"28"},{name:"Mdina",shortCode:"29"},{name:"Mellieħa",shortCode:"30"},{name:"Mġarr",shortCode:"31"},{name:"Mosta",shortCode:"32"},{name:"Mqabba",shortCode:"33"},{name:"Msida",shortCode:"34"},{name:"Mtarfa",shortCode:"35"},{name:"Munxar",shortCode:"36"},{name:"Nadur",shortCode:"37"},{name:"Naxxar",shortCode:"38"},{name:"Paola",shortCode:"39"},{name:"Pembroke",shortCode:"40"},{name:"Pietà",shortCode:"41"},{name:"Qala",shortCode:"42"},{name:"Qormi",shortCode:"43"},{name:"Qrendi",shortCode:"44"},{name:"Rabat Għawdex",shortCode:"45"},{name:"Rabat Malta",shortCode:"46"},{name:"Safi",shortCode:"47"},{name:"San Ġiljan",shortCode:"48"},{name:"San Ġwann",shortCode:"49"},{name:"San Lawrenz",shortCode:"50"},{name:"San Pawl il-Baħar",shortCode:"51"},{name:"Sannat",shortCode:"52"},{name:"Santa Luċija",shortCode:"53"},{name:"Santa Venera",shortCode:"54"},{name:"Siġġiewi",shortCode:"55"},{name:"Sliema",shortCode:"56"},{name:"Swieqi",shortCode:"57"},{name:"Tai Xbiex",shortCode:"58"},{name:"Tarzien",shortCode:"59"},{name:"Valletta",shortCode:"60"},{name:"Xagħra",shortCode:"61"},{name:"Xewkija",shortCode:"62"},{name:"Xgħajra",shortCode:"63"},{name:"Żabbar",shortCode:"64"},{name:"Żebbuġ Għawde",shortCode:"65"},{name:"Żebbuġ Malta",shortCode:"66"},{name:"Żejtun",shortCode:"67"},{name:"Żurrieq",shortCode:"68"}]},{countryName:"Marshall Islands",countryShortCode:"MH",regions:[{name:"Ailinglaplap",shortCode:"ALL"},{name:"Ailuk",shortCode:"ALK"},{name:"Arno",shortCode:"ARN"},{name:"Aur",shortCode:"AUR"},{name:"Bikini and Kili",shortCode:"KIL"},{name:"Ebon",shortCode:"EBO"},{name:"Jabat",shortCode:"JAB"},{name:"Jaluit",shortCode:"JAL"},{name:"Kwajalein",shortCode:"KWA"},{name:"Lae",shortCode:"LAE"},{name:"Lib",shortCode:"LIB"},{name:"Likiep",shortCode:"LIK"},{name:"Majuro",shortCode:"MAJ"},{name:"Maloelap",shortCode:"MAL"},{name:"Mejit",shortCode:"MEJ"},{name:"Namdrik",shortCode:"NMK"},{name:"Namu",shortCode:"NMU"},{name:"Rongelap",shortCode:"RON"},{name:"Ujae",shortCode:"UJA"},{name:"Utrik",shortCode:"UTI"},{name:"Wotho",shortCode:"WTH"},{name:"Wotje",shortCode:"WTJ"}]},{countryName:"Martinique",countryShortCode:"MQ",regions:[{name:"Martinique"}]},{countryName:"Mauritania",countryShortCode:"MR",regions:[{name:"Adrar",shortCode:"07"},{name:"Assaba",shortCode:"03"},{name:"Brakna",shortCode:"05"},{name:"Dakhlet Nouadhibou",shortCode:"08"},{name:"Gorgol",shortCode:"04"},{name:"Guidimaka",shortCode:"10"},{name:"Hodh Ech Chargui",shortCode:"01"},{name:"Hodh El Gharbi",shortCode:"02"},{name:"Inchiri",shortCode:"12"},{name:"Nouakchott Nord",shortCode:"14"},{name:"Nouakchott Ouest",shortCode:"13"},{name:"Nouakchott Sud",shortCode:"15"},{name:"Tagant",shortCode:"09"},{name:"Tiris Zemmour",shortCode:"11"},{name:"Trarza",shortCode:"06"}]},{countryName:"Mauritius",countryShortCode:"MU",regions:[{name:"Agalega Islands",shortCode:"AG"},{name:"Beau Bassin-Rose Hill",shortCode:"BR"},{name:"Black River",shortCode:"BL"},{name:"Cargados Carajos Shoals",shortCode:"CC"},{name:"Curepipe",shortCode:"CU"},{name:"Flacq",shortCode:"FL"},{name:"Grand Port",shortCode:"GP"},{name:"Moka",shortCode:"MO"},{name:"Pamplemousses",shortCode:"PA"},{name:"Plaines Wilhems",shortCode:"PW"},{name:"Port Louis (City)",shortCode:"PU"},{name:"Port Louis",shortCode:"PL"},{name:"Riviere du Rempart",shortCode:"RR"},{name:"Rodrigues Island",shortCode:"RO"},{name:"Savanne",shortCode:"SA"},{name:"Vacoas-Phoenix",shortCode:"CP"}]},{countryName:"Mayotte",countryShortCode:"YT",regions:[{name:"Dzaoudzi",shortCode:"01"},{name:"Pamandzi",shortCode:"02"},{name:"Mamoudzou",shortCode:"03"},{name:"Dembeni",shortCode:"04"},{name:"Bandrélé",shortCode:"05"},{name:"Kani-Kéli",shortCode:"06"},{name:"Bouéni",shortCode:"07"},{name:"Chirongui",shortCode:"08"},{name:"Sada",shortCode:"09"},{name:"Ouangani",shortCode:"10"},{name:"Chiconi",shortCode:"11"},{name:"Tsingoni",shortCode:"12"},{name:"M'Tsangamouji",shortCode:"13"},{name:"Acoua",shortCode:"14"},{name:"Mtsamboro",shortCode:"15"},{name:"Bandraboua",shortCode:"16"},{name:"Koungou",shortCode:"17"}]},{countryName:"Mexico",countryShortCode:"MX",regions:[{name:"Aguascalientes",shortCode:"AGU"},{name:"Baja California",shortCode:"BCN"},{name:"Baja California Sur",shortCode:"BCS"},{name:"Campeche",shortCode:"CAM"},{name:"Ciudad de México",shortCode:"DIF"},{name:"Chiapas",shortCode:"CHP"},{name:"Chihuahua",shortCode:"CHH"},{name:"Coahuila de Zaragoza",shortCode:"COA"},{name:"Colima",shortCode:"COL"},{name:"Durango",shortCode:"DUR"},{name:"Estado de México",shortCode:"MEX"},{name:"Guanajuato",shortCode:"GUA"},{name:"Guerrero",shortCode:"GRO"},{name:"Hidalgo",shortCode:"HID"},{name:"Jalisco",shortCode:"JAL"},{name:"Michoacán de Ocampo",shortCode:"MIC"},{name:"Morelos",shortCode:"MOR"},{name:"Nayarit",shortCode:"NAY"},{name:"Nuevo León",shortCode:"NLE"},{name:"Oaxaca",shortCode:"OAX"},{name:"Puebla",shortCode:"PUE"},{name:"Querétaro de Arteaga",shortCode:"QUE"},{name:"Quintana Roo",shortCode:"ROO"},{name:"San Luis Potosí",shortCode:"SLP"},{name:"Sinaloa",shortCode:"SIN"},{name:"Sonora",shortCode:"SON"},{name:"Tabasco",shortCode:"TAB"},{name:"Tamaulipas",shortCode:"TAM"},{name:"Tlaxcala",shortCode:"TLA"},{name:"Veracruz",shortCode:"VER"},{name:"Yucatán",shortCode:"YUC"},{name:"Zacatecas",shortCode:"ZAC"}]},{countryName:"Micronesia, Federated States of",countryShortCode:"FM",regions:[{name:"Chuuk (Truk)",shortCode:"TRK"},{name:"Kosrae",shortCode:"KSA"},{name:"Pohnpei",shortCode:"PNI"},{name:"Yap",shortCode:"YAP"}]},{countryName:"Moldova",countryShortCode:"MD",regions:[{name:"Aenii Noi",shortCode:"AN"},{name:"Basarabeasca",shortCode:"BS"},{name:"Bălți",shortCode:"BA"},{name:"Bender",shortCode:"BD"},{name:"Briceni",shortCode:"BR"},{name:"Cahul",shortCode:"CA"},{name:"Cantemir",shortCode:"CT"},{name:"Călărași",shortCode:"CL"},{name:"Căușeni",shortCode:"CS"},{name:"Chișinău",shortCode:"CU"},{name:"Cimișlia",shortCode:"CM"},{name:"Criuleni",shortCode:"CR"},{name:"Dondușeni",shortCode:"DO"},{name:"Drochia",shortCode:"DR"},{name:"Dubăsari",shortCode:"DU"},{name:"Edineț",shortCode:"ED"},{name:"Fălești",shortCode:"FA"},{name:"Florești",shortCode:"FL"},{name:"Găgăuzia",shortCode:"GA"},{name:"Glodeni",shortCode:"GL"},{name:"Hîncești",shortCode:"HI"},{name:"Ialoveni",shortCode:"IA"},{name:"Leova",shortCode:"LE"},{name:"Nisporeni",shortCode:"NI"},{name:"Ocnița",shortCode:"OC"},{name:"Orhei",shortCode:"OR"},{name:"Rezina",shortCode:"RE"},{name:"Rîșcani",shortCode:"RI"},{name:"Sîngerei",shortCode:"SI"},{name:"Soroca",shortCode:"SO"},{name:"Stînga Nistrului",shortCode:"SN"},{name:"Strășeni",shortCode:"ST"},{name:"Șoldănești",shortCode:"SD"},{name:"Ștefan Vodă",shortCode:"SV"},{name:"Taraclia",shortCode:"TA"},{name:"Telenești",shortCode:"TE"},{name:"Ungheni",shortCode:"UN"}]},{countryName:"Monaco",countryShortCode:"MC",regions:[{name:"Colle",shortCode:"CL"},{name:"Condamine",shortCode:"CO"},{name:"Fontvieille",shortCode:"FO"},{name:"Gare",shortCode:"GA"},{name:"Jardin Exotique",shortCode:"JE"},{name:"Larvotto",shortCode:"LA"},{name:"Malbousquet",shortCode:"MA"},{name:"Monaco-Ville",shortCode:"MO"},{name:"Moneghetti",shortCode:"MG"},{name:"Monte-Carlo",shortCode:"MC"},{name:"Moulins",shortCode:"MU"},{name:"Port-Hercule",shortCode:"PH"},{name:"Saint-Roman",shortCode:"SR"},{name:"Sainte-Dévote",shortCode:"SD"},{name:"Source",shortCode:"SO"},{name:"Spélugues",shortCode:"SP"},{name:"Vallon de la Rousse",shortCode:"VR"}]},{countryName:"Mongolia",countryShortCode:"MN",regions:[{name:"Arhangay",shortCode:"073"},{name:"Bayan-Olgiy",shortCode:"071"},{name:"Bayanhongor",shortCode:"069"},{name:"Bulgan",shortCode:"067"},{name:"Darhan",shortCode:"037"},{name:"Dornod",shortCode:"061"},{name:"Dornogovi",shortCode:"063"},{name:"Dundgovi",shortCode:"059"},{name:"Dzavhan",shortCode:"065"},{name:"Govi-Altay",shortCode:"065"},{name:"Govi-Sumber",shortCode:"064"},{name:"Hovd",shortCode:"043"},{name:"Hovsgol",shortCode:"041"},{name:"Omnogovi",shortCode:"053"},{name:"Ovorhangay",shortCode:"055"},{name:"Selenge",shortCode:"049"},{name:"Suhbaatar",shortCode:"051"},{name:"Tov",shortCode:"047"},{name:"Ulaanbaatar",shortCode:"1"},{name:"Uvs",shortCode:"046"}]},{countryName:"Montenegro",countryShortCode:"ME",regions:[{name:"Andrijevica",shortCode:"01"},{name:"Bar",shortCode:"02"},{name:"Berane",shortCode:"03"},{name:"Bijelo Polje",shortCode:"04"},{name:"Budva",shortCode:"05"},{name:"Cetinje",shortCode:"06"},{name:"Danilovgrad",shortCode:"07"},{name:"Gusinje",shortCode:"22"},{name:"Herceg Novi",shortCode:"08"},{name:"Kolašin",shortCode:"09"},{name:"Kotor",shortCode:"10"},{name:"Mojkovac",shortCode:"11"},{name:"Nikšić",shortCode:"12"},{name:"Petnica",shortCode:"23"},{name:"Plav",shortCode:"13"},{name:"Plužine",shortCode:"14"},{name:"Pljevlja",shortCode:"15"},{name:"Podgorica",shortCode:"16"},{name:"Rožaje",shortCode:"17"},{name:"Šavnik",shortCode:"18"},{name:"Tivat",shortCode:"19"},{name:"Ulcinj",shortCode:"20"},{name:"Žabljak",shortCode:"21"}]},{countryName:"Montserrat",countryShortCode:"MS",regions:[{name:"Saint Anthony"},{name:"Saint Georges"},{name:"Saint Peter's"}]},{countryName:"Morocco",countryShortCode:"MA",regions:[{name:"Chaouia-Ouardigha",shortCode:"09"},{name:"Doukhala-Abda",shortCode:"10"},{name:"Fès-Boulemane",shortCode:"05"},{name:"Gharb-Chrarda-Beni Hssen",shortCode:"02"},{name:"Grand Casablanca",shortCode:"08"},{name:"Guelmim-Es Semara",shortCode:"14"},{name:"Laâyoune-Boujdour-Sakia el Hamra",shortCode:"15"},{name:"Marrakech-Tensift-Al Haouz",shortCode:"11"},{name:"Meknès-Tafilalet",shortCode:"06"},{name:"Oriental",shortCode:"04"},{name:"Oued ed Dahab-Lagouira",shortCode:"16"},{name:"Souss-Massa-Drâa",shortCode:"13"},{name:"Tadla-Azilal",shortCode:"12"},{name:"Tanger-Tétouan",shortCode:"01"},{name:"Taza-Al Hoceima-Taounate",shortCode:"03"}]},{countryName:"Mozambique",countryShortCode:"MZ",regions:[{name:"Cabo Delgado",shortCode:"P"},{name:"Gaza",shortCode:"G"},{name:"Inhambane",shortCode:"I"},{name:"Manica",shortCode:"B"},{name:"Maputo",shortCode:"L"},{name:"Maputo (City)",shortCode:"MPM"},{name:"Nampula",shortCode:"N"},{name:"Niassa",shortCode:"A"},{name:"Sofala",shortCode:"S"},{name:"Tete",shortCode:"T"},{name:"Zambezia",shortCode:"Q"}]},{countryName:"Myanmar",countryShortCode:"MM",regions:[{name:"Ayeyarwady",shortCode:"07"},{name:"Bago",shortCode:"02"},{name:"Chin",shortCode:"14"},{name:"Kachin",shortCode:"11"},{name:"Kayah",shortCode:"12"},{name:"Kayin",shortCode:"13"},{name:"Magway",shortCode:"03"},{name:"Mandalay",shortCode:"04"},{name:"Mon",shortCode:"15"},{name:"Nay Pyi Taw",shortCode:"18"},{name:"Rakhine",shortCode:"16"},{name:"Sagaing",shortCode:"01"},{name:"Shan",shortCode:"17"},{name:"Tanintharyi",shortCode:"05"},{name:"Yangon",shortCode:"06"}]},{countryName:"Namibia",countryShortCode:"NA",regions:[{name:"Erongo",shortCode:"ER"},{name:"Hardap",shortCode:"HA"},{name:"Kavango East",shortCode:"KE"},{name:"Kavango West",shortCode:"KW"},{name:"Karas",shortCode:"KA"},{name:"Khomas",shortCode:"KH"},{name:"Kunene",shortCode:"KU"},{name:"Ohangwena",shortCode:"OW"},{name:"Omaheke",shortCode:"OH"},{name:"Omusati",shortCode:"OS"},{name:"Oshana",shortCode:"ON"},{name:"Oshikoto",shortCode:"OT"},{name:"Otjozondjupa",shortCode:"OD"},{name:"Zambezi",shortCode:"CA"}]},{countryName:"Nauru",countryShortCode:"NR",regions:[{name:"Aiwo",shortCode:"01"},{name:"Anabar",shortCode:"02"},{name:"Anetan",shortCode:"03"},{name:"Anibare",shortCode:"04"},{name:"Baiti",shortCode:"05"},{name:"Boe",shortCode:"06"},{name:"Buada",shortCode:"07"},{name:"Denigomodu",shortCode:"08"},{name:"Ewa",shortCode:"09"},{name:"Ijuw",shortCode:"10"},{name:"Meneng",shortCode:"11"},{name:"Nibok",shortCode:"12"},{name:"Uaboe",shortCode:"13"},{name:"Yaren",shortCode:"14"}]},{countryName:"Nepal",countryShortCode:"NP",regions:[{name:"Bagmati",shortCode:"BA"},{name:"Bheri",shortCode:"BH"},{name:"Dhawalagiri",shortCode:"DH"},{name:"Gandaki",shortCode:"GA"},{name:"Janakpur",shortCode:"JA"},{name:"Karnali",shortCode:"KA"},{name:"Kosi",shortCode:"KO"},{name:"Lumbini",shortCode:"LU"},{name:"Mahakali",shortCode:"MA"},{name:"Mechi",shortCode:"ME"},{name:"Narayani",shortCode:"NA"},{name:"Rapti",shortCode:"RA"},{name:"Sagarmatha",shortCode:"SA"},{name:"Seti",shortCode:"SE"}]},{countryName:"Netherlands",countryShortCode:"NL",regions:[{name:"Drenthe",shortCode:"DR"},{name:"Flevoland",shortCode:"FL"},{name:"Friesland",shortCode:"FR"},{name:"Gelderland",shortCode:"GE"},{name:"Groningen",shortCode:"GR"},{name:"Limburg",shortCode:"LI"},{name:"Noord-Brabant",shortCode:"NB"},{name:"Noord-Holland",shortCode:"NH"},{name:"Overijssel",shortCode:"OV"},{name:"Utrecht",shortCode:"UT"},{name:"Zeeland",shortCode:"ZE"},{name:"Zuid-Holland",shortCode:"ZH"}]},{countryName:"New Caledonia",countryShortCode:"NC",regions:[{name:"Iles Loyaute"},{name:"Nord"},{name:"Sud"}]},{countryName:"New Zealand",countryShortCode:"NZ",regions:[{name:"Auckland",shortCode:"AUK"},{name:"Bay of Plenty",shortCode:"BOP"},{name:"Canterbury",shortCode:"CAN"},{name:"Gisborne",shortCode:"GIS"},{name:"Hawke's Bay",shortCode:"HKB"},{name:"Marlborough",shortCode:"MBH"},{name:"Manawatu-Wanganui",shortCode:"MWT"},{name:"Northland",shortCode:"NTL"},{name:"Nelson",shortCode:"NSN"},{name:"Otago",shortCode:"OTA"},{name:"Southland",shortCode:"STL"},{name:"Taranaki",shortCode:"TKI"},{name:"Tasman",shortCode:"TAS"},{name:"Waikato",shortCode:"WKO"},{name:"Wellington",shortCode:"WGN"},{name:"West Coast",shortCode:"WTC"},{name:"Chatham Islands Territory",shortCode:"CIT"}]},{countryName:"Nicaragua",countryShortCode:"NI",regions:[{name:"Boaco",shortCode:"BO"},{name:"Carazo",shortCode:"CA"},{name:"Chinandega",shortCode:"CI"},{name:"Chontales",shortCode:"CO"},{name:"Estelí",shortCode:"ES"},{name:"Granada",shortCode:"GR"},{name:"Jinotega",shortCode:"JI"},{name:"León",shortCode:"LE"},{name:"Madriz",shortCode:"MD"},{name:"Managua",shortCode:"MN"},{name:"Masaya",shortCode:"MS"},{name:"Matagalpa",shortCode:"MT"},{name:"Nueva Segovia",shortCode:"NS"},{name:"Río San Juan",shortCode:"SJ"},{name:"Rivas",shortCode:"RI"},{name:"Atlántico Norte",shortCode:"AN"},{name:"Atlántico Sur",shortCode:"AS"}]},{countryName:"Niger",countryShortCode:"NE",regions:[{name:"Agadez",shortCode:"1"},{name:"Diffa",shortCode:"2"},{name:"Dosso",shortCode:"3"},{name:"Maradi",shortCode:"4"},{name:"Niamey",shortCode:"8"},{name:"Tahoua",shortCode:"5"},{name:"Tillabéri",shortCode:"6"},{name:"Zinder",shortCode:"7"}]},{countryName:"Nigeria",countryShortCode:"NG",regions:[{name:"Abia",shortCode:"AB"},{name:"Abuja Federal Capital Territory",shortCode:"FC"},{name:"Adamawa",shortCode:"AD"},{name:"Akwa Ibom",shortCode:"AK"},{name:"Anambra",shortCode:"AN"},{name:"Bauchi",shortCode:"BA"},{name:"Bayelsa",shortCode:"BY"},{name:"Benue",shortCode:"BE"},{name:"Borno",shortCode:"BO"},{name:"Cross River",shortCode:"CR"},{name:"Delta",shortCode:"DE"},{name:"Ebonyi",shortCode:"EB"},{name:"Edo",shortCode:"ED"},{name:"Ekiti",shortCode:"EK"},{name:"Enugu",shortCode:"EN"},{name:"Gombe",shortCode:"GO"},{name:"Imo",shortCode:"IM"},{name:"Jigawa",shortCode:"JI"},{name:"Kaduna",shortCode:"KD"},{name:"Kano",shortCode:"KN"},{name:"Katsina",shortCode:"KT"},{name:"Kebbi",shortCode:"KE"},{name:"Kogi",shortCode:"KO"},{name:"Kwara",shortCode:"KW"},{name:"Lagos",shortCode:"LA"},{name:"Nassarawa",shortCode:"NA"},{name:"Niger",shortCode:"NI"},{name:"Ogun",shortCode:"OG"},{name:"Ondo",shortCode:"ON"},{name:"Osun",shortCode:"OS"},{name:"Oyo",shortCode:"OY"},{name:"Plateau",shortCode:"PL"},{name:"Rivers",shortCode:"RI"},{name:"Sokoto",shortCode:"SO"},{name:"Taraba",shortCode:"TA"},{name:"Yobe",shortCode:"YO"},{name:"Zamfara",shortCode:"ZA"}]},{countryName:"Niue",countryShortCode:"NU",regions:[{name:"Niue"}]},{countryName:"Norfolk Island",countryShortCode:"NF",regions:[{name:"Norfolk Island"}]},{countryName:"Northern Mariana Islands",countryShortCode:"MP",regions:[{name:"Northern Islands"},{name:"Rota"},{name:"Saipan"},{name:"Tinian"}]},{countryName:"Norway",countryShortCode:"NO",regions:[{name:"Akershus",shortCode:"02"},{name:"Aust-Agder",shortCode:"09"},{name:"Buskerud",shortCode:"06"},{name:"Finnmark",shortCode:"20"},{name:"Hedmark",shortCode:"04"},{name:"Hordaland",shortCode:"12"},{name:"Møre og Romsdal",shortCode:"15"},{name:"Nordland",shortCode:"18"},{name:"Nord-Trøndelag",shortCode:"17"},{name:"Oppland",shortCode:"05"},{name:"Oslo",shortCode:"03"},{name:"Rogaland",shortCode:"11"},{name:"Sogn og Fjordane",shortCode:"14"},{name:"Sør-Trøndelag",shortCode:"16"},{name:"Telemark",shortCode:"08"},{name:"Troms",shortCode:"19"},{name:"Vest-Agder",shortCode:"10"},{name:"Vestfold",shortCode:"07"},{name:"Østfold",shortCode:"01"},{name:"Jan Mayen",shortCode:"22"},{name:"Svalbard",shortCode:"21"}]},{countryName:"Oman",countryShortCode:"OM",regions:[{name:"Ad Dakhiliyah",shortCode:"DA"},{name:"Al Buraymi",shortCode:"BU"},{name:"Al Wusta",shortCode:"WU"},{name:"Az Zahirah",shortCode:"ZA"},{name:"Janub al Batinah",shortCode:"BS"},{name:"Janub ash Sharqiyah",shortCode:"SS"},{name:"Masqat",shortCode:"MA"},{name:"Musandam",shortCode:"MU"},{name:"Shamal al Batinah",shortCode:"BJ"},{name:"Shamal ash Sharqiyah",shortCode:"SJ"},{name:"Zufar",shortCode:"ZU"}]},{countryName:"Pakistan",countryShortCode:"PK",regions:[{name:"Āzād Kashmīr",shortCode:"JK"},{name:"Balōchistān",shortCode:"BA"},{name:"Gilgit-Baltistān",shortCode:"GB"},{name:"Islāmābād",shortCode:"IS"},{name:"Khaībar Pakhtūnkhwās",shortCode:"KP"},{name:"Punjāb",shortCode:"PB"},{name:"Sindh",shortCode:"SD"},{name:"Federally Administered Tribal Areas",shortCode:"TA"}]},{countryName:"Palau",countryShortCode:"PW",regions:[{name:"Aimeliik",shortCode:"002"},{name:"Airai",shortCode:"004"},{name:"Angaur",shortCode:"010"},{name:"Hatobohei",shortCode:"050"},{name:"Kayangel",shortCode:"100"},{name:"Koror",shortCode:"150"},{name:"Melekeok",shortCode:"212"},{name:"Ngaraard",shortCode:"214"},{name:"Ngarchelong",shortCode:"218"},{name:"Ngardmau",shortCode:"222"},{name:"Ngatpang",shortCode:"224"},{name:"Ngchesar",shortCode:"226"},{name:"Ngeremlengui",shortCode:"227"},{name:"Ngiwal",shortCode:"228"},{name:"Peleliu",shortCode:"350"},{name:"Sonsoral",shortCode:"350"}]},{countryName:"Palestine, State of",countryShortCode:"PS",regions:[{name:"Ak Khalīl",shortCode:"HBN"},{name:"Al Quds",shortCode:"JEM"},{name:"Arīḩā wal Aghwār",shortCode:"JRH"},{name:"Bayt Laḩm",shortCode:"BTH"},{name:"Dayr al Balaḩ",shortCode:"DEB"},{name:"Ghazzah",shortCode:"GZA"},{name:"Janīn",shortCode:"JEN"},{name:"Khān Yūnis",shortCode:"KYS"},{name:"Nāblus",shortCode:"NBS"},{name:"Qalqīyah",shortCode:"QQA"},{name:"Rafaḩ",shortCode:"RFH"},{name:"Rām Allāh wal Bīrah",shortCode:"RBH"},{name:"Salfīt",shortCode:"SLT"},{name:"Shamāl Ghazzah",shortCode:"NGZ"},{name:"Ţūbās",shortCode:"TBS"},{name:"Ţūlkarm",shortCode:"TKM"}]},{countryName:"Panama",countryShortCode:"PA",regions:[{name:"Bocas del Toro",shortCode:"1"},{name:"Chiriquí",shortCode:"4"},{name:"Coclé",shortCode:"2"},{name:"Colón",shortCode:"3"},{name:"Darién",shortCode:"5"},{name:"Emberá",shortCode:"EM"},{name:"Herrera",shortCode:"6"},{name:"Kuna Yala",shortCode:"KY"},{name:"Los Santos",shortCode:"7"},{name:"Ngäbe-Buglé",shortCode:"NB"},{name:"Panamá",shortCode:"8"},{name:"Panamá Oeste",shortCode:"10"},{name:"Veraguas",shortCode:"9"}]},{countryName:"Papua New Guinea",countryShortCode:"PG",regions:[{name:"Bougainville",shortCode:"NSB"},{name:"Central",shortCode:"CPM"},{name:"Chimbu",shortCode:"CPK"},{name:"East New Britain",shortCode:"EBR"},{name:"East Sepik",shortCode:"ESW"},{name:"Eastern Highlands",shortCode:"EHG"},{name:"Enga",shortCode:"EPW"},{name:"Gulf",shortCode:"GPK"},{name:"Hela",shortCode:"HLA"},{name:"Jiwaka",shortCode:"JWK"},{name:"Madang",shortCode:"MOM"},{name:"Manus",shortCode:"MRL"},{name:"Milne Bay",shortCode:"MBA"},{name:"Morobe",shortCode:"MPL"},{name:"Port Moresby",shortCode:"NCD"},{name:"New Ireland",shortCode:"NIK"},{name:"Northern",shortCode:"NPP"},{name:"Southern Highlands",shortCode:"SHM"},{name:"West New Britain",shortCode:"WBK"},{name:"West Sepik",shortCode:"SAN"},{name:"Western",shortCode:"WPD"},{name:"Western Highlands",shortCode:"WHM"}]},{countryName:"Paraguay",countryShortCode:"PY",regions:[{name:"Alto Paraguay",shortCode:"16"},{name:"Alto Parana",shortCode:"10"},{name:"Amambay",shortCode:"13"},{name:"Asuncion",shortCode:"ASU"},{name:"Caaguazu",shortCode:"5"},{name:"Caazapa",shortCode:"6"},{name:"Canindeyu",shortCode:"14"},{name:"Central",shortCode:"11"},{name:"Concepcion",shortCode:"1"},{name:"Cordillera",shortCode:"3"},{name:"Guaira",shortCode:"4"},{name:"Itapua",shortCode:"7"},{name:"Misiones",shortCode:"8"},{name:"Neembucu",shortCode:"12"},{name:"Paraguari",shortCode:"9"},{name:"Presidente Hayes",shortCode:"15"},{name:"San Pedro",shortCode:"2"}]},{countryName:"Peru",countryShortCode:"PE",regions:[{name:"Amazonas",shortCode:"AMA"},{name:"Ancash",shortCode:"ANC"},{name:"Apurimac",shortCode:"APU"},{name:"Arequipa",shortCode:"ARE"},{name:"Ayacucho",shortCode:"AYA"},{name:"Cajamarca",shortCode:"CAJ"},{name:"Callao",shortCode:"CAL"},{name:"Cusco",shortCode:"CUS"},{name:"Huancavelica",shortCode:"HUV"},{name:"Huanuco",shortCode:"HUC"},{name:"Ica",shortCode:"ICA"},{name:"Junin",shortCode:"JUN"},{name:"La Libertad",shortCode:"LAL"},{name:"Lambayeque",shortCode:"LAM"},{name:"Lima",shortCode:"LIM"},{name:"Loreto",shortCode:"LOR"},{name:"Madre de Dios",shortCode:"MDD"},{name:"Moquegua",shortCode:"MOQ"},{name:"Municipalidad Metropolitana de Lima",shortCode:"LMA"},{name:"Pasco",shortCode:"PAS"},{name:"Piura",shortCode:"PIU"},{name:"Puno",shortCode:"PUN"},{name:"San Martin",shortCode:"SAM"},{name:"Tacna",shortCode:"TAC"},{name:"Tumbes",shortCode:"TUM"},{name:"Ucayali",shortCode:"UCA"}]},{countryName:"Philippines",countryShortCode:"PH",regions:[{name:"Abra",shortCode:"ABR"},{name:"Agusan del Norte",shortCode:"AGN"},{name:"Agusan del Sur",shortCode:"AGS"},{name:"Aklan",shortCode:"AKL"},{name:"Albay",shortCode:"ALB"},{name:"Antique",shortCode:"ANT"},{name:"Apayao",shortCode:"APA"},{name:"Aurora",shortCode:"AUR"},{name:"Basilan",shortCode:"BAS"},{name:"Bataan",shortCode:"BAN"},{name:"Batanes",shortCode:"BTN"},{name:"Batangas",shortCode:"BTG"},{name:"Benguet",shortCode:"BEN"},{name:"Biliran",shortCode:"BIL"},{name:"Bohol",shortCode:"BOH"},{name:"Bukidnon",shortCode:"BUK"},{name:"Bulacan",shortCode:"BUL"},{name:"Cagayan",shortCode:"CAG"},{name:"Camarines Norte",shortCode:"CAN"},{name:"Camarines Sur",shortCode:"CAS"},{name:"Camiguin",shortCode:"CAM"},{name:"Capiz",shortCode:"CAP"},{name:"Catanduanes",shortCode:"CAT"},{name:"Cavite",shortCode:"CAV"},{name:"Cebu",shortCode:"CEB"},{name:"Compostela",shortCode:"COM"},{name:"Cotabato",shortCode:"NCO"},{name:"Davao del Norte",shortCode:"DAV"},{name:"Davao del Sur",shortCode:"DAS"},{name:"Davao Occidental",shortCode:"DVO"},{name:"Davao Oriental",shortCode:"DAO"},{name:"Dinagat Islands",shortCode:"DIN"},{name:"Eastern Samar",shortCode:"EAS"},{name:"Guimaras",shortCode:"GUI"},{name:"Ifugao",shortCode:"IFU"},{name:"Ilocos Norte",shortCode:"ILN"},{name:"Ilocos Sur",shortCode:"ILS"},{name:"Iloilo",shortCode:"ILI"},{name:"Isabela",shortCode:"ISA"},{name:"Kalinga",shortCode:"KAL"},{name:"La Union",shortCode:"LUN"},{name:"Laguna",shortCode:"LAG"},{name:"Lanao del Norte",shortCode:"LAN"},{name:"Lanao del Sur",shortCode:"LAS"},{name:"Leyte",shortCode:"LEY"},{name:"Maguindanao",shortCode:"MAG"},{name:"Masbate",shortCode:"MAS"},{name:"Metro Manila",shortCode:"00"},{name:"Mindoro Occidental",shortCode:"MDC"},{name:"Mindoro Oriental",shortCode:"MDR"},{name:"Misamis Occidental",shortCode:"MSC"},{name:"Misamis Oriental",shortCode:"MSR"},{name:"Mountain Province",shortCode:"MOU"},{name:"Negros Occidental",shortCode:"NEC"},{name:"Negros Oriental",shortCode:"NER"},{name:"Northern Samar",shortCode:"NSA"},{name:"Nueva Ecija",shortCode:"NUE"},{name:"Nueva Vizcaya",shortCode:"NUV"},{name:"Palawan",shortCode:"PLW"},{name:"Pampanga",shortCode:"PAM"},{name:"Pangasinan",shortCode:"PAN"},{name:"Quezon",shortCode:"QUE"},{name:"Quirino",shortCode:"QUI"},{name:"Rizal",shortCode:"RIZ"},{name:"Romblon",shortCode:"ROM"},{name:"Samar",shortCode:"WSA"},{name:"Sarangani",shortCode:"SAR"},{name:"Siquijor",shortCode:"SIG"},{name:"Sorsogon",shortCode:"SOR"},{name:"Southern Leyte",shortCode:"SLE"},{name:"Sultan Kudarat",shortCode:"AUK"},{name:"Sulu",shortCode:"SLU"},{name:"Surigao del Norte",shortCode:"SUN"},{name:"Surigao del Sur",shortCode:"SUR"},{name:"Tarlac",shortCode:"TAR"},{name:"Tawi-Tawi",shortCode:"TAW"},{name:"Zambales",shortCode:"ZMB"},{name:"Zamboanga del Norte",shortCode:"ZAN"},{name:"Zamboanga del Sur",shortCode:"ZAS"},{name:"Zamboanga Sibugay",shortCode:"ZSI"}]},{countryName:"Pitcairn",countryShortCode:"PN",regions:[{name:"Pitcairn Islands"}]},{countryName:"Poland",countryShortCode:"PL",regions:[{name:"Dolnośląskie",shortCode:"DS"},{name:"Kujawsko-pomorskie",shortCode:"KP"},{name:"Łódzkie",shortCode:"LD"},{name:"Lubelskie",shortCode:"LU"},{name:"Lubuskie",shortCode:"LB"},{name:"Malopolskie",shortCode:"MA"},{name:"Mazowieckie",shortCode:"MZ"},{name:"Opolskie",shortCode:"OP"},{name:"Podkarpackie",shortCode:"PK"},{name:"Podlaskie",shortCode:"PD"},{name:"Pomorskie",shortCode:"PM"},{name:"Śląskie",shortCode:"SL"},{name:"Świętokrzyskie",shortCode:"SK"},{name:"Warmińsko-mazurskie",shortCode:"WN"},{name:"Wielkopolskie",shortCode:"WP"},{name:"Zachodniopomorskie",shortCode:"ZP"}]},{countryName:"Portugal",countryShortCode:"PT",regions:[{name:"Açores",shortCode:"20"},{name:"Aveiro",shortCode:"01"},{name:"Beja",shortCode:"02"},{name:"Braga",shortCode:"03"},{name:"Bragança",shortCode:"04"},{name:"Castelo Branco",shortCode:"05"},{name:"Coimbra",shortCode:"06"},{name:"Évora",shortCode:"07"},{name:"Faro",shortCode:"08"},{name:"Guarda",shortCode:"09"},{name:"Leiria",shortCode:"10"},{name:"Lisboa",shortCode:"11"},{name:"Madeira",shortCode:"30"},{name:"Portalegre",shortCode:"12"},{name:"Porto",shortCode:"13"},{name:"Santarém",shortCode:"14"},{name:"Setúbal",shortCode:"15"},{name:"Viana do Castelo",shortCode:"16"},{name:"Vila Real",shortCode:"17"},{name:"Viseu",shortCode:"18"}]},{countryName:"Puerto Rico",countryShortCode:"PR",regions:[{name:"Adjuntas",shortCode:"AD"},{name:"Aguada",shortCode:"AG"},{name:"Aguadilla",shortCode:"AU"},{name:"Aguas Buenas",shortCode:"AB"},{name:"Aibonito",shortCode:"AI"},{name:"Anasco",shortCode:"AN"},{name:"Arecibo",shortCode:"AR"},{name:"Arroyo",shortCode:"AO"},{name:"Barceloneta",shortCode:"BA"},{name:"Barranquitas",shortCode:"BR"},{name:"Bayamon",shortCode:"BY"},{name:"Cabo Rojo",shortCode:"CR"},{name:"Caguas",shortCode:"CA"},{name:"Camuy",shortCode:"CM"},{name:"Canovanas",shortCode:"CN"},{name:"Carolina",shortCode:"CL"},{name:"Cat",shortCode:"CT"},{name:"Ceiba",shortCode:"CB"},{name:"Ciales",shortCode:"CE"},{name:"Cidra",shortCode:"CD"},{name:"Coamo",shortCode:"CO"},{name:"Comerio",shortCode:"CI"},{name:"Corozal",shortCode:"CZ"},{name:"Culebra",shortCode:"CU"},{name:"Dorado",shortCode:"DO"},{name:"Fajardo",shortCode:"FA"},{name:"Florida",shortCode:"FL"},{name:"Guanica",shortCode:"GA"},{name:"Guayama",shortCode:"GY"},{name:"Guayanilla",shortCode:"GN"},{name:"Guaynabo",shortCode:"GU"},{name:"Gurabo",shortCode:"GB"},{name:"Hatillo",shortCode:"HT"},{name:"Hormigueros",shortCode:"HO"},{name:"Humacao",shortCode:"HM"},{name:"Isabe",shortCode:"IS"},{name:"Juana Diaz",shortCode:"JD"},{name:"Juncos",shortCode:"JU"},{name:"Lajas",shortCode:"LJ"},{name:"Lares",shortCode:"LR"},{name:"Las Marias",shortCode:"LM"},{name:"Las oiza",shortCode:"LO"},{name:"Luquillo",shortCode:"LQ"},{name:"Manati",shortCode:"MN"},{name:"Maricao",shortCode:"MR"},{name:"Maunabo",shortCode:"MU"},{name:"Mayaguez",shortCode:"MY"},{name:"Moca",shortCode:"MO"},{name:"Morovis",shortCode:"MV"},{name:"Naguabo",shortCode:"NG"},{name:"Naranjito",shortCode:"NR"},{name:"Orocovis",shortCode:"OC"},{name:"Patillas",shortCode:"PT"},{name:"Penuelas",shortCode:"PU"},{name:"Ponce",shortCode:"PO"},{name:"Quebradillas",shortCode:"QB"},{name:"Rincon",shortCode:"RN"},{name:"Rio Grande",shortCode:"RG"},{name:"Sabana linas",shortCode:"SL"},{name:"San German",shortCode:"SG"},{name:"San Juan",shortCode:"SJ"},{name:"San Lorenzo",shortCode:"SN"},{name:"San Sebastian",shortCode:"SS"},{name:"Santa Isabel",shortCode:"SI"},{name:"Toa Alta",shortCode:"TA"},{name:"Toa Baja",shortCode:"TB"},{name:"Trujillo Alto",shortCode:"TJ"},{name:"Utuado",shortCode:"UT"},{name:"Vega Alta",shortCode:"VA"},{name:"Vega ues",shortCode:"VU"},{name:"Villalba",shortCode:"VI"},{name:"Yabucoa",shortCode:"YB"},{name:"Yauco",shortCode:"YA"}]},{countryName:"Qatar",countryShortCode:"QA",regions:[{name:"Ad Dawḩah",shortCode:"DA"},{name:"Al Khawr wa adh Dhakhīrah",shortCode:"KH"},{name:"Al Wakrah",shortCode:"WA"},{name:"Ar Rayyān",shortCode:"RA"},{name:"Ash Shamāl",shortCode:"MS"},{name:"Az̧ Za̧`āyin",shortCode:"ZA"},{name:"Umm Şalāl",shortCode:"US"}]},{countryName:"Réunion",countryShortCode:"RE",regions:[{name:"Réunion"}]},{countryName:"Romania",countryShortCode:"RO",regions:[{name:"Alba",shortCode:"AB"},{name:"Arad",shortCode:"AR"},{name:"Arges",shortCode:"AG"},{name:"Bacau",shortCode:"BC"},{name:"Bihor",shortCode:"BH"},{name:"Bistrita-Nasaud",shortCode:"BN"},{name:"Botosani",shortCode:"BT"},{name:"Braila",shortCode:"BR"},{name:"Brasov",shortCode:"BV"},{name:"Bucuresti",shortCode:"B"},{name:"Buzau",shortCode:"BZ"},{name:"Calarasi",shortCode:"CL"},{name:"Caras-Severin",shortCode:"CS"},{name:"Cluj",shortCode:"CJ"},{name:"Constanta",shortCode:"CT"},{name:"Covasna",shortCode:"CV"},{name:"Dambovita",shortCode:"DB"},{name:"Dolj",shortCode:"DJ"},{name:"Galati",shortCode:"GL"},{name:"Giurgiu",shortCode:"GR"},{name:"Gorj",shortCode:"GJ"},{name:"Harghita",shortCode:"HR"},{name:"Hunedoara",shortCode:"HD"},{name:"Ialomita",shortCode:"IL"},{name:"Iasi",shortCode:"IS"},{name:"Maramures",shortCode:"MM"},{name:"Mehedinti",shortCode:"MH"},{name:"Mures",shortCode:"MS"},{name:"Neamt",shortCode:"NT"},{name:"Olt",shortCode:"OT"},{name:"Prahova",shortCode:"PH"},{name:"Salaj",shortCode:"SJ"},{name:"Satu Mare",shortCode:"SM"},{name:"Sibiu",shortCode:"SB"},{name:"Suceava",shortCode:"SV"},{name:"Teleorman",shortCode:"TR"},{name:"Timis",shortCode:"TM"},{name:"Tulcea",shortCode:"TL"},{name:"Valcea",shortCode:"VL"},{name:"Vaslui",shortCode:"VS"},{name:"Vrancea",shortCode:"VN"}]},{countryName:"Russian Federation",countryShortCode:"RU",regions:[{name:"Republic of Adygea",shortCode:"AD"},{name:"Republic of Altai (Gorno-Altaysk)",shortCode:"AL"},{name:"Altai Krai",shortCode:"ALT"},{name:"Amur Oblast",shortCode:"AMU"},{name:"Arkhangelsk Oblast",shortCode:"ARK"},{name:"Astrakhan Oblast",shortCode:"AST"},{name:"Republic of Bashkortostan",shortCode:"BA"},{name:"Belgorod Oblast",shortCode:"BEL"},{name:"Bryansk Oblast",shortCode:"BRY"},{name:"Republic of Buryatia",shortCode:"BU"},{name:"Chechen Republic",shortCode:"CE"},{name:"Chelyabinsk Oblast",shortCode:"CHE"},{name:"Chukotka Autonomous Okrug",shortCode:"CHU"},{name:"Chuvash Republic",shortCode:"CU"},{name:"Republic of Dagestan",shortCode:"DA"},{name:"Republic of Ingushetia",shortCode:"IN"},{name:"Irkutsk Oblast",shortCode:"IRK"},{name:"Ivanovo Oblast",shortCode:"IVA"},{name:"Jewish Autonomous Oblast",shortCode:"JEW"},{name:"Kabardino-Balkar Republic",shortCode:"KB"},{name:"Kaliningrad Oblast",shortCode:"KLN"},{name:"Republic of Kalmykia",shortCode:"KL"},{name:"Kaluga Oblast",shortCode:"KLU"},{name:"Kamchatka Krai",shortCode:"KAM"},{name:"Karachay-Cherkess Republic",shortCode:"KC"},{name:"Republic of Karelia",shortCode:"KR"},{name:"Khabarovsk Krai",shortCode:"KHA"},{name:"Republic of Khakassia",shortCode:"KK"},{name:"Khanty-Mansi Autonomous Okrug - Yugra",shortCode:"KHM"},{name:"Kemerovo Oblast",shortCode:"KEM"},{name:"Kirov Oblast",shortCode:"KIR"},{name:"Komi Republic",shortCode:"KO"},{name:"Kostroma Oblast",shortCode:"KOS"},{name:"Krasnodar Krai",shortCode:"KDA"},{name:"Krasnoyarsk Krai",shortCode:"KYA"},{name:"Kurgan Oblast",shortCode:"KGN"},{name:"Kursk Oblast",shortCode:"KRS"},{name:"Leningrad Oblast",shortCode:"LEN"},{name:"Lipetsk Oblast",shortCode:"LIP"},{name:"Magadan Oblast",shortCode:"MAG"},{name:"Mari El Republic",shortCode:"ME"},{name:"Republic of Mordovia",shortCode:"MO"},{name:"Moscow Oblast",shortCode:"MOS"},{name:"Moscow",shortCode:"MOW"},{name:"Murmansk Oblast",shortCode:"MU"},{name:"Nenets Autonomous Okrug",shortCode:"NEN"},{name:"Nizhny Novgorod Oblast",shortCode:"NIZ"},{name:"Novgorod Oblast",shortCode:"NGR"},{name:"Novosibirsk Oblast",shortCode:"NVS"},{name:"Omsk Oblast",shortCode:"OMS"},{name:"Orenburg Oblast",shortCode:"ORE"},{name:"Oryol Oblast",shortCode:"ORL"},{name:"Penza Oblast",shortCode:"PNZ"},{name:"Perm Krai",shortCode:"PER"},{name:"Primorsky Krai",shortCode:"PRI"},{name:"Pskov Oblast",shortCode:"PSK"},{name:"Rostov Oblast",shortCode:"ROS"},{name:"Ryazan Oblast",shortCode:"RYA"},{name:"Saint Petersburg",shortCode:"SPE"},{name:"Sakha (Yakutia) Republic",shortCode:"SA"},{name:"Sakhalin Oblast",shortCode:"SAK"},{name:"Samara Oblast",shortCode:"SAM"},{name:"Saratov Oblast",shortCode:"SAR"},{name:"Republic of North Ossetia-Alania",shortCode:"NOA"},{name:"Smolensk Oblast",shortCode:"SMO"},{name:"Stavropol Krai",shortCode:"STA"},{name:"Sverdlovsk Oblast",shortCode:"SVE"},{name:"Tambov Oblast",shortCode:"TAM"},{name:"Republic of Tatarstan",shortCode:"TA"},{name:"Tomsk Oblast",shortCode:"TOM"},{name:"Tuva Republic",shortCode:"TU"},{name:"Tula Oblast",shortCode:"TUL"},{name:"Tver Oblast",shortCode:"TVE"},{name:"Tyumen Oblast",shortCode:"TYU"},{name:"Udmurt Republic",shortCode:"UD"},{name:"Ulyanovsk Oblast",shortCode:"ULY"},{name:"Vladimir Oblast",shortCode:"VLA"},{name:"Volgograd Oblast",shortCode:"VGG"},{name:"Vologda Oblast",shortCode:"VLG"},{name:"Voronezh Oblast",shortCode:"VOR"},{name:"Yamalo-Nenets Autonomous Okrug",shortCode:"YAN"},{name:"Yaroslavl Oblast",shortCode:"YAR"},{name:"Zabaykalsky Krai",shortCode:"ZAB"}]},{countryName:"Rwanda",countryShortCode:"RW",regions:[{name:"Kigali",shortCode:"01"},{name:"Eastern",shortCode:"02"},{name:"Northern",shortCode:"03"},{name:"Western",shortCode:"04"},{name:"Southern",shortCode:"05"}]},{countryName:"Saint Barthélemy",countryShortCode:"BL",regions:[{name:"Au Vent",shortCode:"02"},{name:"Sous le Vent",shortCode:"01"}]},{countryName:"Saint Helena, Ascension and Tristan da Cunha",countryShortCode:"SH",regions:[{name:"Ascension",shortCode:"AC"},{name:"Saint Helena",shortCode:"HL"},{name:"Tristan da Cunha",shortCode:"TA"}]},{countryName:"Saint Kitts and Nevis",countryShortCode:"KN",regions:[{name:"Saint Kitts",shortCode:"K"},{name:"Nevis",shortCode:"N"}]},{countryName:"Saint Lucia",countryShortCode:"LC",regions:[{name:"Anse-la-Raye",shortCode:"01"},{name:"Canaries",shortCode:"12"},{name:"Castries",shortCode:"02"},{name:"Choiseul",shortCode:"03"},{name:"Dennery",shortCode:"05"},{name:"Gros Islet",shortCode:"06"},{name:"Laborie",shortCode:"07"},{name:"Micoud",shortCode:"08"},{name:"Soufriere",shortCode:"10"},{name:"Vieux Fort",shortCode:"11"}]},{countryName:"Saint Martin",countryShortCode:"MF",regions:[{name:"Saint Martin"}]},{countryName:"Saint Pierre and Miquelon",countryShortCode:"PM",regions:[{name:"Miquelon"},{name:"Saint Pierre"}]},{countryName:"Saint Vincent and the Grenadines",countryShortCode:"VC",regions:[{name:"Charlotte",shortCode:"01"},{name:"Grenadines",shortCode:"06"},{name:"Saint Andrew",shortCode:"02"},{name:"Saint David",shortCode:"03"},{name:"Saint George",shortCode:"04"},{name:"Saint Patrick",shortCode:"05"}]},{countryName:"Samoa",countryShortCode:"WS",regions:[{name:"A'ana",shortCode:"AA"},{name:"Aiga-i-le-Tai",shortCode:"AL"},{name:"Atua",shortCode:"AT"},{name:"Fa'asaleleaga",shortCode:"FA"},{name:"Gaga'emauga",shortCode:"GE"},{name:"Gagaifomauga",shortCode:"GI"},{name:"Palauli",shortCode:"PA"},{name:"Satupa'itea",shortCode:"SA"},{name:"Tuamasaga",shortCode:"TU"},{name:"Va'a-o-Fonoti",shortCode:"VF"},{name:"Vaisigano",shortCode:"VS"}]},{countryName:"San Marino",countryShortCode:"SM",regions:[{name:"Acquaviva",shortCode:"01"},{name:"Borgo Maggiore",shortCode:"06"},{name:"Chiesanuova",shortCode:"02"},{name:"Domagnano",shortCode:"03"},{name:"Faetano",shortCode:"04"},{name:"Fiorentino",shortCode:"05"},{name:"Montegiardino",shortCode:"08"},{name:"San Marino",shortCode:"07"},{name:"Serravalle",shortCode:"09"}]},{countryName:"Sao Tome and Principe",countryShortCode:"ST",regions:[{name:"Principe",shortCode:"P"},{name:"Sao Tome",shortCode:"S"}]},{countryName:"Saudi Arabia",countryShortCode:"SA",regions:[{name:"'Asir",shortCode:"14"},{name:"Al Bahah",shortCode:"11"},{name:"Al Hudud ash Shamaliyah",shortCode:"08"},{name:"Al Jawf",shortCode:"12"},{name:"Al Madinah al Munawwarah",shortCode:"03"},{name:"Al Qasim",shortCode:"05"},{name:"Ar Riyad",shortCode:"01"},{name:"Ash Sharqiyah",shortCode:"04"},{name:"Ha'il",shortCode:"06"},{name:"Jazan",shortCode:"09"},{name:"Makkah al Mukarramah",shortCode:"02"},{name:"Najran",shortCode:"10"},{name:"Tabuk",shortCode:"07"}]},{countryName:"Senegal",countryShortCode:"SN",regions:[{name:"Dakar",shortCode:"DK"},{name:"Diourbel",shortCode:"DB"},{name:"Fatick",shortCode:"FK"},{name:"Kaffrine",shortCode:"KA"},{name:"Kaolack",shortCode:"KL"},{name:"Kedougou",shortCode:"KE"},{name:"Kolda",shortCode:"KD"},{name:"Louga",shortCode:"LG"},{name:"Matam",shortCode:"MT"},{name:"Saint-Louis",shortCode:"SL"},{name:"Sedhiou",shortCode:"SE"},{name:"Tambacounda",shortCode:"TC"},{name:"Thies",shortCode:"TH"},{name:"Ziguinchor",shortCode:"ZG"}]},{countryName:"Serbia",countryShortCode:"RS",regions:[{name:"Beograd (Belgrade)",shortCode:"00"},{name:"Borski",shortCode:"14"},{name:"Braničevski",shortCode:"11"},{name:"Jablanički",shortCode:"23"},{name:"Južnobački",shortCode:"06"},{name:"Južnobanatski",shortCode:"04"},{name:"Kolubarski",shortCode:"09"},{name:"Kosovski",shortCode:"25"},{name:"Kosovsko-Mitrovački",shortCode:"28"},{name:"Kosovsko-Pomoravski",shortCode:"29"},{name:"Mačvanski",shortCode:"08"},{name:"Moravički",shortCode:"17"},{name:"Nišavski",shortCode:"20"},{name:"Pčinjski",shortCode:"24"},{name:"Pećki",shortCode:"26"},{name:"Pirotski",shortCode:"22"},{name:"Podunavski",shortCode:"10"},{name:"Pomoravski",shortCode:"13"},{name:"Prizrenski",shortCode:"27"},{name:"Rasinski",shortCode:"19"},{name:"Raški",shortCode:"18"},{name:"Severnobački",shortCode:"01"},{name:"Severnobanatski",shortCode:"03"},{name:"Srednjebanatski",shortCode:"02"},{name:"Sremski",shortCode:"07"},{name:"Šumadijski",shortCode:"12"},{name:"Toplički",shortCode:"21"},{name:"Zaječarski",shortCode:"15"},{name:"Zapadnobački",shortCode:"05"},{name:"Zlatiborski",shortCode:"16"}]},{countryName:"Seychelles",countryShortCode:"SC",regions:[{name:"Anse aux Pins",shortCode:"01"},{name:"Anse Boileau",shortCode:"02"},{name:"Anse Etoile",shortCode:"03"},{name:"Anse Royale",shortCode:"05"},{name:"Anu Cap",shortCode:"04"},{name:"Baie Lazare",shortCode:"06"},{name:"Baie Sainte Anne",shortCode:"07"},{name:"Beau Vallon",shortCode:"08"},{name:"Bel Air",shortCode:"09"},{name:"Bel Ombre",shortCode:"10"},{name:"Cascade",shortCode:"11"},{name:"Glacis",shortCode:"12"},{name:"Grand'Anse Mahe",shortCode:"13"},{name:"Grand'Anse Praslin",shortCode:"14"},{name:"La Digue",shortCode:"15"},{name:"La Riviere Anglaise",shortCode:"16"},{name:"Les Mamelles",shortCode:"24"},{name:"Mont Buxton",shortCode:"17"},{name:"Mont Fleuri",shortCode:"18"},{name:"Plaisance",shortCode:"19"},{name:"Pointe La Rue",shortCode:"20"},{name:"Port Glaud",shortCode:"21"},{name:"Roche Caiman",shortCode:"25"},{name:"Saint Louis",shortCode:"22"},{name:"Takamaka",shortCode:"23"}]},{countryName:"Sierra Leone",countryShortCode:"SL",regions:[{name:"Eastern",shortCode:"E"},{name:"Northern",shortCode:"N"},{name:"Southern",shortCode:"S"},{name:"Western",shortCode:"W"}]},{countryName:"Singapore",countryShortCode:"SG",regions:[{name:"Central Singapore",shortCode:"01"},{name:"North East",shortCode:"02"},{name:"North West",shortCode:"03"},{name:"South East",shortCode:"04"},{name:"South West",shortCode:"05"}]},{countryName:"Sint Maarten (Dutch part)",countryShortCode:"SX",regions:[{name:"Sint Maarten"}]},{countryName:"Slovakia",countryShortCode:"SK",regions:[{name:"Banskobystricky",shortCode:"BC"},{name:"Bratislavsky",shortCode:"BL"},{name:"Kosicky",shortCode:"KI"},{name:"Nitriansky",shortCode:"NI"},{name:"Presovsky",shortCode:"PV"},{name:"Trenciansky",shortCode:"TC"},{name:"Trnavsky",shortCode:"TA"},{name:"Zilinsky",shortCode:"ZI"}]},{countryName:"Slovenia",countryShortCode:"SI",regions:[{name:"Ajdovscina",shortCode:"001"},{name:"Apace",shortCode:"195"},{name:"Beltinci",shortCode:"002"},{name:"Benedikt",shortCode:"148"},{name:"Bistrica ob Sotli",shortCode:"149"},{name:"Bled",shortCode:"003"},{name:"Bloke",shortCode:"150"},{name:"Bohinj",shortCode:"004"},{name:"Borovnica",shortCode:"005"},{name:"Bovec",shortCode:"006"},{name:"Braslovce",shortCode:"151"},{name:"Brda",shortCode:"007"},{name:"Brezice",shortCode:"009"},{name:"Brezovica",shortCode:"008"},{name:"Cankova",shortCode:"152"},{name:"Celje",shortCode:"011"},{name:"Cerklje na Gorenjskem",shortCode:"012"},{name:"Cerknica",shortCode:"013"},{name:"Cerkno",shortCode:"014"},{name:"Cerkvenjak",shortCode:"153"},{name:"Cirkulane",shortCode:"196"},{name:"Crensovci",shortCode:"015"},{name:"Crna na Koroskem",shortCode:"016"},{name:"Crnomelj",shortCode:"017"},{name:"Destrnik",shortCode:"018"},{name:"Divaca",shortCode:"019"},{name:"Dobje",shortCode:"154"},{name:"Dobrepolje",shortCode:"020"},{name:"Dobrna",shortCode:"155"},{name:"Dobrova-Polhov Gradec",shortCode:"021"},{name:"Dobrovnik",shortCode:"156"},{name:"Dol pri Ljubljani",shortCode:"022"},{name:"Dolenjske Toplice",shortCode:"157"},{name:"Domzale",shortCode:"023"},{name:"Dornava",shortCode:"024"},{name:"Dravograd",shortCode:"025"},{name:"Duplek",shortCode:"026"},{name:"Gorenja Vas-Poljane",shortCode:"027"},{name:"Gorisnica",shortCode:"028"},{name:"Gorje",shortCode:"207"},{name:"Gornja Radgona",shortCode:"029"},{name:"Gornji Grad",shortCode:"030"},{name:"Gornji Petrovci",shortCode:"031"},{name:"Grad",shortCode:"158"},{name:"Grosuplje",shortCode:"032"},{name:"Hajdina",shortCode:"159"},{name:"Hoce-Slivnica",shortCode:"160"},{name:"Hodos",shortCode:"161"},{name:"Horjul",shortCode:"162"},{name:"Hrastnik",shortCode:"034"},{name:"Hrpelje-Kozina",shortCode:"035"},{name:"Idrija",shortCode:"036"},{name:"Ig",shortCode:"037"},{name:"Ilirska Bistrica",shortCode:"038"},{name:"Ivancna Gorica",shortCode:"039"},{name:"Izola",shortCode:"040s"},{name:"Jesenice",shortCode:"041"},{name:"Jursinci",shortCode:"042"},{name:"Kamnik",shortCode:"043"},{name:"Kanal",shortCode:"044"},{name:"Kidricevo",shortCode:"045"},{name:"Kobarid",shortCode:"046"},{name:"Kobilje",shortCode:"047"},{name:"Kocevje",shortCode:"048"},{name:"Komen",shortCode:"049"},{name:"Komenda",shortCode:"164"},{name:"Koper",shortCode:"050"},{name:"Kodanjevica na Krki",shortCode:"197"},{name:"Kostel",shortCode:"165"},{name:"Kozje",shortCode:"051"},{name:"Kranj",shortCode:"052"},{name:"Kranjska Gora",shortCode:"053"},{name:"Krizevci",shortCode:"166"},{name:"Krsko",shortCode:"054"},{name:"Kungota",shortCode:"055"},{name:"Kuzma",shortCode:"056"},{name:"Lasko",shortCode:"057"},{name:"Lenart",shortCode:"058"},{name:"Lendava",shortCode:"059"},{name:"Litija",shortCode:"068"},{name:"Ljubljana",shortCode:"061"},{name:"Ljubno",shortCode:"062"},{name:"Ljutomer",shortCode:"063"},{name:"Log-Dragomer",shortCode:"208"},{name:"Logatec",shortCode:"064"},{name:"Loska Dolina",shortCode:"065"},{name:"Loski Potok",shortCode:"066"},{name:"Lovrenc na Pohorju",shortCode:"167"},{name:"Lukovica",shortCode:"068"},{name:"Luce",shortCode:"067"},{name:"Majsperk",shortCode:"069"},{name:"Makole",shortCode:"198"},{name:"Maribor",shortCode:"070"},{name:"Markovci",shortCode:"168"},{name:"Medvode",shortCode:"071"},{name:"Menges",shortCode:"072"},{name:"Metlika",shortCode:"073"},{name:"Mezica",shortCode:"074"},{name:"Miklavz na Dravskem Polju",shortCode:"169"},{name:"Miren-Kostanjevica",shortCode:"075"},{name:"Mirna",shortCode:"212"},{name:"Mirna Pec",shortCode:"170"},{name:"Mislinja",shortCode:"076"},{name:"Mokronog-Trebelno",shortCode:"199"},{name:"Moravce",shortCode:"077"},{name:"Moravske Toplice",shortCode:"078"},{name:"Mozirje",shortCode:"079"},{name:"Murska Sobota",shortCode:"080"},{name:"Naklo",shortCode:"082"},{name:"Nazarje",shortCode:"083"},{name:"Nova Gorica",shortCode:"084"},{name:"Novo Mesto",shortCode:"085"},{name:"Odranci",shortCode:"086"},{name:"Ormoz",shortCode:"087"},{name:"Osilnica",shortCode:"088"},{name:"Pesnica",shortCode:"089"},{name:"Piran",shortCode:"090"},{name:"Pivka",shortCode:"091"},{name:"Podcetrtek",shortCode:"092"},{name:"Podlehnik",shortCode:"172"},{name:"Podvelka",shortCode:"093"},{name:"Poljcane",shortCode:"200"},{name:"Postojna",shortCode:"094"},{name:"Prebold",shortCode:"174"},{name:"Preddvor",shortCode:"095"},{name:"Prevalje",shortCode:"175"},{name:"Ptuj",shortCode:"096"},{name:"Race-Fram",shortCode:"098"},{name:"Radece",shortCode:"099"},{name:"Radenci",shortCode:"100"},{name:"Radlje ob Dravi",shortCode:"101"},{name:"Radovljica",shortCode:"102"},{name:"Ravne na Koroskem",shortCode:"103"},{name:"Razkrizje",shortCode:"176"},{name:"Recica ob Savinji",shortCode:"209"},{name:"Rence-Vogrsko",shortCode:"201"},{name:"Ribnica",shortCode:"104"},{name:"Ribnica na Poboriu",shortCode:"177"},{name:"Rogaska Slatina",shortCode:"106"},{name:"Rogasovci",shortCode:"105"},{name:"Rogatec",shortCode:"107"},{name:"Ruse",shortCode:"108"},{name:"Salovci",shortCode:"033"},{name:"Selnica ob Dravi",shortCode:"178"},{name:"Semic",shortCode:"109"},{name:"Sempeter-Vrtojba",shortCode:"183"},{name:"Sencur",shortCode:"117"},{name:"Sentilj",shortCode:"118"},{name:"Sentjernej",shortCode:"119"},{name:"Sentjur",shortCode:"120"},{name:"Sentrupert",shortCode:"211"},{name:"Sevnica",shortCode:"110"},{name:"Sezana",shortCode:"111"},{name:"Skocjan",shortCode:"121"},{name:"Skofja Loka",shortCode:"122"},{name:"Skofljica",shortCode:"123"},{name:"Slovenj Gradec",shortCode:"112"},{name:"Slovenska Bistrica",shortCode:"113"},{name:"Slovenske Konjice",shortCode:"114"},{name:"Smarje pri elsah",shortCode:"124"},{name:"Smarjeske Toplice",shortCode:"206"},{name:"Smartno ob Paki",shortCode:"125"},{name:"Smartno pri Litiji",shortCode:"194"},{name:"Sodrazica",shortCode:"179"},{name:"Solcava",shortCode:"180"},{name:"Sostanj",shortCode:"126"},{name:"Sredisce ob Dravi",shortCode:"202"},{name:"Starse",shortCode:"115"},{name:"Store",shortCode:"127"},{name:"Straza",shortCode:"203"},{name:"Sveta Ana",shortCode:"181"},{name:"Sveta Trojica v Slovenskih Goricah",shortCode:"204"},{name:"Sveta Andraz v Slovenskih Goricah",shortCode:"182"},{name:"Sveti Jurij",shortCode:"116"},{name:"Sveti Jurij v Slovenskih Goricah",shortCode:"210"},{name:"Sveti Tomaz",shortCode:"205"},{name:"Tabor",shortCode:"184"},{name:"Tisina",shortCode:"128"},{name:"Tolmin",shortCode:"128"},{name:"Trbovlje",shortCode:"129"},{name:"Trebnje",shortCode:"130"},{name:"Trnovska Vas",shortCode:"185"},{name:"Trzin",shortCode:"186"},{name:"Trzic",shortCode:"131"},{name:"Turnisce",shortCode:"132"},{name:"Velenje",shortCode:"133"},{name:"Velika Polana",shortCode:"187"},{name:"Velike Lasce",shortCode:"134"},{name:"Verzej",shortCode:"188"},{name:"Videm",shortCode:"135"},{name:"Vipava",shortCode:"136"},{name:"Vitanje",shortCode:"137"},{name:"Vodice",shortCode:"138"},{name:"Vojnik",shortCode:"139"},{name:"Vransko",shortCode:"189"},{name:"Vrhnika",shortCode:"140"},{name:"Vuzenica",shortCode:"141"},{name:"Zagorje ob Savi",shortCode:"142"},{name:"Zavrc",shortCode:"143"},{name:"Zrece",shortCode:"144"},{name:"Zalec",shortCode:"190"},{name:"Zelezniki",shortCode:"146"},{name:"Zetale",shortCode:"191"},{name:"Ziri",shortCode:"147"},{name:"Zirovnica",shortCode:"192"},{name:"Zuzemberk",shortCode:"193"}]},{countryName:"Solomon Islands",countryShortCode:"SB",regions:[{name:"Central",shortCode:"CE"},{name:"Choiseul",shortCode:"CH"},{name:"Guadalcanal",shortCode:"GU"},{name:"Honiara",shortCode:"CT"},{name:"Isabel",shortCode:"IS"},{name:"Makira-Ulawa",shortCode:"MK"},{name:"Malaita",shortCode:"ML"},{name:"Rennell and Bellona",shortCode:"RB"},{name:"Temotu",shortCode:"TE"},{name:"Western",shortCode:"WE"}]},{countryName:"Somalia",countryShortCode:"SO",regions:[{name:"Awdal",shortCode:"AW"},{name:"Bakool",shortCode:"BK"},{name:"Banaadir",shortCode:"BN"},{name:"Bari",shortCode:"BR"},{name:"Bay",shortCode:"BY"},{name:"Galguduud",shortCode:"GA"},{name:"Gedo",shortCode:"GE"},{name:"Hiiraan",shortCode:"HI"},{name:"Jubbada Dhexe",shortCode:"JD"},{name:"Jubbada Hoose",shortCode:"JH"},{name:"Mudug",shortCode:"MU"},{name:"Nugaal",shortCode:"NU"},{name:"Sanaag",shortCode:"SA"},{name:"Shabeellaha Dhexe",shortCode:"SD"},{name:"Shabeellaha Hoose",shortCode:"SH"},{name:"Sool",shortCode:"SO"},{name:"Togdheer",shortCode:"TO"},{name:"Woqooyi Galbeed",shortCode:"WO"}]},{countryName:"South Africa",countryShortCode:"ZA",regions:[{name:"Eastern Cape",shortCode:"EC"},{name:"Free State",shortCode:"FS"},{name:"Gauteng",shortCode:"GT"},{name:"KwaZulu-Natal",shortCode:"NL"},{name:"Limpopo",shortCode:"LP"},{name:"Mpumalanga",shortCode:"MP"},{name:"Northern Cape",shortCode:"NC"},{name:"North West",shortCode:"NW"},{name:"Western Cape",shortCode:"WC"}]},{countryName:"South Georgia and South Sandwich Islands",countryShortCode:"GS",regions:[{name:"Bird Island"},{name:"Bristol Island"},{name:"Clerke Rocks"},{name:"Montagu Island"},{name:"Saunders Island"},{name:"South Georgia"},{name:"Southern Thule"},{name:"Traversay Islands"}]},{countryName:"South Sudan",countryShortCode:"SS",regions:[{name:"Central Equatoria",shortCode:"CE"},{name:"Eastern Equatoria",shortCode:"EE"},{name:"Jonglei",shortCode:"JG"},{name:"Lakes",shortCode:"LK"},{name:"Northern Bahr el Ghazal",shortCode:"BN"},{name:"Unity",shortCode:"UY"},{name:"Upper Nile",shortCode:"NU"},{name:"Warrap",shortCode:"WR"},{name:"Western Bahr el Ghazal",shortCode:"BW"},{name:"Western Equatoria",shortCode:"EW"}]},{countryName:"Spain",countryShortCode:"ES",regions:[{name:"Albacete",shortCode:"CM"},{name:"Alicante",shortCode:"VC"},{name:"Almería",shortCode:"AN"},{name:"Araba/Álava",shortCode:"VI"},{name:"Asturias",shortCode:"O"},{name:"Ávila",shortCode:"AV"},{name:"Badajoz",shortCode:"BA"},{name:"Barcelona",shortCode:"B"},{name:"Bizkaia",shortCode:"BI"},{name:"Burgos",shortCode:"BU"},{name:"Cáceres",shortCode:"CC"},{name:"Cádiz",shortCode:"CA"},{name:"Cantabria",shortCode:"S"},{name:"Castellón",shortCode:"CS"},{name:"Cueta",shortCode:"CU"},{name:"Ciudad Real",shortCode:"CR"},{name:"Córdoba",shortCode:"CO"},{name:"A Coruña",shortCode:"C"},{name:"Cuenca",shortCode:"CU"},{name:"Gipuzkoa",shortCode:"SS"},{name:"Girona",shortCode:"GI"},{name:"Granada",shortCode:"GR"},{name:"Guadalajara",shortCode:"GU"},{name:"Huelva",shortCode:"H"},{name:"Huesca",shortCode:"HU"},{name:"Illes Balears",shortCode:"PM"},{name:"Jaén",shortCode:"J"},{name:"León",shortCode:"LE"},{name:"Lleida",shortCode:"L"},{name:"Lugo",shortCode:"LU"},{name:"Madrid",shortCode:"M"},{name:"Málaga",shortCode:"MA"},{name:"Melilla",shortCode:"ML"},{name:"Murcia",shortCode:"MU"},{name:"Navarre",shortCode:"NA"},{name:"Ourense",shortCode:"OR"},{name:"Palencia",shortCode:"P"},{name:"Las Palmas",shortCode:"GC"},{name:"Pontevedra",shortCode:"PO"},{name:"La Rioja",shortCode:"LO"},{name:"Salamanca",shortCode:"SA"},{name:"Santa Cruz de Tenerife",shortCode:"TF"},{name:"Segovia",shortCode:"SG"},{name:"Sevilla",shortCode:"SE"},{name:"Soria",shortCode:"SO"},{name:"Tarragona",shortCode:"T"},{name:"Teruel",shortCode:"TE"},{name:"Toledo",shortCode:"TO"},{name:"Valencia",shortCode:"V"},{name:"Valladolid",shortCode:"VA"},{name:"Zamora",shortCode:"ZA"},{name:"Zaragoza",shortCode:"Z"}]},{countryName:"Sri Lanka",countryShortCode:"LK",regions:[{name:"Basnahira",shortCode:"1"},{name:"Dakunu",shortCode:"3"},{name:"Madhyama",shortCode:"2"},{name:"Naegenahira",shortCode:"5"},{name:"Sabaragamuwa",shortCode:"9"},{name:"Uturu",shortCode:"4"},{name:"Uturumaeda",shortCode:"7"},{name:"Vayamba",shortCode:"6"},{name:"Uva",shortCode:"8"}]},{countryName:"Sudan",countryShortCode:"SD",regions:[{name:"Al Bahr al Ahmar",shortCode:"RS"},{name:"Al Jazirah",shortCode:"GZ"},{name:"Al Khartum",shortCode:"KH"},{name:"Al Qadarif",shortCode:"GD"},{name:"An Nil al Abyad",shortCode:"NW"},{name:"An Nil al Azraq",shortCode:"NB"},{name:"Ash Shamaliyah",shortCode:"NO"},{name:"Gharb Darfur",shortCode:"DW"},{name:"Gharb Kurdufan",shortCode:"GK"},{name:"Janub Darfur",shortCode:"DS"},{name:"Janub Kurdufan",shortCode:"KS"},{name:"Kassala",shortCode:"KA"},{name:"Nahr an Nil",shortCode:"NR"},{name:"Shamal Darfur",shortCode:"DN"},{name:"Sharq Darfur",shortCode:"DE"},{name:"Shiamal Kurdufan",shortCode:"KN"},{name:"Sinnar",shortCode:"SI"},{name:"Wasat Darfur Zalinjay",shortCode:"DC"}]},{countryName:"Suriname",countryShortCode:"SR",regions:[{name:"Brokopondo",shortCode:"BR"},{name:"Commewijne",shortCode:"CM"},{name:"Coronie",shortCode:"CR"},{name:"Marowijne",shortCode:"MA"},{name:"Nickerie",shortCode:"NI"},{name:"Para",shortCode:"PR"},{name:"Paramaribo",shortCode:"PM"},{name:"Saramacca",shortCode:"SA"},{name:"Sipaliwini",shortCode:"SI"},{name:"Wanica",shortCode:"WA"}]},{countryName:"Swaziland",countryShortCode:"SZ",regions:[{name:"Hhohho",shortCode:"HH"},{name:"Lubombo",shortCode:"LU"},{name:"Manzini",shortCode:"MA"},{name:"Shiselweni",shortCode:"SH"}]},{countryName:"Sweden",countryShortCode:"SE",regions:[{name:"Blekinge",shortCode:"K"},{name:"Dalarna",shortCode:"W"},{name:"Gävleborg",shortCode:"X"},{name:"Gotland",shortCode:"I"},{name:"Halland",shortCode:"N"},{name:"Jämtland",shortCode:"Z"},{name:"Jönköping",shortCode:"F"},{name:"Kalmar",shortCode:"H"},{name:"Kronoberg",shortCode:"G"},{name:"Norrbotten",shortCode:"BD"},{name:"Örebro",shortCode:"T"},{name:"Östergötland",shortCode:"E"},{name:"Skåne",shortCode:"M"},{name:"Södermanland",shortCode:"D"},{name:"Stockholm",shortCode:"AB"},{name:"Uppsala",shortCode:"C"},{name:"Värmland",shortCode:"S"},{name:"Västerbotten",shortCode:"AC"},{name:"Västernorrland",shortCode:"Y"},{name:"Västmanland",shortCode:"U"},{name:"Västra Götaland",shortCode:"O"}]},{countryName:"Switzerland",countryShortCode:"CH",regions:[{name:"Aargau",shortCode:"AG"},{name:"Appenzell Ausserrhoden",shortCode:"AR"},{name:"Appenzell Innerhoden",shortCode:"AI"},{name:"Basel-Landschaft",shortCode:"BL"},{name:"Basel-Stadt",shortCode:"BS"},{name:"Bern",shortCode:"BE"},{name:"Fribourg",shortCode:"FR"},{name:"Genève",shortCode:"GE"},{name:"Glarus",shortCode:"GL"},{name:"Graubünden",shortCode:"GR"},{name:"Jura",shortCode:"JU"},{name:"Luzern",shortCode:"LU"},{name:"Neuchâtel",shortCode:"NE"},{name:"Nidwalden",shortCode:"NW"},{name:"Obwalden",shortCode:"OW"},{name:"Sankt Gallen",shortCode:"SG"},{name:"Schaffhausen",shortCode:"SH"},{name:"Schwyz",shortCode:"SZ"},{name:"Solothurn",shortCode:"SO"},{name:"Thurgau",shortCode:"TG"},{name:"Ticino",shortCode:"TI"},{name:"Uri",shortCode:"UR"},{name:"Valais",shortCode:"VS"},{name:"Vaud",shortCode:"VD"},{name:"Zug",shortCode:"ZG"},{name:"Zürich",shortCode:"ZH"}]},{countryName:"Syrian Arab Republic",countryShortCode:"SY",regions:[{name:"Al Hasakah",shortCode:"HA"},{name:"Al Ladhiqiyah",shortCode:"LA"},{name:"Al Qunaytirah",shortCode:"QU"},{name:"Ar Raqqah",shortCode:"RA"},{name:"As Suwayda'",shortCode:"SU"},{name:"Dar'a",shortCode:"DR"},{name:"Dayr az Zawr",shortCode:"DY"},{name:"Dimashq",shortCode:"DI"},{name:"Halab",shortCode:"HL"},{name:"Hamah",shortCode:"HM"},{name:"Hims",shortCode:"HI"},{name:"Idlib",shortCode:"ID"},{name:"Rif Dimashq",shortCode:"RD"},{name:"Tartus",shortCode:"TA"}]},{countryName:"Taiwan",countryShortCode:"TW",regions:[{name:"Chang-hua",shortCode:"CHA"},{name:"Chia-i",shortCode:"CYQ"},{name:"Hsin-chu",shortCode:"HSQ"},{name:"Hua-lien",shortCode:"HUA"},{name:"Kao-hsiung",shortCode:"KHH"},{name:"Keelung",shortCode:"KEE"},{name:"Kinmen",shortCode:"KIN"},{name:"Lienchiang",shortCode:"LIE"},{name:"Miao-li",shortCode:"MIA"},{name:"Nan-t'ou",shortCode:"NAN"},{name:"P'eng-hu",shortCode:"PEN"},{name:"New Taipei",shortCode:"NWT"},{name:"P'ing-chung",shortCode:"PIF"},{name:"T'ai-chung",shortCode:"TXG"},{name:"T'ai-nan",shortCode:"TNN"},{name:"T'ai-pei",shortCode:"TPE"},{name:"T'ai-tung",shortCode:"TTT"},{name:"T'ao-yuan",shortCode:"TAO"},{name:"Yi-lan",shortCode:"ILA"},{name:"Yun-lin",shortCode:"YUN"}]},{countryName:"Tajikistan",countryShortCode:"TJ",regions:[{name:"Dushanbe",shortCode:"DU"},{name:"Kŭhistoni Badakhshon",shortCode:"GB"},{name:"Khatlon",shortCode:"KT"},{name:"Sughd",shortCode:"SU"}]},{countryName:"Tanzania, United Republic of",countryShortCode:"TZ",regions:[{name:"Arusha",shortCode:"01"},{name:"Coast",shortCode:"19"},{name:"Dar es Salaam",shortCode:"02"},{name:"Dodoma",shortCode:"03"},{name:"Iringa",shortCode:"04"},{name:"Kagera",shortCode:"05"},{name:"Kigoma",shortCode:"08"},{name:"Kilimanjaro",shortCode:"09"},{name:"Lindi",shortCode:"12"},{name:"Manyara",shortCode:"26"},{name:"Mara",shortCode:"13"},{name:"Mbeya",shortCode:"14"},{name:"Morogoro",shortCode:"16"},{name:"Mtwara",shortCode:"17"},{name:"Mwanza",shortCode:"18"},{name:"Pemba North",shortCode:"06"},{name:"Pemba South",shortCode:"10"},{name:"Rukwa",shortCode:"20"},{name:"Ruvuma",shortCode:"21"},{name:"Shinyanga",shortCode:"22"},{name:"Singida",shortCode:"23"},{name:"Tabora",shortCode:"24"},{name:"Tanga",shortCode:"25"},{name:"Zanzibar North",shortCode:"07"},{name:"Zanzibar Central/South",shortCode:"11"},{name:"Zanzibar Urban/West",shortCode:"15"}]},{countryName:"Thailand",countryShortCode:"TH",regions:[{name:"Amnat Charoen",shortCode:"37"},{name:"Ang Thong",shortCode:"15"},{name:"Bueng Kan",shortCode:"38"},{name:"Buri Ram",shortCode:"31"},{name:"Chachoengsao",shortCode:"24"},{name:"Chai Nat",shortCode:"18"},{name:"Chaiyaphum",shortCode:"36"},{name:"Chanthaburi",shortCode:"22"},{name:"Chiang Mai",shortCode:"50"},{name:"Chiang Rai",shortCode:"57"},{name:"Chon Buri",shortCode:"20"},{name:"Chumphon",shortCode:"86"},{name:"Kalasin",shortCode:"46"},{name:"Kamphaeng Phet",shortCode:"62"},{name:"Kanchanaburi",shortCode:"71"},{name:"Khon Kaen",shortCode:"40"},{name:"Krabi",shortCode:"81"},{name:"Krung Thep Mahanakhon (Bangkok)",shortCode:"10"},{name:"Lampang",shortCode:"52"},{name:"Lamphun",shortCode:"51"},{name:"Loei",shortCode:"42"},{name:"Lop Buri",shortCode:"16"},{name:"Mae Hong Son",shortCode:"58"},{name:"Maha Sarakham",shortCode:"44"},{name:"Mukdahan",shortCode:"49"},{name:"Nakhon Nayok",shortCode:"26"},{name:"Nakhon Phathom",shortCode:"73"},{name:"Nakhon Phanom",shortCode:"48"},{name:"Nakhon Ratchasima",shortCode:"30"},{name:"Nakhon Sawan",shortCode:"60"},{name:"Nakhon Si Thammarat",shortCode:"80"},{name:"Nan",shortCode:"55"},{name:"Narathiwat",shortCode:"96"},{name:"Nong Bua Lam Phu",shortCode:"39"},{name:"Nong Khai",shortCode:"43"},{name:"Nonthaburi",shortCode:"12"},{name:"Pathum Thani",shortCode:"13"},{name:"Pattani",shortCode:"94"},{name:"Phangnga",shortCode:"82"},{name:"Phatthalung",shortCode:"93"},{name:"Phayao",shortCode:"56"},{name:"Phetchabun",shortCode:"76"},{name:"Phetchaburi",shortCode:"76"},{name:"Phichit",shortCode:"66"},{name:"Phitsanulok",shortCode:"65"},{name:"Phra Nakhon Si Ayutthaya",shortCode:"14"},{name:"Phrae",shortCode:"54"},{name:"Phuket",shortCode:"83"},{name:"Prachin Buri",shortCode:"25"},{name:"Prachuap Khiri Khan",shortCode:"77"},{name:"Ranong",shortCode:"85"},{name:"Ratchaburi",shortCode:"70"},{name:"Rayong",shortCode:"21"},{name:"Roi Et",shortCode:"45"},{name:"Sa Kaeo",shortCode:"27"},{name:"Sakon Nakhon",shortCode:"47"},{name:"Samut Prakan",shortCode:"11"},{name:"Samut Sakhon",shortCode:"74"},{name:"Samut Songkhram",shortCode:"75"},{name:"Saraburi",shortCode:"19"},{name:"Satun",shortCode:"91"},{name:"Sing Buri",shortCode:"17"},{name:"Si Sa ket",shortCode:"33"},{name:"Songkhla",shortCode:"90"},{name:"Sukhothai",shortCode:"64"},{name:"Suphan Buri",shortCode:"72"},{name:"Surat Thani",shortCode:"84"},{name:"Surin",shortCode:"32"},{name:"Tak",shortCode:"63"},{name:"Trang",shortCode:"92"},{name:"Trat",shortCode:"23"},{name:"Ubon Ratchathani",shortCode:"34"},{name:"Udon Thani",shortCode:"41"},{name:"Uthai Thani",shortCode:"61"},{name:"Uttaradit",shortCode:"53"},{name:"Yala",shortCode:"95"},{name:"Yasothon",shortCode:"35"}]},{countryName:"Timor-Leste",countryShortCode:"TL",regions:[{name:"Aileu",shortCode:"AL"},{name:"Ainaro",shortCode:"AN"},{name:"Baucau",shortCode:"BA"},{name:"Bobonaro",shortCode:"BO"},{name:"Cova Lima",shortCode:"CO"},{name:"Dili",shortCode:"DI"},{name:"Ermera",shortCode:"ER"},{name:"Lautem",shortCode:"LA"},{name:"Liquica",shortCode:"LI"},{name:"Manatuto",shortCode:"MT"},{name:"Manufahi",shortCode:"MF"},{name:"Oecussi",shortCode:"OE"},{name:"Viqueque",shortCode:"VI"}]},{countryName:"Togo",countryShortCode:"TG",regions:[{name:"Centre",shortCode:"C"},{name:"Kara",shortCode:"K"},{name:"Maritime",shortCode:"M"},{name:"Plateaux",shortCode:"P"},{name:"Savannes",shortCode:"S"}]},{countryName:"Tokelau",countryShortCode:"TK",regions:[{name:"Atafu"},{name:"Fakaofo"},{name:"Nukunonu"}]},{countryName:"Tonga",countryShortCode:"TO",regions:[{name:"'Eua",shortCode:"01"},{name:"Ha'apai",shortCode:"02"},{name:"Niuas",shortCode:"03"},{name:"Tongatapu",shortCode:"04"},{name:"Vava'u",shortCode:"05"}]},{countryName:"Trinidad and Tobago",countryShortCode:"TT",regions:[{name:"Arima",shortCode:"ARI"},{name:"Chaguanas",shortCode:"CHA"},{name:"Couva-Tabaquite-Talparo",shortCode:"CTT"},{name:"Diefo Martin",shortCode:"DMN"},{name:"Mayaro-Rio Claro",shortCode:"MRC"},{name:"Penal-Debe",shortCode:"PED"},{name:"Point Fortin",shortCode:"PTF"},{name:"Port-of-Spain",shortCode:"POS"},{name:"Princes Town",shortCode:"PRT"},{name:"San Fernando",shortCode:"SFO"},{name:"San Juan-Laventille",shortCode:"SJL"},{name:"Sangre Grande",shortCode:"SGE"},{name:"Siparia",shortCode:"SIP"},{name:"Tobago",shortCode:"TOB"},{name:"Tunapuna-Piarco",shortCode:"TUP"}]},{countryName:"Tunisia",countryShortCode:"TN",regions:[{name:"Ariana",shortCode:"12"},{name:"Beja",shortCode:"31"},{name:"Ben Arous",shortCode:"13"},{name:"Bizerte",shortCode:"23"},{name:"Gabes",shortCode:"81"},{name:"Gafsa",shortCode:"71"},{name:"Jendouba",shortCode:"32"},{name:"Kairouan",shortCode:"41"},{name:"Kasserine",shortCode:"42"},{name:"Kebili",shortCode:"73"},{name:"Kef",shortCode:"33"},{name:"Mahdia",shortCode:"53"},{name:"Medenine",shortCode:"82"},{name:"Monastir",shortCode:"52"},{name:"Nabeul",shortCode:"21"},{name:"Sfax",shortCode:"61"},{name:"Sidi Bouzid",shortCode:"43"},{name:"Siliana",shortCode:"34"},{name:"Sousse",shortCode:"51"},{name:"Tataouine",shortCode:"83"},{name:"Tozeur",shortCode:"72"},{name:"Tunis",shortCode:"11"},{name:"Zaghouan",shortCode:"22"}]},{countryName:"Turkey",countryShortCode:"TR",regions:[{name:"Adana",shortCode:"01"},{name:"Adiyaman",shortCode:"02"},{name:"Afyonkarahisar",shortCode:"03"},{name:"Agri",shortCode:"04"},{name:"Aksaray",shortCode:"68"},{name:"Amasya",shortCode:"05"},{name:"Ankara",shortCode:"06"},{name:"Antalya",shortCode:"07"},{name:"Ardahan",shortCode:"75"},{name:"Artvin",shortCode:"08"},{name:"Aydin",shortCode:"09"},{name:"Balikesir",shortCode:"10"},{name:"Bartin",shortCode:"74"},{name:"Batman",shortCode:"72"},{name:"Bayburt",shortCode:"69"},{name:"Bilecik",shortCode:"11"},{name:"Bingol",shortCode:"12"},{name:"Bitlis",shortCode:"13"},{name:"Bolu",shortCode:"14"},{name:"Burdur",shortCode:"15"},{name:"Bursa",shortCode:"16"},{name:"Canakkale",shortCode:"17"},{name:"Cankiri",shortCode:"18"},{name:"Corum",shortCode:"19"},{name:"Denizli",shortCode:"20"},{name:"Diyarbakir",shortCode:"21"},{name:"Duzce",shortCode:"81"},{name:"Edirne",shortCode:"22"},{name:"Elazig",shortCode:"23"},{name:"Erzincan",shortCode:"24"},{name:"Erzurum",shortCode:"25"},{name:"Eskisehir",shortCode:"26"},{name:"Gaziantep",shortCode:"27"},{name:"Giresun",shortCode:"28"},{name:"Gumushane",shortCode:"29"},{name:"Hakkari",shortCode:"30"},{name:"Hatay",shortCode:"31"},{name:"Igdir",shortCode:"76"},{name:"Isparta",shortCode:"32"},{name:"Istanbul",shortCode:"34"},{name:"Izmir",shortCode:"35"},{name:"Kahramanmaras",shortCode:"46"},{name:"Karabuk",shortCode:"78"},{name:"Karaman",shortCode:"70"},{name:"Kars",shortCode:"36"},{name:"Kastamonu",shortCode:"37"},{name:"Kayseri",shortCode:"38"},{name:"Kilis",shortCode:"79"},{name:"Kirikkale",shortCode:"71"},{name:"Kirklareli",shortCode:"39"},{name:"Kirsehir",shortCode:"40"},{name:"Kocaeli",shortCode:"41"},{name:"Konya",shortCode:"42"},{name:"Kutahya",shortCode:"43"},{name:"Malatya",shortCode:"44"},{name:"Manisa",shortCode:"45"},{name:"Mardin",shortCode:"47"},{name:"Mersin",shortCode:"33"},{name:"Mugla",shortCode:"48"},{name:"Mus",shortCode:"49"},{name:"Nevsehir",shortCode:"50"},{name:"Nigde",shortCode:"51"},{name:"Ordu",shortCode:"52"},{name:"Osmaniye",shortCode:"80"},{name:"Rize",shortCode:"53"},{name:"Sakarya",shortCode:"54"},{name:"Samsun",shortCode:"55"},{name:"Sanliurfa",shortCode:"63"},{name:"Siirt",shortCode:"56"},{name:"Sinop",shortCode:"57"},{name:"Sirnak",shortCode:"73"},{name:"Sivas",shortCode:"58"},{name:"Tekirdag",shortCode:"59"},{name:"Tokat",shortCode:"60"},{name:"Trabzon",shortCode:"61"},{name:"Tunceli",shortCode:"62"},{name:"Usak",shortCode:"64"},{name:"Van",shortCode:"65"},{name:"Yalova",shortCode:"77"},{name:"Yozgat",shortCode:"66"},{name:"Zonguldak",shortCode:"67"}]},{countryName:"Turkmenistan",countryShortCode:"TM",regions:[{name:"Ahal",shortCode:"A"},{name:"Asgabat",shortCode:"S"},{name:"Balkan",shortCode:"B"},{name:"Dashoguz",shortCode:"D"},{name:"Lebap",shortCode:"L"},{name:"Mary",shortCode:"M"}]},{countryName:"Turks and Caicos Islands",countryShortCode:"TC",regions:[{name:"Turks and Caicos Islands"}]},{countryName:"Tuvalu",countryShortCode:"TV",regions:[{name:"Funafuti",shortCode:"FUN"},{name:"Nanumanga",shortCode:"NMG"},{name:"Nanumea",shortCode:"NMA"},{name:"Niutao",shortCode:"NIT"},{name:"Nui",shortCode:"NUI"},{name:"Nukufetau",shortCode:"NKF"},{name:"Nukulaelae",shortCode:"NKL"},{name:"Vaitupu",shortCode:"VAU"}]},{countryName:"Uganda",countryShortCode:"UG",regions:[{name:"Abim",shortCode:"317"},{name:"Adjumani",shortCode:"301"},{name:"Amolatar",shortCode:"314"},{name:"Amuria",shortCode:"216"},{name:"Amuru",shortCode:"319"},{name:"Apac",shortCode:"302"},{name:"Arua",shortCode:"303"},{name:"Budaka",shortCode:"217"},{name:"Bududa",shortCode:"223"},{name:"Bugiri",shortCode:"201"},{name:"Bukedea",shortCode:"224"},{name:"Bukwa",shortCode:"218"},{name:"Buliisa",shortCode:"419"},{name:"Bundibugyo",shortCode:"401"},{name:"Bushenyi",shortCode:"402"},{name:"Busia",shortCode:"202"},{name:"Butaleja",shortCode:"219"},{name:"Dokolo",shortCode:"318"},{name:"Gulu",shortCode:"304"},{name:"Hoima",shortCode:"403"},{name:"Ibanda",shortCode:"416"},{name:"Iganga",shortCode:"203"},{name:"Isingiro",shortCode:"417"},{name:"Jinja",shortCode:"204"},{name:"Kaabong",shortCode:"315"},{name:"Kabale",shortCode:"404"},{name:"Kabarole",shortCode:"405"},{name:"Kaberamaido",shortCode:"213"},{name:"Kalangala",shortCode:"101"},{name:"Kaliro",shortCode:"220"},{name:"Kampala",shortCode:"102"},{name:"Kamuli",shortCode:"205"},{name:"Kamwenge",shortCode:"413"},{name:"Kanungu",shortCode:"414"},{name:"Kapchorwa",shortCode:"206"},{name:"Kasese",shortCode:"406"},{name:"Katakwi",shortCode:"207"},{name:"Kayunga",shortCode:"112"},{name:"Kibaale",shortCode:"407"},{name:"Kiboga",shortCode:"103"},{name:"Kiruhura",shortCode:"418"},{name:"Kisoro",shortCode:"408"},{name:"Kitgum",shortCode:"305"},{name:"Koboko",shortCode:"316"},{name:"Kotido",shortCode:"306"},{name:"Kumi",shortCode:"208"},{name:"Kyenjojo",shortCode:"415"},{name:"Lira",shortCode:"307"},{name:"Luwero",shortCode:"104"},{name:"Lyantonde",shortCode:"116"},{name:"Manafwa",shortCode:"221"},{name:"Maracha",shortCode:"320"},{name:"Masaka",shortCode:"105"},{name:"Masindi",shortCode:"409"},{name:"Mayuge",shortCode:"214"},{name:"Mbale",shortCode:"209"},{name:"Mbarara",shortCode:"410"},{name:"Mityana",shortCode:"114"},{name:"Moroto",shortCode:"308"},{name:"Moyo",shortCode:"309"},{name:"Mpigi",shortCode:"106"},{name:"Mubende",shortCode:"107"},{name:"Mukono",shortCode:"108"},{name:"Nakapiripirit",shortCode:"311"},{name:"Nakaseke",shortCode:"115"},{name:"Nakasongola",shortCode:"109"},{name:"Namutumba",shortCode:"222"},{name:"Nebbi",shortCode:"310"},{name:"Ntungamo",shortCode:"411"},{name:"Oyam",shortCode:"321"},{name:"Pader",shortCode:"312"},{name:"Pallisa",shortCode:"210"},{name:"Rakai",shortCode:"110"},{name:"Rukungiri",shortCode:"412"},{name:"Sembabule",shortCode:"111"},{name:"Sironko",shortCode:"215"},{name:"Soroti",shortCode:"211"},{name:"Tororo",shortCode:"212"},{name:"Wakiso",shortCode:"113"},{name:"Yumbe",shortCode:"313"}]},{countryName:"Ukraine",countryShortCode:"UA",regions:[{name:"Cherkasy",shortCode:"71"},{name:"Chernihiv",shortCode:"74"},{name:"Chernivtsi",shortCode:"77"},{name:"Dnipropetrovsk",shortCode:"12"},{name:"Donetsk",shortCode:"14"},{name:"Ivano-Frankivsk",shortCode:"26"},{name:"Kharkiv",shortCode:"63"},{name:"Kherson",shortCode:"65"},{name:"Khmelnytskyi",shortCode:"68"},{name:"Kiev",shortCode:"32"},{name:"Kirovohrad",shortCode:"35"},{name:"Luhansk",shortCode:"09"},{name:"Lviv",shortCode:"46"},{name:"Mykolaiv",shortCode:"48"},{name:"Odessa",shortCode:"51"},{name:"Poltava",shortCode:"53"},{name:"Rivne",shortCode:"56"},{name:"Sumy",shortCode:"59"},{name:"Ternopil",shortCode:"61"},{name:"Vinnytsia",shortCode:"05"},{name:"Volyn",shortCode:"07"},{name:"Zakarpattia",shortCode:"21"},{name:"Zaporizhia",shortCode:"23"},{name:"Zhytomyr",shortCode:"18"},{name:"Avtonomna Respublika Krym",shortCode:"43"},{name:"Kyïv",shortCode:"30"},{name:"Sevastopol",shortCode:"40"}]},{countryName:"United Arab Emirates",countryShortCode:"AE",regions:[{name:"Abu Dhabi",shortCode:"AZ"},{name:"Ajman",shortCode:"AJ"},{name:"Dubai",shortCode:"DU"},{name:"Fujairah",shortCode:"FU"},{name:"Ras al Khaimah",shortCode:"RK"},{name:"Sharjah",shortCode:"SH"},{name:"Umm Al Quwain",shortCode:"UQ"}]},{countryName:"United Kingdom",countryShortCode:"GB",regions:[{name:"Avon",shortCode:"AVN"},{name:"Bedfordshire",shortCode:"BDF"},{name:"Berkshire",shortCode:"BRK"},{name:"Bristol, City of",shortCode:"COB"},{name:"Buckinghamshire",shortCode:"BKM"},{name:"Cambridgeshire",shortCode:"CAM"},{name:"Cheshire",shortCode:"CHS"},{name:"Cleveland",shortCode:"CLV"},{name:"Cornwall",shortCode:"CON"},{name:"Cumbria",shortCode:"CMA"},{name:"Derbyshire",shortCode:"DBY"},{name:"Devon",shortCode:"DEV"},{name:"Dorset",shortCode:"DOR"},{name:"Durham",shortCode:"DUR"},{name:"East Sussex",shortCode:"SXE"},{name:"Essex",shortCode:"ESS"},{name:"Gloucestershire",shortCode:"GLS"},{name:"Greater London",shortCode:"LND"},{name:"Greater Manchester",shortCode:"GTM"},{name:"Hampshire",shortCode:"HAM"},{name:"Hereford and Worcester",shortCode:"HWR"},{name:"Herefordshire",shortCode:"HEF"},{name:"Hertfordshire",shortCode:"HRT"},{name:"Isle of Wight",shortCode:"IOW"},{name:"Kent",shortCode:"KEN"},{name:"Lancashire",shortCode:"LAN"},{name:"Leicestershire",shortCode:"LEI"},{name:"Lincolnshire",shortCode:"LIN"},{name:"London",shortCode:"LDN"},{name:"Merseyside",shortCode:"MSY"},{name:"Middlesex",shortCode:"MDX"},{name:"Norfolk",shortCode:"NFK"},{name:"Northamptonshire",shortCode:"NTH"},{name:"Northumberland",shortCode:"NBL"},{name:"North Humberside",shortCode:"NHM"},{name:"North Yorkshire",shortCode:"NYK"},{name:"Nottinghamshire",shortCode:"NTT"},{name:"Oxfordshire",shortCode:"OXF"},{name:"Rutland",shortCode:"RUT"},{name:"Shropshire",shortCode:"SAL"},{name:"Somerset",shortCode:"SOM"},{name:"South Humberside",shortCode:"SHM"},{name:"South Yorkshire",shortCode:"SYK"},{name:"Staffordshire",shortCode:"STS"},{name:"Suffolk",shortCode:"SFK"},{name:"Surrey",shortCode:"SRY"},{name:"Tyne and Wear",shortCode:"TWR"},{name:"Warwickshire",shortCode:"WAR"},{name:"West Midlands",shortCode:"WMD"},{name:"West Sussex",shortCode:"SXW"},{name:"West Yorkshire",shortCode:"WYK"},{name:"Wiltshire",shortCode:"WIL"},{name:"Worcestershire",shortCode:"WOR"},{name:"Antrim",shortCode:"ANT"},{name:"Armagh",shortCode:"ARM"},{name:"Belfast, City of",shortCode:"BLF"},{name:"Down",shortCode:"DOW"},{name:"Fermanagh",shortCode:"FER"},{name:"Londonderry",shortCode:"LDY"},{name:"Derry, City of",shortCode:"DRY"},{name:"Tyrone",shortCode:"TYR"},{name:"Aberdeen, City of",shortCode:"AN"},{name:"Aberdeenshire",shortCode:"ABD"},{name:"Angus (Forfarshire)",shortCode:"ANS"},{name:"Argyll",shortCode:"AGB"},{name:"Ayrshire",shortCode:"ARG"},{name:"Banffshire",shortCode:"BAN"},{name:"Berwickshire",shortCode:"BEW"},{name:"Bute",shortCode:"BUT"},{name:"Caithness",shortCode:"CAI"},{name:"Clackmannanshire",shortCode:"CLK"},{name:"Cromartyshire",shortCode:"COC"},{name:"Dumfriesshire",shortCode:"DFS"},{name:"Dunbartonshire (Dumbarton)",shortCode:"DNB"},{name:"Dundee, City of",shortCode:"DD"},{name:"East Lothian (Haddingtonshire)",shortCode:"ELN"},{name:"Edinburgh, City of",shortCode:"EB"},{name:"Fife",shortCode:"FIF"},{name:"Glasgow, City of",shortCode:"GLA"},{name:"Inverness-shire",shortCode:"INV"},{name:"Kincardineshire",shortCode:"KCD"},{name:"Kinross-shire",shortCode:"KRS"},{name:"Kirkcudbrightshire",shortCode:"KKD"},{name:"Lanarkshire",shortCode:"LKS"},{name:"Midlothian (County of Edinburgh)",shortCode:"MLN"},{name:"Moray (Elginshire)",shortCode:"MOR"},{name:"Nairnshire",shortCode:"NAI"},{name:"Orkney",shortCode:"OKI"},{name:"Peeblesshire",shortCode:"PEE"},{name:"Perthshire",shortCode:"PER"},{name:"Renfrewshire",shortCode:"RFW"},{name:"Ross and Cromarty",shortCode:"ROC"},{name:"Ross-shire",shortCode:"ROS"},{name:"Roxburghshire",shortCode:"ROX"},{name:"Selkirkshire",shortCode:"SEL"},{name:"Shetland (Zetland)",shortCode:"SHI"},{name:"Stirlingshire",shortCode:"STI"},{name:"Sutherland",shortCode:"SUT"},{name:"West Lothian (Linlithgowshire)",shortCode:"WLN"},{name:"Wigtownshire",shortCode:"WIG"},{name:"Clwyd",shortCode:"CWD"},{name:"Dyfed",shortCode:"DFD"},{name:"Gwent",shortCode:"GNT"},{name:"Gwynedd",shortCode:"GWN"},{name:"Mid Glamorgan",shortCode:"MGM"},{name:"Powys",shortCode:"POW"},{name:"South Glamorgan",shortCode:"SGM"},{name:"West Glamorgan",shortCode:"WGM"}]},{countryName:"United States",countryShortCode:"US",regions:[{name:"Alabama",shortCode:"AL"},{name:"Alaska",shortCode:"AK"},{name:"American Samoa",shortCode:"AS"},{name:"Arizona",shortCode:"AZ"},{name:"Arkansas",shortCode:"AR"},{name:"California",shortCode:"CA"},{name:"Colorado",shortCode:"CO"},{name:"Connecticut",shortCode:"CT"},{name:"Delaware",shortCode:"DE"},{name:"District of Columbia",shortCode:"DC"},{name:"Micronesia",shortCode:"FM"},{name:"Florida",shortCode:"FL"},{name:"Georgia",shortCode:"GA"},{name:"Guam",shortCode:"GU"},{name:"Hawaii",shortCode:"HI"},{name:"Idaho",shortCode:"ID"},{name:"Illinois",shortCode:"IL"},{name:"Indiana",shortCode:"IN"},{name:"Iowa",shortCode:"IA"},{name:"Kansas",shortCode:"KS"},{name:"Kentucky",shortCode:"KY"},{name:"Louisiana",shortCode:"LA"},{name:"Maine",shortCode:"ME"},{name:"Marshall Islands",shortCode:"MH"},{name:"Maryland",shortCode:"MD"},{name:"Massachusetts",shortCode:"MA"},{name:"Michigan",shortCode:"MI"},{name:"Minnesota",shortCode:"MN"},{name:"Mississippi",shortCode:"MS"},{name:"Missouri",shortCode:"MO"},{name:"Montana",shortCode:"MT"},{name:"Nebraska",shortCode:"NE"},{name:"Nevada",shortCode:"NV"},{name:"New Hampshire",shortCode:"NH"},{name:"New Jersey",shortCode:"NJ"},{name:"New Mexico",shortCode:"NM"},{name:"New York",shortCode:"NY"},{name:"North Carolina",shortCode:"NC"},{name:"North Dakota",shortCode:"ND"},{name:"Northern Mariana Islands",shortCode:"MP"},{name:"Ohio",shortCode:"OH"},{name:"Oklahoma",shortCode:"OK"},{name:"Oregon",shortCode:"OR"},{name:"Palau",shortCode:"PW"},{name:"Pennsylvania",shortCode:"PA"},{name:"Puerto Rico",shortCode:"PR"},{name:"Rhode Island",shortCode:"RI"},{name:"South Carolina",shortCode:"SC"},{name:"South Dakota",shortCode:"SD"},{name:"Tennessee",shortCode:"TN"},{name:"Texas",shortCode:"TX"},{name:"Utah",shortCode:"UT"},{name:"Vermont",shortCode:"VT"},{name:"Virgin Islands",shortCode:"VI"},{name:"Virginia",shortCode:"VA"},{name:"Washington",shortCode:"WA"},{name:"West Virginia",shortCode:"WV"},{name:"Wisconsin",shortCode:"WI"},{name:"Wyoming",shortCode:"WY"},{name:"Armed Forces Americas",shortCode:"AA"},{name:"Armed Forces Europe, Canada, Africa and Middle East",shortCode:"AE"},{name:"Armed Forces Pacific",shortCode:"AP"}]},{countryName:"United States Minor Outlying Islands",countryShortCode:"UM",regions:[{name:"Baker Island",shortCode:"81"},{name:"Howland Island",shortCode:"84"},{name:"Jarvis Island",shortCode:"86"},{name:"Johnston Atoll",shortCode:"67"},{name:"Kingman Reef",shortCode:"89"},{name:"Midway Islands",shortCode:"71"},{name:"Navassa Island",shortCode:"76"},{name:"Palmyra Atoll",shortCode:"95"},{name:"Wake Island",shortCode:"79"},{name:"Bajo Nuevo Bank",shortCode:"BN"},{name:"Serranilla Bank",shortCode:"SB"}]},{countryName:"Uruguay",countryShortCode:"UY",regions:[{name:"Artigas",shortCode:"AR"},{name:"Canelones",shortCode:"CA"},{name:"Cerro Largo",shortCode:"CL"},{name:"Colonia",shortCode:"CO"},{name:"Durazno",shortCode:"DU"},{name:"Flores",shortCode:"FS"},{name:"Florida",shortCode:"FD"},{name:"Lavalleja",shortCode:"LA"},{name:"Maldonado",shortCode:"MA"},{name:"Montevideo",shortCode:"MO"},{name:"Paysandú",shortCode:"PA"},{name:"Río Negro",shortCode:"RN"},{name:"Rivera",shortCode:"RV"},{name:"Rocha",shortCode:"RO"},{name:"Salto",shortCode:"SA"},{name:"San José",shortCode:"SJ"},{name:"Soriano",shortCode:"SO"},{name:"Tacuarembó",shortCode:"TA"},{name:"Treinta y Tres",shortCode:"TT"}]},{countryName:"Uzbekistan",countryShortCode:"UZ",regions:[{name:"Toshkent shahri",shortCode:"TK"},{name:"Andijon",shortCode:"AN"},{name:"Buxoro",shortCode:"BU"},{name:"Farg‘ona",shortCode:"FA"},{name:"Jizzax",shortCode:"JI"},{name:"Namangan",shortCode:"NG"},{name:"Navoiy",shortCode:"NW"},{name:"Qashqadaryo (Qarshi)",shortCode:"QA"},{name:"Samarqand",shortCode:"SA"},{name:"Sirdaryo (Guliston)",shortCode:"SI"},{name:"Surxondaryo (Termiz)",shortCode:"SU"},{name:"Toshkent wiloyati",shortCode:"TO"},{name:"Xorazm (Urganch)",shortCode:"XO"},{name:"Qoraqalpog‘iston Respublikasi (Nukus)",shortCode:"QR"}]},{countryName:"Vanuatu",countryShortCode:"VU",regions:[{name:"Malampa",shortCode:"MAP"},{name:"Pénama",shortCode:"PAM"},{name:"Sanma",shortCode:"SAM"},{name:"Shéfa",shortCode:"SEE"},{name:"Taféa",shortCode:"TAE"},{name:"Torba",shortCode:"TOB"}]},{countryName:"Venezuela, Bolivarian Republic of",countryShortCode:"VE",regions:[{name:"Dependencias Federales",shortCode:"W"},{name:"Distrito Federal",shortCode:"A"},{name:"Amazonas",shortCode:"Z"},{name:"Anzoátegui",shortCode:"B"},{name:"Apure",shortCode:"C"},{name:"Aragua",shortCode:"D"},{name:"Barinas",shortCode:"E"},{name:"Bolívar",shortCode:"F"},{name:"Carabobo",shortCode:"G"},{name:"Cojedes",shortCode:"H"},{name:"Delta Amacuro",shortCode:"Y"},{name:"Falcón",shortCode:"I"},{name:"Guárico",shortCode:"J"},{name:"Lara",shortCode:"K"},{name:"Mérida",shortCode:"L"},{name:"Miranda",shortCode:"M"},{name:"Monagas",shortCode:"N"},{name:"Nueva Esparta",shortCode:"O"},{name:"Portuguesa",shortCode:"P"},{name:"Sucre",shortCode:"R"},{name:"Táchira",shortCode:"S"},{name:"Trujillo",shortCode:"T"},{name:"Vargas",shortCode:"X"},{name:"Yaracuy",shortCode:"U"},{name:"Zulia",shortCode:"V"}]},{countryName:"Vietnam",countryShortCode:"VN",regions:[{name:"Đồng Nai",shortCode:"39"},{name:"Đồng Tháp",shortCode:"45"},{name:"Gia Lai",shortCode:"30"},{name:"Hà Giang",shortCode:"03"},{name:"Hà Nam",shortCode:"63"},{name:"Hà Tây",shortCode:"15"},{name:"Hà Tĩnh",shortCode:"23"},{name:"Hải Dương",shortCode:"61"},{name:"Hậu Giang",shortCode:"73"},{name:"Hòa Bình",shortCode:"14"},{name:"Hưng Yên",shortCode:"66"},{name:"Khánh Hòa",shortCode:"34"},{name:"Kiên Giang",shortCode:"47"},{name:"Kon Tum",shortCode:"28"},{name:"Lai Châu",shortCode:"01"},{name:"Lâm Đồng",shortCode:"35"},{name:"Lạng Sơn",shortCode:"09"},{name:"Lào Cai",shortCode:"02"},{name:"Long An",shortCode:"41"},{name:"Nam Định",shortCode:"67"},{name:"Nghệ An",shortCode:"22"},{name:"Ninh Bình",shortCode:"18"},{name:"Ninh Thuận",shortCode:"36"},{name:"Phú Thọ",shortCode:"68"},{name:"Phú Yên",shortCode:"32"},{name:"Quảng Bình",shortCode:"24"},{name:"Quảng Nam",shortCode:"27"},{name:"Quảng Ngãi",shortCode:"29"},{name:"Quảng Ninh",shortCode:"13"},{name:"Quảng Trị",shortCode:"25"},{name:"Sóc Trăng",shortCode:"52"},{name:"Sơn La",shortCode:"05"},{name:"Tây Ninh",shortCode:"37"},{name:"Thái Bình",shortCode:"20"},{name:"Thái Nguyên",shortCode:"69"},{name:"Thanh Hóa",shortCode:"21"},{name:"Thừa Thiên–Huế",shortCode:"26"},{name:"Tiền Giang",shortCode:"46"},{name:"Trà Vinh",shortCode:"51"},{name:"Tuyên Quang",shortCode:"07"},{name:"Vĩnh Long",shortCode:"49"},{name:"Vĩnh Phúc",shortCode:"70"},{name:"Yên Bái",shortCode:"06"},{name:"Cần Thơ",shortCode:"CT"},{name:"Đà Nẵng",shortCode:"DN"},{name:"Hà Nội",shortCode:"HN"},{name:"Hải Phòng",shortCode:"HP"},{name:"Hồ Chí Minh (Sài Gòn)",shortCode:"SG"}]},{countryName:"Virgin Islands, British",countryShortCode:"VG",regions:[{name:"Anegada",shortCode:"ANG"},{name:"Jost Van Dyke",shortCode:"JVD"},{name:"Tortola",shortCode:"TTA"},{name:"Virgin Gorda",shortCode:"VGD"}]},{countryName:"Virgin Islands, U.S.",countryShortCode:"VI",regions:[{name:"St. Thomas",shortCode:"STH"},{name:"St. John",shortCode:"SJO"},{name:"St. Croix",shortCode:"SCR"}]},{countryName:"Wallis and Futuna",countryShortCode:"WF",regions:[{name:"Alo",shortCode:"ALO"},{name:"Sigave",shortCode:"SIG"},{name:"Wallis",shortCode:"WAL"}]},{countryName:"Western Sahara",countryShortCode:"EH",regions:[{name:"Es Smara",shortCode:"ESM"},{name:"Boujdour",shortCode:"BOD"},{name:"Laâyoune",shortCode:"LAA"},{name:"Aousserd",shortCode:"AOU"},{name:"Oued ed Dahab",shortCode:"OUD"}]},{countryName:"Yemen",countryShortCode:"YE",regions:[{name:"Abyān",shortCode:"AB"},{name:"'Adan",shortCode:"AD"},{name:"Aḑ Ḑāli'",shortCode:"DA"},{name:"Al Bayḑā'",shortCode:"BA"},{name:"Al Ḩudaydah",shortCode:"HU"},{name:"Al Jawf",shortCode:"JA"},{name:"Al Mahrah",shortCode:"MR"},{name:"Al Maḩwīt",shortCode:"MW"},{name:"'Amrān",shortCode:"AM"},{name:"Dhamār",shortCode:"DH"},{name:"Ḩaḑramawt",shortCode:"HD"},{name:"Ḩajjah",shortCode:"HJ"},{name:"Ibb",shortCode:"IB"},{name:"Laḩij",shortCode:"LA"},{name:"Ma'rib",shortCode:"MA"},{name:"Raymah",shortCode:"RA"},{name:"Şā‘dah",shortCode:"SD"},{name:"Şan‘ā'",shortCode:"SN"},{name:"Shabwah",shortCode:"SH"},{name:"Tā‘izz",shortCode:"TA"}]},{countryName:"Zambia",countryShortCode:"ZM",regions:[{name:"Central",shortCode:"02"},{name:"Copperbelt",shortCode:"08"},{name:"Eastern",shortCode:"03"},{name:"Luapula",shortCode:"04"},{name:"Lusaka",shortCode:"09"},{name:"Northern",shortCode:"05"},{name:"North-Western",shortCode:"06"},{name:"Southern",shortCode:"07"},{name:"Western",shortCode:"01"}]},{countryName:"Zimbabwe",countryShortCode:"ZW",regions:[{name:"Bulawayo",shortCode:"BU"},{name:"Harare",shortCode:"HA"},{name:"Manicaland",shortCode:"MA"},{name:"Mashonaland Central",shortCode:"MC"},{name:"Mashonaland East",shortCode:"ME"},{name:"Mashonaland West",shortCode:"MW"},{name:"Masvingo",shortCode:"MV"},{name:"Matabeleland North",shortCode:"MN"},{name:"Matabeleland South",shortCode:"MS"},{name:"Midlands",shortCode:"MI"}]}]),d={name:"CountrySelect",props:{country:String,countryName:Boolean,whiteList:Array,blackList:Array,className:String,shortCodeDropdown:Boolean,autocomplete:Boolean,topCountry:{type:String,default:""},placeholder:{type:String,default:"Select Country"},disablePlaceholder:{type:Boolean,default:!1},removePlaceholder:{type:Boolean,default:!1},usei18n:{type:Boolean,default:!0}},data:function(){return{ran:!1}},computed:{countries:function(){var e=this,o=s.filter((function(o){return e.countryName?o.countryName!==e.firstCountry:o.countryShortCode!==e.firstCountry}));if(this.whiteList&&(o=o.filter((function(o){return e.whiteList.includes(o.countryShortCode)}))),this.blackList&&(o=o.filter((function(o){return!e.blackList.includes(o.countryShortCode)}))),this.$i18n&&this.usei18n&&(o=o.map((function(o){var a=Object.assign({},o);return a.countryName=e.$t(o.countryName),a})),o.sort((function(e,o){return e.countryName>o.countryName?1:-1}))),this.removePlaceholder){var a=this.firstCountry||o[0][this.valueType];this.onChange(a)}return o},firstCountry:function(){var e=this;if(this.countryName){if(2===this.topCountry.length){var o=s.find((function(o){return o.countryShortCode===e.topCountry}));return o.countryName}return this.topCountry}return this.topCountry?this.topCountry:""},name:function(){return this.name},value:function(){return this.country},valueType:function(){return this.countryName?"countryName":"countryShortCode"},autocompleteAttr:function(){var e=function(e){return e?"country-name":"country"};return this.autocomplete?e(this.countryName):"off"}},methods:{onChange:function(e){this.$emit("input",e)},topCountryName:function(){var e=this,o=s.find((function(o){return e.countryName?o.countryName===e.firstCountry:o.countryShortCode===e.firstCountry}));return this.$i18n&&this.usei18n?this.$t(o.countryName):this.shortCodeDropdown?o.countryShortCode:o.countryName}}},h=d;function m(e,o,a,n,r,t,s,d){var h,m="function"===typeof e?e.options:e;if(o&&(m.render=o,m.staticRenderFns=a,m._compiled=!0),n&&(m.functional=!0),t&&(m._scopeId="data-v-"+t),s?(h=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},m._ssrRegister=h):r&&(h=d?function(){r.call(this,(m.functional?this.parent:this).$root.$options.shadowRoot)}:r),h)if(m.functional){m._injectStyles=h;var C=m.render;m.render=function(e,o){return h.call(o),C(e,o)}}else{var i=m.beforeCreate;m.beforeCreate=i?[].concat(i,h):[h]}return{exports:e,options:m}}var C=m(h,r,t,!1,null,null,null),i=C.exports,u=function(){var e=this,o=e.$createElement,a=e._self._c||o;return a("select",{class:e.className,attrs:{autocomplete:e.autocompleteAttr},on:{change:function(o){return e.onChange(o.target.value)}}},[e.disablePlaceholder||e.removePlaceholder?e._e():a("option",{attrs:{value:""}},[e._v(e._s(e.placeholder))]),e.disablePlaceholder&&!e.removePlaceholder?a("option",{attrs:{value:"",disabled:"",selected:""}},[e._v(e._s(e.placeholder))]):e._e(),e._l(e.shownRegions,(function(o,n){return a("option",{key:n,domProps:{value:""!==o[e.valueType]?o[e.valueType]:o.name.substring(0,3),selected:e.region===o[e.valueType]}},[e._v(e._s(e.shortCodeDropdown?o.shortCode:o.name))])}))],2)},l=[],c={name:"RegionSelect",props:{country:String,region:String,defaultRegion:String,countryName:Boolean,whiteList:Array,blackList:Array,regionName:Boolean,className:String,shortCodeDropdown:Boolean,placeholder:{type:String,default:"Select Region"},disablePlaceholder:{type:Boolean,default:!1},removePlaceholder:{type:Boolean,default:!1},usei18n:{type:Boolean,default:!0}},data:function(){return{shownRegions:[],regions:s,ran:!1}},mounted:function(){if(this.country)this.getRegionWithCountry();else{var e="";e=this.countryName?this.defaultRegion?this.defaultRegion:"United States":this.defaultRegion?this.defaultRegion:"US",this.getRegionWithCountry(e)}},computed:{name:function(){return this.name},value:function(){return this.region},valueType:function(){return this.regionName?"name":"shortCode"},autocompleteAttr:function(){return this.autocomplete?"address-level1":"off"}},methods:{onChange:function(e){this.$emit("input",e)},getRegionWithCountry:function(e){var o=this;e=e||this.country;var a=s.find((function(a){return o.countryName?a.countryName===e:a.countryShortCode===e})).regions;this.$i18n&&this.usei18n&&(a=a.map((function(e){var a=Object.assign({},e);return a.name=o.$t(e.name),a})),a.sort((function(e,o){return e.name>o.name?1:-1}))),this.whiteList&&(a=a.filter((function(e){return o.whiteList.includes(e.shortCode)}))),this.blackList&&(a=a.filter((function(e){return!o.blackList.includes(e.shortCode)}))),this.shownRegions=a,this.disablePlaceholder&&this.ran&&this.onChange(this.shownRegions[0][this.valueType]),this.removePlaceholder&&this.onChange(this.shownRegions[0][this.valueType]),this.ran=!0}},watch:{country:function(e,o){""!==o&&this.onChange(""),this.country?this.getRegionWithCountry():this.shownRegions=[]}}},S=c,g=m(S,u,l,!1,null,null,null),y=g.exports,A=function(e){var o={CountrySelect:i,RegionSelect:y};Object.keys(o).forEach((function(a){e.component(a,o[a])}))},N={CountrySelect:i,RegionSelect:y,install:A},M=N;o["default"]=M}})})); //# sourceMappingURL=vueCountryRegionSelect.umd.min.js.map /***/ }), /***/ "d22d": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {/* harmony import */ var core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4917"); /* harmony import */ var core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_match__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("a481"); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("7f7f"); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("7514"); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3__); /* =========================================================== * Bootstrap: fileinput.js v3.1.3 * http://jasny.github.com/bootstrap/javascript/#fileinput * =========================================================== * Copyright 2012-2014 Arnold Daniels * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ +function ($) { "use strict"; var isIE = window.navigator.appName == 'Microsoft Internet Explorer'; // FILEUPLOAD PUBLIC CLASS DEFINITION // ================================= var Fileinput = function Fileinput(element, options) { this.$element = $(element); this.$input = this.$element.find(':file'); if (this.$input.length === 0) return; this.name = this.$input.attr('name') || options.name; this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]'); if (this.$hidden.length === 0) { this.$hidden = $('').insertBefore(this.$input); } this.$preview = this.$element.find('.fileinput-preview'); var height = this.$preview.css('height'); if (this.$preview.css('display') !== 'inline' && height !== '0px' && height !== 'none') { this.$preview.css('line-height', height); } this.original = { exists: this.$element.hasClass('fileinput-exists'), preview: this.$preview.html(), hiddenVal: this.$hidden.val() }; this.listen(); }; Fileinput.prototype.listen = function () { this.$input.on('change.bs.fileinput', $.proxy(this.change, this)); $(this.$input[0].form).on('reset.bs.fileinput', $.proxy(this.reset, this)); this.$element.find('[data-trigger="fileinput"]').on('click.bs.fileinput', $.proxy(this.trigger, this)); this.$element.find('[data-dismiss="fileinput"]').on('click.bs.fileinput', $.proxy(this.clear, this)); }, Fileinput.prototype.change = function (e) { var files = e.target.files === undefined ? e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '') }] : [] : e.target.files; e.stopPropagation(); if (files.length === 0) { this.clear(); return; } this.$hidden.val(''); this.$hidden.attr('name', ''); this.$input.attr('name', this.name); var file = files[0]; if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") { var reader = new FileReader(); var preview = this.$preview; var element = this.$element; reader.onload = function (re) { var $img = $(''); $img[0].src = re.target.result; files[0].result = re.target.result; element.find('.fileinput-filename').text(file.name); // if parent has max-height, using `(max-)height: 100%` on child doesn't take padding and border into account if (preview.css('max-height') != 'none') $img.css('max-height', parseInt(preview.css('max-height'), 10) - parseInt(preview.css('padding-top'), 10) - parseInt(preview.css('padding-bottom'), 10) - parseInt(preview.css('border-top'), 10) - parseInt(preview.css('border-bottom'), 10)); preview.html($img); element.addClass('fileinput-exists').removeClass('fileinput-new'); element.trigger('change.bs.fileinput', files); }; reader.readAsDataURL(file); } else { this.$element.find('.fileinput-filename').text(file.name); this.$preview.text(file.name); this.$element.addClass('fileinput-exists').removeClass('fileinput-new'); this.$element.trigger('change.bs.fileinput'); } }, Fileinput.prototype.clear = function (e) { if (e) e.preventDefault(); this.$hidden.val(''); this.$hidden.attr('name', this.name); this.$input.attr('name', ''); //ie8+ doesn't support changing the value of input with type=file so clone instead if (isIE) { var inputClone = this.$input.clone(true); this.$input.after(inputClone); this.$input.remove(); this.$input = inputClone; } else { this.$input.val(''); } this.$preview.html(''); this.$element.find('.fileinput-filename').text(''); this.$element.addClass('fileinput-new').removeClass('fileinput-exists'); if (e !== undefined) { this.$input.trigger('change'); this.$element.trigger('clear.bs.fileinput'); } }, Fileinput.prototype.reset = function () { this.clear(); this.$hidden.val(this.original.hiddenVal); this.$preview.html(this.original.preview); this.$element.find('.fileinput-filename').text(''); if (this.original.exists) this.$element.addClass('fileinput-exists').removeClass('fileinput-new');else this.$element.addClass('fileinput-new').removeClass('fileinput-exists'); this.$element.trigger('reset.bs.fileinput'); }, Fileinput.prototype.trigger = function (e) { this.$input.trigger('click'); e.preventDefault(); }; // FILEUPLOAD PLUGIN DEFINITION // =========================== var old = $.fn.fileinput; $.fn.fileinput = function (options) { return this.each(function () { var $this = $(this), data = $this.data('bs.fileinput'); if (!data) $this.data('bs.fileinput', data = new Fileinput(this, options)); if (typeof options == 'string') data[options](); }); }; $.fn.fileinput.Constructor = Fileinput; // FILEINPUT NO CONFLICT // ==================== $.fn.fileinput.noConflict = function () { $.fn.fileinput = old; return this; }; // FILEUPLOAD DATA-API // ================== $(document).on('click.fileinput.data-api', '[data-provides="fileinput"]', function (e) { var $this = $(this); if ($this.data('bs.fileinput')) return; $this.fileinput($this.data()); var $target = $(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]'); if ($target.length > 0) { e.preventDefault(); $target.trigger('click.bs.fileinput'); } }); }(__webpack_provided_window_dot_jQuery); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "d26a": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Tibetan [bo] //! author : Thupten N. Chakrishar : https://github.com/vajradog ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { 1: '༡', 2: '༢', 3: '༣', 4: '༤', 5: '༥', 6: '༦', 7: '༧', 8: '༨', 9: '༩', 0: '༠', }, numberMap = { '༡': '1', '༢': '2', '༣': '3', '༤': '4', '༥': '5', '༦': '6', '༧': '7', '༨': '8', '༩': '9', '༠': '0', }; var bo = moment.defineLocale('bo', { months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split( '_' ), monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split( '_' ), monthsShortRegex: /^(ཟླ་\d{1,2})/, monthsParseExact: true, weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split( '_' ), weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split( '_' ), weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'), longDateFormat: { LT: 'A h:mm', LTS: 'A h:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm', LLLL: 'dddd, D MMMM YYYY, A h:mm', }, calendar: { sameDay: '[དི་རིང] LT', nextDay: '[སང་ཉིན] LT', nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT', lastDay: '[ཁ་སང] LT', lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s ལ་', past: '%s སྔན་ལ', s: 'ལམ་སང', ss: '%d སྐར་ཆ།', m: 'སྐར་མ་གཅིག', mm: '%d སྐར་མ', h: 'ཆུ་ཚོད་གཅིག', hh: '%d ཆུ་ཚོད', d: 'ཉིན་གཅིག', dd: '%d ཉིན་', M: 'ཟླ་བ་གཅིག', MM: '%d ཟླ་བ', y: 'ལོ་གཅིག', yy: '%d ལོ', }, preparse: function (string) { return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'མཚན་མོ' && hour >= 4) || (meridiem === 'ཉིན་གུང' && hour < 5) || meridiem === 'དགོང་དག' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'མཚན་མོ'; } else if (hour < 10) { return 'ཞོགས་ཀས'; } else if (hour < 17) { return 'ཉིན་གུང'; } else if (hour < 20) { return 'དགོང་དག'; } else { return 'མཚན་མོ'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return bo; }))); /***/ }), /***/ "d2c8": /***/ (function(module, exports, __webpack_require__) { // helper for String#{startsWith, endsWith, includes} var isRegExp = __webpack_require__("aae3"); var defined = __webpack_require__("be13"); module.exports = function (that, searchString, NAME) { if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; /***/ }), /***/ "d2d4": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Portuguese (Brazil) [pt-br] //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ptBr = moment.defineLocale('pt-br', { months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split( '_' ), monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split( '_' ), weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'), weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY [às] HH:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm', }, calendar: { sameDay: '[Hoje às] LT', nextDay: '[Amanhã às] LT', nextWeek: 'dddd [às] LT', lastDay: '[Ontem às] LT', lastWeek: function () { return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' // Saturday + Sunday : '[Última] dddd [às] LT'; // Monday - Friday }, sameElse: 'L', }, relativeTime: { future: 'em %s', past: 'há %s', s: 'poucos segundos', ss: '%d segundos', m: 'um minuto', mm: '%d minutos', h: 'uma hora', hh: '%d horas', d: 'um dia', dd: '%d dias', M: 'um mês', MM: '%d meses', y: 'um ano', yy: '%d anos', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', invalidDate: 'Data inválida', }); return ptBr; }))); /***/ }), /***/ "d3f4": /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /***/ "d4c0": /***/ (function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols var getKeys = __webpack_require__("0d58"); var gOPS = __webpack_require__("2621"); var pIE = __webpack_require__("52a7"); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; /***/ }), /***/ "d522": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "d53b": /***/ (function(module, exports) { module.exports = function (done, value) { return { value: value, done: !!done }; }; /***/ }), /***/ "d550": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8e6e"); /* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("ac6a"); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("456d"); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6762"); /* harmony import */ var core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_array_includes__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("7f7f"); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("96cf"); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("1da1"); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("ade3"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("c1df"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("2f62"); /* harmony import */ var vue_multiselect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("8e5f"); /* harmony import */ var vue_multiselect__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(vue_multiselect__WEBPACK_IMPORTED_MODULE_10__); /* harmony import */ var vue2_datepicker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("ea76"); /* harmony import */ var vue2_datepicker__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(vue2_datepicker__WEBPACK_IMPORTED_MODULE_11__); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ head: { title: function title() { return { inner: "Add Aircraft", separator: " " }; } }, components: { Multiselect: vue_multiselect__WEBPACK_IMPORTED_MODULE_10___default.a, DatePicker: vue2_datepicker__WEBPACK_IMPORTED_MODULE_11___default.a }, computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_9__[/* mapState */ "b"])({ aircrafts: function aircrafts(state) { return state.profile.aircrafts; }, pilotTrainings: function pilotTrainings(state) { return state.profile.pilotTrainings; }, aircraftDetail: function aircraftDetail(state) { return state.profile.aircraftDetail; } })), methods: { initData: function () { var _initData = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.$store.dispatch("profile/getAircrafts"); case 2: _context.next = 4; return this.$store.dispatch("profile/getPilotTrainings"); case 4: if (this.$router.currentRoute.name === "EditAircraft") { this.getAircraftDetail(this.$route.query.aircraftId); this.isEdit = true; } case 5: case "end": return _context.stop(); } } }, _callee, this); })); function initData() { return _initData.apply(this, arguments); } return initData; }(), addPilotAircraft: function () { var _addPilotAircraft = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var _this = this; var storePath, params; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: if (!this.validateInput()) { _context2.next = 8; break; } $("#btn-save").button("loading"); storePath = this.isEdit ? "profile/updatePilotAircraft" : "profile/addPilotAircrafts"; params = { body: { aircraftId: this.aircraftSelected.aircraftId, pilotTrainingId: this.pilotTrainingSelected.pilotTrainingId, isTypeRated: this.typeRateSelected.value ? this.typeRateSelected.value : null, hoursAircraftTotal: parseInt(this.hoursAircraftTotal, 10), hoursPic: parseInt(this.hoursPic, 10), priceDomestic: parseInt(this.priceDomestic, 10), priceInternational: parseInt(this.priceInternational, 10), trainingDate: moment__WEBPACK_IMPORTED_MODULE_8___default()(this.trainingDate).format("YYYY-MM-DD"), is135: this.is135 }, callBack: function callBack() { _this.$router.push("/edit/aircraft"); } }; console.log(params); _context2.next = 7; return this.$store.dispatch(storePath, params); case 7: $("#btn-save").button("reset"); case 8: case "end": return _context2.stop(); } } }, _callee2, this); })); function addPilotAircraft() { return _addPilotAircraft.apply(this, arguments); } return addPilotAircraft; }(), customLabel: function customLabel(option) { return "".concat(option.manufacturer, " - ").concat(option.model); }, customLabelForPilotTraining: function customLabelForPilotTraining(option) { return "".concat(option.training); }, customLabelForTypeRate: function customLabelForTypeRate(option) { return "".concat(option.title); }, validateInput: function validateInput() { if (this.aircraftSelected === null || this.pilotTrainingSelected === null || this.hoursAircraftTotal === "" || this.hoursPic === "" || this.priceDomestic === "" || this.priceInternational === "" || this.trainingDate === "") { this.isError = true; return false; } else { this.isError = false; return true; } }, // GET AIRCRAFT getAircraftDetail: function () { var _getAircraftDetail = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(aircraftId) { return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _context3.next = 2; return this.$store.dispatch("profile/getAircraftDetail", { id: aircraftId }); case 2: // init data to view this.aircraftSelected = this.aircraftDetail.aircraft; this.pilotTrainingSelected = this.aircraftDetail.trainingPilotTraining; this.typeRateSelected = this.getTypeRateObject(this.aircraftDetail.isTypeRated); this.hoursAircraftTotal = this.aircraftDetail.hoursAircraftTotal; this.hoursPic = this.aircraftDetail.hoursPic; this.priceDomestic = this.aircraftDetail.priceDomestic; this.priceInternational = this.aircraftDetail.priceInternational; this.trainingDate = this.aircraftDetail.trainingDate; this.is135 = this.aircraftDetail.is135; case 11: case "end": return _context3.stop(); } } }, _callee3, this); })); function getAircraftDetail(_x) { return _getAircraftDetail.apply(this, arguments); } return getAircraftDetail; }(), getTypeRateObject: function getTypeRateObject(value) { if (value === null) { value = ""; } return this.typeRated.filter(function (item) { return item.value === value; })[0]; }, onKeyDown: function onKeyDown(evt) { evt = evt ? evt : window.event; var charCode = evt.which ? evt.which : evt.keyCode; var notAllowed = [188, 190, 189, 187, 109, 107, 69, 110]; if (notAllowed.includes(charCode)) { evt.preventDefault(); } else { return true; } } }, data: function data() { return { isError: false, isEdit: false, errorMessage: "This field is required", typeRated: [{ title: "N/A", value: "" }, { title: "Yes", value: true }, { title: "No", value: false }], aircraftSelected: null, pilotTrainingSelected: null, typeRateSelected: { title: "N/A", value: "" }, hoursAircraftTotal: 0, hoursPic: 0, priceDomestic: 0, priceInternational: 0, trainingDate: "", is135: false }; }, mounted: function mounted() { // Changes Takes Place On Body Resize Event this.$autoSetHeight(); // init data this.initData(); } // watch: { // priceDomestic() { // if (this.priceDomestic.length > 9) { // this.priceDomestic = this.priceDomestic.substring(0, 9); // } // } // } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "d610": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "v", function() { return /* reexport */ Fragment; }); __webpack_require__.d(__webpack_exports__, "cb", function() { return /* reexport */ createElement; }); __webpack_require__.d(__webpack_exports__, "hb", function() { return /* reexport */ createRef; }); __webpack_require__.d(__webpack_exports__, "qb", function() { return /* reexport */ flushToDom; }); __webpack_require__.d(__webpack_exports__, "Yb", function() { return /* reexport */ render; }); __webpack_require__.d(__webpack_exports__, "fc", function() { return /* reexport */ unmountComponentAtNode; }); __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BASE_OPTION_DEFAULTS; }); __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ main_BaseComponent; }); __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ BgEvent; }); __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ main_CalendarApi; }); __webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ main_CalendarContent; }); __webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ main_CalendarDataManager; }); __webpack_require__.d(__webpack_exports__, "g", function() { return /* binding */ main_CalendarRoot; }); __webpack_require__.d(__webpack_exports__, "h", function() { return /* binding */ CustomContentRenderContext; }); __webpack_require__.d(__webpack_exports__, "i", function() { return /* binding */ main_DateComponent; }); __webpack_require__.d(__webpack_exports__, "j", function() { return /* binding */ DateProfileGenerator; }); __webpack_require__.d(__webpack_exports__, "k", function() { return /* binding */ main_DayCellContent; }); __webpack_require__.d(__webpack_exports__, "l", function() { return /* binding */ main_DayCellRoot; }); __webpack_require__.d(__webpack_exports__, "m", function() { return /* binding */ main_DayHeader; }); __webpack_require__.d(__webpack_exports__, "n", function() { return /* binding */ DaySeriesModel; }); __webpack_require__.d(__webpack_exports__, "o", function() { return /* binding */ DayTableModel; }); __webpack_require__.d(__webpack_exports__, "p", function() { return /* binding */ DelayedRunner; }); __webpack_require__.d(__webpack_exports__, "q", function() { return /* binding */ ElementDragging; }); __webpack_require__.d(__webpack_exports__, "r", function() { return /* binding */ main_ElementScrollController; }); __webpack_require__.d(__webpack_exports__, "s", function() { return /* binding */ Emitter; }); __webpack_require__.d(__webpack_exports__, "t", function() { return /* binding */ main_EventApi; }); __webpack_require__.d(__webpack_exports__, "u", function() { return /* binding */ main_EventRoot; }); __webpack_require__.d(__webpack_exports__, "w", function() { return /* binding */ Interaction; }); __webpack_require__.d(__webpack_exports__, "x", function() { return /* binding */ main_MoreLinkRoot; }); __webpack_require__.d(__webpack_exports__, "y", function() { return /* binding */ main_NowTimer; }); __webpack_require__.d(__webpack_exports__, "z", function() { return /* binding */ PositionCache; }); __webpack_require__.d(__webpack_exports__, "A", function() { return /* binding */ RefMap; }); __webpack_require__.d(__webpack_exports__, "B", function() { return /* binding */ ScrollController; }); __webpack_require__.d(__webpack_exports__, "C", function() { return /* binding */ main_SegHierarchy; }); __webpack_require__.d(__webpack_exports__, "D", function() { return /* binding */ main_SimpleScrollGrid; }); __webpack_require__.d(__webpack_exports__, "E", function() { return /* binding */ main_Slicer; }); __webpack_require__.d(__webpack_exports__, "F", function() { return /* binding */ main_StandardEvent; }); __webpack_require__.d(__webpack_exports__, "G", function() { return /* binding */ main_ViewRoot; }); __webpack_require__.d(__webpack_exports__, "H", function() { return /* binding */ WeekNumberRoot; }); __webpack_require__.d(__webpack_exports__, "I", function() { return /* binding */ main_WindowScrollController; }); __webpack_require__.d(__webpack_exports__, "J", function() { return /* binding */ addDays; }); __webpack_require__.d(__webpack_exports__, "K", function() { return /* binding */ addWeeks; }); __webpack_require__.d(__webpack_exports__, "L", function() { return /* binding */ allowContextMenu; }); __webpack_require__.d(__webpack_exports__, "M", function() { return /* binding */ allowSelection; }); __webpack_require__.d(__webpack_exports__, "N", function() { return /* binding */ applyMutationToEventStore; }); __webpack_require__.d(__webpack_exports__, "O", function() { return /* binding */ applyStyle; }); __webpack_require__.d(__webpack_exports__, "P", function() { return /* binding */ applyStyleProp; }); __webpack_require__.d(__webpack_exports__, "Q", function() { return /* binding */ buildEntryKey; }); __webpack_require__.d(__webpack_exports__, "R", function() { return /* binding */ buildEventApis; }); __webpack_require__.d(__webpack_exports__, "S", function() { return /* binding */ buildEventRangeKey; }); __webpack_require__.d(__webpack_exports__, "T", function() { return /* binding */ buildNavLinkAttrs; }); __webpack_require__.d(__webpack_exports__, "U", function() { return /* binding */ buildSegTimeText; }); __webpack_require__.d(__webpack_exports__, "V", function() { return /* binding */ compareNumbers; }); __webpack_require__.d(__webpack_exports__, "W", function() { return /* binding */ computeInnerRect; }); __webpack_require__.d(__webpack_exports__, "X", function() { return /* binding */ computeRect; }); __webpack_require__.d(__webpack_exports__, "Y", function() { return /* binding */ config; }); __webpack_require__.d(__webpack_exports__, "Z", function() { return /* binding */ constrainPoint; }); __webpack_require__.d(__webpack_exports__, "ab", function() { return /* binding */ createAriaClickAttrs; }); __webpack_require__.d(__webpack_exports__, "bb", function() { return /* binding */ createDuration; }); __webpack_require__.d(__webpack_exports__, "db", function() { return /* binding */ createEmptyEventStore; }); __webpack_require__.d(__webpack_exports__, "eb", function() { return /* binding */ createEventInstance; }); __webpack_require__.d(__webpack_exports__, "fb", function() { return /* binding */ createFormatter; }); __webpack_require__.d(__webpack_exports__, "gb", function() { return /* binding */ createPlugin; }); __webpack_require__.d(__webpack_exports__, "ib", function() { return /* binding */ diffDates; }); __webpack_require__.d(__webpack_exports__, "jb", function() { return /* binding */ diffPoints; }); __webpack_require__.d(__webpack_exports__, "kb", function() { return /* binding */ diffWeeks; }); __webpack_require__.d(__webpack_exports__, "lb", function() { return /* binding */ disableCursor; }); __webpack_require__.d(__webpack_exports__, "mb", function() { return /* binding */ elementClosest; }); __webpack_require__.d(__webpack_exports__, "nb", function() { return /* binding */ elementMatches; }); __webpack_require__.d(__webpack_exports__, "ob", function() { return /* binding */ enableCursor; }); __webpack_require__.d(__webpack_exports__, "pb", function() { return /* binding */ eventTupleToStore; }); __webpack_require__.d(__webpack_exports__, "rb", function() { return /* binding */ getClippingParents; }); __webpack_require__.d(__webpack_exports__, "sb", function() { return /* binding */ getDefaultEventEnd; }); __webpack_require__.d(__webpack_exports__, "tb", function() { return /* binding */ getElRoot; }); __webpack_require__.d(__webpack_exports__, "ub", function() { return /* binding */ getElSeg; }); __webpack_require__.d(__webpack_exports__, "vb", function() { return /* binding */ getEventTargetViaRoot; }); __webpack_require__.d(__webpack_exports__, "wb", function() { return /* binding */ getRectCenter; }); __webpack_require__.d(__webpack_exports__, "xb", function() { return /* binding */ getRelevantEvents; }); __webpack_require__.d(__webpack_exports__, "yb", function() { return /* binding */ getSegAnchorAttrs; }); __webpack_require__.d(__webpack_exports__, "zb", function() { return /* binding */ getSegMeta; }); __webpack_require__.d(__webpack_exports__, "Ab", function() { return /* binding */ getStickyFooterScrollbar; }); __webpack_require__.d(__webpack_exports__, "Bb", function() { return /* binding */ getStickyHeaderDates; }); __webpack_require__.d(__webpack_exports__, "Cb", function() { return /* binding */ getUniqueDomId; }); __webpack_require__.d(__webpack_exports__, "Db", function() { return /* binding */ identity; }); __webpack_require__.d(__webpack_exports__, "Eb", function() { return /* binding */ interactionSettingsStore; }); __webpack_require__.d(__webpack_exports__, "Fb", function() { return /* binding */ interactionSettingsToStore; }); __webpack_require__.d(__webpack_exports__, "Gb", function() { return /* binding */ intersectRanges; }); __webpack_require__.d(__webpack_exports__, "Hb", function() { return /* binding */ intersectRects; }); __webpack_require__.d(__webpack_exports__, "Ib", function() { return /* binding */ intersectSpans; }); __webpack_require__.d(__webpack_exports__, "Jb", function() { return /* binding */ isArraysEqual; }); __webpack_require__.d(__webpack_exports__, "Kb", function() { return /* binding */ isDateSelectionValid; }); __webpack_require__.d(__webpack_exports__, "Lb", function() { return /* binding */ isDateSpansEqual; }); __webpack_require__.d(__webpack_exports__, "Mb", function() { return /* binding */ isInteractionValid; }); __webpack_require__.d(__webpack_exports__, "Nb", function() { return /* binding */ isPropsEqual; }); __webpack_require__.d(__webpack_exports__, "Ob", function() { return /* binding */ mapHash; }); __webpack_require__.d(__webpack_exports__, "Pb", function() { return /* binding */ memoize; }); __webpack_require__.d(__webpack_exports__, "Qb", function() { return /* binding */ parseDragMeta; }); __webpack_require__.d(__webpack_exports__, "Rb", function() { return /* binding */ parseEventDef; }); __webpack_require__.d(__webpack_exports__, "Sb", function() { return /* binding */ pointInsideRect; }); __webpack_require__.d(__webpack_exports__, "Tb", function() { return /* binding */ preventContextMenu; }); __webpack_require__.d(__webpack_exports__, "Ub", function() { return /* binding */ preventSelection; }); __webpack_require__.d(__webpack_exports__, "Vb", function() { return /* binding */ rangeContainsRange; }); __webpack_require__.d(__webpack_exports__, "Wb", function() { return /* binding */ refineEventDef; }); __webpack_require__.d(__webpack_exports__, "Xb", function() { return /* binding */ removeElement; }); __webpack_require__.d(__webpack_exports__, "Zb", function() { return /* binding */ renderFill; }); __webpack_require__.d(__webpack_exports__, "ac", function() { return /* binding */ renderScrollShim; }); __webpack_require__.d(__webpack_exports__, "bc", function() { return /* binding */ setRef; }); __webpack_require__.d(__webpack_exports__, "cc", function() { return /* binding */ sortEventSegs; }); __webpack_require__.d(__webpack_exports__, "dc", function() { return /* binding */ startOfDay; }); __webpack_require__.d(__webpack_exports__, "ec", function() { return /* binding */ triggerDateSelect; }); __webpack_require__.d(__webpack_exports__, "gc", function() { return /* binding */ whenTransitionDone; }); // UNUSED EXPORTS: Component, createContext, createPortal, BASE_OPTION_REFINERS, CalendarDataProvider, ContentHook, DateEnv, EventSourceApi, MountHook, NamedTimeZoneImpl, NowIndicatorRoot, RenderHook, ScrollResponder, Scroller, Splitter, TableDateCell, TableDowCell, Theme, ViewApi, ViewContextType, addDurations, addMs, asCleanDays, asRoughMinutes, asRoughMs, asRoughSeconds, binarySearch, buildClassNameNormalizer, buildHashFromArray, buildIsoString, buildSegCompareObj, collectFromHash, combineEventUis, compareByFieldSpec, compareByFieldSpecs, compareObjs, computeEarliestSegStart, computeEdges, computeFallbackHeaderFormat, computeHeightAndMargins, computeSegDraggable, computeSegEndResizable, computeSegStartResizable, computeShrinkWidth, computeSmallestCellWidth, computeVisibleDayRange, createEventUi, diffDayAndTime, diffDays, diffWholeDays, diffWholeWeeks, filterEventStoreDefs, filterHash, findDirectChildren, findElements, flexibleCompare, formatDate, formatDayString, formatIsoTimeString, formatRange, getAllowYScrolling, getCanVGrowWithinCell, getDateMeta, getDayClassNames, getEntrySpanEnd, getEventClassNames, getIsRtlScrollbarOnLeft, getScrollGridClassNames, getScrollbarWidths, getSectionClassNames, getSectionHasLiquidHeight, getSlotClassNames, getUnequalProps, globalLocales, globalPlugins, greatestDurationDenominator, groupIntersectingEntries, guid, hasBgRendering, hasShrinkWidth, isColPropsEqual, isInt, isMultiDayRange, isPropsValid, isValidDate, joinSpans, listenBySelector, memoizeArraylike, memoizeHashlike, memoizeObjArg, mergeEventStores, multiplyDuration, padStart, parseBusinessHours, parseClassNames, parseFieldSpecs, parseMarker, preventDefault, rangeContainsMarker, rangesEqual, rangesIntersect, refineProps, removeExact, renderChunkContent, renderMicroColGroup, requestJson, sanitizeShrinkWidth, setElSeg, sliceEventStore, sliceEvents, translateRect, unpromisify, version, wholeDivideDurations // EXTERNAL MODULE: ./node_modules/@fullcalendar/common/main.css var main = __webpack_require__("f54b"); // EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js var tslib_es6 = __webpack_require__("9ab4"); // CONCATENATED MODULE: ./node_modules/@fullcalendar/common/vdom.js /// if (typeof FullCalendarVDom === 'undefined') { throw new Error('Please import the top-level fullcalendar lib before attempting to import a plugin.'); } var Component = FullCalendarVDom.Component; var createElement = FullCalendarVDom.createElement; var render = FullCalendarVDom.render; var createRef = FullCalendarVDom.createRef; var Fragment = FullCalendarVDom.Fragment; var createContext = FullCalendarVDom.createContext; var createPortal = FullCalendarVDom.createPortal; var flushToDom = FullCalendarVDom.flushToDom; var unmountComponentAtNode = FullCalendarVDom.unmountComponentAtNode; /* eslint-enable */ // CONCATENATED MODULE: ./node_modules/@fullcalendar/common/main.js /*! FullCalendar v5.10.1 Docs & License: https://fullcalendar.io/ (c) 2021 Adam Shaw */ // no public types yet. when there are, export from: // import {} from './api-type-deps' var EventSourceApi = /** @class */ (function () { function EventSourceApi(context, internalEventSource) { this.context = context; this.internalEventSource = internalEventSource; } EventSourceApi.prototype.remove = function () { this.context.dispatch({ type: 'REMOVE_EVENT_SOURCE', sourceId: this.internalEventSource.sourceId, }); }; EventSourceApi.prototype.refetch = function () { this.context.dispatch({ type: 'FETCH_EVENT_SOURCES', sourceIds: [this.internalEventSource.sourceId], isRefetch: true, }); }; Object.defineProperty(EventSourceApi.prototype, "id", { get: function () { return this.internalEventSource.publicId; }, enumerable: false, configurable: true }); Object.defineProperty(EventSourceApi.prototype, "url", { get: function () { return this.internalEventSource.meta.url; }, enumerable: false, configurable: true }); Object.defineProperty(EventSourceApi.prototype, "format", { get: function () { return this.internalEventSource.meta.format; // TODO: bad. not guaranteed }, enumerable: false, configurable: true }); return EventSourceApi; }()); function removeElement(el) { if (el.parentNode) { el.parentNode.removeChild(el); } } // Querying // ---------------------------------------------------------------------------------------------------------------- function elementClosest(el, selector) { if (el.closest) { return el.closest(selector); // really bad fallback for IE // from https://developer.mozilla.org/en-US/docs/Web/API/Element/closest } if (!document.documentElement.contains(el)) { return null; } do { if (elementMatches(el, selector)) { return el; } el = (el.parentElement || el.parentNode); } while (el !== null && el.nodeType === 1); return null; } function elementMatches(el, selector) { var method = el.matches || el.matchesSelector || el.msMatchesSelector; return method.call(el, selector); } // accepts multiple subject els // returns a real array. good for methods like forEach // TODO: accept the document function findElements(container, selector) { var containers = container instanceof HTMLElement ? [container] : container; var allMatches = []; for (var i = 0; i < containers.length; i += 1) { var matches = containers[i].querySelectorAll(selector); for (var j = 0; j < matches.length; j += 1) { allMatches.push(matches[j]); } } return allMatches; } // accepts multiple subject els // only queries direct child elements // TODO: rename to findDirectChildren! function findDirectChildren(parent, selector) { var parents = parent instanceof HTMLElement ? [parent] : parent; var allMatches = []; for (var i = 0; i < parents.length; i += 1) { var childNodes = parents[i].children; // only ever elements for (var j = 0; j < childNodes.length; j += 1) { var childNode = childNodes[j]; if (!selector || elementMatches(childNode, selector)) { allMatches.push(childNode); } } } return allMatches; } // Style // ---------------------------------------------------------------------------------------------------------------- var PIXEL_PROP_RE = /(top|left|right|bottom|width|height)$/i; function applyStyle(el, props) { for (var propName in props) { applyStyleProp(el, propName, props[propName]); } } function applyStyleProp(el, name, val) { if (val == null) { el.style[name] = ''; } else if (typeof val === 'number' && PIXEL_PROP_RE.test(name)) { el.style[name] = val + "px"; } else { el.style[name] = val; } } // Event Handling // ---------------------------------------------------------------------------------------------------------------- // if intercepting bubbled events at the document/window/body level, // and want to see originating element (the 'target'), use this util instead // of `ev.target` because it goes within web-component boundaries. function getEventTargetViaRoot(ev) { var _a, _b; return (_b = (_a = ev.composedPath) === null || _a === void 0 ? void 0 : _a.call(ev)[0]) !== null && _b !== void 0 ? _b : ev.target; } // Shadow DOM consuderations // ---------------------------------------------------------------------------------------------------------------- function getElRoot(el) { return el.getRootNode ? el.getRootNode() : document; } // Unique ID for DOM attribute var guid$1 = 0; function getUniqueDomId() { guid$1 += 1; return 'fc-dom-' + guid$1; } // Stops a mouse/touch event from doing it's native browser action function preventDefault(ev) { ev.preventDefault(); } // Event Delegation // ---------------------------------------------------------------------------------------------------------------- function buildDelegationHandler(selector, handler) { return function (ev) { var matchedChild = elementClosest(ev.target, selector); if (matchedChild) { handler.call(matchedChild, ev, matchedChild); } }; } function listenBySelector(container, eventType, selector, handler) { var attachedHandler = buildDelegationHandler(selector, handler); container.addEventListener(eventType, attachedHandler); return function () { container.removeEventListener(eventType, attachedHandler); }; } function listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) { var currentMatchedChild; return listenBySelector(container, 'mouseover', selector, function (mouseOverEv, matchedChild) { if (matchedChild !== currentMatchedChild) { currentMatchedChild = matchedChild; onMouseEnter(mouseOverEv, matchedChild); var realOnMouseLeave_1 = function (mouseLeaveEv) { currentMatchedChild = null; onMouseLeave(mouseLeaveEv, matchedChild); matchedChild.removeEventListener('mouseleave', realOnMouseLeave_1); }; // listen to the next mouseleave, and then unattach matchedChild.addEventListener('mouseleave', realOnMouseLeave_1); } }); } // Animation // ---------------------------------------------------------------------------------------------------------------- var transitionEventNames = [ 'webkitTransitionEnd', 'otransitionend', 'oTransitionEnd', 'msTransitionEnd', 'transitionend', ]; // triggered only when the next single subsequent transition finishes function whenTransitionDone(el, callback) { var realCallback = function (ev) { callback(ev); transitionEventNames.forEach(function (eventName) { el.removeEventListener(eventName, realCallback); }); }; transitionEventNames.forEach(function (eventName) { el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes }); } // ARIA workarounds // ---------------------------------------------------------------------------------------------------------------- function createAriaClickAttrs(handler) { return Object(tslib_es6["a" /* __assign */])({ onClick: handler }, createAriaKeyboardAttrs(handler)); } function createAriaKeyboardAttrs(handler) { return { tabIndex: 0, onKeyDown: function (ev) { if (ev.key === 'Enter' || ev.key === ' ') { handler(ev); ev.preventDefault(); // if space, don't scroll down page } }, }; } var guidNumber = 0; function guid() { guidNumber += 1; return String(guidNumber); } /* FullCalendar-specific DOM Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Make the mouse cursor express that an event is not allowed in the current area function disableCursor() { document.body.classList.add('fc-not-allowed'); } // Returns the mouse cursor to its original look function enableCursor() { document.body.classList.remove('fc-not-allowed'); } /* Selection ----------------------------------------------------------------------------------------------------------------------*/ function preventSelection(el) { el.classList.add('fc-unselectable'); el.addEventListener('selectstart', preventDefault); } function allowSelection(el) { el.classList.remove('fc-unselectable'); el.removeEventListener('selectstart', preventDefault); } /* Context Menu ----------------------------------------------------------------------------------------------------------------------*/ function preventContextMenu(el) { el.addEventListener('contextmenu', preventDefault); } function allowContextMenu(el) { el.removeEventListener('contextmenu', preventDefault); } function parseFieldSpecs(input) { var specs = []; var tokens = []; var i; var token; if (typeof input === 'string') { tokens = input.split(/\s*,\s*/); } else if (typeof input === 'function') { tokens = [input]; } else if (Array.isArray(input)) { tokens = input; } for (i = 0; i < tokens.length; i += 1) { token = tokens[i]; if (typeof token === 'string') { specs.push(token.charAt(0) === '-' ? { field: token.substring(1), order: -1 } : { field: token, order: 1 }); } else if (typeof token === 'function') { specs.push({ func: token }); } } return specs; } function compareByFieldSpecs(obj0, obj1, fieldSpecs) { var i; var cmp; for (i = 0; i < fieldSpecs.length; i += 1) { cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i]); if (cmp) { return cmp; } } return 0; } function compareByFieldSpec(obj0, obj1, fieldSpec) { if (fieldSpec.func) { return fieldSpec.func(obj0, obj1); } return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field]) * (fieldSpec.order || 1); } function flexibleCompare(a, b) { if (!a && !b) { return 0; } if (b == null) { return -1; } if (a == null) { return 1; } if (typeof a === 'string' || typeof b === 'string') { return String(a).localeCompare(String(b)); } return a - b; } /* String Utilities ----------------------------------------------------------------------------------------------------------------------*/ function padStart(val, len) { var s = String(val); return '000'.substr(0, len - s.length) + s; } function formatWithOrdinals(formatter, args, fallbackText) { if (typeof formatter === 'function') { return formatter.apply(void 0, args); } if (typeof formatter === 'string') { // non-blank string return args.reduce(function (str, arg, index) { return (str.replace('$' + index, arg || '')); }, formatter); } return fallbackText; } /* Number Utilities ----------------------------------------------------------------------------------------------------------------------*/ function compareNumbers(a, b) { return a - b; } function isInt(n) { return n % 1 === 0; } /* FC-specific DOM dimension stuff ----------------------------------------------------------------------------------------------------------------------*/ function computeSmallestCellWidth(cellEl) { var allWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-frame'); var contentWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-cushion'); if (!allWidthEl) { throw new Error('needs fc-scrollgrid-shrink-frame className'); // TODO: use const } if (!contentWidthEl) { throw new Error('needs fc-scrollgrid-shrink-cushion className'); } return cellEl.getBoundingClientRect().width - allWidthEl.getBoundingClientRect().width + // the cell padding+border contentWidthEl.getBoundingClientRect().width; } var DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; // Adding function addWeeks(m, n) { var a = dateToUtcArray(m); a[2] += n * 7; return arrayToUtcDate(a); } function addDays(m, n) { var a = dateToUtcArray(m); a[2] += n; return arrayToUtcDate(a); } function addMs(m, n) { var a = dateToUtcArray(m); a[6] += n; return arrayToUtcDate(a); } // Diffing (all return floats) // TODO: why not use ranges? function diffWeeks(m0, m1) { return diffDays(m0, m1) / 7; } function diffDays(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24); } function diffHours(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60); } function diffMinutes(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60); } function diffSeconds(m0, m1) { return (m1.valueOf() - m0.valueOf()) / 1000; } function diffDayAndTime(m0, m1) { var m0day = startOfDay(m0); var m1day = startOfDay(m1); return { years: 0, months: 0, days: Math.round(diffDays(m0day, m1day)), milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf()), }; } // Diffing Whole Units function diffWholeWeeks(m0, m1) { var d = diffWholeDays(m0, m1); if (d !== null && d % 7 === 0) { return d / 7; } return null; } function diffWholeDays(m0, m1) { if (timeAsMs(m0) === timeAsMs(m1)) { return Math.round(diffDays(m0, m1)); } return null; } // Start-Of function startOfDay(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), ]); } function startOfHour(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), ]); } function startOfMinute(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), m.getUTCMinutes(), ]); } function startOfSecond(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), m.getUTCMinutes(), m.getUTCSeconds(), ]); } // Week Computation function weekOfYear(marker, dow, doy) { var y = marker.getUTCFullYear(); var w = weekOfGivenYear(marker, y, dow, doy); if (w < 1) { return weekOfGivenYear(marker, y - 1, dow, doy); } var nextW = weekOfGivenYear(marker, y + 1, dow, doy); if (nextW >= 1) { return Math.min(w, nextW); } return w; } function weekOfGivenYear(marker, year, dow, doy) { var firstWeekStart = arrayToUtcDate([year, 0, 1 + firstWeekOffset(year, dow, doy)]); var dayStart = startOfDay(marker); var days = Math.round(diffDays(firstWeekStart, dayStart)); return Math.floor(days / 7) + 1; // zero-indexed } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { // first-week day -- which january is always in the first week (4 for iso, 1 for other) var fwd = 7 + dow - doy; // first-week day local weekday -- which local weekday is fwd var fwdlw = (7 + arrayToUtcDate([year, 0, fwd]).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // Array Conversion function dateToLocalArray(date) { return [ date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds(), ]; } function arrayToLocalDate(a) { return new Date(a[0], a[1] || 0, a[2] == null ? 1 : a[2], // day of month a[3] || 0, a[4] || 0, a[5] || 0); } function dateToUtcArray(date) { return [ date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds(), ]; } function arrayToUtcDate(a) { // according to web standards (and Safari), a month index is required. // massage if only given a year. if (a.length === 1) { a = a.concat([0]); } return new Date(Date.UTC.apply(Date, a)); } // Other Utils function isValidDate(m) { return !isNaN(m.valueOf()); } function timeAsMs(m) { return m.getUTCHours() * 1000 * 60 * 60 + m.getUTCMinutes() * 1000 * 60 + m.getUTCSeconds() * 1000 + m.getUTCMilliseconds(); } function createEventInstance(defId, range, forcedStartTzo, forcedEndTzo) { return { instanceId: guid(), defId: defId, range: range, forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo, forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo, }; } var main_hasOwnProperty = Object.prototype.hasOwnProperty; // Merges an array of objects into a single object. // The second argument allows for an array of property names who's object values will be merged together. function mergeProps(propObjs, complexPropsMap) { var dest = {}; if (complexPropsMap) { for (var name_1 in complexPropsMap) { var complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered for (var i = propObjs.length - 1; i >= 0; i -= 1) { var val = propObjs[i][name_1]; if (typeof val === 'object' && val) { // non-null object complexObjs.unshift(val); } else if (val !== undefined) { dest[name_1] = val; // if there were no objects, this value will be used break; } } // if the trailing values were objects, use the merged value if (complexObjs.length) { dest[name_1] = mergeProps(complexObjs); } } } // copy values into the destination, going from last to first for (var i = propObjs.length - 1; i >= 0; i -= 1) { var props = propObjs[i]; for (var name_2 in props) { if (!(name_2 in dest)) { // if already assigned by previous props or complex props, don't reassign dest[name_2] = props[name_2]; } } } return dest; } function filterHash(hash, func) { var filtered = {}; for (var key in hash) { if (func(hash[key], key)) { filtered[key] = hash[key]; } } return filtered; } function mapHash(hash, func) { var newHash = {}; for (var key in hash) { newHash[key] = func(hash[key], key); } return newHash; } function arrayToHash(a) { var hash = {}; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { var item = a_1[_i]; hash[item] = true; } return hash; } function buildHashFromArray(a, func) { var hash = {}; for (var i = 0; i < a.length; i += 1) { var tuple = func(a[i], i); hash[tuple[0]] = tuple[1]; } return hash; } function hashValuesToArray(obj) { var a = []; for (var key in obj) { a.push(obj[key]); } return a; } function isPropsEqual(obj0, obj1) { if (obj0 === obj1) { return true; } for (var key in obj0) { if (main_hasOwnProperty.call(obj0, key)) { if (!(key in obj1)) { return false; } } } for (var key in obj1) { if (main_hasOwnProperty.call(obj1, key)) { if (obj0[key] !== obj1[key]) { return false; } } } return true; } function getUnequalProps(obj0, obj1) { var keys = []; for (var key in obj0) { if (main_hasOwnProperty.call(obj0, key)) { if (!(key in obj1)) { keys.push(key); } } } for (var key in obj1) { if (main_hasOwnProperty.call(obj1, key)) { if (obj0[key] !== obj1[key]) { keys.push(key); } } } return keys; } function compareObjs(oldProps, newProps, equalityFuncs) { if (equalityFuncs === void 0) { equalityFuncs = {}; } if (oldProps === newProps) { return true; } for (var key in newProps) { if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) ; else { return false; } } // check for props that were omitted in the new for (var key in oldProps) { if (!(key in newProps)) { return false; } } return true; } /* assumed "true" equality for handler names like "onReceiveSomething" */ function isObjValsEqual(val0, val1, comparator) { if (val0 === val1 || comparator === true) { return true; } if (comparator) { return comparator(val0, val1); } return false; } function collectFromHash(hash, startIndex, endIndex, step) { if (startIndex === void 0) { startIndex = 0; } if (step === void 0) { step = 1; } var res = []; if (endIndex == null) { endIndex = Object.keys(hash).length; } for (var i = startIndex; i < endIndex; i += step) { var val = hash[i]; if (val !== undefined) { // will disregard undefined for sparse arrays res.push(val); } } return res; } function parseRecurring(refined, defaultAllDay, dateEnv, recurringTypes) { for (var i = 0; i < recurringTypes.length; i += 1) { var parsed = recurringTypes[i].parse(refined, dateEnv); if (parsed) { var allDay = refined.allDay; if (allDay == null) { allDay = defaultAllDay; if (allDay == null) { allDay = parsed.allDayGuess; if (allDay == null) { allDay = false; } } } return { allDay: allDay, duration: parsed.duration, typeData: parsed.typeData, typeId: i, }; } } return null; } function expandRecurring(eventStore, framingRange, context) { var dateEnv = context.dateEnv, pluginHooks = context.pluginHooks, options = context.options; var defs = eventStore.defs, instances = eventStore.instances; // remove existing recurring instances // TODO: bad. always expand events as a second step instances = filterHash(instances, function (instance) { return !defs[instance.defId].recurringDef; }); for (var defId in defs) { var def = defs[defId]; if (def.recurringDef) { var duration = def.recurringDef.duration; if (!duration) { duration = def.allDay ? options.defaultAllDayEventDuration : options.defaultTimedEventDuration; } var starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.recurringTypes); for (var _i = 0, starts_1 = starts; _i < starts_1.length; _i++) { var start = starts_1[_i]; var instance = createEventInstance(defId, { start: start, end: dateEnv.add(start, duration), }); instances[instance.instanceId] = instance; } } } return { defs: defs, instances: instances }; } /* Event MUST have a recurringDef */ function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) { var typeDef = recurringTypes[eventDef.recurringDef.typeId]; var markers = typeDef.expand(eventDef.recurringDef.typeData, { start: dateEnv.subtract(framingRange.start, duration), end: framingRange.end, }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to if (eventDef.allDay) { markers = markers.map(startOfDay); } return markers; } var INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds']; var PARSE_RE = /^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/; // Parsing and Creation function createDuration(input, unit) { var _a; if (typeof input === 'string') { return parseString(input); } if (typeof input === 'object' && input) { // non-null object return parseObject(input); } if (typeof input === 'number') { return parseObject((_a = {}, _a[unit || 'milliseconds'] = input, _a)); } return null; } function parseString(s) { var m = PARSE_RE.exec(s); if (m) { var sign = m[1] ? -1 : 1; return { years: 0, months: 0, days: sign * (m[2] ? parseInt(m[2], 10) : 0), milliseconds: sign * ((m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds (m[6] ? parseInt(m[6], 10) : 0) // ms ), }; } return null; } function parseObject(obj) { var duration = { years: obj.years || obj.year || 0, months: obj.months || obj.month || 0, days: obj.days || obj.day || 0, milliseconds: (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes (obj.seconds || obj.second || 0) * 1000 + // seconds (obj.milliseconds || obj.millisecond || obj.ms || 0), // ms }; var weeks = obj.weeks || obj.week; if (weeks) { duration.days += weeks * 7; duration.specifiedWeeks = true; } return duration; } // Equality function durationsEqual(d0, d1) { return d0.years === d1.years && d0.months === d1.months && d0.days === d1.days && d0.milliseconds === d1.milliseconds; } function asCleanDays(dur) { if (!dur.years && !dur.months && !dur.milliseconds) { return dur.days; } return 0; } // Simple Math function addDurations(d0, d1) { return { years: d0.years + d1.years, months: d0.months + d1.months, days: d0.days + d1.days, milliseconds: d0.milliseconds + d1.milliseconds, }; } function subtractDurations(d1, d0) { return { years: d1.years - d0.years, months: d1.months - d0.months, days: d1.days - d0.days, milliseconds: d1.milliseconds - d0.milliseconds, }; } function multiplyDuration(d, n) { return { years: d.years * n, months: d.months * n, days: d.days * n, milliseconds: d.milliseconds * n, }; } // Conversions // "Rough" because they are based on average-case Gregorian months/years function asRoughYears(dur) { return asRoughDays(dur) / 365; } function asRoughMonths(dur) { return asRoughDays(dur) / 30; } function asRoughDays(dur) { return asRoughMs(dur) / 864e5; } function asRoughMinutes(dur) { return asRoughMs(dur) / (1000 * 60); } function asRoughSeconds(dur) { return asRoughMs(dur) / 1000; } function asRoughMs(dur) { return dur.years * (365 * 864e5) + dur.months * (30 * 864e5) + dur.days * 864e5 + dur.milliseconds; } // Advanced Math function wholeDivideDurations(numerator, denominator) { var res = null; for (var i = 0; i < INTERNAL_UNITS.length; i += 1) { var unit = INTERNAL_UNITS[i]; if (denominator[unit]) { var localRes = numerator[unit] / denominator[unit]; if (!isInt(localRes) || (res !== null && res !== localRes)) { return null; } res = localRes; } else if (numerator[unit]) { // needs to divide by something but can't! return null; } } return res; } function greatestDurationDenominator(dur) { var ms = dur.milliseconds; if (ms) { if (ms % 1000 !== 0) { return { unit: 'millisecond', value: ms }; } if (ms % (1000 * 60) !== 0) { return { unit: 'second', value: ms / 1000 }; } if (ms % (1000 * 60 * 60) !== 0) { return { unit: 'minute', value: ms / (1000 * 60) }; } if (ms) { return { unit: 'hour', value: ms / (1000 * 60 * 60) }; } } if (dur.days) { if (dur.specifiedWeeks && dur.days % 7 === 0) { return { unit: 'week', value: dur.days / 7 }; } return { unit: 'day', value: dur.days }; } if (dur.months) { return { unit: 'month', value: dur.months }; } if (dur.years) { return { unit: 'year', value: dur.years }; } return { unit: 'millisecond', value: 0 }; } // timeZoneOffset is in minutes function buildIsoString(marker, timeZoneOffset, stripZeroTime) { if (stripZeroTime === void 0) { stripZeroTime = false; } var s = marker.toISOString(); s = s.replace('.000', ''); if (stripZeroTime) { s = s.replace('T00:00:00Z', ''); } if (s.length > 10) { // time part wasn't stripped, can add timezone info if (timeZoneOffset == null) { s = s.replace('Z', ''); } else if (timeZoneOffset !== 0) { s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true)); } // otherwise, its UTC-0 and we want to keep the Z } return s; } // formats the date, but with no time part // TODO: somehow merge with buildIsoString and stripZeroTime // TODO: rename. omit "string" function formatDayString(marker) { return marker.toISOString().replace(/T.*$/, ''); } // TODO: use Date::toISOString and use everything after the T? function formatIsoTimeString(marker) { return padStart(marker.getUTCHours(), 2) + ':' + padStart(marker.getUTCMinutes(), 2) + ':' + padStart(marker.getUTCSeconds(), 2); } function formatTimeZoneOffset(minutes, doIso) { if (doIso === void 0) { doIso = false; } var sign = minutes < 0 ? '-' : '+'; var abs = Math.abs(minutes); var hours = Math.floor(abs / 60); var mins = Math.round(abs % 60); if (doIso) { return sign + padStart(hours, 2) + ":" + padStart(mins, 2); } return "GMT" + sign + hours + (mins ? ":" + padStart(mins, 2) : ''); } // TODO: new util arrayify? function removeExact(array, exactVal) { var removeCnt = 0; var i = 0; while (i < array.length) { if (array[i] === exactVal) { array.splice(i, 1); removeCnt += 1; } else { i += 1; } } return removeCnt; } function isArraysEqual(a0, a1, equalityFunc) { if (a0 === a1) { return true; } var len = a0.length; var i; if (len !== a1.length) { // not array? or not same length? return false; } for (i = 0; i < len; i += 1) { if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) { return false; } } return true; } function memoize(workerFunc, resEquality, teardownFunc) { var currentArgs; var currentRes; return function () { var newArgs = []; for (var _i = 0; _i < arguments.length; _i++) { newArgs[_i] = arguments[_i]; } if (!currentArgs) { currentRes = workerFunc.apply(this, newArgs); } else if (!isArraysEqual(currentArgs, newArgs)) { if (teardownFunc) { teardownFunc(currentRes); } var res = workerFunc.apply(this, newArgs); if (!resEquality || !resEquality(res, currentRes)) { currentRes = res; } } currentArgs = newArgs; return currentRes; }; } function memoizeObjArg(workerFunc, resEquality, teardownFunc) { var _this = this; var currentArg; var currentRes; return function (newArg) { if (!currentArg) { currentRes = workerFunc.call(_this, newArg); } else if (!isPropsEqual(currentArg, newArg)) { if (teardownFunc) { teardownFunc(currentRes); } var res = workerFunc.call(_this, newArg); if (!resEquality || !resEquality(res, currentRes)) { currentRes = res; } } currentArg = newArg; return currentRes; }; } function memoizeArraylike(// used at all? workerFunc, resEquality, teardownFunc) { var _this = this; var currentArgSets = []; var currentResults = []; return function (newArgSets) { var currentLen = currentArgSets.length; var newLen = newArgSets.length; var i = 0; for (; i < currentLen; i += 1) { if (!newArgSets[i]) { // one of the old sets no longer exists if (teardownFunc) { teardownFunc(currentResults[i]); } } else if (!isArraysEqual(currentArgSets[i], newArgSets[i])) { if (teardownFunc) { teardownFunc(currentResults[i]); } var res = workerFunc.apply(_this, newArgSets[i]); if (!resEquality || !resEquality(res, currentResults[i])) { currentResults[i] = res; } } } for (; i < newLen; i += 1) { currentResults[i] = workerFunc.apply(_this, newArgSets[i]); } currentArgSets = newArgSets; currentResults.splice(newLen); // remove excess return currentResults; }; } function memoizeHashlike(// used? workerFunc, resEquality, teardownFunc) { var _this = this; var currentArgHash = {}; var currentResHash = {}; return function (newArgHash) { var newResHash = {}; for (var key in newArgHash) { if (!currentResHash[key]) { newResHash[key] = workerFunc.apply(_this, newArgHash[key]); } else if (!isArraysEqual(currentArgHash[key], newArgHash[key])) { if (teardownFunc) { teardownFunc(currentResHash[key]); } var res = workerFunc.apply(_this, newArgHash[key]); newResHash[key] = (resEquality && resEquality(res, currentResHash[key])) ? currentResHash[key] : res; } else { newResHash[key] = currentResHash[key]; } } currentArgHash = newArgHash; currentResHash = newResHash; return newResHash; }; } var EXTENDED_SETTINGS_AND_SEVERITIES = { week: 3, separator: 0, omitZeroMinute: 0, meridiem: 0, omitCommas: 0, }; var STANDARD_DATE_PROP_SEVERITIES = { timeZoneName: 7, era: 6, year: 5, month: 4, day: 2, weekday: 2, hour: 1, minute: 1, second: 1, }; var MERIDIEM_RE = /\s*([ap])\.?m\.?/i; // eats up leading spaces too var COMMA_RE = /,/g; // we need re for globalness var MULTI_SPACE_RE = /\s+/g; var LTR_RE = /\u200e/g; // control character var UTC_RE = /UTC|GMT/; var NativeFormatter = /** @class */ (function () { function NativeFormatter(formatSettings) { var standardDateProps = {}; var extendedSettings = {}; var severity = 0; for (var name_1 in formatSettings) { if (name_1 in EXTENDED_SETTINGS_AND_SEVERITIES) { extendedSettings[name_1] = formatSettings[name_1]; severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name_1], severity); } else { standardDateProps[name_1] = formatSettings[name_1]; if (name_1 in STANDARD_DATE_PROP_SEVERITIES) { // TODO: what about hour12? no severity severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name_1], severity); } } } this.standardDateProps = standardDateProps; this.extendedSettings = extendedSettings; this.severity = severity; this.buildFormattingFunc = memoize(buildFormattingFunc); } NativeFormatter.prototype.format = function (date, context) { return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date); }; NativeFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { var _a = this, standardDateProps = _a.standardDateProps, extendedSettings = _a.extendedSettings; var diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem); if (!diffSeverity) { return this.format(start, context); } var biggestUnitForPartial = diffSeverity; if (biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') && (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') && (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit')) { biggestUnitForPartial = 1; // make it look like the dates are only different in terms of time } var full0 = this.format(start, context); var full1 = this.format(end, context); if (full0 === full1) { return full0; } var partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial); var partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context); var partial0 = partialFormattingFunc(start); var partial1 = partialFormattingFunc(end); var insertion = findCommonInsertion(full0, partial0, full1, partial1); var separator = extendedSettings.separator || betterDefaultSeparator || context.defaultSeparator || ''; if (insertion) { return insertion.before + partial0 + separator + partial1 + insertion.after; } return full0 + separator + full1; }; NativeFormatter.prototype.getLargestUnit = function () { switch (this.severity) { case 7: case 6: case 5: return 'year'; case 4: return 'month'; case 3: return 'week'; case 2: return 'day'; default: return 'time'; // really? } }; return NativeFormatter; }()); function buildFormattingFunc(standardDateProps, extendedSettings, context) { var standardDatePropCnt = Object.keys(standardDateProps).length; if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') { return function (date) { return (formatTimeZoneOffset(date.timeZoneOffset)); }; } if (standardDatePropCnt === 0 && extendedSettings.week) { return function (date) { return (formatWeekNumber(context.computeWeekNumber(date.marker), context.weekText, context.weekTextLong, context.locale, extendedSettings.week)); }; } return buildNativeFormattingFunc(standardDateProps, extendedSettings, context); } function buildNativeFormattingFunc(standardDateProps, extendedSettings, context) { standardDateProps = Object(tslib_es6["a" /* __assign */])({}, standardDateProps); // copy extendedSettings = Object(tslib_es6["a" /* __assign */])({}, extendedSettings); // copy sanitizeSettings(standardDateProps, extendedSettings); standardDateProps.timeZone = 'UTC'; // we leverage the only guaranteed timeZone for our UTC markers var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps); var zeroFormat; // needed? if (extendedSettings.omitZeroMinute) { var zeroProps = Object(tslib_es6["a" /* __assign */])({}, standardDateProps); delete zeroProps.minute; // seconds and ms were already considered in sanitizeSettings zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps); } return function (date) { var marker = date.marker; var format; if (zeroFormat && !marker.getUTCMinutes()) { format = zeroFormat; } else { format = normalFormat; } var s = format.format(marker); return postProcess(s, date, standardDateProps, extendedSettings, context); }; } function sanitizeSettings(standardDateProps, extendedSettings) { // deal with a browser inconsistency where formatting the timezone // requires that the hour/minute be present. if (standardDateProps.timeZoneName) { if (!standardDateProps.hour) { standardDateProps.hour = '2-digit'; } if (!standardDateProps.minute) { standardDateProps.minute = '2-digit'; } } // only support short timezone names if (standardDateProps.timeZoneName === 'long') { standardDateProps.timeZoneName = 'short'; } // if requesting to display seconds, MUST display minutes if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) { delete extendedSettings.omitZeroMinute; } } function postProcess(s, date, standardDateProps, extendedSettings, context) { s = s.replace(LTR_RE, ''); // remove left-to-right control chars. do first. good for other regexes if (standardDateProps.timeZoneName === 'short') { s = injectTzoStr(s, (context.timeZone === 'UTC' || date.timeZoneOffset == null) ? 'UTC' : // important to normalize for IE, which does "GMT" formatTimeZoneOffset(date.timeZoneOffset)); } if (extendedSettings.omitCommas) { s = s.replace(COMMA_RE, '').trim(); } if (extendedSettings.omitZeroMinute) { s = s.replace(':00', ''); // zeroFormat doesn't always achieve this } // ^ do anything that might create adjacent spaces before this point, // because MERIDIEM_RE likes to eat up loading spaces if (extendedSettings.meridiem === false) { s = s.replace(MERIDIEM_RE, '').trim(); } else if (extendedSettings.meridiem === 'narrow') { // a/p s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase(); }); } else if (extendedSettings.meridiem === 'short') { // am/pm s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase() + "m"; }); } else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase s = s.replace(MERIDIEM_RE, function (m0) { return m0.toLocaleLowerCase(); }); } s = s.replace(MULTI_SPACE_RE, ' '); s = s.trim(); return s; } function injectTzoStr(s, tzoStr) { var replaced = false; s = s.replace(UTC_RE, function () { replaced = true; return tzoStr; }); // IE11 doesn't include UTC/GMT in the original string, so append to end if (!replaced) { s += " " + tzoStr; } return s; } function formatWeekNumber(num, weekText, weekTextLong, locale, display) { var parts = []; if (display === 'long') { parts.push(weekTextLong); } else if (display === 'short' || display === 'narrow') { parts.push(weekText); } if (display === 'long' || display === 'short') { parts.push(' '); } parts.push(locale.simpleNumberFormat.format(num)); if (locale.options.direction === 'rtl') { // TODO: use control characters instead? parts.reverse(); } return parts.join(''); } // Range Formatting Utils // 0 = exactly the same // 1 = different by time // and bigger function computeMarkerDiffSeverity(d0, d1, ca) { if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) { return 5; } if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) { return 4; } if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) { return 2; } if (timeAsMs(d0) !== timeAsMs(d1)) { return 1; } return 0; } function computePartialFormattingOptions(options, biggestUnit) { var partialOptions = {}; for (var name_2 in options) { if (!(name_2 in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone) STANDARD_DATE_PROP_SEVERITIES[name_2] <= biggestUnit) { partialOptions[name_2] = options[name_2]; } } return partialOptions; } function findCommonInsertion(full0, partial0, full1, partial1) { var i0 = 0; while (i0 < full0.length) { var found0 = full0.indexOf(partial0, i0); if (found0 === -1) { break; } var before0 = full0.substr(0, found0); i0 = found0 + partial0.length; var after0 = full0.substr(i0); var i1 = 0; while (i1 < full1.length) { var found1 = full1.indexOf(partial1, i1); if (found1 === -1) { break; } var before1 = full1.substr(0, found1); i1 = found1 + partial1.length; var after1 = full1.substr(i1); if (before0 === before1 && after0 === after1) { return { before: before0, after: after0, }; } } } return null; } function expandZonedMarker(dateInfo, calendarSystem) { var a = calendarSystem.markerToArray(dateInfo.marker); return { marker: dateInfo.marker, timeZoneOffset: dateInfo.timeZoneOffset, array: a, year: a[0], month: a[1], day: a[2], hour: a[3], minute: a[4], second: a[5], millisecond: a[6], }; } function createVerboseFormattingArg(start, end, context, betterDefaultSeparator) { var startInfo = expandZonedMarker(start, context.calendarSystem); var endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null; return { date: startInfo, start: startInfo, end: endInfo, timeZone: context.timeZone, localeCodes: context.locale.codes, defaultSeparator: betterDefaultSeparator || context.defaultSeparator, }; } /* TODO: fix the terminology of "formatter" vs "formatting func" */ /* At the time of instantiation, this object does not know which cmd-formatting system it will use. It receives this at the time of formatting, as a setting. */ var CmdFormatter = /** @class */ (function () { function CmdFormatter(cmdStr) { this.cmdStr = cmdStr; } CmdFormatter.prototype.format = function (date, context, betterDefaultSeparator) { return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, betterDefaultSeparator)); }; CmdFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, betterDefaultSeparator)); }; return CmdFormatter; }()); var FuncFormatter = /** @class */ (function () { function FuncFormatter(func) { this.func = func; } FuncFormatter.prototype.format = function (date, context, betterDefaultSeparator) { return this.func(createVerboseFormattingArg(date, null, context, betterDefaultSeparator)); }; FuncFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { return this.func(createVerboseFormattingArg(start, end, context, betterDefaultSeparator)); }; return FuncFormatter; }()); function createFormatter(input) { if (typeof input === 'object' && input) { // non-null object return new NativeFormatter(input); } if (typeof input === 'string') { return new CmdFormatter(input); } if (typeof input === 'function') { return new FuncFormatter(input); } return null; } // base options // ------------ var BASE_OPTION_REFINERS = { navLinkDayClick: identity, navLinkWeekClick: identity, duration: createDuration, bootstrapFontAwesome: identity, buttonIcons: identity, customButtons: identity, defaultAllDayEventDuration: createDuration, defaultTimedEventDuration: createDuration, nextDayThreshold: createDuration, scrollTime: createDuration, scrollTimeReset: Boolean, slotMinTime: createDuration, slotMaxTime: createDuration, dayPopoverFormat: createFormatter, slotDuration: createDuration, snapDuration: createDuration, headerToolbar: identity, footerToolbar: identity, defaultRangeSeparator: String, titleRangeSeparator: String, forceEventDuration: Boolean, dayHeaders: Boolean, dayHeaderFormat: createFormatter, dayHeaderClassNames: identity, dayHeaderContent: identity, dayHeaderDidMount: identity, dayHeaderWillUnmount: identity, dayCellClassNames: identity, dayCellContent: identity, dayCellDidMount: identity, dayCellWillUnmount: identity, initialView: String, aspectRatio: Number, weekends: Boolean, weekNumberCalculation: identity, weekNumbers: Boolean, weekNumberClassNames: identity, weekNumberContent: identity, weekNumberDidMount: identity, weekNumberWillUnmount: identity, editable: Boolean, viewClassNames: identity, viewDidMount: identity, viewWillUnmount: identity, nowIndicator: Boolean, nowIndicatorClassNames: identity, nowIndicatorContent: identity, nowIndicatorDidMount: identity, nowIndicatorWillUnmount: identity, showNonCurrentDates: Boolean, lazyFetching: Boolean, startParam: String, endParam: String, timeZoneParam: String, timeZone: String, locales: identity, locale: identity, themeSystem: String, dragRevertDuration: Number, dragScroll: Boolean, allDayMaintainDuration: Boolean, unselectAuto: Boolean, dropAccept: identity, eventOrder: parseFieldSpecs, eventOrderStrict: Boolean, handleWindowResize: Boolean, windowResizeDelay: Number, longPressDelay: Number, eventDragMinDistance: Number, expandRows: Boolean, height: identity, contentHeight: identity, direction: String, weekNumberFormat: createFormatter, eventResizableFromStart: Boolean, displayEventTime: Boolean, displayEventEnd: Boolean, weekText: String, weekTextLong: String, progressiveEventRendering: Boolean, businessHours: identity, initialDate: identity, now: identity, eventDataTransform: identity, stickyHeaderDates: identity, stickyFooterScrollbar: identity, viewHeight: identity, defaultAllDay: Boolean, eventSourceFailure: identity, eventSourceSuccess: identity, eventDisplay: String, eventStartEditable: Boolean, eventDurationEditable: Boolean, eventOverlap: identity, eventConstraint: identity, eventAllow: identity, eventBackgroundColor: String, eventBorderColor: String, eventTextColor: String, eventColor: String, eventClassNames: identity, eventContent: identity, eventDidMount: identity, eventWillUnmount: identity, selectConstraint: identity, selectOverlap: identity, selectAllow: identity, droppable: Boolean, unselectCancel: String, slotLabelFormat: identity, slotLaneClassNames: identity, slotLaneContent: identity, slotLaneDidMount: identity, slotLaneWillUnmount: identity, slotLabelClassNames: identity, slotLabelContent: identity, slotLabelDidMount: identity, slotLabelWillUnmount: identity, dayMaxEvents: identity, dayMaxEventRows: identity, dayMinWidth: Number, slotLabelInterval: createDuration, allDayText: String, allDayClassNames: identity, allDayContent: identity, allDayDidMount: identity, allDayWillUnmount: identity, slotMinWidth: Number, navLinks: Boolean, eventTimeFormat: createFormatter, rerenderDelay: Number, moreLinkText: identity, moreLinkHint: identity, selectMinDistance: Number, selectable: Boolean, selectLongPressDelay: Number, eventLongPressDelay: Number, selectMirror: Boolean, eventMaxStack: Number, eventMinHeight: Number, eventMinWidth: Number, eventShortHeight: Number, slotEventOverlap: Boolean, plugins: identity, firstDay: Number, dayCount: Number, dateAlignment: String, dateIncrement: createDuration, hiddenDays: identity, monthMode: Boolean, fixedWeekCount: Boolean, validRange: identity, visibleRange: identity, titleFormat: identity, eventInteractive: Boolean, // only used by list-view, but languages define the value, so we need it in base options noEventsText: String, viewHint: identity, navLinkHint: identity, closeHint: String, timeHint: String, eventHint: String, moreLinkClick: identity, moreLinkClassNames: identity, moreLinkContent: identity, moreLinkDidMount: identity, moreLinkWillUnmount: identity, }; // do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results. // raw values. var BASE_OPTION_DEFAULTS = { eventDisplay: 'auto', defaultRangeSeparator: ' - ', titleRangeSeparator: ' \u2013 ', defaultTimedEventDuration: '01:00:00', defaultAllDayEventDuration: { day: 1 }, forceEventDuration: false, nextDayThreshold: '00:00:00', dayHeaders: true, initialView: '', aspectRatio: 1.35, headerToolbar: { start: 'title', center: '', end: 'today prev,next', }, weekends: true, weekNumbers: false, weekNumberCalculation: 'local', editable: false, nowIndicator: false, scrollTime: '06:00:00', scrollTimeReset: true, slotMinTime: '00:00:00', slotMaxTime: '24:00:00', showNonCurrentDates: true, lazyFetching: true, startParam: 'start', endParam: 'end', timeZoneParam: 'timeZone', timeZone: 'local', locales: [], locale: '', themeSystem: 'standard', dragRevertDuration: 500, dragScroll: true, allDayMaintainDuration: false, unselectAuto: true, dropAccept: '*', eventOrder: 'start,-duration,allDay,title', dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' }, handleWindowResize: true, windowResizeDelay: 100, longPressDelay: 1000, eventDragMinDistance: 5, expandRows: false, navLinks: false, selectable: false, eventMinHeight: 15, eventMinWidth: 30, eventShortHeight: 30, }; // calendar listeners // ------------------ var CALENDAR_LISTENER_REFINERS = { datesSet: identity, eventsSet: identity, eventAdd: identity, eventChange: identity, eventRemove: identity, windowResize: identity, eventClick: identity, eventMouseEnter: identity, eventMouseLeave: identity, select: identity, unselect: identity, loading: identity, // internal _unmount: identity, _beforeprint: identity, _afterprint: identity, _noEventDrop: identity, _noEventResize: identity, _resize: identity, _scrollRequest: identity, }; // calendar-specific options // ------------------------- var CALENDAR_OPTION_REFINERS = { buttonText: identity, buttonHints: identity, views: identity, plugins: identity, initialEvents: identity, events: identity, eventSources: identity, }; var COMPLEX_OPTION_COMPARATORS = { headerToolbar: isBoolComplexEqual, footerToolbar: isBoolComplexEqual, buttonText: isBoolComplexEqual, buttonHints: isBoolComplexEqual, buttonIcons: isBoolComplexEqual, }; function isBoolComplexEqual(a, b) { if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects return isPropsEqual(a, b); } return a === b; } // view-specific options // --------------------- var VIEW_OPTION_REFINERS = { type: String, component: identity, buttonText: String, buttonTextKey: String, dateProfileGeneratorClass: identity, usesMinMaxTime: Boolean, classNames: identity, content: identity, didMount: identity, willUnmount: identity, }; // util funcs // ---------------------------------------------------------------------------------------------------- function mergeRawOptions(optionSets) { return mergeProps(optionSets, COMPLEX_OPTION_COMPARATORS); } function refineProps(input, refiners) { var refined = {}; var extra = {}; for (var propName in refiners) { if (propName in input) { refined[propName] = refiners[propName](input[propName]); } } for (var propName in input) { if (!(propName in refiners)) { extra[propName] = input[propName]; } } return { refined: refined, extra: extra }; } function identity(raw) { return raw; } function parseEvents(rawEvents, eventSource, context, allowOpenRange) { var eventStore = createEmptyEventStore(); var eventRefiners = buildEventRefiners(context); for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) { var rawEvent = rawEvents_1[_i]; var tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners); if (tuple) { eventTupleToStore(tuple, eventStore); } } return eventStore; } function eventTupleToStore(tuple, eventStore) { if (eventStore === void 0) { eventStore = createEmptyEventStore(); } eventStore.defs[tuple.def.defId] = tuple.def; if (tuple.instance) { eventStore.instances[tuple.instance.instanceId] = tuple.instance; } return eventStore; } // retrieves events that have the same groupId as the instance specified by `instanceId` // or they are the same as the instance. // why might instanceId not be in the store? an event from another calendar? function getRelevantEvents(eventStore, instanceId) { var instance = eventStore.instances[instanceId]; if (instance) { var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); }); // add the original // TODO: wish we could use eventTupleToStore or something like it newStore.defs[def_1.defId] = def_1; newStore.instances[instance.instanceId] = instance; return newStore; } return createEmptyEventStore(); } function isEventDefsGrouped(def0, def1) { return Boolean(def0.groupId && def0.groupId === def1.groupId); } function createEmptyEventStore() { return { defs: {}, instances: {} }; } function mergeEventStores(store0, store1) { return { defs: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, store0.defs), store1.defs), instances: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, store0.instances), store1.instances), }; } function filterEventStoreDefs(eventStore, filterFunc) { var defs = filterHash(eventStore.defs, filterFunc); var instances = filterHash(eventStore.instances, function (instance) { return (defs[instance.defId] // still exists? ); }); return { defs: defs, instances: instances }; } function excludeSubEventStore(master, sub) { var defs = master.defs, instances = master.instances; var filteredDefs = {}; var filteredInstances = {}; for (var defId in defs) { if (!sub.defs[defId]) { // not explicitly excluded filteredDefs[defId] = defs[defId]; } } for (var instanceId in instances) { if (!sub.instances[instanceId] && // not explicitly excluded filteredDefs[instances[instanceId].defId] // def wasn't filtered away ) { filteredInstances[instanceId] = instances[instanceId]; } } return { defs: filteredDefs, instances: filteredInstances, }; } function normalizeConstraint(input, context) { if (Array.isArray(input)) { return parseEvents(input, null, context, true); // allowOpenRange=true } if (typeof input === 'object' && input) { // non-null object return parseEvents([input], null, context, true); // allowOpenRange=true } if (input != null) { return String(input); } return null; } function parseClassNames(raw) { if (Array.isArray(raw)) { return raw; } if (typeof raw === 'string') { return raw.split(/\s+/); } return []; } // TODO: better called "EventSettings" or "EventConfig" // TODO: move this file into structs // TODO: separate constraint/overlap/allow, because selection uses only that, not other props var EVENT_UI_REFINERS = { display: String, editable: Boolean, startEditable: Boolean, durationEditable: Boolean, constraint: identity, overlap: identity, allow: identity, className: parseClassNames, classNames: parseClassNames, color: String, backgroundColor: String, borderColor: String, textColor: String, }; var EMPTY_EVENT_UI = { display: null, startEditable: null, durationEditable: null, constraints: [], overlap: null, allows: [], backgroundColor: '', borderColor: '', textColor: '', classNames: [], }; function createEventUi(refined, context) { var constraint = normalizeConstraint(refined.constraint, context); return { display: refined.display || null, startEditable: refined.startEditable != null ? refined.startEditable : refined.editable, durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable, constraints: constraint != null ? [constraint] : [], overlap: refined.overlap != null ? refined.overlap : null, allows: refined.allow != null ? [refined.allow] : [], backgroundColor: refined.backgroundColor || refined.color || '', borderColor: refined.borderColor || refined.color || '', textColor: refined.textColor || '', classNames: (refined.className || []).concat(refined.classNames || []), // join singular and plural }; } // TODO: prevent against problems with <2 args! function combineEventUis(uis) { return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI); } function combineTwoEventUis(item0, item1) { return { display: item1.display != null ? item1.display : item0.display, startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable, durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable, constraints: item0.constraints.concat(item1.constraints), overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap, allows: item0.allows.concat(item1.allows), backgroundColor: item1.backgroundColor || item0.backgroundColor, borderColor: item1.borderColor || item0.borderColor, textColor: item1.textColor || item0.textColor, classNames: item0.classNames.concat(item1.classNames), }; } var EVENT_NON_DATE_REFINERS = { id: String, groupId: String, title: String, url: String, interactive: Boolean, }; var EVENT_DATE_REFINERS = { start: identity, end: identity, date: identity, allDay: Boolean, }; var EVENT_REFINERS = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, EVENT_NON_DATE_REFINERS), EVENT_DATE_REFINERS), { extendedProps: identity }); function parseEvent(raw, eventSource, context, allowOpenRange, refiners) { if (refiners === void 0) { refiners = buildEventRefiners(context); } var _a = refineEventDef(raw, context, refiners), refined = _a.refined, extra = _a.extra; var defaultAllDay = computeIsDefaultAllDay(eventSource, context); var recurringRes = parseRecurring(refined, defaultAllDay, context.dateEnv, context.pluginHooks.recurringTypes); if (recurringRes) { var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context); def.recurringDef = { typeId: recurringRes.typeId, typeData: recurringRes.typeData, duration: recurringRes.duration, }; return { def: def, instance: null }; } var singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange); if (singleRes) { var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context); var instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo); return { def: def, instance: instance }; } return null; } function refineEventDef(raw, context, refiners) { if (refiners === void 0) { refiners = buildEventRefiners(context); } return refineProps(raw, refiners); } function buildEventRefiners(context) { return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, EVENT_UI_REFINERS), EVENT_REFINERS), context.pluginHooks.eventRefiners); } /* Will NOT populate extendedProps with the leftover properties. Will NOT populate date-related props. */ function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context) { var def = { title: refined.title || '', groupId: refined.groupId || '', publicId: refined.id || '', url: refined.url || '', recurringDef: null, defId: guid(), sourceId: sourceId, allDay: allDay, hasEnd: hasEnd, interactive: refined.interactive, ui: createEventUi(refined, context), extendedProps: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, (refined.extendedProps || {})), extra), }; for (var _i = 0, _a = context.pluginHooks.eventDefMemberAdders; _i < _a.length; _i++) { var memberAdder = _a[_i]; Object(tslib_es6["a" /* __assign */])(def, memberAdder(refined)); } // help out EventApi from having user modify props Object.freeze(def.ui.classNames); Object.freeze(def.extendedProps); return def; } function parseSingle(refined, defaultAllDay, context, allowOpenRange) { var allDay = refined.allDay; var startMeta; var startMarker = null; var hasEnd = false; var endMeta; var endMarker = null; var startInput = refined.start != null ? refined.start : refined.date; startMeta = context.dateEnv.createMarkerMeta(startInput); if (startMeta) { startMarker = startMeta.marker; } else if (!allowOpenRange) { return null; } if (refined.end != null) { endMeta = context.dateEnv.createMarkerMeta(refined.end); } if (allDay == null) { if (defaultAllDay != null) { allDay = defaultAllDay; } else { // fall back to the date props LAST allDay = (!startMeta || startMeta.isTimeUnspecified) && (!endMeta || endMeta.isTimeUnspecified); } } if (allDay && startMarker) { startMarker = startOfDay(startMarker); } if (endMeta) { endMarker = endMeta.marker; if (allDay) { endMarker = startOfDay(endMarker); } if (startMarker && endMarker <= startMarker) { endMarker = null; } } if (endMarker) { hasEnd = true; } else if (!allowOpenRange) { hasEnd = context.options.forceEventDuration || false; endMarker = context.dateEnv.add(startMarker, allDay ? context.options.defaultAllDayEventDuration : context.options.defaultTimedEventDuration); } return { allDay: allDay, hasEnd: hasEnd, range: { start: startMarker, end: endMarker }, forcedStartTzo: startMeta ? startMeta.forcedTzo : null, forcedEndTzo: endMeta ? endMeta.forcedTzo : null, }; } function computeIsDefaultAllDay(eventSource, context) { var res = null; if (eventSource) { res = eventSource.defaultAllDay; } if (res == null) { res = context.options.defaultAllDay; } return res; } /* Date stuff that doesn't belong in datelib core ----------------------------------------------------------------------------------------------------------------------*/ // given a timed range, computes an all-day range that has the same exact duration, // but whose start time is aligned with the start of the day. function computeAlignedDayRange(timedRange) { var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1; var start = startOfDay(timedRange.start); var end = addDays(start, dayCnt); return { start: start, end: end }; } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day // TODO: give nextDayThreshold a default arg function computeVisibleDayRange(timedRange, nextDayThreshold) { if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); } var startDay = null; var endDay = null; if (timedRange.end) { endDay = startOfDay(timedRange.end); var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay` // If the end time is actually inclusively part of the next day and is equal to or // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) { endDay = addDays(endDay, 1); } } if (timedRange.start) { startDay = startOfDay(timedRange.start); // the beginning of the day the range starts // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day. if (endDay && endDay <= startDay) { endDay = addDays(startDay, 1); } } return { start: startDay, end: endDay }; } // spans from one day into another? function isMultiDayRange(range) { var visibleRange = computeVisibleDayRange(range); return diffDays(visibleRange.start, visibleRange.end) > 1; } function diffDates(date0, date1, dateEnv, largeUnit) { if (largeUnit === 'year') { return createDuration(dateEnv.diffWholeYears(date0, date1), 'year'); } if (largeUnit === 'month') { return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month'); } return diffDayAndTime(date0, date1); // returns a duration } function parseRange(input, dateEnv) { var start = null; var end = null; if (input.start) { start = dateEnv.createMarker(input.start); } if (input.end) { end = dateEnv.createMarker(input.end); } if (!start && !end) { return null; } if (start && end && end < start) { return null; } return { start: start, end: end }; } // SIDE-EFFECT: will mutate ranges. // Will return a new array result. function invertRanges(ranges, constraintRange) { var invertedRanges = []; var start = constraintRange.start; // the end of the previous range. the start of the new range var i; var dateRange; // ranges need to be in order. required for our date-walking algorithm ranges.sort(compareRanges); for (i = 0; i < ranges.length; i += 1) { dateRange = ranges[i]; // add the span of time before the event (if there is any) if (dateRange.start > start) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: dateRange.start }); } if (dateRange.end > start) { start = dateRange.end; } } // add the span of time after the last event (if there is any) if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: constraintRange.end }); } return invertedRanges; } function compareRanges(range0, range1) { return range0.start.valueOf() - range1.start.valueOf(); // earlier ranges go first } function intersectRanges(range0, range1) { var start = range0.start, end = range0.end; var newRange = null; if (range1.start !== null) { if (start === null) { start = range1.start; } else { start = new Date(Math.max(start.valueOf(), range1.start.valueOf())); } } if (range1.end != null) { if (end === null) { end = range1.end; } else { end = new Date(Math.min(end.valueOf(), range1.end.valueOf())); } } if (start === null || end === null || start < end) { newRange = { start: start, end: end }; } return newRange; } function rangesEqual(range0, range1) { return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) && (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf()); } function rangesIntersect(range0, range1) { return (range0.end === null || range1.start === null || range0.end > range1.start) && (range0.start === null || range1.end === null || range0.start < range1.end); } function rangeContainsRange(outerRange, innerRange) { return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) && (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end)); } function rangeContainsMarker(range, date) { return (range.start === null || date >= range.start) && (range.end === null || date < range.end); } // If the given date is not within the given range, move it inside. // (If it's past the end, make it one millisecond before the end). function constrainMarkerToRange(date, range) { if (range.start != null && date < range.start) { return range.start; } if (range.end != null && date >= range.end) { return new Date(range.end.valueOf() - 1); } return date; } /* Specifying nextDayThreshold signals that all-day ranges should be sliced. */ function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) { var inverseBgByGroupId = {}; var inverseBgByDefId = {}; var defByGroupId = {}; var bgRanges = []; var fgRanges = []; var eventUis = compileEventUis(eventStore.defs, eventUiBases); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; var ui = eventUis[def.defId]; if (ui.display === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId] = []; if (!defByGroupId[def.groupId]) { defByGroupId[def.groupId] = def; } } else { inverseBgByDefId[defId] = []; } } } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = eventStore.defs[instance.defId]; var ui = eventUis[def.defId]; var origRange = instance.range; var normalRange = (!def.allDay && nextDayThreshold) ? computeVisibleDayRange(origRange, nextDayThreshold) : origRange; var slicedRange = intersectRanges(normalRange, framingRange); if (slicedRange) { if (ui.display === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId].push(slicedRange); } else { inverseBgByDefId[instance.defId].push(slicedRange); } } else if (ui.display !== 'none') { (ui.display === 'background' ? bgRanges : fgRanges).push({ def: def, ui: ui, instance: instance, range: slicedRange, isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(), isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(), }); } } } for (var groupId in inverseBgByGroupId) { // BY GROUP var ranges = inverseBgByGroupId[groupId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) { var invertedRange = invertedRanges_1[_i]; var def = defByGroupId[groupId]; var ui = eventUis[def.defId]; bgRanges.push({ def: def, ui: ui, instance: null, range: invertedRange, isStart: false, isEnd: false, }); } } for (var defId in inverseBgByDefId) { var ranges = inverseBgByDefId[defId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) { var invertedRange = invertedRanges_2[_a]; bgRanges.push({ def: eventStore.defs[defId], ui: eventUis[defId], instance: null, range: invertedRange, isStart: false, isEnd: false, }); } } return { bg: bgRanges, fg: fgRanges }; } function hasBgRendering(def) { return def.ui.display === 'background' || def.ui.display === 'inverse-background'; } function setElSeg(el, seg) { el.fcSeg = seg; } function getElSeg(el) { return el.fcSeg || el.parentNode.fcSeg || // for the harness null; } // event ui computation function compileEventUis(eventDefs, eventUiBases) { return mapHash(eventDefs, function (eventDef) { return compileEventUi(eventDef, eventUiBases); }); } function compileEventUi(eventDef, eventUiBases) { var uis = []; if (eventUiBases['']) { uis.push(eventUiBases['']); } if (eventUiBases[eventDef.defId]) { uis.push(eventUiBases[eventDef.defId]); } uis.push(eventDef.ui); return combineEventUis(uis); } function sortEventSegs(segs, eventOrderSpecs) { var objs = segs.map(buildSegCompareObj); objs.sort(function (obj0, obj1) { return compareByFieldSpecs(obj0, obj1, eventOrderSpecs); }); return objs.map(function (c) { return c._seg; }); } // returns a object with all primitive props that can be compared function buildSegCompareObj(seg) { var eventRange = seg.eventRange; var eventDef = eventRange.def; var range = eventRange.instance ? eventRange.instance.range : eventRange.range; var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events var end = range.end ? range.end.valueOf() : 0; // " return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventDef.extendedProps), eventDef), { id: eventDef.publicId, start: start, end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg }); } function computeSegDraggable(seg, context) { var pluginHooks = context.pluginHooks; var transformers = pluginHooks.isDraggableTransformers; var _a = seg.eventRange, def = _a.def, ui = _a.ui; var val = ui.startEditable; for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) { var transformer = transformers_1[_i]; val = transformer(val, def, ui, context); } return val; } function computeSegStartResizable(seg, context) { return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart; } function computeSegEndResizable(seg, context) { return seg.isEnd && seg.eventRange.ui.durationEditable; } function buildSegTimeText(seg, timeFormat, context, defaultDisplayEventTime, // defaults to true defaultDisplayEventEnd, // defaults to true startOverride, endOverride) { var dateEnv = context.dateEnv, options = context.options; var displayEventTime = options.displayEventTime, displayEventEnd = options.displayEventEnd; var eventDef = seg.eventRange.def; var eventInstance = seg.eventRange.instance; if (displayEventTime == null) { displayEventTime = defaultDisplayEventTime !== false; } if (displayEventEnd == null) { displayEventEnd = defaultDisplayEventEnd !== false; } var wholeEventStart = eventInstance.range.start; var wholeEventEnd = eventInstance.range.end; var segStart = startOverride || seg.start || seg.eventRange.range.start; var segEnd = endOverride || seg.end || seg.eventRange.range.end; var isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf(); var isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf(); if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) { segStart = isStartDay ? wholeEventStart : segStart; segEnd = isEndDay ? wholeEventEnd : segEnd; if (displayEventEnd && eventDef.hasEnd) { return dateEnv.formatRange(segStart, segEnd, timeFormat, { forcedStartTzo: startOverride ? null : eventInstance.forcedStartTzo, forcedEndTzo: endOverride ? null : eventInstance.forcedEndTzo, }); } return dateEnv.format(segStart, timeFormat, { forcedTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooo, same }); } return ''; } function getSegMeta(seg, todayRange, nowDate) { var segRange = seg.eventRange.range; return { isPast: segRange.end < (nowDate || todayRange.start), isFuture: segRange.start >= (nowDate || todayRange.end), isToday: todayRange && rangeContainsMarker(todayRange, segRange.start), }; } function getEventClassNames(props) { var classNames = ['fc-event']; if (props.isMirror) { classNames.push('fc-event-mirror'); } if (props.isDraggable) { classNames.push('fc-event-draggable'); } if (props.isStartResizable || props.isEndResizable) { classNames.push('fc-event-resizable'); } if (props.isDragging) { classNames.push('fc-event-dragging'); } if (props.isResizing) { classNames.push('fc-event-resizing'); } if (props.isSelected) { classNames.push('fc-event-selected'); } if (props.isStart) { classNames.push('fc-event-start'); } if (props.isEnd) { classNames.push('fc-event-end'); } if (props.isPast) { classNames.push('fc-event-past'); } if (props.isToday) { classNames.push('fc-event-today'); } if (props.isFuture) { classNames.push('fc-event-future'); } return classNames; } function buildEventRangeKey(eventRange) { return eventRange.instance ? eventRange.instance.instanceId : eventRange.def.defId + ":" + eventRange.range.start.toISOString(); // inverse-background events don't have specific instances. TODO: better solution } function getSegAnchorAttrs(seg, context) { var _a = seg.eventRange, def = _a.def, instance = _a.instance; var url = def.url; if (url) { return { href: url }; } var emitter = context.emitter, options = context.options; var eventInteractive = options.eventInteractive; if (eventInteractive == null) { eventInteractive = def.interactive; if (eventInteractive == null) { eventInteractive = Boolean(emitter.hasHandlers('eventClick')); } } // mock what happens in EventClicking if (eventInteractive) { // only attach keyboard-related handlers because click handler is already done in EventClicking return createAriaKeyboardAttrs(function (ev) { emitter.trigger('eventClick', { el: ev.target, event: new main_EventApi(context, def, instance), jsEvent: ev, view: context.viewApi, }); }); } return {}; } var STANDARD_PROPS = { start: identity, end: identity, allDay: Boolean, }; function parseDateSpan(raw, dateEnv, defaultDuration) { var span = parseOpenDateSpan(raw, dateEnv); var range = span.range; if (!range.start) { return null; } if (!range.end) { if (defaultDuration == null) { return null; } range.end = dateEnv.add(range.start, defaultDuration); } return span; } /* TODO: somehow combine with parseRange? Will return null if the start/end props were present but parsed invalidly. */ function parseOpenDateSpan(raw, dateEnv) { var _a = refineProps(raw, STANDARD_PROPS), standardProps = _a.refined, extra = _a.extra; var startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null; var endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null; var allDay = standardProps.allDay; if (allDay == null) { allDay = (startMeta && startMeta.isTimeUnspecified) && (!endMeta || endMeta.isTimeUnspecified); } return Object(tslib_es6["a" /* __assign */])({ range: { start: startMeta ? startMeta.marker : null, end: endMeta ? endMeta.marker : null, }, allDay: allDay }, extra); } function isDateSpansEqual(span0, span1) { return rangesEqual(span0.range, span1.range) && span0.allDay === span1.allDay && isSpanPropsEqual(span0, span1); } // the NON-DATE-RELATED props function isSpanPropsEqual(span0, span1) { for (var propName in span1) { if (propName !== 'range' && propName !== 'allDay') { if (span0[propName] !== span1[propName]) { return false; } } } // are there any props that span0 has that span1 DOESN'T have? // both have range/allDay, so no need to special-case. for (var propName in span0) { if (!(propName in span1)) { return false; } } return true; } function buildDateSpanApi(span, dateEnv) { return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, buildRangeApi(span.range, dateEnv, span.allDay)), { allDay: span.allDay }); } function buildRangeApiWithTimeZone(range, dateEnv, omitTime) { return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, buildRangeApi(range, dateEnv, omitTime)), { timeZone: dateEnv.timeZone }); } function buildRangeApi(range, dateEnv, omitTime) { return { start: dateEnv.toDate(range.start), end: dateEnv.toDate(range.end), startStr: dateEnv.formatIso(range.start, { omitTime: omitTime }), endStr: dateEnv.formatIso(range.end, { omitTime: omitTime }), }; } function fabricateEventRange(dateSpan, eventUiBases, context) { var res = refineEventDef({ editable: false }, context); var def = parseEventDef(res.refined, res.extra, '', // sourceId dateSpan.allDay, true, // hasEnd context); return { def: def, ui: compileEventUi(def, eventUiBases), instance: createEventInstance(def.defId, dateSpan.range), range: dateSpan.range, isStart: true, isEnd: true, }; } function triggerDateSelect(selection, pev, context) { context.emitter.trigger('select', Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view })); } function triggerDateUnselect(pev, context) { context.emitter.trigger('unselect', { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view, }); } function buildDateSpanApiWithContext(dateSpan, context) { var props = {}; for (var _i = 0, _a = context.pluginHooks.dateSpanTransforms; _i < _a.length; _i++) { var transform = _a[_i]; Object(tslib_es6["a" /* __assign */])(props, transform(dateSpan, context)); } Object(tslib_es6["a" /* __assign */])(props, buildDateSpanApi(dateSpan, context.dateEnv)); return props; } // Given an event's allDay status and start date, return what its fallback end date should be. // TODO: rename to computeDefaultEventEnd function getDefaultEventEnd(allDay, marker, context) { var dateEnv = context.dateEnv, options = context.options; var end = marker; if (allDay) { end = startOfDay(end); end = dateEnv.add(end, options.defaultAllDayEventDuration); } else { end = dateEnv.add(end, options.defaultTimedEventDuration); } return end; } // applies the mutation to ALL defs/instances within the event store function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) { var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase); var dest = createEmptyEventStore(); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context); } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = dest.defs[instance.defId]; // important to grab the newly modified def dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context); } return dest; } function applyMutationToEventDef(eventDef, eventConfig, mutation, context) { var standardProps = mutation.standardProps || {}; // if hasEnd has not been specified, guess a good value based on deltas. // if duration will change, there's no way the default duration will persist, // and thus, we need to mark the event as having a real end if (standardProps.hasEnd == null && eventConfig.durationEditable && (mutation.startDelta || mutation.endDelta)) { standardProps.hasEnd = true; // TODO: is this mutation okay? } var copy = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventDef), standardProps), { ui: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventDef.ui), standardProps.ui) }); if (mutation.extendedProps) { copy.extendedProps = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, copy.extendedProps), mutation.extendedProps); } for (var _i = 0, _a = context.pluginHooks.eventDefMutationAppliers; _i < _a.length; _i++) { var applier = _a[_i]; applier(copy, mutation, context); } if (!copy.hasEnd && context.options.forceEventDuration) { copy.hasEnd = true; } return copy; } function applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef eventConfig, mutation, context) { var dateEnv = context.dateEnv; var forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true; var clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false; var copy = Object(tslib_es6["a" /* __assign */])({}, eventInstance); if (forceAllDay) { copy.range = computeAlignedDayRange(copy.range); } if (mutation.datesDelta && eventConfig.startEditable) { copy.range = { start: dateEnv.add(copy.range.start, mutation.datesDelta), end: dateEnv.add(copy.range.end, mutation.datesDelta), }; } if (mutation.startDelta && eventConfig.durationEditable) { copy.range = { start: dateEnv.add(copy.range.start, mutation.startDelta), end: copy.range.end, }; } if (mutation.endDelta && eventConfig.durationEditable) { copy.range = { start: copy.range.start, end: dateEnv.add(copy.range.end, mutation.endDelta), }; } if (clearEnd) { copy.range = { start: copy.range.start, end: getDefaultEventEnd(eventDef.allDay, copy.range.start, context), }; } // in case event was all-day but the supplied deltas were not // better util for this? if (eventDef.allDay) { copy.range = { start: startOfDay(copy.range.start), end: startOfDay(copy.range.end), }; } // handle invalid durations if (copy.range.end < copy.range.start) { copy.range.end = getDefaultEventEnd(eventDef.allDay, copy.range.start, context); } return copy; } // no public types yet. when there are, export from: // import {} from './api-type-deps' var ViewApi = /** @class */ (function () { function ViewApi(type, getCurrentData, dateEnv) { this.type = type; this.getCurrentData = getCurrentData; this.dateEnv = dateEnv; } Object.defineProperty(ViewApi.prototype, "calendar", { get: function () { return this.getCurrentData().calendarApi; }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "title", { get: function () { return this.getCurrentData().viewTitle; }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "activeStart", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "activeEnd", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "currentStart", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "currentEnd", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end); }, enumerable: false, configurable: true }); ViewApi.prototype.getOption = function (name) { return this.getCurrentData().options[name]; // are the view-specific options }; return ViewApi; }()); var EVENT_SOURCE_REFINERS = { id: String, defaultAllDay: Boolean, url: String, format: String, events: identity, eventDataTransform: identity, // for any network-related sources success: identity, failure: identity, }; function parseEventSource(raw, context, refiners) { if (refiners === void 0) { refiners = buildEventSourceRefiners(context); } var rawObj; if (typeof raw === 'string') { rawObj = { url: raw }; } else if (typeof raw === 'function' || Array.isArray(raw)) { rawObj = { events: raw }; } else if (typeof raw === 'object' && raw) { // not null rawObj = raw; } if (rawObj) { var _a = refineProps(rawObj, refiners), refined = _a.refined, extra = _a.extra; var metaRes = buildEventSourceMeta(refined, context); if (metaRes) { return { _raw: raw, isFetching: false, latestFetchId: '', fetchRange: null, defaultAllDay: refined.defaultAllDay, eventDataTransform: refined.eventDataTransform, success: refined.success, failure: refined.failure, publicId: refined.id || '', sourceId: guid(), sourceDefId: metaRes.sourceDefId, meta: metaRes.meta, ui: createEventUi(refined, context), extendedProps: extra, }; } } return null; } function buildEventSourceRefiners(context) { return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, EVENT_UI_REFINERS), EVENT_SOURCE_REFINERS), context.pluginHooks.eventSourceRefiners); } function buildEventSourceMeta(raw, context) { var defs = context.pluginHooks.eventSourceDefs; for (var i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence var def = defs[i]; var meta = def.parseMeta(raw); if (meta) { return { sourceDefId: i, meta: meta }; } } return null; } function reduceCurrentDate(currentDate, action) { switch (action.type) { case 'CHANGE_DATE': return action.dateMarker; default: return currentDate; } } function getInitialDate(options, dateEnv) { var initialDateInput = options.initialDate; // compute the initial ambig-timezone date if (initialDateInput != null) { return dateEnv.createMarker(initialDateInput); } return getNow(options.now, dateEnv); // getNow already returns unzoned } function getNow(nowInput, dateEnv) { if (typeof nowInput === 'function') { nowInput = nowInput(); } if (nowInput == null) { return dateEnv.createNowMarker(); } return dateEnv.createMarker(nowInput); } var main_CalendarApi = /** @class */ (function () { function CalendarApi() { } CalendarApi.prototype.getCurrentData = function () { return this.currentDataManager.getCurrentData(); }; CalendarApi.prototype.dispatch = function (action) { return this.currentDataManager.dispatch(action); }; Object.defineProperty(CalendarApi.prototype, "view", { get: function () { return this.getCurrentData().viewApi; } // for public API , enumerable: false, configurable: true }); CalendarApi.prototype.batchRendering = function (callback) { callback(); }; CalendarApi.prototype.updateSize = function () { this.trigger('_resize', true); }; // Options // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.setOption = function (name, val) { this.dispatch({ type: 'SET_OPTION', optionName: name, rawOptionValue: val, }); }; CalendarApi.prototype.getOption = function (name) { return this.currentDataManager.currentCalendarOptionsInput[name]; }; CalendarApi.prototype.getAvailableLocaleCodes = function () { return Object.keys(this.getCurrentData().availableRawLocales); }; // Trigger // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.on = function (handlerName, handler) { var currentDataManager = this.currentDataManager; if (currentDataManager.currentCalendarOptionsRefiners[handlerName]) { currentDataManager.emitter.on(handlerName, handler); } else { console.warn("Unknown listener name '" + handlerName + "'"); } }; CalendarApi.prototype.off = function (handlerName, handler) { this.currentDataManager.emitter.off(handlerName, handler); }; // not meant for public use CalendarApi.prototype.trigger = function (handlerName) { var _a; var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } (_a = this.currentDataManager.emitter).trigger.apply(_a, Object(tslib_es6["c" /* __spreadArray */])([handlerName], args)); }; // View // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.changeView = function (viewType, dateOrRange) { var _this = this; this.batchRendering(function () { _this.unselect(); if (dateOrRange) { if (dateOrRange.start && dateOrRange.end) { // a range _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, }); _this.dispatch({ type: 'SET_OPTION', optionName: 'visibleRange', rawOptionValue: dateOrRange, }); } else { var dateEnv = _this.getCurrentData().dateEnv; _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, dateMarker: dateEnv.createMarker(dateOrRange), }); } } else { _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, }); } }); }; // Forces navigation to a view for the given date. // `viewType` can be a specific view name or a generic one like "week" or "day". // needs to change CalendarApi.prototype.zoomTo = function (dateMarker, viewType) { var state = this.getCurrentData(); var spec; viewType = viewType || 'day'; // day is default zoom spec = state.viewSpecs[viewType] || this.getUnitViewSpec(viewType); this.unselect(); if (spec) { this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: spec.type, dateMarker: dateMarker, }); } else { this.dispatch({ type: 'CHANGE_DATE', dateMarker: dateMarker, }); } }; // Given a duration singular unit, like "week" or "day", finds a matching view spec. // Preference is given to views that have corresponding buttons. CalendarApi.prototype.getUnitViewSpec = function (unit) { var _a = this.getCurrentData(), viewSpecs = _a.viewSpecs, toolbarConfig = _a.toolbarConfig; var viewTypes = [].concat(toolbarConfig.header ? toolbarConfig.header.viewsWithButtons : [], toolbarConfig.footer ? toolbarConfig.footer.viewsWithButtons : []); var i; var spec; for (var viewType in viewSpecs) { viewTypes.push(viewType); } for (i = 0; i < viewTypes.length; i += 1) { spec = viewSpecs[viewTypes[i]]; if (spec) { if (spec.singleUnit === unit) { return spec; } } } return null; }; // Current Date // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.prev = function () { this.unselect(); this.dispatch({ type: 'PREV' }); }; CalendarApi.prototype.next = function () { this.unselect(); this.dispatch({ type: 'NEXT' }); }; CalendarApi.prototype.prevYear = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.addYears(state.currentDate, -1), }); }; CalendarApi.prototype.nextYear = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.addYears(state.currentDate, 1), }); }; CalendarApi.prototype.today = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: getNow(state.calendarOptions.now, state.dateEnv), }); }; CalendarApi.prototype.gotoDate = function (zonedDateInput) { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.createMarker(zonedDateInput), }); }; CalendarApi.prototype.incrementDate = function (deltaInput) { var state = this.getCurrentData(); var delta = createDuration(deltaInput); if (delta) { // else, warn about invalid input? this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.add(state.currentDate, delta), }); } }; // for external API CalendarApi.prototype.getDate = function () { var state = this.getCurrentData(); return state.dateEnv.toDate(state.currentDate); }; // Date Formatting Utils // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.formatDate = function (d, formatter) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter)); }; // `settings` is for formatter AND isEndExclusive CalendarApi.prototype.formatRange = function (d0, d1, settings) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings), settings); }; CalendarApi.prototype.formatIso = function (d, omitTime) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime }); }; // Date Selection / Event Selection / DayClick // ----------------------------------------------------------------------------------------------------------------- // this public method receives start/end dates in any format, with any timezone // NOTE: args were changed from v3 CalendarApi.prototype.select = function (dateOrObj, endDate) { var selectionInput; if (endDate == null) { if (dateOrObj.start != null) { selectionInput = dateOrObj; } else { selectionInput = { start: dateOrObj, end: null, }; } } else { selectionInput = { start: dateOrObj, end: endDate, }; } var state = this.getCurrentData(); var selection = parseDateSpan(selectionInput, state.dateEnv, createDuration({ days: 1 })); if (selection) { // throw parse error otherwise? this.dispatch({ type: 'SELECT_DATES', selection: selection }); triggerDateSelect(selection, null, state); } }; // public method CalendarApi.prototype.unselect = function (pev) { var state = this.getCurrentData(); if (state.dateSelection) { this.dispatch({ type: 'UNSELECT_DATES' }); triggerDateUnselect(pev, state); } }; // Public Events API // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.addEvent = function (eventInput, sourceInput) { if (eventInput instanceof main_EventApi) { var def = eventInput._def; var instance = eventInput._instance; var currentData = this.getCurrentData(); // not already present? don't want to add an old snapshot if (!currentData.eventStore.defs[def.defId]) { this.dispatch({ type: 'ADD_EVENTS', eventStore: eventTupleToStore({ def: def, instance: instance }), // TODO: better util for two args? }); this.triggerEventAdd(eventInput); } return eventInput; } var state = this.getCurrentData(); var eventSource; if (sourceInput instanceof EventSourceApi) { eventSource = sourceInput.internalEventSource; } else if (typeof sourceInput === 'boolean') { if (sourceInput) { // true. part of the first event source eventSource = hashValuesToArray(state.eventSources)[0]; } } else if (sourceInput != null) { // an ID. accepts a number too var sourceApi = this.getEventSourceById(sourceInput); // TODO: use an internal function if (!sourceApi) { console.warn("Could not find an event source with ID \"" + sourceInput + "\""); // TODO: test return null; } eventSource = sourceApi.internalEventSource; } var tuple = parseEvent(eventInput, eventSource, state, false); if (tuple) { var newEventApi = new main_EventApi(state, tuple.def, tuple.def.recurringDef ? null : tuple.instance); this.dispatch({ type: 'ADD_EVENTS', eventStore: eventTupleToStore(tuple), }); this.triggerEventAdd(newEventApi); return newEventApi; } return null; }; CalendarApi.prototype.triggerEventAdd = function (eventApi) { var _this = this; var emitter = this.getCurrentData().emitter; emitter.trigger('eventAdd', { event: eventApi, relatedEvents: [], revert: function () { _this.dispatch({ type: 'REMOVE_EVENTS', eventStore: eventApiToStore(eventApi), }); }, }); }; // TODO: optimize CalendarApi.prototype.getEventById = function (id) { var state = this.getCurrentData(); var _a = state.eventStore, defs = _a.defs, instances = _a.instances; id = String(id); for (var defId in defs) { var def = defs[defId]; if (def.publicId === id) { if (def.recurringDef) { return new main_EventApi(state, def, null); } for (var instanceId in instances) { var instance = instances[instanceId]; if (instance.defId === def.defId) { return new main_EventApi(state, def, instance); } } } } return null; }; CalendarApi.prototype.getEvents = function () { var currentData = this.getCurrentData(); return buildEventApis(currentData.eventStore, currentData); }; CalendarApi.prototype.removeAllEvents = function () { this.dispatch({ type: 'REMOVE_ALL_EVENTS' }); }; // Public Event Sources API // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.getEventSources = function () { var state = this.getCurrentData(); var sourceHash = state.eventSources; var sourceApis = []; for (var internalId in sourceHash) { sourceApis.push(new EventSourceApi(state, sourceHash[internalId])); } return sourceApis; }; CalendarApi.prototype.getEventSourceById = function (id) { var state = this.getCurrentData(); var sourceHash = state.eventSources; id = String(id); for (var sourceId in sourceHash) { if (sourceHash[sourceId].publicId === id) { return new EventSourceApi(state, sourceHash[sourceId]); } } return null; }; CalendarApi.prototype.addEventSource = function (sourceInput) { var state = this.getCurrentData(); if (sourceInput instanceof EventSourceApi) { // not already present? don't want to add an old snapshot if (!state.eventSources[sourceInput.internalEventSource.sourceId]) { this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [sourceInput.internalEventSource], }); } return sourceInput; } var eventSource = parseEventSource(sourceInput, state); if (eventSource) { // TODO: error otherwise? this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] }); return new EventSourceApi(state, eventSource); } return null; }; CalendarApi.prototype.removeAllEventSources = function () { this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' }); }; CalendarApi.prototype.refetchEvents = function () { this.dispatch({ type: 'FETCH_EVENT_SOURCES', isRefetch: true }); }; // Scroll // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.scrollToTime = function (timeInput) { var time = createDuration(timeInput); if (time) { this.trigger('_scrollRequest', { time: time }); } }; return CalendarApi; }()); var main_EventApi = /** @class */ (function () { // instance will be null if expressing a recurring event that has no current instances, // OR if trying to validate an incoming external event that has no dates assigned function EventApi(context, def, instance) { this._context = context; this._def = def; this._instance = instance || null; } /* TODO: make event struct more responsible for this */ EventApi.prototype.setProp = function (name, val) { var _a, _b; if (name in EVENT_DATE_REFINERS) { console.warn('Could not set date-related prop \'name\'. Use one of the date-related methods instead.'); // TODO: make proper aliasing system? } else if (name === 'id') { val = EVENT_NON_DATE_REFINERS[name](val); this.mutate({ standardProps: { publicId: val }, // hardcoded internal name }); } else if (name in EVENT_NON_DATE_REFINERS) { val = EVENT_NON_DATE_REFINERS[name](val); this.mutate({ standardProps: (_a = {}, _a[name] = val, _a), }); } else if (name in EVENT_UI_REFINERS) { var ui = EVENT_UI_REFINERS[name](val); if (name === 'color') { ui = { backgroundColor: val, borderColor: val }; } else if (name === 'editable') { ui = { startEditable: val, durationEditable: val }; } else { ui = (_b = {}, _b[name] = val, _b); } this.mutate({ standardProps: { ui: ui }, }); } else { console.warn("Could not set prop '" + name + "'. Use setExtendedProp instead."); } }; EventApi.prototype.setExtendedProp = function (name, val) { var _a; this.mutate({ extendedProps: (_a = {}, _a[name] = val, _a), }); }; EventApi.prototype.setStart = function (startInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var start = dateEnv.createMarker(startInput); if (start && this._instance) { // TODO: warning if parsed bad var instanceRange = this._instance.range; var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); // what if parsed bad!? if (options.maintainDuration) { this.mutate({ datesDelta: startDelta }); } else { this.mutate({ startDelta: startDelta }); } } }; EventApi.prototype.setEnd = function (endInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var end; if (endInput != null) { end = dateEnv.createMarker(endInput); if (!end) { return; // TODO: warning if parsed bad } } if (this._instance) { if (end) { var endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity); this.mutate({ endDelta: endDelta }); } else { this.mutate({ standardProps: { hasEnd: false } }); } } }; EventApi.prototype.setDates = function (startInput, endInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var standardProps = { allDay: options.allDay }; var start = dateEnv.createMarker(startInput); var end; if (!start) { return; // TODO: warning if parsed bad } if (endInput != null) { end = dateEnv.createMarker(endInput); if (!end) { // TODO: warning if parsed bad return; } } if (this._instance) { var instanceRange = this._instance.range; // when computing the diff for an event being converted to all-day, // compute diff off of the all-day values the way event-mutation does. if (options.allDay === true) { instanceRange = computeAlignedDayRange(instanceRange); } var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); if (end) { var endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity); if (durationsEqual(startDelta, endDelta)) { this.mutate({ datesDelta: startDelta, standardProps: standardProps }); } else { this.mutate({ startDelta: startDelta, endDelta: endDelta, standardProps: standardProps }); } } else { // means "clear the end" standardProps.hasEnd = false; this.mutate({ datesDelta: startDelta, standardProps: standardProps }); } } }; EventApi.prototype.moveStart = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ startDelta: delta }); } }; EventApi.prototype.moveEnd = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ endDelta: delta }); } }; EventApi.prototype.moveDates = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ datesDelta: delta }); } }; EventApi.prototype.setAllDay = function (allDay, options) { if (options === void 0) { options = {}; } var standardProps = { allDay: allDay }; var maintainDuration = options.maintainDuration; if (maintainDuration == null) { maintainDuration = this._context.options.allDayMaintainDuration; } if (this._def.allDay !== allDay) { standardProps.hasEnd = maintainDuration; } this.mutate({ standardProps: standardProps }); }; EventApi.prototype.formatRange = function (formatInput) { var dateEnv = this._context.dateEnv; var instance = this._instance; var formatter = createFormatter(formatInput); if (this._def.hasEnd) { return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, { forcedStartTzo: instance.forcedStartTzo, forcedEndTzo: instance.forcedEndTzo, }); } return dateEnv.format(instance.range.start, formatter, { forcedTzo: instance.forcedStartTzo, }); }; EventApi.prototype.mutate = function (mutation) { var instance = this._instance; if (instance) { var def = this._def; var context_1 = this._context; var eventStore_1 = context_1.getCurrentData().eventStore; var relevantEvents = getRelevantEvents(eventStore_1, instance.instanceId); var eventConfigBase = { '': { display: '', startEditable: true, durationEditable: true, constraints: [], overlap: null, allows: [], backgroundColor: '', borderColor: '', textColor: '', classNames: [], }, }; relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context_1); var oldEvent = new EventApi(context_1, def, instance); // snapshot this._def = relevantEvents.defs[def.defId]; this._instance = relevantEvents.instances[instance.instanceId]; context_1.dispatch({ type: 'MERGE_EVENTS', eventStore: relevantEvents, }); context_1.emitter.trigger('eventChange', { oldEvent: oldEvent, event: this, relatedEvents: buildEventApis(relevantEvents, context_1, instance), revert: function () { context_1.dispatch({ type: 'RESET_EVENTS', eventStore: eventStore_1, }); }, }); } }; EventApi.prototype.remove = function () { var context = this._context; var asStore = eventApiToStore(this); context.dispatch({ type: 'REMOVE_EVENTS', eventStore: asStore, }); context.emitter.trigger('eventRemove', { event: this, relatedEvents: [], revert: function () { context.dispatch({ type: 'MERGE_EVENTS', eventStore: asStore, }); }, }); }; Object.defineProperty(EventApi.prototype, "source", { get: function () { var sourceId = this._def.sourceId; if (sourceId) { return new EventSourceApi(this._context, this._context.getCurrentData().eventSources[sourceId]); } return null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "start", { get: function () { return this._instance ? this._context.dateEnv.toDate(this._instance.range.start) : null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "end", { get: function () { return (this._instance && this._def.hasEnd) ? this._context.dateEnv.toDate(this._instance.range.end) : null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "startStr", { get: function () { var instance = this._instance; if (instance) { return this._context.dateEnv.formatIso(instance.range.start, { omitTime: this._def.allDay, forcedTzo: instance.forcedStartTzo, }); } return ''; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "endStr", { get: function () { var instance = this._instance; if (instance && this._def.hasEnd) { return this._context.dateEnv.formatIso(instance.range.end, { omitTime: this._def.allDay, forcedTzo: instance.forcedEndTzo, }); } return ''; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "id", { // computable props that all access the def // TODO: find a TypeScript-compatible way to do this at scale get: function () { return this._def.publicId; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "groupId", { get: function () { return this._def.groupId; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "allDay", { get: function () { return this._def.allDay; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "title", { get: function () { return this._def.title; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "url", { get: function () { return this._def.url; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "display", { get: function () { return this._def.ui.display || 'auto'; } // bad. just normalize the type earlier , enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "startEditable", { get: function () { return this._def.ui.startEditable; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "durationEditable", { get: function () { return this._def.ui.durationEditable; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "constraint", { get: function () { return this._def.ui.constraints[0] || null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "overlap", { get: function () { return this._def.ui.overlap; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "allow", { get: function () { return this._def.ui.allows[0] || null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "backgroundColor", { get: function () { return this._def.ui.backgroundColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "borderColor", { get: function () { return this._def.ui.borderColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "textColor", { get: function () { return this._def.ui.textColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "classNames", { // NOTE: user can't modify these because Object.freeze was called in event-def parsing get: function () { return this._def.ui.classNames; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "extendedProps", { get: function () { return this._def.extendedProps; }, enumerable: false, configurable: true }); EventApi.prototype.toPlainObject = function (settings) { if (settings === void 0) { settings = {}; } var def = this._def; var ui = def.ui; var _a = this, startStr = _a.startStr, endStr = _a.endStr; var res = {}; if (def.title) { res.title = def.title; } if (startStr) { res.start = startStr; } if (endStr) { res.end = endStr; } if (def.publicId) { res.id = def.publicId; } if (def.groupId) { res.groupId = def.groupId; } if (def.url) { res.url = def.url; } if (ui.display && ui.display !== 'auto') { res.display = ui.display; } // TODO: what about recurring-event properties??? // TODO: include startEditable/durationEditable/constraint/overlap/allow if (settings.collapseColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) { res.color = ui.backgroundColor; } else { if (ui.backgroundColor) { res.backgroundColor = ui.backgroundColor; } if (ui.borderColor) { res.borderColor = ui.borderColor; } } if (ui.textColor) { res.textColor = ui.textColor; } if (ui.classNames.length) { res.classNames = ui.classNames; } if (Object.keys(def.extendedProps).length) { if (settings.collapseExtendedProps) { Object(tslib_es6["a" /* __assign */])(res, def.extendedProps); } else { res.extendedProps = def.extendedProps; } } return res; }; EventApi.prototype.toJSON = function () { return this.toPlainObject(); }; return EventApi; }()); function eventApiToStore(eventApi) { var _a, _b; var def = eventApi._def; var instance = eventApi._instance; return { defs: (_a = {}, _a[def.defId] = def, _a), instances: instance ? (_b = {}, _b[instance.instanceId] = instance, _b) : {}, }; } function buildEventApis(eventStore, context, excludeInstance) { var defs = eventStore.defs, instances = eventStore.instances; var eventApis = []; var excludeInstanceId = excludeInstance ? excludeInstance.instanceId : ''; for (var id in instances) { var instance = instances[id]; var def = defs[instance.defId]; if (instance.instanceId !== excludeInstanceId) { eventApis.push(new main_EventApi(context, def, instance)); } } return eventApis; } var calendarSystemClassMap = {}; function registerCalendarSystem(name, theClass) { calendarSystemClassMap[name] = theClass; } function createCalendarSystem(name) { return new calendarSystemClassMap[name](); } var GregorianCalendarSystem = /** @class */ (function () { function GregorianCalendarSystem() { } GregorianCalendarSystem.prototype.getMarkerYear = function (d) { return d.getUTCFullYear(); }; GregorianCalendarSystem.prototype.getMarkerMonth = function (d) { return d.getUTCMonth(); }; GregorianCalendarSystem.prototype.getMarkerDay = function (d) { return d.getUTCDate(); }; GregorianCalendarSystem.prototype.arrayToMarker = function (arr) { return arrayToUtcDate(arr); }; GregorianCalendarSystem.prototype.markerToArray = function (marker) { return dateToUtcArray(marker); }; return GregorianCalendarSystem; }()); registerCalendarSystem('gregory', GregorianCalendarSystem); var ISO_RE = /^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/; function parse(str) { var m = ISO_RE.exec(str); if (m) { var marker = new Date(Date.UTC(Number(m[1]), m[3] ? Number(m[3]) - 1 : 0, Number(m[5] || 1), Number(m[7] || 0), Number(m[8] || 0), Number(m[10] || 0), m[12] ? Number("0." + m[12]) * 1000 : 0)); if (isValidDate(marker)) { var timeZoneOffset = null; if (m[13]) { timeZoneOffset = (m[15] === '-' ? -1 : 1) * (Number(m[16] || 0) * 60 + Number(m[18] || 0)); } return { marker: marker, isTimeUnspecified: !m[6], timeZoneOffset: timeZoneOffset, }; } } return null; } var DateEnv = /** @class */ (function () { function DateEnv(settings) { var timeZone = this.timeZone = settings.timeZone; var isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC'; if (settings.namedTimeZoneImpl && isNamedTimeZone) { this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone); } this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl); this.calendarSystem = createCalendarSystem(settings.calendarSystem); this.locale = settings.locale; this.weekDow = settings.locale.week.dow; this.weekDoy = settings.locale.week.doy; if (settings.weekNumberCalculation === 'ISO') { this.weekDow = 1; this.weekDoy = 4; } if (typeof settings.firstDay === 'number') { this.weekDow = settings.firstDay; } if (typeof settings.weekNumberCalculation === 'function') { this.weekNumberFunc = settings.weekNumberCalculation; } this.weekText = settings.weekText != null ? settings.weekText : settings.locale.options.weekText; this.weekTextLong = (settings.weekTextLong != null ? settings.weekTextLong : settings.locale.options.weekTextLong) || this.weekText; this.cmdFormatter = settings.cmdFormatter; this.defaultSeparator = settings.defaultSeparator; } // Creating / Parsing DateEnv.prototype.createMarker = function (input) { var meta = this.createMarkerMeta(input); if (meta === null) { return null; } return meta.marker; }; DateEnv.prototype.createNowMarker = function () { if (this.canComputeOffset) { return this.timestampToMarker(new Date().valueOf()); } // if we can't compute the current date val for a timezone, // better to give the current local date vals than UTC return arrayToUtcDate(dateToLocalArray(new Date())); }; DateEnv.prototype.createMarkerMeta = function (input) { if (typeof input === 'string') { return this.parse(input); } var marker = null; if (typeof input === 'number') { marker = this.timestampToMarker(input); } else if (input instanceof Date) { input = input.valueOf(); if (!isNaN(input)) { marker = this.timestampToMarker(input); } } else if (Array.isArray(input)) { marker = arrayToUtcDate(input); } if (marker === null || !isValidDate(marker)) { return null; } return { marker: marker, isTimeUnspecified: false, forcedTzo: null }; }; DateEnv.prototype.parse = function (s) { var parts = parse(s); if (parts === null) { return null; } var marker = parts.marker; var forcedTzo = null; if (parts.timeZoneOffset !== null) { if (this.canComputeOffset) { marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000); } else { forcedTzo = parts.timeZoneOffset; } } return { marker: marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo: forcedTzo }; }; // Accessors DateEnv.prototype.getYear = function (marker) { return this.calendarSystem.getMarkerYear(marker); }; DateEnv.prototype.getMonth = function (marker) { return this.calendarSystem.getMarkerMonth(marker); }; // Adding / Subtracting DateEnv.prototype.add = function (marker, dur) { var a = this.calendarSystem.markerToArray(marker); a[0] += dur.years; a[1] += dur.months; a[2] += dur.days; a[6] += dur.milliseconds; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.subtract = function (marker, dur) { var a = this.calendarSystem.markerToArray(marker); a[0] -= dur.years; a[1] -= dur.months; a[2] -= dur.days; a[6] -= dur.milliseconds; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.addYears = function (marker, n) { var a = this.calendarSystem.markerToArray(marker); a[0] += n; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.addMonths = function (marker, n) { var a = this.calendarSystem.markerToArray(marker); a[1] += n; return this.calendarSystem.arrayToMarker(a); }; // Diffing Whole Units DateEnv.prototype.diffWholeYears = function (m0, m1) { var calendarSystem = this.calendarSystem; if (timeAsMs(m0) === timeAsMs(m1) && calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) && calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1)) { return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0); } return null; }; DateEnv.prototype.diffWholeMonths = function (m0, m1) { var calendarSystem = this.calendarSystem; if (timeAsMs(m0) === timeAsMs(m1) && calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1)) { return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) + (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12; } return null; }; // Range / Duration DateEnv.prototype.greatestWholeUnit = function (m0, m1) { var n = this.diffWholeYears(m0, m1); if (n !== null) { return { unit: 'year', value: n }; } n = this.diffWholeMonths(m0, m1); if (n !== null) { return { unit: 'month', value: n }; } n = diffWholeWeeks(m0, m1); if (n !== null) { return { unit: 'week', value: n }; } n = diffWholeDays(m0, m1); if (n !== null) { return { unit: 'day', value: n }; } n = diffHours(m0, m1); if (isInt(n)) { return { unit: 'hour', value: n }; } n = diffMinutes(m0, m1); if (isInt(n)) { return { unit: 'minute', value: n }; } n = diffSeconds(m0, m1); if (isInt(n)) { return { unit: 'second', value: n }; } return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() }; }; DateEnv.prototype.countDurationsBetween = function (m0, m1, d) { // TODO: can use greatestWholeUnit var diff; if (d.years) { diff = this.diffWholeYears(m0, m1); if (diff !== null) { return diff / asRoughYears(d); } } if (d.months) { diff = this.diffWholeMonths(m0, m1); if (diff !== null) { return diff / asRoughMonths(d); } } if (d.days) { diff = diffWholeDays(m0, m1); if (diff !== null) { return diff / asRoughDays(d); } } return (m1.valueOf() - m0.valueOf()) / asRoughMs(d); }; // Start-Of // these DON'T return zoned-dates. only UTC start-of dates DateEnv.prototype.startOf = function (m, unit) { if (unit === 'year') { return this.startOfYear(m); } if (unit === 'month') { return this.startOfMonth(m); } if (unit === 'week') { return this.startOfWeek(m); } if (unit === 'day') { return startOfDay(m); } if (unit === 'hour') { return startOfHour(m); } if (unit === 'minute') { return startOfMinute(m); } if (unit === 'second') { return startOfSecond(m); } return null; }; DateEnv.prototype.startOfYear = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), ]); }; DateEnv.prototype.startOfMonth = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), this.calendarSystem.getMarkerMonth(m), ]); }; DateEnv.prototype.startOfWeek = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), this.calendarSystem.getMarkerMonth(m), m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7), ]); }; // Week Number DateEnv.prototype.computeWeekNumber = function (marker) { if (this.weekNumberFunc) { return this.weekNumberFunc(this.toDate(marker)); } return weekOfYear(marker, this.weekDow, this.weekDoy); }; // TODO: choke on timeZoneName: long DateEnv.prototype.format = function (marker, formatter, dateOptions) { if (dateOptions === void 0) { dateOptions = {}; } return formatter.format({ marker: marker, timeZoneOffset: dateOptions.forcedTzo != null ? dateOptions.forcedTzo : this.offsetForMarker(marker), }, this); }; DateEnv.prototype.formatRange = function (start, end, formatter, dateOptions) { if (dateOptions === void 0) { dateOptions = {}; } if (dateOptions.isEndExclusive) { end = addMs(end, -1); } return formatter.formatRange({ marker: start, timeZoneOffset: dateOptions.forcedStartTzo != null ? dateOptions.forcedStartTzo : this.offsetForMarker(start), }, { marker: end, timeZoneOffset: dateOptions.forcedEndTzo != null ? dateOptions.forcedEndTzo : this.offsetForMarker(end), }, this, dateOptions.defaultSeparator); }; /* DUMB: the omitTime arg is dumb. if we omit the time, we want to omit the timezone offset. and if we do that, might as well use buildIsoString or some other util directly */ DateEnv.prototype.formatIso = function (marker, extraOptions) { if (extraOptions === void 0) { extraOptions = {}; } var timeZoneOffset = null; if (!extraOptions.omitTimeZoneOffset) { if (extraOptions.forcedTzo != null) { timeZoneOffset = extraOptions.forcedTzo; } else { timeZoneOffset = this.offsetForMarker(marker); } } return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime); }; // TimeZone DateEnv.prototype.timestampToMarker = function (ms) { if (this.timeZone === 'local') { return arrayToUtcDate(dateToLocalArray(new Date(ms))); } if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) { return new Date(ms); } return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms)); }; DateEnv.prototype.offsetForMarker = function (m) { if (this.timeZone === 'local') { return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset(); // convert "inverse" offset to "normal" offset } if (this.timeZone === 'UTC') { return 0; } if (this.namedTimeZoneImpl) { return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)); } return null; }; // Conversion DateEnv.prototype.toDate = function (m, forcedTzo) { if (this.timeZone === 'local') { return arrayToLocalDate(dateToUtcArray(m)); } if (this.timeZone === 'UTC') { return new Date(m.valueOf()); // make sure it's a copy } if (!this.namedTimeZoneImpl) { return new Date(m.valueOf() - (forcedTzo || 0)); } return new Date(m.valueOf() - this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60); }; return DateEnv; }()); var globalLocales = []; var MINIMAL_RAW_EN_LOCALE = { code: 'en', week: { dow: 0, doy: 4, // 4 days need to be within the year to be considered the first week }, direction: 'ltr', buttonText: { prev: 'prev', next: 'next', prevYear: 'prev year', nextYear: 'next year', year: 'year', today: 'today', month: 'month', week: 'week', day: 'day', list: 'list', }, weekText: 'W', weekTextLong: 'Week', closeHint: 'Close', timeHint: 'Time', eventHint: 'Event', allDayText: 'all-day', moreLinkText: 'more', noEventsText: 'No events to display', }; var RAW_EN_LOCALE = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, MINIMAL_RAW_EN_LOCALE), { // Includes things we don't want other locales to inherit, // things that derive from other translatable strings. buttonHints: { prev: 'Previous $0', next: 'Next $0', today: function (buttonText, unit) { return (unit === 'day') ? 'Today' : "This " + buttonText; }, }, viewHint: '$0 view', navLinkHint: 'Go to $0', moreLinkHint: function (eventCnt) { return "Show " + eventCnt + " more event" + (eventCnt === 1 ? '' : 's'); } }); function organizeRawLocales(explicitRawLocales) { var defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en'; var allRawLocales = globalLocales.concat(explicitRawLocales); var rawLocaleMap = { en: RAW_EN_LOCALE, }; for (var _i = 0, allRawLocales_1 = allRawLocales; _i < allRawLocales_1.length; _i++) { var rawLocale = allRawLocales_1[_i]; rawLocaleMap[rawLocale.code] = rawLocale; } return { map: rawLocaleMap, defaultCode: defaultCode, }; } function buildLocale(inputSingular, available) { if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) { return parseLocale(inputSingular.code, [inputSingular.code], inputSingular); } return queryLocale(inputSingular, available); } function queryLocale(codeArg, available) { var codes = [].concat(codeArg || []); // will convert to array var raw = queryRawLocale(codes, available) || RAW_EN_LOCALE; return parseLocale(codeArg, codes, raw); } function queryRawLocale(codes, available) { for (var i = 0; i < codes.length; i += 1) { var parts = codes[i].toLocaleLowerCase().split('-'); for (var j = parts.length; j > 0; j -= 1) { var simpleId = parts.slice(0, j).join('-'); if (available[simpleId]) { return available[simpleId]; } } } return null; } function parseLocale(codeArg, codes, raw) { var merged = mergeProps([MINIMAL_RAW_EN_LOCALE, raw], ['buttonText']); delete merged.code; // don't want this part of the options var week = merged.week; delete merged.week; return { codeArg: codeArg, codes: codes, week: week, simpleNumberFormat: new Intl.NumberFormat(codeArg), options: merged, }; } function formatDate(dateInput, options) { if (options === void 0) { options = {}; } var dateEnv = buildDateEnv$1(options); var formatter = createFormatter(options); var dateMeta = dateEnv.createMarkerMeta(dateInput); if (!dateMeta) { // TODO: warning? return ''; } return dateEnv.format(dateMeta.marker, formatter, { forcedTzo: dateMeta.forcedTzo, }); } function formatRange(startInput, endInput, options) { var dateEnv = buildDateEnv$1(typeof options === 'object' && options ? options : {}); // pass in if non-null object var formatter = createFormatter(options); var startMeta = dateEnv.createMarkerMeta(startInput); var endMeta = dateEnv.createMarkerMeta(endInput); if (!startMeta || !endMeta) { // TODO: warning? return ''; } return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, { forcedStartTzo: startMeta.forcedTzo, forcedEndTzo: endMeta.forcedTzo, isEndExclusive: options.isEndExclusive, defaultSeparator: BASE_OPTION_DEFAULTS.defaultRangeSeparator, }); } // TODO: more DRY and optimized function buildDateEnv$1(settings) { var locale = buildLocale(settings.locale || 'en', organizeRawLocales([]).map); // TODO: don't hardcode 'en' everywhere return new DateEnv(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({ timeZone: BASE_OPTION_DEFAULTS.timeZone, calendarSystem: 'gregory' }, settings), { locale: locale })); } var DEF_DEFAULTS = { startTime: '09:00', endTime: '17:00', daysOfWeek: [1, 2, 3, 4, 5], display: 'inverse-background', classNames: 'fc-non-business', groupId: '_businessHours', // so multiple defs get grouped }; /* TODO: pass around as EventDefHash!!! */ function parseBusinessHours(input, context) { return parseEvents(refineInputs(input), null, context); } function refineInputs(input) { var rawDefs; if (input === true) { rawDefs = [{}]; // will get DEF_DEFAULTS verbatim } else if (Array.isArray(input)) { // if specifying an array, every sub-definition NEEDS a day-of-week rawDefs = input.filter(function (rawDef) { return rawDef.daysOfWeek; }); } else if (typeof input === 'object' && input) { // non-null object rawDefs = [input]; } else { // is probably false rawDefs = []; } rawDefs = rawDefs.map(function (rawDef) { return (Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, DEF_DEFAULTS), rawDef)); }); return rawDefs; } function pointInsideRect(point, rect) { return point.left >= rect.left && point.left < rect.right && point.top >= rect.top && point.top < rect.bottom; } // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false function intersectRects(rect1, rect2) { var res = { left: Math.max(rect1.left, rect2.left), right: Math.min(rect1.right, rect2.right), top: Math.max(rect1.top, rect2.top), bottom: Math.min(rect1.bottom, rect2.bottom), }; if (res.left < res.right && res.top < res.bottom) { return res; } return false; } function translateRect(rect, deltaX, deltaY) { return { left: rect.left + deltaX, right: rect.right + deltaX, top: rect.top + deltaY, bottom: rect.bottom + deltaY, }; } // Returns a new point that will have been moved to reside within the given rectangle function constrainPoint(point, rect) { return { left: Math.min(Math.max(point.left, rect.left), rect.right), top: Math.min(Math.max(point.top, rect.top), rect.bottom), }; } // Returns a point that is the center of the given rectangle function getRectCenter(rect) { return { left: (rect.left + rect.right) / 2, top: (rect.top + rect.bottom) / 2, }; } // Subtracts point2's coordinates from point1's coordinates, returning a delta function diffPoints(point1, point2) { return { left: point1.left - point2.left, top: point1.top - point2.top, }; } var canVGrowWithinCell; function getCanVGrowWithinCell() { if (canVGrowWithinCell == null) { canVGrowWithinCell = computeCanVGrowWithinCell(); } return canVGrowWithinCell; } function computeCanVGrowWithinCell() { // for SSR, because this function is call immediately at top-level // TODO: just make this logic execute top-level, immediately, instead of doing lazily if (typeof document === 'undefined') { return true; } var el = document.createElement('div'); el.style.position = 'absolute'; el.style.top = '0px'; el.style.left = '0px'; el.innerHTML = '
'; el.querySelector('table').style.height = '100px'; el.querySelector('div').style.height = '100%'; document.body.appendChild(el); var div = el.querySelector('div'); var possible = div.offsetHeight > 0; document.body.removeChild(el); return possible; } var EMPTY_EVENT_STORE = createEmptyEventStore(); // for purecomponents. TODO: keep elsewhere var Splitter = /** @class */ (function () { function Splitter() { this.getKeysForEventDefs = memoize(this._getKeysForEventDefs); this.splitDateSelection = memoize(this._splitDateSpan); this.splitEventStore = memoize(this._splitEventStore); this.splitIndividualUi = memoize(this._splitIndividualUi); this.splitEventDrag = memoize(this._splitInteraction); this.splitEventResize = memoize(this._splitInteraction); this.eventUiBuilders = {}; // TODO: typescript protection } Splitter.prototype.splitProps = function (props) { var _this = this; var keyInfos = this.getKeyInfo(props); var defKeys = this.getKeysForEventDefs(props.eventStore); var dateSelections = this.splitDateSelection(props.dateSelection); var individualUi = this.splitIndividualUi(props.eventUiBases, defKeys); // the individual *bases* var eventStores = this.splitEventStore(props.eventStore, defKeys); var eventDrags = this.splitEventDrag(props.eventDrag); var eventResizes = this.splitEventResize(props.eventResize); var splitProps = {}; this.eventUiBuilders = mapHash(keyInfos, function (info, key) { return _this.eventUiBuilders[key] || memoize(buildEventUiForKey); }); for (var key in keyInfos) { var keyInfo = keyInfos[key]; var eventStore = eventStores[key] || EMPTY_EVENT_STORE; var buildEventUi = this.eventUiBuilders[key]; splitProps[key] = { businessHours: keyInfo.businessHours || props.businessHours, dateSelection: dateSelections[key] || null, eventStore: eventStore, eventUiBases: buildEventUi(props.eventUiBases[''], keyInfo.ui, individualUi[key]), eventSelection: eventStore.instances[props.eventSelection] ? props.eventSelection : '', eventDrag: eventDrags[key] || null, eventResize: eventResizes[key] || null, }; } return splitProps; }; Splitter.prototype._splitDateSpan = function (dateSpan) { var dateSpans = {}; if (dateSpan) { var keys = this.getKeysForDateSpan(dateSpan); for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { var key = keys_1[_i]; dateSpans[key] = dateSpan; } } return dateSpans; }; Splitter.prototype._getKeysForEventDefs = function (eventStore) { var _this = this; return mapHash(eventStore.defs, function (eventDef) { return _this.getKeysForEventDef(eventDef); }); }; Splitter.prototype._splitEventStore = function (eventStore, defKeys) { var defs = eventStore.defs, instances = eventStore.instances; var splitStores = {}; for (var defId in defs) { for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) { var key = _a[_i]; if (!splitStores[key]) { splitStores[key] = createEmptyEventStore(); } splitStores[key].defs[defId] = defs[defId]; } } for (var instanceId in instances) { var instance = instances[instanceId]; for (var _b = 0, _c = defKeys[instance.defId]; _b < _c.length; _b++) { var key = _c[_b]; if (splitStores[key]) { // must have already been created splitStores[key].instances[instanceId] = instance; } } } return splitStores; }; Splitter.prototype._splitIndividualUi = function (eventUiBases, defKeys) { var splitHashes = {}; for (var defId in eventUiBases) { if (defId) { // not the '' key for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) { var key = _a[_i]; if (!splitHashes[key]) { splitHashes[key] = {}; } splitHashes[key][defId] = eventUiBases[defId]; } } } return splitHashes; }; Splitter.prototype._splitInteraction = function (interaction) { var splitStates = {}; if (interaction) { var affectedStores_1 = this._splitEventStore(interaction.affectedEvents, this._getKeysForEventDefs(interaction.affectedEvents)); // can't rely on defKeys because event data is mutated var mutatedKeysByDefId = this._getKeysForEventDefs(interaction.mutatedEvents); var mutatedStores_1 = this._splitEventStore(interaction.mutatedEvents, mutatedKeysByDefId); var populate = function (key) { if (!splitStates[key]) { splitStates[key] = { affectedEvents: affectedStores_1[key] || EMPTY_EVENT_STORE, mutatedEvents: mutatedStores_1[key] || EMPTY_EVENT_STORE, isEvent: interaction.isEvent, }; } }; for (var key in affectedStores_1) { populate(key); } for (var key in mutatedStores_1) { populate(key); } } return splitStates; }; return Splitter; }()); function buildEventUiForKey(allUi, eventUiForKey, individualUi) { var baseParts = []; if (allUi) { baseParts.push(allUi); } if (eventUiForKey) { baseParts.push(eventUiForKey); } var stuff = { '': combineEventUis(baseParts), }; if (individualUi) { Object(tslib_es6["a" /* __assign */])(stuff, individualUi); } return stuff; } function getDateMeta(date, todayRange, nowDate, dateProfile) { return { dow: date.getUTCDay(), isDisabled: Boolean(dateProfile && !rangeContainsMarker(dateProfile.activeRange, date)), isOther: Boolean(dateProfile && !rangeContainsMarker(dateProfile.currentRange, date)), isToday: Boolean(todayRange && rangeContainsMarker(todayRange, date)), isPast: Boolean(nowDate ? (date < nowDate) : todayRange ? (date < todayRange.start) : false), isFuture: Boolean(nowDate ? (date > nowDate) : todayRange ? (date >= todayRange.end) : false), }; } function getDayClassNames(meta, theme) { var classNames = [ 'fc-day', "fc-day-" + DAY_IDS[meta.dow], ]; if (meta.isDisabled) { classNames.push('fc-day-disabled'); } else { if (meta.isToday) { classNames.push('fc-day-today'); classNames.push(theme.getClass('today')); } if (meta.isPast) { classNames.push('fc-day-past'); } if (meta.isFuture) { classNames.push('fc-day-future'); } if (meta.isOther) { classNames.push('fc-day-other'); } } return classNames; } function getSlotClassNames(meta, theme) { var classNames = [ 'fc-slot', "fc-slot-" + DAY_IDS[meta.dow], ]; if (meta.isDisabled) { classNames.push('fc-slot-disabled'); } else { if (meta.isToday) { classNames.push('fc-slot-today'); classNames.push(theme.getClass('today')); } if (meta.isPast) { classNames.push('fc-slot-past'); } if (meta.isFuture) { classNames.push('fc-slot-future'); } } return classNames; } var DAY_FORMAT = createFormatter({ year: 'numeric', month: 'long', day: 'numeric' }); var WEEK_FORMAT = createFormatter({ week: 'long' }); function buildNavLinkAttrs(context, dateMarker, viewType, isTabbable) { if (viewType === void 0) { viewType = 'day'; } if (isTabbable === void 0) { isTabbable = true; } var dateEnv = context.dateEnv, options = context.options, calendarApi = context.calendarApi; var dateStr = dateEnv.format(dateMarker, viewType === 'week' ? WEEK_FORMAT : DAY_FORMAT); if (options.navLinks) { var zonedDate = dateEnv.toDate(dateMarker); var handleInteraction = function (ev) { var customAction = viewType === 'day' ? options.navLinkDayClick : viewType === 'week' ? options.navLinkWeekClick : null; if (typeof customAction === 'function') { customAction.call(calendarApi, dateEnv.toDate(dateMarker), ev); } else { if (typeof customAction === 'string') { viewType = customAction; } calendarApi.zoomTo(dateMarker, viewType); } }; return Object(tslib_es6["a" /* __assign */])({ title: formatWithOrdinals(options.navLinkHint, [dateStr, zonedDate], dateStr), 'data-navlink': '' }, (isTabbable ? createAriaClickAttrs(handleInteraction) : { onClick: handleInteraction })); } return { 'aria-label': dateStr }; } var _isRtlScrollbarOnLeft = null; function getIsRtlScrollbarOnLeft() { if (_isRtlScrollbarOnLeft === null) { _isRtlScrollbarOnLeft = computeIsRtlScrollbarOnLeft(); } return _isRtlScrollbarOnLeft; } function computeIsRtlScrollbarOnLeft() { var outerEl = document.createElement('div'); applyStyle(outerEl, { position: 'absolute', top: -1000, left: 0, border: 0, padding: 0, overflow: 'scroll', direction: 'rtl', }); outerEl.innerHTML = '
'; document.body.appendChild(outerEl); var innerEl = outerEl.firstChild; var res = innerEl.getBoundingClientRect().left > outerEl.getBoundingClientRect().left; removeElement(outerEl); return res; } var _scrollbarWidths; function getScrollbarWidths() { if (!_scrollbarWidths) { _scrollbarWidths = computeScrollbarWidths(); } return _scrollbarWidths; } function computeScrollbarWidths() { var el = document.createElement('div'); el.style.overflow = 'scroll'; el.style.position = 'absolute'; el.style.top = '-9999px'; el.style.left = '-9999px'; document.body.appendChild(el); var res = computeScrollbarWidthsForEl(el); document.body.removeChild(el); return res; } // WARNING: will include border function computeScrollbarWidthsForEl(el) { return { x: el.offsetHeight - el.clientHeight, y: el.offsetWidth - el.clientWidth, }; } function computeEdges(el, getPadding) { if (getPadding === void 0) { getPadding = false; } var computedStyle = window.getComputedStyle(el); var borderLeft = parseInt(computedStyle.borderLeftWidth, 10) || 0; var borderRight = parseInt(computedStyle.borderRightWidth, 10) || 0; var borderTop = parseInt(computedStyle.borderTopWidth, 10) || 0; var borderBottom = parseInt(computedStyle.borderBottomWidth, 10) || 0; var badScrollbarWidths = computeScrollbarWidthsForEl(el); // includes border! var scrollbarLeftRight = badScrollbarWidths.y - borderLeft - borderRight; var scrollbarBottom = badScrollbarWidths.x - borderTop - borderBottom; var res = { borderLeft: borderLeft, borderRight: borderRight, borderTop: borderTop, borderBottom: borderBottom, scrollbarBottom: scrollbarBottom, scrollbarLeft: 0, scrollbarRight: 0, }; if (getIsRtlScrollbarOnLeft() && computedStyle.direction === 'rtl') { // is the scrollbar on the left side? res.scrollbarLeft = scrollbarLeftRight; } else { res.scrollbarRight = scrollbarLeftRight; } if (getPadding) { res.paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0; res.paddingRight = parseInt(computedStyle.paddingRight, 10) || 0; res.paddingTop = parseInt(computedStyle.paddingTop, 10) || 0; res.paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0; } return res; } function computeInnerRect(el, goWithinPadding, doFromWindowViewport) { if (goWithinPadding === void 0) { goWithinPadding = false; } var outerRect = doFromWindowViewport ? el.getBoundingClientRect() : computeRect(el); var edges = computeEdges(el, goWithinPadding); var res = { left: outerRect.left + edges.borderLeft + edges.scrollbarLeft, right: outerRect.right - edges.borderRight - edges.scrollbarRight, top: outerRect.top + edges.borderTop, bottom: outerRect.bottom - edges.borderBottom - edges.scrollbarBottom, }; if (goWithinPadding) { res.left += edges.paddingLeft; res.right -= edges.paddingRight; res.top += edges.paddingTop; res.bottom -= edges.paddingBottom; } return res; } function computeRect(el) { var rect = el.getBoundingClientRect(); return { left: rect.left + window.pageXOffset, top: rect.top + window.pageYOffset, right: rect.right + window.pageXOffset, bottom: rect.bottom + window.pageYOffset, }; } function computeClippedClientRect(el) { var clippingParents = getClippingParents(el); var rect = el.getBoundingClientRect(); for (var _i = 0, clippingParents_1 = clippingParents; _i < clippingParents_1.length; _i++) { var clippingParent = clippingParents_1[_i]; var intersection = intersectRects(rect, clippingParent.getBoundingClientRect()); if (intersection) { rect = intersection; } else { return null; } } return rect; } function computeHeightAndMargins(el) { return el.getBoundingClientRect().height + computeVMargins(el); } function computeVMargins(el) { var computed = window.getComputedStyle(el); return parseInt(computed.marginTop, 10) + parseInt(computed.marginBottom, 10); } // does not return window function getClippingParents(el) { var parents = []; while (el instanceof HTMLElement) { // will stop when gets to document or null var computedStyle = window.getComputedStyle(el); if (computedStyle.position === 'fixed') { break; } if ((/(auto|scroll)/).test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) { parents.push(el); } el = el.parentNode; } return parents; } // given a function that resolves a result asynchronously. // the function can either call passed-in success and failure callbacks, // or it can return a promise. // if you need to pass additional params to func, bind them first. function unpromisify(func, success, failure) { // guard against success/failure callbacks being called more than once // and guard against a promise AND callback being used together. var isResolved = false; var wrappedSuccess = function () { if (!isResolved) { isResolved = true; success.apply(this, arguments); // eslint-disable-line prefer-rest-params } }; var wrappedFailure = function () { if (!isResolved) { isResolved = true; if (failure) { failure.apply(this, arguments); // eslint-disable-line prefer-rest-params } } }; var res = func(wrappedSuccess, wrappedFailure); if (res && typeof res.then === 'function') { res.then(wrappedSuccess, wrappedFailure); } } var Emitter = /** @class */ (function () { function Emitter() { this.handlers = {}; this.thisContext = null; } Emitter.prototype.setThisContext = function (thisContext) { this.thisContext = thisContext; }; Emitter.prototype.setOptions = function (options) { this.options = options; }; Emitter.prototype.on = function (type, handler) { addToHash(this.handlers, type, handler); }; Emitter.prototype.off = function (type, handler) { removeFromHash(this.handlers, type, handler); }; Emitter.prototype.trigger = function (type) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } var attachedHandlers = this.handlers[type] || []; var optionHandler = this.options && this.options[type]; var handlers = [].concat(optionHandler || [], attachedHandlers); for (var _a = 0, handlers_1 = handlers; _a < handlers_1.length; _a++) { var handler = handlers_1[_a]; handler.apply(this.thisContext, args); } }; Emitter.prototype.hasHandlers = function (type) { return Boolean((this.handlers[type] && this.handlers[type].length) || (this.options && this.options[type])); }; return Emitter; }()); function addToHash(hash, type, handler) { (hash[type] || (hash[type] = [])) .push(handler); } function removeFromHash(hash, type, handler) { if (handler) { if (hash[type]) { hash[type] = hash[type].filter(function (func) { return func !== handler; }); } } else { delete hash[type]; // remove all handler funcs for this type } } /* Records offset information for a set of elements, relative to an origin element. Can record the left/right OR the top/bottom OR both. Provides methods for querying the cache by position. */ var PositionCache = /** @class */ (function () { function PositionCache(originEl, els, isHorizontal, isVertical) { this.els = els; var originClientRect = this.originClientRect = originEl.getBoundingClientRect(); // relative to viewport top-left if (isHorizontal) { this.buildElHorizontals(originClientRect.left); } if (isVertical) { this.buildElVerticals(originClientRect.top); } } // Populates the left/right internal coordinate arrays PositionCache.prototype.buildElHorizontals = function (originClientLeft) { var lefts = []; var rights = []; for (var _i = 0, _a = this.els; _i < _a.length; _i++) { var el = _a[_i]; var rect = el.getBoundingClientRect(); lefts.push(rect.left - originClientLeft); rights.push(rect.right - originClientLeft); } this.lefts = lefts; this.rights = rights; }; // Populates the top/bottom internal coordinate arrays PositionCache.prototype.buildElVerticals = function (originClientTop) { var tops = []; var bottoms = []; for (var _i = 0, _a = this.els; _i < _a.length; _i++) { var el = _a[_i]; var rect = el.getBoundingClientRect(); tops.push(rect.top - originClientTop); bottoms.push(rect.bottom - originClientTop); } this.tops = tops; this.bottoms = bottoms; }; // Given a left offset (from document left), returns the index of the el that it horizontally intersects. // If no intersection is made, returns undefined. PositionCache.prototype.leftToIndex = function (leftPosition) { var _a = this, lefts = _a.lefts, rights = _a.rights; var len = lefts.length; var i; for (i = 0; i < len; i += 1) { if (leftPosition >= lefts[i] && leftPosition < rights[i]) { return i; } } return undefined; // TODO: better }; // Given a top offset (from document top), returns the index of the el that it vertically intersects. // If no intersection is made, returns undefined. PositionCache.prototype.topToIndex = function (topPosition) { var _a = this, tops = _a.tops, bottoms = _a.bottoms; var len = tops.length; var i; for (i = 0; i < len; i += 1) { if (topPosition >= tops[i] && topPosition < bottoms[i]) { return i; } } return undefined; // TODO: better }; // Gets the width of the element at the given index PositionCache.prototype.getWidth = function (leftIndex) { return this.rights[leftIndex] - this.lefts[leftIndex]; }; // Gets the height of the element at the given index PositionCache.prototype.getHeight = function (topIndex) { return this.bottoms[topIndex] - this.tops[topIndex]; }; return PositionCache; }()); /* eslint max-classes-per-file: "off" */ /* An object for getting/setting scroll-related information for an element. Internally, this is done very differently for window versus DOM element, so this object serves as a common interface. */ var ScrollController = /** @class */ (function () { function ScrollController() { } ScrollController.prototype.getMaxScrollTop = function () { return this.getScrollHeight() - this.getClientHeight(); }; ScrollController.prototype.getMaxScrollLeft = function () { return this.getScrollWidth() - this.getClientWidth(); }; ScrollController.prototype.canScrollVertically = function () { return this.getMaxScrollTop() > 0; }; ScrollController.prototype.canScrollHorizontally = function () { return this.getMaxScrollLeft() > 0; }; ScrollController.prototype.canScrollUp = function () { return this.getScrollTop() > 0; }; ScrollController.prototype.canScrollDown = function () { return this.getScrollTop() < this.getMaxScrollTop(); }; ScrollController.prototype.canScrollLeft = function () { return this.getScrollLeft() > 0; }; ScrollController.prototype.canScrollRight = function () { return this.getScrollLeft() < this.getMaxScrollLeft(); }; return ScrollController; }()); var main_ElementScrollController = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(ElementScrollController, _super); function ElementScrollController(el) { var _this = _super.call(this) || this; _this.el = el; return _this; } ElementScrollController.prototype.getScrollTop = function () { return this.el.scrollTop; }; ElementScrollController.prototype.getScrollLeft = function () { return this.el.scrollLeft; }; ElementScrollController.prototype.setScrollTop = function (top) { this.el.scrollTop = top; }; ElementScrollController.prototype.setScrollLeft = function (left) { this.el.scrollLeft = left; }; ElementScrollController.prototype.getScrollWidth = function () { return this.el.scrollWidth; }; ElementScrollController.prototype.getScrollHeight = function () { return this.el.scrollHeight; }; ElementScrollController.prototype.getClientHeight = function () { return this.el.clientHeight; }; ElementScrollController.prototype.getClientWidth = function () { return this.el.clientWidth; }; return ElementScrollController; }(ScrollController)); var main_WindowScrollController = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(WindowScrollController, _super); function WindowScrollController() { return _super !== null && _super.apply(this, arguments) || this; } WindowScrollController.prototype.getScrollTop = function () { return window.pageYOffset; }; WindowScrollController.prototype.getScrollLeft = function () { return window.pageXOffset; }; WindowScrollController.prototype.setScrollTop = function (n) { window.scroll(window.pageXOffset, n); }; WindowScrollController.prototype.setScrollLeft = function (n) { window.scroll(n, window.pageYOffset); }; WindowScrollController.prototype.getScrollWidth = function () { return document.documentElement.scrollWidth; }; WindowScrollController.prototype.getScrollHeight = function () { return document.documentElement.scrollHeight; }; WindowScrollController.prototype.getClientHeight = function () { return document.documentElement.clientHeight; }; WindowScrollController.prototype.getClientWidth = function () { return document.documentElement.clientWidth; }; return WindowScrollController; }(ScrollController)); var main_Theme = /** @class */ (function () { function Theme(calendarOptions) { if (this.iconOverrideOption) { this.setIconOverride(calendarOptions[this.iconOverrideOption]); } } Theme.prototype.setIconOverride = function (iconOverrideHash) { var iconClassesCopy; var buttonName; if (typeof iconOverrideHash === 'object' && iconOverrideHash) { // non-null object iconClassesCopy = Object(tslib_es6["a" /* __assign */])({}, this.iconClasses); for (buttonName in iconOverrideHash) { iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]); } this.iconClasses = iconClassesCopy; } else if (iconOverrideHash === false) { this.iconClasses = {}; } }; Theme.prototype.applyIconOverridePrefix = function (className) { var prefix = this.iconOverridePrefix; if (prefix && className.indexOf(prefix) !== 0) { // if not already present className = prefix + className; } return className; }; Theme.prototype.getClass = function (key) { return this.classes[key] || ''; }; Theme.prototype.getIconClass = function (buttonName, isRtl) { var className; if (isRtl && this.rtlIconClasses) { className = this.rtlIconClasses[buttonName] || this.iconClasses[buttonName]; } else { className = this.iconClasses[buttonName]; } if (className) { return this.baseIconClass + " " + className; } return ''; }; Theme.prototype.getCustomButtonIconClass = function (customButtonProps) { var className; if (this.iconOverrideCustomButtonOption) { className = customButtonProps[this.iconOverrideCustomButtonOption]; if (className) { return this.baseIconClass + " " + this.applyIconOverridePrefix(className); } } return ''; }; return Theme; }()); main_Theme.prototype.classes = {}; main_Theme.prototype.iconClasses = {}; main_Theme.prototype.baseIconClass = ''; main_Theme.prototype.iconOverridePrefix = ''; var main_ScrollResponder = /** @class */ (function () { function ScrollResponder(execFunc, emitter, scrollTime, scrollTimeReset) { var _this = this; this.execFunc = execFunc; this.emitter = emitter; this.scrollTime = scrollTime; this.scrollTimeReset = scrollTimeReset; this.handleScrollRequest = function (request) { _this.queuedRequest = Object(tslib_es6["a" /* __assign */])({}, _this.queuedRequest || {}, request); _this.drain(); }; emitter.on('_scrollRequest', this.handleScrollRequest); this.fireInitialScroll(); } ScrollResponder.prototype.detach = function () { this.emitter.off('_scrollRequest', this.handleScrollRequest); }; ScrollResponder.prototype.update = function (isDatesNew) { if (isDatesNew && this.scrollTimeReset) { this.fireInitialScroll(); // will drain } else { this.drain(); } }; ScrollResponder.prototype.fireInitialScroll = function () { this.handleScrollRequest({ time: this.scrollTime, }); }; ScrollResponder.prototype.drain = function () { if (this.queuedRequest && this.execFunc(this.queuedRequest)) { this.queuedRequest = null; } }; return ScrollResponder; }()); var ViewContextType = createContext({}); // for Components function buildViewContext(viewSpec, viewApi, viewOptions, dateProfileGenerator, dateEnv, theme, pluginHooks, dispatch, getCurrentData, emitter, calendarApi, registerInteractiveComponent, unregisterInteractiveComponent) { return { dateEnv: dateEnv, options: viewOptions, pluginHooks: pluginHooks, emitter: emitter, dispatch: dispatch, getCurrentData: getCurrentData, calendarApi: calendarApi, viewSpec: viewSpec, viewApi: viewApi, dateProfileGenerator: dateProfileGenerator, theme: theme, isRtl: viewOptions.direction === 'rtl', addResizeHandler: function (handler) { emitter.on('_resize', handler); }, removeResizeHandler: function (handler) { emitter.off('_resize', handler); }, createScrollResponder: function (execFunc) { return new main_ScrollResponder(execFunc, emitter, createDuration(viewOptions.scrollTime), viewOptions.scrollTimeReset); }, registerInteractiveComponent: registerInteractiveComponent, unregisterInteractiveComponent: unregisterInteractiveComponent, }; } /* eslint max-classes-per-file: off */ var main_PureComponent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(PureComponent, _super); function PureComponent() { return _super !== null && _super.apply(this, arguments) || this; } PureComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) { if (this.debug) { // eslint-disable-next-line no-console console.log(getUnequalProps(nextProps, this.props), getUnequalProps(nextState, this.state)); } return !compareObjs(this.props, nextProps, this.propEquality) || !compareObjs(this.state, nextState, this.stateEquality); }; PureComponent.addPropsEquality = addPropsEquality; PureComponent.addStateEquality = addStateEquality; PureComponent.contextType = ViewContextType; return PureComponent; }(Component)); main_PureComponent.prototype.propEquality = {}; main_PureComponent.prototype.stateEquality = {}; var main_BaseComponent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(BaseComponent, _super); function BaseComponent() { return _super !== null && _super.apply(this, arguments) || this; } BaseComponent.contextType = ViewContextType; return BaseComponent; }(main_PureComponent)); function addPropsEquality(propEquality) { var hash = Object.create(this.prototype.propEquality); Object(tslib_es6["a" /* __assign */])(hash, propEquality); this.prototype.propEquality = hash; } function addStateEquality(stateEquality) { var hash = Object.create(this.prototype.stateEquality); Object(tslib_es6["a" /* __assign */])(hash, stateEquality); this.prototype.stateEquality = hash; } // use other one function setRef(ref, current) { if (typeof ref === 'function') { ref(current); } else if (ref) { // see https://github.com/facebook/react/issues/13029 ref.current = current; } } /* an INTERACTABLE date component PURPOSES: - hook up to fg, fill, and mirror renderers - interface for dragging and hits */ var main_DateComponent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(DateComponent, _super); function DateComponent() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.uid = guid(); return _this; } // Hit System // ----------------------------------------------------------------------------------------------------------------- DateComponent.prototype.prepareHits = function () { }; DateComponent.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) { return null; // this should be abstract }; // Pointer Interaction Utils // ----------------------------------------------------------------------------------------------------------------- DateComponent.prototype.isValidSegDownEl = function (el) { return !this.props.eventDrag && // HACK !this.props.eventResize && // HACK !elementClosest(el, '.fc-event-mirror'); }; DateComponent.prototype.isValidDateDownEl = function (el) { return !elementClosest(el, '.fc-event:not(.fc-bg-event)') && !elementClosest(el, '.fc-more-link') && // a "more.." link !elementClosest(el, 'a[data-navlink]') && // a clickable nav link !elementClosest(el, '.fc-popover'); // hack }; return DateComponent; }(main_BaseComponent)); // TODO: easier way to add new hooks? need to update a million things function createPlugin(input) { return { id: guid(), deps: input.deps || [], reducers: input.reducers || [], isLoadingFuncs: input.isLoadingFuncs || [], contextInit: [].concat(input.contextInit || []), eventRefiners: input.eventRefiners || {}, eventDefMemberAdders: input.eventDefMemberAdders || [], eventSourceRefiners: input.eventSourceRefiners || {}, isDraggableTransformers: input.isDraggableTransformers || [], eventDragMutationMassagers: input.eventDragMutationMassagers || [], eventDefMutationAppliers: input.eventDefMutationAppliers || [], dateSelectionTransformers: input.dateSelectionTransformers || [], datePointTransforms: input.datePointTransforms || [], dateSpanTransforms: input.dateSpanTransforms || [], views: input.views || {}, viewPropsTransformers: input.viewPropsTransformers || [], isPropsValid: input.isPropsValid || null, externalDefTransforms: input.externalDefTransforms || [], viewContainerAppends: input.viewContainerAppends || [], eventDropTransformers: input.eventDropTransformers || [], componentInteractions: input.componentInteractions || [], calendarInteractions: input.calendarInteractions || [], themeClasses: input.themeClasses || {}, eventSourceDefs: input.eventSourceDefs || [], cmdFormatter: input.cmdFormatter, recurringTypes: input.recurringTypes || [], namedTimeZonedImpl: input.namedTimeZonedImpl, initialView: input.initialView || '', elementDraggingImpl: input.elementDraggingImpl, optionChangeHandlers: input.optionChangeHandlers || {}, scrollGridImpl: input.scrollGridImpl || null, contentTypeHandlers: input.contentTypeHandlers || {}, listenerRefiners: input.listenerRefiners || {}, optionRefiners: input.optionRefiners || {}, propSetHandlers: input.propSetHandlers || {}, }; } function buildPluginHooks(pluginDefs, globalDefs) { var isAdded = {}; var hooks = { reducers: [], isLoadingFuncs: [], contextInit: [], eventRefiners: {}, eventDefMemberAdders: [], eventSourceRefiners: {}, isDraggableTransformers: [], eventDragMutationMassagers: [], eventDefMutationAppliers: [], dateSelectionTransformers: [], datePointTransforms: [], dateSpanTransforms: [], views: {}, viewPropsTransformers: [], isPropsValid: null, externalDefTransforms: [], viewContainerAppends: [], eventDropTransformers: [], componentInteractions: [], calendarInteractions: [], themeClasses: {}, eventSourceDefs: [], cmdFormatter: null, recurringTypes: [], namedTimeZonedImpl: null, initialView: '', elementDraggingImpl: null, optionChangeHandlers: {}, scrollGridImpl: null, contentTypeHandlers: {}, listenerRefiners: {}, optionRefiners: {}, propSetHandlers: {}, }; function addDefs(defs) { for (var _i = 0, defs_1 = defs; _i < defs_1.length; _i++) { var def = defs_1[_i]; if (!isAdded[def.id]) { isAdded[def.id] = true; addDefs(def.deps); hooks = combineHooks(hooks, def); } } } if (pluginDefs) { addDefs(pluginDefs); } addDefs(globalDefs); return hooks; } function buildBuildPluginHooks() { var currentOverrideDefs = []; var currentGlobalDefs = []; var currentHooks; return function (overrideDefs, globalDefs) { if (!currentHooks || !isArraysEqual(overrideDefs, currentOverrideDefs) || !isArraysEqual(globalDefs, currentGlobalDefs)) { currentHooks = buildPluginHooks(overrideDefs, globalDefs); } currentOverrideDefs = overrideDefs; currentGlobalDefs = globalDefs; return currentHooks; }; } function combineHooks(hooks0, hooks1) { return { reducers: hooks0.reducers.concat(hooks1.reducers), isLoadingFuncs: hooks0.isLoadingFuncs.concat(hooks1.isLoadingFuncs), contextInit: hooks0.contextInit.concat(hooks1.contextInit), eventRefiners: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.eventRefiners), hooks1.eventRefiners), eventDefMemberAdders: hooks0.eventDefMemberAdders.concat(hooks1.eventDefMemberAdders), eventSourceRefiners: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.eventSourceRefiners), hooks1.eventSourceRefiners), isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers), eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers), eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers), dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers), datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms), dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms), views: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.views), hooks1.views), viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers), isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid, externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms), viewContainerAppends: hooks0.viewContainerAppends.concat(hooks1.viewContainerAppends), eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers), calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions), componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions), themeClasses: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.themeClasses), hooks1.themeClasses), eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs), cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter, recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes), namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl, initialView: hooks0.initialView || hooks1.initialView, elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl, optionChangeHandlers: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers), scrollGridImpl: hooks1.scrollGridImpl || hooks0.scrollGridImpl, contentTypeHandlers: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.contentTypeHandlers), hooks1.contentTypeHandlers), listenerRefiners: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.listenerRefiners), hooks1.listenerRefiners), optionRefiners: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.optionRefiners), hooks1.optionRefiners), propSetHandlers: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, hooks0.propSetHandlers), hooks1.propSetHandlers), }; } var main_StandardTheme = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(StandardTheme, _super); function StandardTheme() { return _super !== null && _super.apply(this, arguments) || this; } return StandardTheme; }(main_Theme)); main_StandardTheme.prototype.classes = { root: 'fc-theme-standard', tableCellShaded: 'fc-cell-shaded', buttonGroup: 'fc-button-group', button: 'fc-button fc-button-primary', buttonActive: 'fc-button-active', }; main_StandardTheme.prototype.baseIconClass = 'fc-icon'; main_StandardTheme.prototype.iconClasses = { close: 'fc-icon-x', prev: 'fc-icon-chevron-left', next: 'fc-icon-chevron-right', prevYear: 'fc-icon-chevrons-left', nextYear: 'fc-icon-chevrons-right', }; main_StandardTheme.prototype.rtlIconClasses = { prev: 'fc-icon-chevron-right', next: 'fc-icon-chevron-left', prevYear: 'fc-icon-chevrons-right', nextYear: 'fc-icon-chevrons-left', }; main_StandardTheme.prototype.iconOverrideOption = 'buttonIcons'; // TODO: make TS-friendly main_StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon'; main_StandardTheme.prototype.iconOverridePrefix = 'fc-icon-'; function compileViewDefs(defaultConfigs, overrideConfigs) { var hash = {}; var viewType; for (viewType in defaultConfigs) { ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs); } for (viewType in overrideConfigs) { ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs); } return hash; } function ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) { if (hash[viewType]) { return hash[viewType]; } var viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs); if (viewDef) { hash[viewType] = viewDef; } return viewDef; } function buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) { var defaultConfig = defaultConfigs[viewType]; var overrideConfig = overrideConfigs[viewType]; var queryProp = function (name) { return ((defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] : ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null)); }; var theComponent = queryProp('component'); var superType = queryProp('superType'); var superDef = null; if (superType) { if (superType === viewType) { throw new Error('Can\'t have a custom view type that references itself'); } superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs); } if (!theComponent && superDef) { theComponent = superDef.component; } if (!theComponent) { return null; // don't throw a warning, might be settings for a single-unit view } return { type: viewType, component: theComponent, defaults: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, (superDef ? superDef.defaults : {})), (defaultConfig ? defaultConfig.rawOptions : {})), overrides: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, (superDef ? superDef.overrides : {})), (overrideConfig ? overrideConfig.rawOptions : {})), }; } /* eslint max-classes-per-file: off */ // NOTE: in JSX, you should always use this class with arg. otherwise, will default to any??? var main_RenderHook = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(RenderHook, _super); function RenderHook() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.rootElRef = createRef(); _this.handleRootEl = function (el) { setRef(_this.rootElRef, el); if (_this.props.elRef) { setRef(_this.props.elRef, el); } }; return _this; } RenderHook.prototype.render = function () { var _this = this; var props = this.props; var hookProps = props.hookProps; return (createElement(main_MountHook, { hookProps: hookProps, didMount: props.didMount, willUnmount: props.willUnmount, elRef: this.handleRootEl }, function (rootElRef) { return (createElement(ContentHook, { hookProps: hookProps, content: props.content, defaultContent: props.defaultContent, backupElRef: _this.rootElRef }, function (innerElRef, innerContent) { return props.children(rootElRef, normalizeClassNames(props.classNames, hookProps), innerElRef, innerContent); })); })); }; return RenderHook; }(main_BaseComponent)); // TODO: rename to be about function, not default. use in above type // for forcing rerender of components that use the ContentHook var CustomContentRenderContext = createContext(0); function ContentHook(props) { return (createElement(CustomContentRenderContext.Consumer, null, function (renderId) { return (createElement(main_ContentHookInner, Object(tslib_es6["a" /* __assign */])({ renderId: renderId }, props))); })); } var main_ContentHookInner = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(ContentHookInner, _super); function ContentHookInner() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.innerElRef = createRef(); return _this; } ContentHookInner.prototype.render = function () { return this.props.children(this.innerElRef, this.renderInnerContent()); }; ContentHookInner.prototype.componentDidMount = function () { this.updateCustomContent(); }; ContentHookInner.prototype.componentDidUpdate = function () { this.updateCustomContent(); }; ContentHookInner.prototype.componentWillUnmount = function () { if (this.customContentInfo && this.customContentInfo.destroy) { this.customContentInfo.destroy(); } }; ContentHookInner.prototype.renderInnerContent = function () { var customContentInfo = this.customContentInfo; // only populated if using non-[p]react node(s) var innerContent = this.getInnerContent(); var meta = this.getContentMeta(innerContent); // initial run, or content-type changing? (from vue -> react for example) if (!customContentInfo || customContentInfo.contentKey !== meta.contentKey) { // clearing old value if (customContentInfo) { if (customContentInfo.destroy) { customContentInfo.destroy(); } customContentInfo = this.customContentInfo = null; } // assigning new value if (meta.contentKey) { customContentInfo = this.customContentInfo = Object(tslib_es6["a" /* __assign */])({ contentKey: meta.contentKey, contentVal: innerContent[meta.contentKey] }, meta.buildLifecycleFuncs()); } // updating } else if (customContentInfo) { customContentInfo.contentVal = innerContent[meta.contentKey]; } return customContentInfo ? [] // signal that something was specified : innerContent; // assume a [p]react vdom node. use it }; ContentHookInner.prototype.getInnerContent = function () { var props = this.props; var innerContent = normalizeContent(props.content, props.hookProps); if (innerContent === undefined) { // use the default innerContent = normalizeContent(props.defaultContent, props.hookProps); } return innerContent == null ? null : innerContent; // convert undefined to null (better for React) }; ContentHookInner.prototype.getContentMeta = function (innerContent) { var contentTypeHandlers = this.context.pluginHooks.contentTypeHandlers; var contentKey = ''; var buildLifecycleFuncs = null; if (innerContent) { // allowed to be null, for convenience to caller for (var searchKey in contentTypeHandlers) { if (innerContent[searchKey] !== undefined) { contentKey = searchKey; buildLifecycleFuncs = contentTypeHandlers[searchKey]; break; } } } return { contentKey: contentKey, buildLifecycleFuncs: buildLifecycleFuncs }; }; ContentHookInner.prototype.updateCustomContent = function () { if (this.customContentInfo) { // for non-[p]react this.customContentInfo.render(this.innerElRef.current || this.props.backupElRef.current, // the element to render into this.customContentInfo.contentVal); } }; return ContentHookInner; }(main_BaseComponent)); var main_MountHook = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(MountHook, _super); function MountHook() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.handleRootEl = function (rootEl) { _this.rootEl = rootEl; if (_this.props.elRef) { setRef(_this.props.elRef, rootEl); } }; return _this; } MountHook.prototype.render = function () { return this.props.children(this.handleRootEl); }; MountHook.prototype.componentDidMount = function () { var callback = this.props.didMount; if (callback) { callback(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, this.props.hookProps), { el: this.rootEl })); } }; MountHook.prototype.componentWillUnmount = function () { var callback = this.props.willUnmount; if (callback) { callback(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, this.props.hookProps), { el: this.rootEl })); } }; return MountHook; }(main_BaseComponent)); function buildClassNameNormalizer() { var currentGenerator; var currentHookProps; var currentClassNames = []; return function (generator, hookProps) { if (!currentHookProps || !isPropsEqual(currentHookProps, hookProps) || generator !== currentGenerator) { currentGenerator = generator; currentHookProps = hookProps; currentClassNames = normalizeClassNames(generator, hookProps); } return currentClassNames; }; } function normalizeClassNames(classNames, hookProps) { if (typeof classNames === 'function') { classNames = classNames(hookProps); } return parseClassNames(classNames); } function normalizeContent(input, hookProps) { if (typeof input === 'function') { return input(hookProps, createElement); // give the function the vdom-creation func } return input; } var main_ViewRoot = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(ViewRoot, _super); function ViewRoot() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.normalizeClassNames = buildClassNameNormalizer(); return _this; } ViewRoot.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var options = context.options; var hookProps = { view: context.viewApi }; var customClassNames = this.normalizeClassNames(options.viewClassNames, hookProps); return (createElement(main_MountHook, { hookProps: hookProps, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount, elRef: props.elRef }, function (rootElRef) { return props.children(rootElRef, ["fc-" + props.viewSpec.type + "-view", 'fc-view'].concat(customClassNames)); })); }; return ViewRoot; }(main_BaseComponent)); function parseViewConfigs(inputs) { return mapHash(inputs, parseViewConfig); } function parseViewConfig(input) { var rawOptions = typeof input === 'function' ? { component: input } : input; var component = rawOptions.component; if (rawOptions.content) { component = createViewHookComponent(rawOptions); // TODO: remove content/classNames/didMount/etc from options? } return { superType: rawOptions.type, component: component, rawOptions: rawOptions, }; } function createViewHookComponent(options) { return function (viewProps) { return (createElement(ViewContextType.Consumer, null, function (context) { return (createElement(main_ViewRoot, { viewSpec: context.viewSpec }, function (viewElRef, viewClassNames) { var hookProps = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, viewProps), { nextDayThreshold: context.options.nextDayThreshold }); return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.classNames, content: options.content, didMount: options.didMount, willUnmount: options.willUnmount, elRef: viewElRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("div", { className: viewClassNames.concat(customClassNames).join(' '), ref: rootElRef }, innerContent)); })); })); })); }; } function buildViewSpecs(defaultInputs, optionOverrides, dynamicOptionOverrides, localeDefaults) { var defaultConfigs = parseViewConfigs(defaultInputs); var overrideConfigs = parseViewConfigs(optionOverrides.views); var viewDefs = compileViewDefs(defaultConfigs, overrideConfigs); return mapHash(viewDefs, function (viewDef) { return buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults); }); } function buildViewSpec(viewDef, overrideConfigs, optionOverrides, dynamicOptionOverrides, localeDefaults) { var durationInput = viewDef.overrides.duration || viewDef.defaults.duration || dynamicOptionOverrides.duration || optionOverrides.duration; var duration = null; var durationUnit = ''; var singleUnit = ''; var singleUnitOverrides = {}; if (durationInput) { duration = createDurationCached(durationInput); if (duration) { // valid? var denom = greatestDurationDenominator(duration); durationUnit = denom.unit; if (denom.value === 1) { singleUnit = durationUnit; singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].rawOptions : {}; } } } var queryButtonText = function (optionsSubset) { var buttonTextMap = optionsSubset.buttonText || {}; var buttonTextKey = viewDef.defaults.buttonTextKey; if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) { return buttonTextMap[buttonTextKey]; } if (buttonTextMap[viewDef.type] != null) { return buttonTextMap[viewDef.type]; } if (buttonTextMap[singleUnit] != null) { return buttonTextMap[singleUnit]; } return null; }; var queryButtonTitle = function (optionsSubset) { var buttonHints = optionsSubset.buttonHints || {}; var buttonKey = viewDef.defaults.buttonTextKey; // use same key as text if (buttonKey != null && buttonHints[buttonKey] != null) { return buttonHints[buttonKey]; } if (buttonHints[viewDef.type] != null) { return buttonHints[viewDef.type]; } if (buttonHints[singleUnit] != null) { return buttonHints[singleUnit]; } return null; }; return { type: viewDef.type, component: viewDef.component, duration: duration, durationUnit: durationUnit, singleUnit: singleUnit, optionDefaults: viewDef.defaults, optionOverrides: Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, singleUnitOverrides), viewDef.overrides), buttonTextOverride: queryButtonText(dynamicOptionOverrides) || queryButtonText(optionOverrides) || // constructor-specified buttonText lookup hash takes precedence viewDef.overrides.buttonText, buttonTextDefault: queryButtonText(localeDefaults) || viewDef.defaults.buttonText || queryButtonText(BASE_OPTION_DEFAULTS) || viewDef.type, // not DRY buttonTitleOverride: queryButtonTitle(dynamicOptionOverrides) || queryButtonTitle(optionOverrides) || viewDef.overrides.buttonHint, buttonTitleDefault: queryButtonTitle(localeDefaults) || viewDef.defaults.buttonHint || queryButtonTitle(BASE_OPTION_DEFAULTS), // will eventually fall back to buttonText }; } // hack to get memoization working var durationInputMap = {}; function createDurationCached(durationInput) { var json = JSON.stringify(durationInput); var res = durationInputMap[json]; if (res === undefined) { res = createDuration(durationInput); durationInputMap[json] = res; } return res; } var DateProfileGenerator = /** @class */ (function () { function DateProfileGenerator(props) { this.props = props; this.nowDate = getNow(props.nowInput, props.dateEnv); this.initHiddenDays(); } /* Date Range Computation ------------------------------------------------------------------------------------------------------------------*/ // Builds a structure with info about what the dates/ranges will be for the "prev" view. DateProfileGenerator.prototype.buildPrev = function (currentDateProfile, currentDate, forceToValid) { var dateEnv = this.props.dateEnv; var prevDate = dateEnv.subtract(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month currentDateProfile.dateIncrement); return this.build(prevDate, -1, forceToValid); }; // Builds a structure with info about what the dates/ranges will be for the "next" view. DateProfileGenerator.prototype.buildNext = function (currentDateProfile, currentDate, forceToValid) { var dateEnv = this.props.dateEnv; var nextDate = dateEnv.add(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month currentDateProfile.dateIncrement); return this.build(nextDate, 1, forceToValid); }; // Builds a structure holding dates/ranges for rendering around the given date. // Optional direction param indicates whether the date is being incremented/decremented // from its previous value. decremented = -1, incremented = 1 (default). DateProfileGenerator.prototype.build = function (currentDate, direction, forceToValid) { if (forceToValid === void 0) { forceToValid = true; } var props = this.props; var validRange; var currentInfo; var isRangeAllDay; var renderRange; var activeRange; var isValid; validRange = this.buildValidRange(); validRange = this.trimHiddenDays(validRange); if (forceToValid) { currentDate = constrainMarkerToRange(currentDate, validRange); } currentInfo = this.buildCurrentRangeInfo(currentDate, direction); isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit); renderRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.range), currentInfo.unit, isRangeAllDay); renderRange = this.trimHiddenDays(renderRange); activeRange = renderRange; if (!props.showNonCurrentDates) { activeRange = intersectRanges(activeRange, currentInfo.range); } activeRange = this.adjustActiveRange(activeRange); activeRange = intersectRanges(activeRange, validRange); // might return null // it's invalid if the originally requested date is not contained, // or if the range is completely outside of the valid range. isValid = rangesIntersect(currentInfo.range, validRange); return { // constraint for where prev/next operations can go and where events can be dragged/resized to. // an object with optional start and end properties. validRange: validRange, // range the view is formally responsible for. // for example, a month view might have 1st-31st, excluding padded dates currentRange: currentInfo.range, // name of largest unit being displayed, like "month" or "week" currentRangeUnit: currentInfo.unit, isRangeAllDay: isRangeAllDay, // dates that display events and accept drag-n-drop // will be `null` if no dates accept events activeRange: activeRange, // date range with a rendered skeleton // includes not-active days that need some sort of DOM renderRange: renderRange, // Duration object that denotes the first visible time of any given day slotMinTime: props.slotMinTime, // Duration object that denotes the exclusive visible end time of any given day slotMaxTime: props.slotMaxTime, isValid: isValid, // how far the current date will move for a prev/next operation dateIncrement: this.buildDateIncrement(currentInfo.duration), // pass a fallback (might be null) ^ }; }; // Builds an object with optional start/end properties. // Indicates the minimum/maximum dates to display. // not responsible for trimming hidden days. DateProfileGenerator.prototype.buildValidRange = function () { var input = this.props.validRangeInput; var simpleInput = typeof input === 'function' ? input.call(this.props.calendarApi, this.nowDate) : input; return this.refineRange(simpleInput) || { start: null, end: null }; // completely open-ended }; // Builds a structure with info about the "current" range, the range that is // highlighted as being the current month for example. // See build() for a description of `direction`. // Guaranteed to have `range` and `unit` properties. `duration` is optional. DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) { var props = this.props; var duration = null; var unit = null; var range = null; var dayCount; if (props.duration) { duration = props.duration; unit = props.durationUnit; range = this.buildRangeFromDuration(date, direction, duration, unit); } else if ((dayCount = this.props.dayCount)) { unit = 'day'; range = this.buildRangeFromDayCount(date, direction, dayCount); } else if ((range = this.buildCustomVisibleRange(date))) { unit = props.dateEnv.greatestWholeUnit(range.start, range.end).unit; } else { duration = this.getFallbackDuration(); unit = greatestDurationDenominator(duration).unit; range = this.buildRangeFromDuration(date, direction, duration, unit); } return { duration: duration, unit: unit, range: range }; }; DateProfileGenerator.prototype.getFallbackDuration = function () { return createDuration({ day: 1 }); }; // Returns a new activeRange to have time values (un-ambiguate) // slotMinTime or slotMaxTime causes the range to expand. DateProfileGenerator.prototype.adjustActiveRange = function (range) { var _a = this.props, dateEnv = _a.dateEnv, usesMinMaxTime = _a.usesMinMaxTime, slotMinTime = _a.slotMinTime, slotMaxTime = _a.slotMaxTime; var start = range.start, end = range.end; if (usesMinMaxTime) { // expand active range if slotMinTime is negative (why not when positive?) if (asRoughDays(slotMinTime) < 0) { start = startOfDay(start); // necessary? start = dateEnv.add(start, slotMinTime); } // expand active range if slotMaxTime is beyond one day (why not when negative?) if (asRoughDays(slotMaxTime) > 1) { end = startOfDay(end); // necessary? end = addDays(end, -1); end = dateEnv.add(end, slotMaxTime); } } return { start: start, end: end }; }; // Builds the "current" range when it is specified as an explicit duration. // `unit` is the already-computed greatestDurationDenominator unit of duration. DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) { var _a = this.props, dateEnv = _a.dateEnv, dateAlignment = _a.dateAlignment; var start; var end; var res; // compute what the alignment should be if (!dateAlignment) { var dateIncrement = this.props.dateIncrement; if (dateIncrement) { // use the smaller of the two units if (asRoughMs(dateIncrement) < asRoughMs(duration)) { dateAlignment = greatestDurationDenominator(dateIncrement).unit; } else { dateAlignment = unit; } } else { dateAlignment = unit; } } // if the view displays a single day or smaller if (asRoughDays(duration) <= 1) { if (this.isHiddenDay(start)) { start = this.skipHiddenDays(start, direction); start = startOfDay(start); } } function computeRes() { start = dateEnv.startOf(date, dateAlignment); end = dateEnv.add(start, duration); res = { start: start, end: end }; } computeRes(); // if range is completely enveloped by hidden days, go past the hidden days if (!this.trimHiddenDays(res)) { date = this.skipHiddenDays(date, direction); computeRes(); } return res; }; // Builds the "current" range when a dayCount is specified. DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) { var _a = this.props, dateEnv = _a.dateEnv, dateAlignment = _a.dateAlignment; var runningCount = 0; var start = date; var end; if (dateAlignment) { start = dateEnv.startOf(start, dateAlignment); } start = startOfDay(start); start = this.skipHiddenDays(start, direction); end = start; do { end = addDays(end, 1); if (!this.isHiddenDay(end)) { runningCount += 1; } } while (runningCount < dayCount); return { start: start, end: end }; }; // Builds a normalized range object for the "visible" range, // which is a way to define the currentRange and activeRange at the same time. DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) { var props = this.props; var input = props.visibleRangeInput; var simpleInput = typeof input === 'function' ? input.call(props.calendarApi, props.dateEnv.toDate(date)) : input; var range = this.refineRange(simpleInput); if (range && (range.start == null || range.end == null)) { return null; } return range; }; // Computes the range that will represent the element/cells for *rendering*, // but which may have voided days/times. // not responsible for trimming hidden days. DateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) { return currentRange; }; // Compute the duration value that should be added/substracted to the current date // when a prev/next operation happens. DateProfileGenerator.prototype.buildDateIncrement = function (fallback) { var dateIncrement = this.props.dateIncrement; var customAlignment; if (dateIncrement) { return dateIncrement; } if ((customAlignment = this.props.dateAlignment)) { return createDuration(1, customAlignment); } if (fallback) { return fallback; } return createDuration({ days: 1 }); }; DateProfileGenerator.prototype.refineRange = function (rangeInput) { if (rangeInput) { var range = parseRange(rangeInput, this.props.dateEnv); if (range) { range = computeVisibleDayRange(range); } return range; } return null; }; /* Hidden Days ------------------------------------------------------------------------------------------------------------------*/ // Initializes internal variables related to calculating hidden days-of-week DateProfileGenerator.prototype.initHiddenDays = function () { var hiddenDays = this.props.hiddenDays || []; // array of day-of-week indices that are hidden var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool) var dayCnt = 0; var i; if (this.props.weekends === false) { hiddenDays.push(0, 6); // 0=sunday, 6=saturday } for (i = 0; i < 7; i += 1) { if (!(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)) { dayCnt += 1; } } if (!dayCnt) { throw new Error('invalid hiddenDays'); // all days were hidden? bad. } this.isHiddenDayHash = isHiddenDayHash; }; // Remove days from the beginning and end of the range that are computed as hidden. // If the whole range is trimmed off, returns null DateProfileGenerator.prototype.trimHiddenDays = function (range) { var start = range.start, end = range.end; if (start) { start = this.skipHiddenDays(start); } if (end) { end = this.skipHiddenDays(end, -1, true); } if (start == null || end == null || start < end) { return { start: start, end: end }; } return null; }; // Is the current day hidden? // `day` is a day-of-week index (0-6), or a Date (used for UTC) DateProfileGenerator.prototype.isHiddenDay = function (day) { if (day instanceof Date) { day = day.getUTCDay(); } return this.isHiddenDayHash[day]; }; // Incrementing the current day until it is no longer a hidden day, returning a copy. // DOES NOT CONSIDER validRange! // If the initial value of `date` is not a hidden day, don't do anything. // Pass `isExclusive` as `true` if you are dealing with an end date. // `inc` defaults to `1` (increment one day forward each time) DateProfileGenerator.prototype.skipHiddenDays = function (date, inc, isExclusive) { if (inc === void 0) { inc = 1; } if (isExclusive === void 0) { isExclusive = false; } while (this.isHiddenDayHash[(date.getUTCDay() + (isExclusive ? inc : 0) + 7) % 7]) { date = addDays(date, inc); } return date; }; return DateProfileGenerator; }()); function reduceViewType(viewType, action) { switch (action.type) { case 'CHANGE_VIEW_TYPE': viewType = action.viewType; } return viewType; } function reduceDynamicOptionOverrides(dynamicOptionOverrides, action) { var _a; switch (action.type) { case 'SET_OPTION': return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, dynamicOptionOverrides), (_a = {}, _a[action.optionName] = action.rawOptionValue, _a)); default: return dynamicOptionOverrides; } } function reduceDateProfile(currentDateProfile, action, currentDate, dateProfileGenerator) { var dp; switch (action.type) { case 'CHANGE_VIEW_TYPE': return dateProfileGenerator.build(action.dateMarker || currentDate); case 'CHANGE_DATE': return dateProfileGenerator.build(action.dateMarker); case 'PREV': dp = dateProfileGenerator.buildPrev(currentDateProfile, currentDate); if (dp.isValid) { return dp; } break; case 'NEXT': dp = dateProfileGenerator.buildNext(currentDateProfile, currentDate); if (dp.isValid) { return dp; } break; } return currentDateProfile; } function initEventSources(calendarOptions, dateProfile, context) { var activeRange = dateProfile ? dateProfile.activeRange : null; return addSources({}, parseInitialSources(calendarOptions, context), activeRange, context); } function reduceEventSources(eventSources, action, dateProfile, context) { var activeRange = dateProfile ? dateProfile.activeRange : null; // need this check? switch (action.type) { case 'ADD_EVENT_SOURCES': // already parsed return addSources(eventSources, action.sources, activeRange, context); case 'REMOVE_EVENT_SOURCE': return removeSource(eventSources, action.sourceId); case 'PREV': // TODO: how do we track all actions that affect dateProfile :( case 'NEXT': case 'CHANGE_DATE': case 'CHANGE_VIEW_TYPE': if (dateProfile) { return fetchDirtySources(eventSources, activeRange, context); } return eventSources; case 'FETCH_EVENT_SOURCES': return fetchSourcesByIds(eventSources, action.sourceIds ? // why no type? arrayToHash(action.sourceIds) : excludeStaticSources(eventSources, context), activeRange, action.isRefetch || false, context); case 'RECEIVE_EVENTS': case 'RECEIVE_EVENT_ERROR': return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange); case 'REMOVE_ALL_EVENT_SOURCES': return {}; default: return eventSources; } } function reduceEventSourcesNewTimeZone(eventSources, dateProfile, context) { var activeRange = dateProfile ? dateProfile.activeRange : null; // need this check? return fetchSourcesByIds(eventSources, excludeStaticSources(eventSources, context), activeRange, true, context); } function computeEventSourcesLoading(eventSources) { for (var sourceId in eventSources) { if (eventSources[sourceId].isFetching) { return true; } } return false; } function addSources(eventSourceHash, sources, fetchRange, context) { var hash = {}; for (var _i = 0, sources_1 = sources; _i < sources_1.length; _i++) { var source = sources_1[_i]; hash[source.sourceId] = source; } if (fetchRange) { hash = fetchDirtySources(hash, fetchRange, context); } return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventSourceHash), hash); } function removeSource(eventSourceHash, sourceId) { return filterHash(eventSourceHash, function (eventSource) { return eventSource.sourceId !== sourceId; }); } function fetchDirtySources(sourceHash, fetchRange, context) { return fetchSourcesByIds(sourceHash, filterHash(sourceHash, function (eventSource) { return isSourceDirty(eventSource, fetchRange, context); }), fetchRange, false, context); } function isSourceDirty(eventSource, fetchRange, context) { if (!doesSourceNeedRange(eventSource, context)) { return !eventSource.latestFetchId; } return !context.options.lazyFetching || !eventSource.fetchRange || eventSource.isFetching || // always cancel outdated in-progress fetches fetchRange.start < eventSource.fetchRange.start || fetchRange.end > eventSource.fetchRange.end; } function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, isRefetch, context) { var nextSources = {}; for (var sourceId in prevSources) { var source = prevSources[sourceId]; if (sourceIdHash[sourceId]) { nextSources[sourceId] = fetchSource(source, fetchRange, isRefetch, context); } else { nextSources[sourceId] = source; } } return nextSources; } function fetchSource(eventSource, fetchRange, isRefetch, context) { var options = context.options, calendarApi = context.calendarApi; var sourceDef = context.pluginHooks.eventSourceDefs[eventSource.sourceDefId]; var fetchId = guid(); sourceDef.fetch({ eventSource: eventSource, range: fetchRange, isRefetch: isRefetch, context: context, }, function (res) { var rawEvents = res.rawEvents; if (options.eventSourceSuccess) { rawEvents = options.eventSourceSuccess.call(calendarApi, rawEvents, res.xhr) || rawEvents; } if (eventSource.success) { rawEvents = eventSource.success.call(calendarApi, rawEvents, res.xhr) || rawEvents; } context.dispatch({ type: 'RECEIVE_EVENTS', sourceId: eventSource.sourceId, fetchId: fetchId, fetchRange: fetchRange, rawEvents: rawEvents, }); }, function (error) { console.warn(error.message, error); if (options.eventSourceFailure) { options.eventSourceFailure.call(calendarApi, error); } if (eventSource.failure) { eventSource.failure(error); } context.dispatch({ type: 'RECEIVE_EVENT_ERROR', sourceId: eventSource.sourceId, fetchId: fetchId, fetchRange: fetchRange, error: error, }); }); return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventSource), { isFetching: true, latestFetchId: fetchId }); } function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) { var _a; var eventSource = sourceHash[sourceId]; if (eventSource && // not already removed fetchId === eventSource.latestFetchId) { return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, sourceHash), (_a = {}, _a[sourceId] = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, eventSource), { isFetching: false, fetchRange: fetchRange }), _a)); } return sourceHash; } function excludeStaticSources(eventSources, context) { return filterHash(eventSources, function (eventSource) { return doesSourceNeedRange(eventSource, context); }); } function parseInitialSources(rawOptions, context) { var refiners = buildEventSourceRefiners(context); var rawSources = [].concat(rawOptions.eventSources || []); var sources = []; // parsed if (rawOptions.initialEvents) { rawSources.unshift(rawOptions.initialEvents); } if (rawOptions.events) { rawSources.unshift(rawOptions.events); } for (var _i = 0, rawSources_1 = rawSources; _i < rawSources_1.length; _i++) { var rawSource = rawSources_1[_i]; var source = parseEventSource(rawSource, context, refiners); if (source) { sources.push(source); } } return sources; } function doesSourceNeedRange(eventSource, context) { var defs = context.pluginHooks.eventSourceDefs; return !defs[eventSource.sourceDefId].ignoreRange; } function reduceEventStore(eventStore, action, eventSources, dateProfile, context) { switch (action.type) { case 'RECEIVE_EVENTS': // raw return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, context); case 'ADD_EVENTS': // already parsed, but not expanded return addEvent(eventStore, action.eventStore, // new ones dateProfile ? dateProfile.activeRange : null, context); case 'RESET_EVENTS': return action.eventStore; case 'MERGE_EVENTS': // already parsed and expanded return mergeEventStores(eventStore, action.eventStore); case 'PREV': // TODO: how do we track all actions that affect dateProfile :( case 'NEXT': case 'CHANGE_DATE': case 'CHANGE_VIEW_TYPE': if (dateProfile) { return expandRecurring(eventStore, dateProfile.activeRange, context); } return eventStore; case 'REMOVE_EVENTS': return excludeSubEventStore(eventStore, action.eventStore); case 'REMOVE_EVENT_SOURCE': return excludeEventsBySourceId(eventStore, action.sourceId); case 'REMOVE_ALL_EVENT_SOURCES': return filterEventStoreDefs(eventStore, function (eventDef) { return (!eventDef.sourceId // only keep events with no source id ); }); case 'REMOVE_ALL_EVENTS': return createEmptyEventStore(); default: return eventStore; } } function receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, context) { if (eventSource && // not already removed fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources ) { var subset = parseEvents(transformRawEvents(rawEvents, eventSource, context), eventSource, context); if (fetchRange) { subset = expandRecurring(subset, fetchRange, context); } return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset); } return eventStore; } function transformRawEvents(rawEvents, eventSource, context) { var calEachTransform = context.options.eventDataTransform; var sourceEachTransform = eventSource ? eventSource.eventDataTransform : null; if (sourceEachTransform) { rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform); } if (calEachTransform) { rawEvents = transformEachRawEvent(rawEvents, calEachTransform); } return rawEvents; } function transformEachRawEvent(rawEvents, func) { var refinedEvents; if (!func) { refinedEvents = rawEvents; } else { refinedEvents = []; for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) { var rawEvent = rawEvents_1[_i]; var refinedEvent = func(rawEvent); if (refinedEvent) { refinedEvents.push(refinedEvent); } else if (refinedEvent == null) { refinedEvents.push(rawEvent); } // if a different falsy value, do nothing } } return refinedEvents; } function addEvent(eventStore, subset, expandRange, context) { if (expandRange) { subset = expandRecurring(subset, expandRange, context); } return mergeEventStores(eventStore, subset); } function rezoneEventStoreDates(eventStore, oldDateEnv, newDateEnv) { var defs = eventStore.defs; var instances = mapHash(eventStore.instances, function (instance) { var def = defs[instance.defId]; if (def.allDay || def.recurringDef) { return instance; // isn't dependent on timezone } return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, instance), { range: { start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)), end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo)), }, forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo, forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo }); }); return { defs: defs, instances: instances }; } function excludeEventsBySourceId(eventStore, sourceId) { return filterEventStoreDefs(eventStore, function (eventDef) { return eventDef.sourceId !== sourceId; }); } // QUESTION: why not just return instances? do a general object-property-exclusion util function excludeInstances(eventStore, removals) { return { defs: eventStore.defs, instances: filterHash(eventStore.instances, function (instance) { return !removals[instance.instanceId]; }), }; } function reduceDateSelection(currentSelection, action) { switch (action.type) { case 'UNSELECT_DATES': return null; case 'SELECT_DATES': return action.selection; default: return currentSelection; } } function reduceSelectedEvent(currentInstanceId, action) { switch (action.type) { case 'UNSELECT_EVENT': return ''; case 'SELECT_EVENT': return action.eventInstanceId; default: return currentInstanceId; } } function reduceEventDrag(currentDrag, action) { var newDrag; switch (action.type) { case 'UNSET_EVENT_DRAG': return null; case 'SET_EVENT_DRAG': newDrag = action.state; return { affectedEvents: newDrag.affectedEvents, mutatedEvents: newDrag.mutatedEvents, isEvent: newDrag.isEvent, }; default: return currentDrag; } } function reduceEventResize(currentResize, action) { var newResize; switch (action.type) { case 'UNSET_EVENT_RESIZE': return null; case 'SET_EVENT_RESIZE': newResize = action.state; return { affectedEvents: newResize.affectedEvents, mutatedEvents: newResize.mutatedEvents, isEvent: newResize.isEvent, }; default: return currentResize; } } function parseToolbars(calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) { var header = calendarOptions.headerToolbar ? parseToolbar(calendarOptions.headerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null; var footer = calendarOptions.footerToolbar ? parseToolbar(calendarOptions.footerToolbar, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) : null; return { header: header, footer: footer }; } function parseToolbar(sectionStrHash, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi) { var sectionWidgets = {}; var viewsWithButtons = []; var hasTitle = false; for (var sectionName in sectionStrHash) { var sectionStr = sectionStrHash[sectionName]; var sectionRes = parseSection(sectionStr, calendarOptions, calendarOptionOverrides, theme, viewSpecs, calendarApi); sectionWidgets[sectionName] = sectionRes.widgets; viewsWithButtons.push.apply(viewsWithButtons, sectionRes.viewsWithButtons); hasTitle = hasTitle || sectionRes.hasTitle; } return { sectionWidgets: sectionWidgets, viewsWithButtons: viewsWithButtons, hasTitle: hasTitle }; } /* BAD: querying icons and text here. should be done at render time */ function parseSection(sectionStr, calendarOptions, // defaults+overrides, then refined calendarOptionOverrides, // overrides only!, unrefined :( theme, viewSpecs, calendarApi) { var isRtl = calendarOptions.direction === 'rtl'; var calendarCustomButtons = calendarOptions.customButtons || {}; var calendarButtonTextOverrides = calendarOptionOverrides.buttonText || {}; var calendarButtonText = calendarOptions.buttonText || {}; var calendarButtonHintOverrides = calendarOptionOverrides.buttonHints || {}; var calendarButtonHints = calendarOptions.buttonHints || {}; var sectionSubstrs = sectionStr ? sectionStr.split(' ') : []; var viewsWithButtons = []; var hasTitle = false; var widgets = sectionSubstrs.map(function (buttonGroupStr) { return (buttonGroupStr.split(',').map(function (buttonName) { if (buttonName === 'title') { hasTitle = true; return { buttonName: buttonName }; } var customButtonProps; var viewSpec; var buttonClick; var buttonIcon; // only one of these will be set var buttonText; // " var buttonHint; // ^ for the title="" attribute, for accessibility if ((customButtonProps = calendarCustomButtons[buttonName])) { buttonClick = function (ev) { if (customButtonProps.click) { customButtonProps.click.call(ev.target, ev, ev.target); // TODO: use Calendar this context? } }; (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) || (buttonIcon = theme.getIconClass(buttonName, isRtl)) || (buttonText = customButtonProps.text); buttonHint = customButtonProps.hint || customButtonProps.text; } else if ((viewSpec = viewSpecs[buttonName])) { viewsWithButtons.push(buttonName); buttonClick = function () { calendarApi.changeView(buttonName); }; (buttonText = viewSpec.buttonTextOverride) || (buttonIcon = theme.getIconClass(buttonName, isRtl)) || (buttonText = viewSpec.buttonTextDefault); var textFallback = viewSpec.buttonTextOverride || viewSpec.buttonTextDefault; buttonHint = formatWithOrdinals(viewSpec.buttonTitleOverride || viewSpec.buttonTitleDefault || calendarOptions.viewHint, [textFallback, buttonName], // view-name = buttonName textFallback); } else if (calendarApi[buttonName]) { // a calendarApi method buttonClick = function () { calendarApi[buttonName](); }; (buttonText = calendarButtonTextOverrides[buttonName]) || (buttonIcon = theme.getIconClass(buttonName, isRtl)) || (buttonText = calendarButtonText[buttonName]); // everything else is considered default if (buttonName === 'prevYear' || buttonName === 'nextYear') { var prevOrNext = buttonName === 'prevYear' ? 'prev' : 'next'; buttonHint = formatWithOrdinals(calendarButtonHintOverrides[prevOrNext] || calendarButtonHints[prevOrNext], [ calendarButtonText.year || 'year', 'year', ], calendarButtonText[buttonName]); } else { buttonHint = function (navUnit) { return formatWithOrdinals(calendarButtonHintOverrides[buttonName] || calendarButtonHints[buttonName], [ calendarButtonText[navUnit] || navUnit, navUnit, ], calendarButtonText[buttonName]); }; } } return { buttonName: buttonName, buttonClick: buttonClick, buttonIcon: buttonIcon, buttonText: buttonText, buttonHint: buttonHint }; })); }); return { widgets: widgets, viewsWithButtons: viewsWithButtons, hasTitle: hasTitle }; } var eventSourceDef$2 = { ignoreRange: true, parseMeta: function (refined) { if (Array.isArray(refined.events)) { return refined.events; } return null; }, fetch: function (arg, success) { success({ rawEvents: arg.eventSource.meta, }); }, }; var arrayEventSourcePlugin = createPlugin({ eventSourceDefs: [eventSourceDef$2], }); var eventSourceDef$1 = { parseMeta: function (refined) { if (typeof refined.events === 'function') { return refined.events; } return null; }, fetch: function (arg, success, failure) { var dateEnv = arg.context.dateEnv; var func = arg.eventSource.meta; unpromisify(func.bind(null, buildRangeApiWithTimeZone(arg.range, dateEnv)), function (rawEvents) { success({ rawEvents: rawEvents }); // needs an object response }, failure); }, }; var funcEventSourcePlugin = createPlugin({ eventSourceDefs: [eventSourceDef$1], }); function requestJson(method, url, params, successCallback, failureCallback) { method = method.toUpperCase(); var body = null; if (method === 'GET') { url = injectQueryStringParams(url, params); } else { body = encodeParams(params); } var xhr = new XMLHttpRequest(); xhr.open(method, url, true); if (method !== 'GET') { xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 400) { var parsed = false; var res = void 0; try { res = JSON.parse(xhr.responseText); parsed = true; } catch (err) { // will handle parsed=false } if (parsed) { successCallback(res, xhr); } else { failureCallback('Failure parsing JSON', xhr); } } else { failureCallback('Request failed', xhr); } }; xhr.onerror = function () { failureCallback('Request failed', xhr); }; xhr.send(body); } function injectQueryStringParams(url, params) { return url + (url.indexOf('?') === -1 ? '?' : '&') + encodeParams(params); } function encodeParams(params) { var parts = []; for (var key in params) { parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(params[key])); } return parts.join('&'); } var JSON_FEED_EVENT_SOURCE_REFINERS = { method: String, extraParams: identity, startParam: String, endParam: String, timeZoneParam: String, }; var eventSourceDef = { parseMeta: function (refined) { if (refined.url && (refined.format === 'json' || !refined.format)) { return { url: refined.url, format: 'json', method: (refined.method || 'GET').toUpperCase(), extraParams: refined.extraParams, startParam: refined.startParam, endParam: refined.endParam, timeZoneParam: refined.timeZoneParam, }; } return null; }, fetch: function (arg, success, failure) { var meta = arg.eventSource.meta; var requestParams = buildRequestParams(meta, arg.range, arg.context); requestJson(meta.method, meta.url, requestParams, function (rawEvents, xhr) { success({ rawEvents: rawEvents, xhr: xhr }); }, function (errorMessage, xhr) { failure({ message: errorMessage, xhr: xhr }); }); }, }; var jsonFeedEventSourcePlugin = createPlugin({ eventSourceRefiners: JSON_FEED_EVENT_SOURCE_REFINERS, eventSourceDefs: [eventSourceDef], }); function buildRequestParams(meta, range, context) { var dateEnv = context.dateEnv, options = context.options; var startParam; var endParam; var timeZoneParam; var customRequestParams; var params = {}; startParam = meta.startParam; if (startParam == null) { startParam = options.startParam; } endParam = meta.endParam; if (endParam == null) { endParam = options.endParam; } timeZoneParam = meta.timeZoneParam; if (timeZoneParam == null) { timeZoneParam = options.timeZoneParam; } // retrieve any outbound GET/POST data from the options if (typeof meta.extraParams === 'function') { // supplied as a function that returns a key/value object customRequestParams = meta.extraParams(); } else { // probably supplied as a straight key/value object customRequestParams = meta.extraParams || {}; } Object(tslib_es6["a" /* __assign */])(params, customRequestParams); params[startParam] = dateEnv.formatIso(range.start); params[endParam] = dateEnv.formatIso(range.end); if (dateEnv.timeZone !== 'local') { params[timeZoneParam] = dateEnv.timeZone; } return params; } var SIMPLE_RECURRING_REFINERS = { daysOfWeek: identity, startTime: createDuration, endTime: createDuration, duration: createDuration, startRecur: identity, endRecur: identity, }; var recurring = { parse: function (refined, dateEnv) { if (refined.daysOfWeek || refined.startTime || refined.endTime || refined.startRecur || refined.endRecur) { var recurringData = { daysOfWeek: refined.daysOfWeek || null, startTime: refined.startTime || null, endTime: refined.endTime || null, startRecur: refined.startRecur ? dateEnv.createMarker(refined.startRecur) : null, endRecur: refined.endRecur ? dateEnv.createMarker(refined.endRecur) : null, }; var duration = void 0; if (refined.duration) { duration = refined.duration; } if (!duration && refined.startTime && refined.endTime) { duration = subtractDurations(refined.endTime, refined.startTime); } return { allDayGuess: Boolean(!refined.startTime && !refined.endTime), duration: duration, typeData: recurringData, // doesn't need endTime anymore but oh well }; } return null; }, expand: function (typeData, framingRange, dateEnv) { var clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur }); if (clippedFramingRange) { return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv); } return []; }, }; var simpleRecurringEventsPlugin = createPlugin({ recurringTypes: [recurring], eventRefiners: SIMPLE_RECURRING_REFINERS, }); function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) { var dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null; var dayMarker = startOfDay(framingRange.start); var endMarker = framingRange.end; var instanceStarts = []; while (dayMarker < endMarker) { var instanceStart // if everyday, or this particular day-of-week = void 0; // if everyday, or this particular day-of-week if (!dowHash || dowHash[dayMarker.getUTCDay()]) { if (startTime) { instanceStart = dateEnv.add(dayMarker, startTime); } else { instanceStart = dayMarker; } instanceStarts.push(instanceStart); } dayMarker = addDays(dayMarker, 1); } return instanceStarts; } var changeHandlerPlugin = createPlugin({ optionChangeHandlers: { events: function (events, context) { handleEventSources([events], context); }, eventSources: handleEventSources, }, }); /* BUG: if `event` was supplied, all previously-given `eventSources` will be wiped out */ function handleEventSources(inputs, context) { var unfoundSources = hashValuesToArray(context.getCurrentData().eventSources); var newInputs = []; for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { var input = inputs_1[_i]; var inputFound = false; for (var i = 0; i < unfoundSources.length; i += 1) { if (unfoundSources[i]._raw === input) { unfoundSources.splice(i, 1); // delete inputFound = true; break; } } if (!inputFound) { newInputs.push(input); } } for (var _a = 0, unfoundSources_1 = unfoundSources; _a < unfoundSources_1.length; _a++) { var unfoundSource = unfoundSources_1[_a]; context.dispatch({ type: 'REMOVE_EVENT_SOURCE', sourceId: unfoundSource.sourceId, }); } for (var _b = 0, newInputs_1 = newInputs; _b < newInputs_1.length; _b++) { var newInput = newInputs_1[_b]; context.calendarApi.addEventSource(newInput); } } function handleDateProfile(dateProfile, context) { context.emitter.trigger('datesSet', Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, buildRangeApiWithTimeZone(dateProfile.activeRange, context.dateEnv)), { view: context.viewApi })); } function handleEventStore(eventStore, context) { var emitter = context.emitter; if (emitter.hasHandlers('eventsSet')) { emitter.trigger('eventsSet', buildEventApis(eventStore, context)); } } /* this array is exposed on the root namespace so that UMD plugins can add to it. see the rollup-bundles script. */ var globalPlugins = [ arrayEventSourcePlugin, funcEventSourcePlugin, jsonFeedEventSourcePlugin, simpleRecurringEventsPlugin, changeHandlerPlugin, createPlugin({ isLoadingFuncs: [ function (state) { return computeEventSourcesLoading(state.eventSources); }, ], contentTypeHandlers: { html: buildHtmlRenderer, domNodes: buildDomNodeRenderer, }, propSetHandlers: { dateProfile: handleDateProfile, eventStore: handleEventStore, }, }), ]; function buildHtmlRenderer() { var currentEl = null; var currentHtml = ''; function render(el, html) { if (el !== currentEl || html !== currentHtml) { el.innerHTML = html; } currentEl = el; currentHtml = html; } function destroy() { currentEl.innerHTML = ''; currentEl = null; currentHtml = ''; } return { render: render, destroy: destroy }; } function buildDomNodeRenderer() { var currentEl = null; var currentDomNodes = []; function render(el, domNodes) { var newDomNodes = Array.prototype.slice.call(domNodes); if (el !== currentEl || !isArraysEqual(currentDomNodes, newDomNodes)) { // append first, remove second (for scroll resetting) for (var _i = 0, newDomNodes_1 = newDomNodes; _i < newDomNodes_1.length; _i++) { var newNode = newDomNodes_1[_i]; el.appendChild(newNode); } destroy(); } currentEl = el; currentDomNodes = newDomNodes; } function destroy() { currentDomNodes.forEach(removeElement); currentDomNodes = []; currentEl = null; } return { render: render, destroy: destroy }; } var DelayedRunner = /** @class */ (function () { function DelayedRunner(drainedOption) { this.drainedOption = drainedOption; this.isRunning = false; this.isDirty = false; this.pauseDepths = {}; this.timeoutId = 0; } DelayedRunner.prototype.request = function (delay) { this.isDirty = true; if (!this.isPaused()) { this.clearTimeout(); if (delay == null) { this.tryDrain(); } else { this.timeoutId = setTimeout(// NOT OPTIMAL! TODO: look at debounce this.tryDrain.bind(this), delay); } } }; DelayedRunner.prototype.pause = function (scope) { if (scope === void 0) { scope = ''; } var pauseDepths = this.pauseDepths; pauseDepths[scope] = (pauseDepths[scope] || 0) + 1; this.clearTimeout(); }; DelayedRunner.prototype.resume = function (scope, force) { if (scope === void 0) { scope = ''; } var pauseDepths = this.pauseDepths; if (scope in pauseDepths) { if (force) { delete pauseDepths[scope]; } else { pauseDepths[scope] -= 1; var depth = pauseDepths[scope]; if (depth <= 0) { delete pauseDepths[scope]; } } this.tryDrain(); } }; DelayedRunner.prototype.isPaused = function () { return Object.keys(this.pauseDepths).length; }; DelayedRunner.prototype.tryDrain = function () { if (!this.isRunning && !this.isPaused()) { this.isRunning = true; while (this.isDirty) { this.isDirty = false; this.drained(); // might set isDirty to true again } this.isRunning = false; } }; DelayedRunner.prototype.clear = function () { this.clearTimeout(); this.isDirty = false; this.pauseDepths = {}; }; DelayedRunner.prototype.clearTimeout = function () { if (this.timeoutId) { clearTimeout(this.timeoutId); this.timeoutId = 0; } }; DelayedRunner.prototype.drained = function () { if (this.drainedOption) { this.drainedOption(); } }; return DelayedRunner; }()); var TaskRunner = /** @class */ (function () { function TaskRunner(runTaskOption, drainedOption) { this.runTaskOption = runTaskOption; this.drainedOption = drainedOption; this.queue = []; this.delayedRunner = new DelayedRunner(this.drain.bind(this)); } TaskRunner.prototype.request = function (task, delay) { this.queue.push(task); this.delayedRunner.request(delay); }; TaskRunner.prototype.pause = function (scope) { this.delayedRunner.pause(scope); }; TaskRunner.prototype.resume = function (scope, force) { this.delayedRunner.resume(scope, force); }; TaskRunner.prototype.drain = function () { var queue = this.queue; while (queue.length) { var completedTasks = []; var task = void 0; while ((task = queue.shift())) { this.runTask(task); completedTasks.push(task); } this.drained(completedTasks); } // keep going, in case new tasks were added in the drained handler }; TaskRunner.prototype.runTask = function (task) { if (this.runTaskOption) { this.runTaskOption(task); } }; TaskRunner.prototype.drained = function (completedTasks) { if (this.drainedOption) { this.drainedOption(completedTasks); } }; return TaskRunner; }()); // Computes what the title at the top of the calendarApi should be for this view function buildTitle(dateProfile, viewOptions, dateEnv) { var range; // for views that span a large unit of time, show the proper interval, ignoring stray days before and after if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) { range = dateProfile.currentRange; } else { // for day units or smaller, use the actual day range range = dateProfile.activeRange; } return dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || buildTitleFormat(dateProfile)), { isEndExclusive: dateProfile.isRangeAllDay, defaultSeparator: viewOptions.titleRangeSeparator, }); } // Generates the format string that should be used to generate the title for the current date range. // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`. function buildTitleFormat(dateProfile) { var currentRangeUnit = dateProfile.currentRangeUnit; if (currentRangeUnit === 'year') { return { year: 'numeric' }; } if (currentRangeUnit === 'month') { return { year: 'numeric', month: 'long' }; // like "September 2014" } var days = diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end); if (days !== null && days > 1) { // multi-day range. shorter, like "Sep 9 - 10 2014" return { year: 'numeric', month: 'short', day: 'numeric' }; } // one day. longer, like "September 9 2014" return { year: 'numeric', month: 'long', day: 'numeric' }; } // in future refactor, do the redux-style function(state=initial) for initial-state // also, whatever is happening in constructor, have it happen in action queue too var main_CalendarDataManager = /** @class */ (function () { function CalendarDataManager(props) { var _this = this; this.computeOptionsData = memoize(this._computeOptionsData); this.computeCurrentViewData = memoize(this._computeCurrentViewData); this.organizeRawLocales = memoize(organizeRawLocales); this.buildLocale = memoize(buildLocale); this.buildPluginHooks = buildBuildPluginHooks(); this.buildDateEnv = memoize(buildDateEnv); this.buildTheme = memoize(buildTheme); this.parseToolbars = memoize(parseToolbars); this.buildViewSpecs = memoize(buildViewSpecs); this.buildDateProfileGenerator = memoizeObjArg(buildDateProfileGenerator); this.buildViewApi = memoize(buildViewApi); this.buildViewUiProps = memoizeObjArg(buildViewUiProps); this.buildEventUiBySource = memoize(buildEventUiBySource, isPropsEqual); this.buildEventUiBases = memoize(buildEventUiBases); this.parseContextBusinessHours = memoizeObjArg(parseContextBusinessHours); this.buildTitle = memoize(buildTitle); this.emitter = new Emitter(); this.actionRunner = new TaskRunner(this._handleAction.bind(this), this.updateData.bind(this)); this.currentCalendarOptionsInput = {}; this.currentCalendarOptionsRefined = {}; this.currentViewOptionsInput = {}; this.currentViewOptionsRefined = {}; this.currentCalendarOptionsRefiners = {}; this.getCurrentData = function () { return _this.data; }; this.dispatch = function (action) { _this.actionRunner.request(action); // protects against recursive calls to _handleAction }; this.props = props; this.actionRunner.pause(); var dynamicOptionOverrides = {}; var optionsData = this.computeOptionsData(props.optionOverrides, dynamicOptionOverrides, props.calendarApi); var currentViewType = optionsData.calendarOptions.initialView || optionsData.pluginHooks.initialView; var currentViewData = this.computeCurrentViewData(currentViewType, optionsData, props.optionOverrides, dynamicOptionOverrides); // wire things up // TODO: not DRY props.calendarApi.currentDataManager = this; this.emitter.setThisContext(props.calendarApi); this.emitter.setOptions(currentViewData.options); var currentDate = getInitialDate(optionsData.calendarOptions, optionsData.dateEnv); var dateProfile = currentViewData.dateProfileGenerator.build(currentDate); if (!rangeContainsMarker(dateProfile.activeRange, currentDate)) { currentDate = dateProfile.currentRange.start; } var calendarContext = { dateEnv: optionsData.dateEnv, options: optionsData.calendarOptions, pluginHooks: optionsData.pluginHooks, calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: this.emitter, getCurrentData: this.getCurrentData, }; // needs to be after setThisContext for (var _i = 0, _a = optionsData.pluginHooks.contextInit; _i < _a.length; _i++) { var callback = _a[_i]; callback(calendarContext); } // NOT DRY var eventSources = initEventSources(optionsData.calendarOptions, dateProfile, calendarContext); var initialState = { dynamicOptionOverrides: dynamicOptionOverrides, currentViewType: currentViewType, currentDate: currentDate, dateProfile: dateProfile, businessHours: this.parseContextBusinessHours(calendarContext), eventSources: eventSources, eventUiBases: {}, eventStore: createEmptyEventStore(), renderableEventStore: createEmptyEventStore(), dateSelection: null, eventSelection: '', eventDrag: null, eventResize: null, selectionConfig: this.buildViewUiProps(calendarContext).selectionConfig, }; var contextAndState = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, calendarContext), initialState); for (var _b = 0, _c = optionsData.pluginHooks.reducers; _b < _c.length; _b++) { var reducer = _c[_b]; Object(tslib_es6["a" /* __assign */])(initialState, reducer(null, null, contextAndState)); } if (computeIsLoading(initialState, calendarContext)) { this.emitter.trigger('loading', true); // NOT DRY } this.state = initialState; this.updateData(); this.actionRunner.resume(); } CalendarDataManager.prototype.resetOptions = function (optionOverrides, append) { var props = this.props; props.optionOverrides = append ? Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, props.optionOverrides), optionOverrides) : optionOverrides; this.actionRunner.request({ type: 'NOTHING', }); }; CalendarDataManager.prototype._handleAction = function (action) { var _a = this, props = _a.props, state = _a.state, emitter = _a.emitter; var dynamicOptionOverrides = reduceDynamicOptionOverrides(state.dynamicOptionOverrides, action); var optionsData = this.computeOptionsData(props.optionOverrides, dynamicOptionOverrides, props.calendarApi); var currentViewType = reduceViewType(state.currentViewType, action); var currentViewData = this.computeCurrentViewData(currentViewType, optionsData, props.optionOverrides, dynamicOptionOverrides); // wire things up // TODO: not DRY props.calendarApi.currentDataManager = this; emitter.setThisContext(props.calendarApi); emitter.setOptions(currentViewData.options); var calendarContext = { dateEnv: optionsData.dateEnv, options: optionsData.calendarOptions, pluginHooks: optionsData.pluginHooks, calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: emitter, getCurrentData: this.getCurrentData, }; var currentDate = state.currentDate, dateProfile = state.dateProfile; if (this.data && this.data.dateProfileGenerator !== currentViewData.dateProfileGenerator) { // hack dateProfile = currentViewData.dateProfileGenerator.build(currentDate); } currentDate = reduceCurrentDate(currentDate, action); dateProfile = reduceDateProfile(dateProfile, action, currentDate, currentViewData.dateProfileGenerator); if (action.type === 'PREV' || // TODO: move this logic into DateProfileGenerator action.type === 'NEXT' || // " !rangeContainsMarker(dateProfile.currentRange, currentDate)) { currentDate = dateProfile.currentRange.start; } var eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendarContext); var eventStore = reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendarContext); var isEventsLoading = computeEventSourcesLoading(eventSources); // BAD. also called in this func in computeIsLoading var renderableEventStore = (isEventsLoading && !currentViewData.options.progressiveEventRendering) ? (state.renderableEventStore || eventStore) : // try from previous state eventStore; var _b = this.buildViewUiProps(calendarContext), eventUiSingleBase = _b.eventUiSingleBase, selectionConfig = _b.selectionConfig; // will memoize obj var eventUiBySource = this.buildEventUiBySource(eventSources); var eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource); var newState = { dynamicOptionOverrides: dynamicOptionOverrides, currentViewType: currentViewType, currentDate: currentDate, dateProfile: dateProfile, eventSources: eventSources, eventStore: eventStore, renderableEventStore: renderableEventStore, selectionConfig: selectionConfig, eventUiBases: eventUiBases, businessHours: this.parseContextBusinessHours(calendarContext), dateSelection: reduceDateSelection(state.dateSelection, action), eventSelection: reduceSelectedEvent(state.eventSelection, action), eventDrag: reduceEventDrag(state.eventDrag, action), eventResize: reduceEventResize(state.eventResize, action), }; var contextAndState = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, calendarContext), newState); for (var _i = 0, _c = optionsData.pluginHooks.reducers; _i < _c.length; _i++) { var reducer = _c[_i]; Object(tslib_es6["a" /* __assign */])(newState, reducer(state, action, contextAndState)); // give the OLD state, for old value } var wasLoading = computeIsLoading(state, calendarContext); var isLoading = computeIsLoading(newState, calendarContext); // TODO: use propSetHandlers in plugin system if (!wasLoading && isLoading) { emitter.trigger('loading', true); } else if (wasLoading && !isLoading) { emitter.trigger('loading', false); } this.state = newState; if (props.onAction) { props.onAction(action); } }; CalendarDataManager.prototype.updateData = function () { var _a = this, props = _a.props, state = _a.state; var oldData = this.data; var optionsData = this.computeOptionsData(props.optionOverrides, state.dynamicOptionOverrides, props.calendarApi); var currentViewData = this.computeCurrentViewData(state.currentViewType, optionsData, props.optionOverrides, state.dynamicOptionOverrides); var data = this.data = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({ viewTitle: this.buildTitle(state.dateProfile, currentViewData.options, optionsData.dateEnv), calendarApi: props.calendarApi, dispatch: this.dispatch, emitter: this.emitter, getCurrentData: this.getCurrentData }, optionsData), currentViewData), state); var changeHandlers = optionsData.pluginHooks.optionChangeHandlers; var oldCalendarOptions = oldData && oldData.calendarOptions; var newCalendarOptions = optionsData.calendarOptions; if (oldCalendarOptions && oldCalendarOptions !== newCalendarOptions) { if (oldCalendarOptions.timeZone !== newCalendarOptions.timeZone) { // hack state.eventSources = data.eventSources = reduceEventSourcesNewTimeZone(data.eventSources, state.dateProfile, data); state.eventStore = data.eventStore = rezoneEventStoreDates(data.eventStore, oldData.dateEnv, data.dateEnv); } for (var optionName in changeHandlers) { if (oldCalendarOptions[optionName] !== newCalendarOptions[optionName]) { changeHandlers[optionName](newCalendarOptions[optionName], data); } } } if (props.onData) { props.onData(data); } }; CalendarDataManager.prototype._computeOptionsData = function (optionOverrides, dynamicOptionOverrides, calendarApi) { // TODO: blacklist options that are handled by optionChangeHandlers var _a = this.processRawCalendarOptions(optionOverrides, dynamicOptionOverrides), refinedOptions = _a.refinedOptions, pluginHooks = _a.pluginHooks, localeDefaults = _a.localeDefaults, availableLocaleData = _a.availableLocaleData, extra = _a.extra; warnUnknownOptions(extra); var dateEnv = this.buildDateEnv(refinedOptions.timeZone, refinedOptions.locale, refinedOptions.weekNumberCalculation, refinedOptions.firstDay, refinedOptions.weekText, pluginHooks, availableLocaleData, refinedOptions.defaultRangeSeparator); var viewSpecs = this.buildViewSpecs(pluginHooks.views, optionOverrides, dynamicOptionOverrides, localeDefaults); var theme = this.buildTheme(refinedOptions, pluginHooks); var toolbarConfig = this.parseToolbars(refinedOptions, optionOverrides, theme, viewSpecs, calendarApi); return { calendarOptions: refinedOptions, pluginHooks: pluginHooks, dateEnv: dateEnv, viewSpecs: viewSpecs, theme: theme, toolbarConfig: toolbarConfig, localeDefaults: localeDefaults, availableRawLocales: availableLocaleData.map, }; }; // always called from behind a memoizer CalendarDataManager.prototype.processRawCalendarOptions = function (optionOverrides, dynamicOptionOverrides) { var _a = mergeRawOptions([ BASE_OPTION_DEFAULTS, optionOverrides, dynamicOptionOverrides, ]), locales = _a.locales, locale = _a.locale; var availableLocaleData = this.organizeRawLocales(locales); var availableRawLocales = availableLocaleData.map; var localeDefaults = this.buildLocale(locale || availableLocaleData.defaultCode, availableRawLocales).options; var pluginHooks = this.buildPluginHooks(optionOverrides.plugins || [], globalPlugins); var refiners = this.currentCalendarOptionsRefiners = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, BASE_OPTION_REFINERS), CALENDAR_LISTENER_REFINERS), CALENDAR_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners); var extra = {}; var raw = mergeRawOptions([ BASE_OPTION_DEFAULTS, localeDefaults, optionOverrides, dynamicOptionOverrides, ]); var refined = {}; var currentRaw = this.currentCalendarOptionsInput; var currentRefined = this.currentCalendarOptionsRefined; var anyChanges = false; for (var optionName in raw) { if (optionName !== 'plugins') { // because plugins is special-cased if (raw[optionName] === currentRaw[optionName] || (COMPLEX_OPTION_COMPARATORS[optionName] && (optionName in currentRaw) && COMPLEX_OPTION_COMPARATORS[optionName](currentRaw[optionName], raw[optionName]))) { refined[optionName] = currentRefined[optionName]; } else if (refiners[optionName]) { refined[optionName] = refiners[optionName](raw[optionName]); anyChanges = true; } else { extra[optionName] = currentRaw[optionName]; } } } if (anyChanges) { this.currentCalendarOptionsInput = raw; this.currentCalendarOptionsRefined = refined; } return { rawOptions: this.currentCalendarOptionsInput, refinedOptions: this.currentCalendarOptionsRefined, pluginHooks: pluginHooks, availableLocaleData: availableLocaleData, localeDefaults: localeDefaults, extra: extra, }; }; CalendarDataManager.prototype._computeCurrentViewData = function (viewType, optionsData, optionOverrides, dynamicOptionOverrides) { var viewSpec = optionsData.viewSpecs[viewType]; if (!viewSpec) { throw new Error("viewType \"" + viewType + "\" is not available. Please make sure you've loaded all neccessary plugins"); } var _a = this.processRawViewOptions(viewSpec, optionsData.pluginHooks, optionsData.localeDefaults, optionOverrides, dynamicOptionOverrides), refinedOptions = _a.refinedOptions, extra = _a.extra; warnUnknownOptions(extra); var dateProfileGenerator = this.buildDateProfileGenerator({ dateProfileGeneratorClass: viewSpec.optionDefaults.dateProfileGeneratorClass, duration: viewSpec.duration, durationUnit: viewSpec.durationUnit, usesMinMaxTime: viewSpec.optionDefaults.usesMinMaxTime, dateEnv: optionsData.dateEnv, calendarApi: this.props.calendarApi, slotMinTime: refinedOptions.slotMinTime, slotMaxTime: refinedOptions.slotMaxTime, showNonCurrentDates: refinedOptions.showNonCurrentDates, dayCount: refinedOptions.dayCount, dateAlignment: refinedOptions.dateAlignment, dateIncrement: refinedOptions.dateIncrement, hiddenDays: refinedOptions.hiddenDays, weekends: refinedOptions.weekends, nowInput: refinedOptions.now, validRangeInput: refinedOptions.validRange, visibleRangeInput: refinedOptions.visibleRange, monthMode: refinedOptions.monthMode, fixedWeekCount: refinedOptions.fixedWeekCount, }); var viewApi = this.buildViewApi(viewType, this.getCurrentData, optionsData.dateEnv); return { viewSpec: viewSpec, options: refinedOptions, dateProfileGenerator: dateProfileGenerator, viewApi: viewApi }; }; CalendarDataManager.prototype.processRawViewOptions = function (viewSpec, pluginHooks, localeDefaults, optionOverrides, dynamicOptionOverrides) { var raw = mergeRawOptions([ BASE_OPTION_DEFAULTS, viewSpec.optionDefaults, localeDefaults, optionOverrides, viewSpec.optionOverrides, dynamicOptionOverrides, ]); var refiners = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, BASE_OPTION_REFINERS), CALENDAR_LISTENER_REFINERS), CALENDAR_OPTION_REFINERS), VIEW_OPTION_REFINERS), pluginHooks.listenerRefiners), pluginHooks.optionRefiners); var refined = {}; var currentRaw = this.currentViewOptionsInput; var currentRefined = this.currentViewOptionsRefined; var anyChanges = false; var extra = {}; for (var optionName in raw) { if (raw[optionName] === currentRaw[optionName]) { refined[optionName] = currentRefined[optionName]; } else { if (raw[optionName] === this.currentCalendarOptionsInput[optionName]) { if (optionName in this.currentCalendarOptionsRefined) { // might be an "extra" prop refined[optionName] = this.currentCalendarOptionsRefined[optionName]; } } else if (refiners[optionName]) { refined[optionName] = refiners[optionName](raw[optionName]); } else { extra[optionName] = raw[optionName]; } anyChanges = true; } } if (anyChanges) { this.currentViewOptionsInput = raw; this.currentViewOptionsRefined = refined; } return { rawOptions: this.currentViewOptionsInput, refinedOptions: this.currentViewOptionsRefined, extra: extra, }; }; return CalendarDataManager; }()); function buildDateEnv(timeZone, explicitLocale, weekNumberCalculation, firstDay, weekText, pluginHooks, availableLocaleData, defaultSeparator) { var locale = buildLocale(explicitLocale || availableLocaleData.defaultCode, availableLocaleData.map); return new DateEnv({ calendarSystem: 'gregory', timeZone: timeZone, namedTimeZoneImpl: pluginHooks.namedTimeZonedImpl, locale: locale, weekNumberCalculation: weekNumberCalculation, firstDay: firstDay, weekText: weekText, cmdFormatter: pluginHooks.cmdFormatter, defaultSeparator: defaultSeparator, }); } function buildTheme(options, pluginHooks) { var ThemeClass = pluginHooks.themeClasses[options.themeSystem] || main_StandardTheme; return new ThemeClass(options); } function buildDateProfileGenerator(props) { var DateProfileGeneratorClass = props.dateProfileGeneratorClass || DateProfileGenerator; return new DateProfileGeneratorClass(props); } function buildViewApi(type, getCurrentData, dateEnv) { return new ViewApi(type, getCurrentData, dateEnv); } function buildEventUiBySource(eventSources) { return mapHash(eventSources, function (eventSource) { return eventSource.ui; }); } function buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) { var eventUiBases = { '': eventUiSingleBase }; for (var defId in eventDefs) { var def = eventDefs[defId]; if (def.sourceId && eventUiBySource[def.sourceId]) { eventUiBases[defId] = eventUiBySource[def.sourceId]; } } return eventUiBases; } function buildViewUiProps(calendarContext) { var options = calendarContext.options; return { eventUiSingleBase: createEventUi({ display: options.eventDisplay, editable: options.editable, startEditable: options.eventStartEditable, durationEditable: options.eventDurationEditable, constraint: options.eventConstraint, overlap: typeof options.eventOverlap === 'boolean' ? options.eventOverlap : undefined, allow: options.eventAllow, backgroundColor: options.eventBackgroundColor, borderColor: options.eventBorderColor, textColor: options.eventTextColor, color: options.eventColor, // classNames: options.eventClassNames // render hook will handle this }, calendarContext), selectionConfig: createEventUi({ constraint: options.selectConstraint, overlap: typeof options.selectOverlap === 'boolean' ? options.selectOverlap : undefined, allow: options.selectAllow, }, calendarContext), }; } function computeIsLoading(state, context) { for (var _i = 0, _a = context.pluginHooks.isLoadingFuncs; _i < _a.length; _i++) { var isLoadingFunc = _a[_i]; if (isLoadingFunc(state)) { return true; } } return false; } function parseContextBusinessHours(calendarContext) { return parseBusinessHours(calendarContext.options.businessHours, calendarContext); } function warnUnknownOptions(options, viewName) { for (var optionName in options) { console.warn("Unknown option '" + optionName + "'" + (viewName ? " for view '" + viewName + "'" : '')); } } // TODO: move this to react plugin? var main_CalendarDataProvider = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(CalendarDataProvider, _super); function CalendarDataProvider(props) { var _this = _super.call(this, props) || this; _this.handleData = function (data) { if (!_this.dataManager) { // still within initial run, before assignment in constructor // eslint-disable-next-line react/no-direct-mutation-state _this.state = data; // can't use setState yet } else { _this.setState(data); } }; _this.dataManager = new main_CalendarDataManager({ optionOverrides: props.optionOverrides, calendarApi: props.calendarApi, onData: _this.handleData, }); return _this; } CalendarDataProvider.prototype.render = function () { return this.props.children(this.state); }; CalendarDataProvider.prototype.componentDidUpdate = function (prevProps) { var newOptionOverrides = this.props.optionOverrides; if (newOptionOverrides !== prevProps.optionOverrides) { // prevent recursive handleData this.dataManager.resetOptions(newOptionOverrides); } }; return CalendarDataProvider; }(Component)); // HELPERS /* if nextDayThreshold is specified, slicing is done in an all-day fashion. you can get nextDayThreshold from context.nextDayThreshold */ function sliceEvents(props, allDay) { return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg; } var NamedTimeZoneImpl = /** @class */ (function () { function NamedTimeZoneImpl(timeZoneName) { this.timeZoneName = timeZoneName; } return NamedTimeZoneImpl; }()); var main_SegHierarchy = /** @class */ (function () { function SegHierarchy() { // settings this.strictOrder = false; this.allowReslicing = false; this.maxCoord = -1; // -1 means no max this.maxStackCnt = -1; // -1 means no max this.levelCoords = []; // ordered this.entriesByLevel = []; // parallel with levelCoords this.stackCnts = {}; // TODO: use better technique!? } SegHierarchy.prototype.addSegs = function (inputs) { var hiddenEntries = []; for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { var input = inputs_1[_i]; this.insertEntry(input, hiddenEntries); } return hiddenEntries; }; SegHierarchy.prototype.insertEntry = function (entry, hiddenEntries) { var insertion = this.findInsertion(entry); if (this.isInsertionValid(insertion, entry)) { this.insertEntryAt(entry, insertion); return 1; } return this.handleInvalidInsertion(insertion, entry, hiddenEntries); }; SegHierarchy.prototype.isInsertionValid = function (insertion, entry) { return (this.maxCoord === -1 || insertion.levelCoord + entry.thickness <= this.maxCoord) && (this.maxStackCnt === -1 || insertion.stackCnt < this.maxStackCnt); }; // returns number of new entries inserted SegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) { if (this.allowReslicing && insertion.touchingEntry) { return this.splitEntry(entry, insertion.touchingEntry, hiddenEntries); } hiddenEntries.push(entry); return 0; }; SegHierarchy.prototype.splitEntry = function (entry, barrier, hiddenEntries) { var partCnt = 0; var splitHiddenEntries = []; var entrySpan = entry.span; var barrierSpan = barrier.span; if (entrySpan.start < barrierSpan.start) { partCnt += this.insertEntry({ index: entry.index, thickness: entry.thickness, span: { start: entrySpan.start, end: barrierSpan.start }, }, splitHiddenEntries); } if (entrySpan.end > barrierSpan.end) { partCnt += this.insertEntry({ index: entry.index, thickness: entry.thickness, span: { start: barrierSpan.end, end: entrySpan.end }, }, splitHiddenEntries); } if (partCnt) { hiddenEntries.push.apply(hiddenEntries, Object(tslib_es6["c" /* __spreadArray */])([{ index: entry.index, thickness: entry.thickness, span: intersectSpans(barrierSpan, entrySpan), // guaranteed to intersect }], splitHiddenEntries)); return partCnt; } hiddenEntries.push(entry); return 0; }; SegHierarchy.prototype.insertEntryAt = function (entry, insertion) { var _a = this, entriesByLevel = _a.entriesByLevel, levelCoords = _a.levelCoords; if (insertion.lateral === -1) { // create a new level insertAt(levelCoords, insertion.level, insertion.levelCoord); insertAt(entriesByLevel, insertion.level, [entry]); } else { // insert into existing level insertAt(entriesByLevel[insertion.level], insertion.lateral, entry); } this.stackCnts[buildEntryKey(entry)] = insertion.stackCnt; }; SegHierarchy.prototype.findInsertion = function (newEntry) { var _a = this, levelCoords = _a.levelCoords, entriesByLevel = _a.entriesByLevel, strictOrder = _a.strictOrder, stackCnts = _a.stackCnts; var levelCnt = levelCoords.length; var candidateCoord = 0; var touchingLevel = -1; var touchingLateral = -1; var touchingEntry = null; var stackCnt = 0; for (var trackingLevel = 0; trackingLevel < levelCnt; trackingLevel += 1) { var trackingCoord = levelCoords[trackingLevel]; // if the current level is past the placed entry, we have found a good empty space and can stop. // if strictOrder, keep finding more lateral intersections. if (!strictOrder && trackingCoord >= candidateCoord + newEntry.thickness) { break; } var trackingEntries = entriesByLevel[trackingLevel]; var trackingEntry = void 0; var searchRes = binarySearch(trackingEntries, newEntry.span.start, getEntrySpanEnd); // find first entry after newEntry's end var lateralIndex = searchRes[0] + searchRes[1]; // if exact match (which doesn't collide), go to next one while ( // loop through entries that horizontally intersect (trackingEntry = trackingEntries[lateralIndex]) && // but not past the whole entry list trackingEntry.span.start < newEntry.span.end // and not entirely past newEntry ) { var trackingEntryBottom = trackingCoord + trackingEntry.thickness; // intersects into the top of the candidate? if (trackingEntryBottom > candidateCoord) { candidateCoord = trackingEntryBottom; touchingEntry = trackingEntry; touchingLevel = trackingLevel; touchingLateral = lateralIndex; } // butts up against top of candidate? (will happen if just intersected as well) if (trackingEntryBottom === candidateCoord) { // accumulate the highest possible stackCnt of the trackingEntries that butt up stackCnt = Math.max(stackCnt, stackCnts[buildEntryKey(trackingEntry)] + 1); } lateralIndex += 1; } } // the destination level will be after touchingEntry's level. find it var destLevel = 0; if (touchingEntry) { destLevel = touchingLevel + 1; while (destLevel < levelCnt && levelCoords[destLevel] < candidateCoord) { destLevel += 1; } } // if adding to an existing level, find where to insert var destLateral = -1; if (destLevel < levelCnt && levelCoords[destLevel] === candidateCoord) { destLateral = binarySearch(entriesByLevel[destLevel], newEntry.span.end, getEntrySpanEnd)[0]; } return { touchingLevel: touchingLevel, touchingLateral: touchingLateral, touchingEntry: touchingEntry, stackCnt: stackCnt, levelCoord: candidateCoord, level: destLevel, lateral: destLateral, }; }; // sorted by levelCoord (lowest to highest) SegHierarchy.prototype.toRects = function () { var _a = this, entriesByLevel = _a.entriesByLevel, levelCoords = _a.levelCoords; var levelCnt = entriesByLevel.length; var rects = []; for (var level = 0; level < levelCnt; level += 1) { var entries = entriesByLevel[level]; var levelCoord = levelCoords[level]; for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { var entry = entries_1[_i]; rects.push(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, entry), { levelCoord: levelCoord })); } } return rects; }; return SegHierarchy; }()); function getEntrySpanEnd(entry) { return entry.span.end; } function buildEntryKey(entry) { return entry.index + ':' + entry.span.start; } // returns groups with entries sorted by input order function groupIntersectingEntries(entries) { var merges = []; for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) { var entry = entries_2[_i]; var filteredMerges = []; var hungryMerge = { span: entry.span, entries: [entry], }; for (var _a = 0, merges_1 = merges; _a < merges_1.length; _a++) { var merge = merges_1[_a]; if (intersectSpans(merge.span, hungryMerge.span)) { hungryMerge = { entries: merge.entries.concat(hungryMerge.entries), span: joinSpans(merge.span, hungryMerge.span), }; } else { filteredMerges.push(merge); } } filteredMerges.push(hungryMerge); merges = filteredMerges; } return merges; } function joinSpans(span0, span1) { return { start: Math.min(span0.start, span1.start), end: Math.max(span0.end, span1.end), }; } function intersectSpans(span0, span1) { var start = Math.max(span0.start, span1.start); var end = Math.min(span0.end, span1.end); if (start < end) { return { start: start, end: end }; } return null; } // general util // --------------------------------------------------------------------------------------------------------------------- function insertAt(arr, index, item) { arr.splice(index, 0, item); } function binarySearch(a, searchVal, getItemVal) { var startIndex = 0; var endIndex = a.length; // exclusive if (!endIndex || searchVal < getItemVal(a[startIndex])) { // no items OR before first item return [0, 0]; } if (searchVal > getItemVal(a[endIndex - 1])) { // after last item return [endIndex, 0]; } while (startIndex < endIndex) { var middleIndex = Math.floor(startIndex + (endIndex - startIndex) / 2); var middleVal = getItemVal(a[middleIndex]); if (searchVal < middleVal) { endIndex = middleIndex; } else if (searchVal > middleVal) { startIndex = middleIndex + 1; } else { // equal! return [middleIndex, 1]; } } return [startIndex, 0]; } var Interaction = /** @class */ (function () { function Interaction(settings) { this.component = settings.component; this.isHitComboAllowed = settings.isHitComboAllowed || null; } Interaction.prototype.destroy = function () { }; return Interaction; }()); function parseInteractionSettings(component, input) { return { component: component, el: input.el, useEventCenter: input.useEventCenter != null ? input.useEventCenter : true, isHitComboAllowed: input.isHitComboAllowed || null, }; } function interactionSettingsToStore(settings) { var _a; return _a = {}, _a[settings.component.uid] = settings, _a; } // global state var interactionSettingsStore = {}; /* An abstraction for a dragging interaction originating on an event. Does higher-level things than PointerDragger, such as possibly: - a "mirror" that moves with the pointer - a minimum number of pixels or other criteria for a true drag to begin subclasses must emit: - pointerdown - dragstart - dragmove - pointerup - dragend */ var ElementDragging = /** @class */ (function () { function ElementDragging(el, selector) { this.emitter = new Emitter(); } ElementDragging.prototype.destroy = function () { }; ElementDragging.prototype.setMirrorIsVisible = function (bool) { // optional if subclass doesn't want to support a mirror }; ElementDragging.prototype.setMirrorNeedsRevert = function (bool) { // optional if subclass doesn't want to support a mirror }; ElementDragging.prototype.setAutoScrollEnabled = function (bool) { // optional }; return ElementDragging; }()); // TODO: get rid of this in favor of options system, // tho it's really easy to access this globally rather than pass thru options. var config = {}; /* Information about what will happen when an external element is dragged-and-dropped onto a calendar. Contains information for creating an event. */ var DRAG_META_REFINERS = { startTime: createDuration, duration: createDuration, create: Boolean, sourceId: String, }; function parseDragMeta(raw) { var _a = refineProps(raw, DRAG_META_REFINERS), refined = _a.refined, extra = _a.extra; return { startTime: refined.startTime || null, duration: refined.duration || null, create: refined.create != null ? refined.create : true, sourceId: refined.sourceId, leftoverProps: extra, }; } var main_ToolbarSection = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(ToolbarSection, _super); function ToolbarSection() { return _super !== null && _super.apply(this, arguments) || this; } ToolbarSection.prototype.render = function () { var _this = this; var children = this.props.widgetGroups.map(function (widgetGroup) { return _this.renderWidgetGroup(widgetGroup); }); return createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['div', { className: 'fc-toolbar-chunk' }], children)); }; ToolbarSection.prototype.renderWidgetGroup = function (widgetGroup) { var props = this.props; var theme = this.context.theme; var children = []; var isOnlyButtons = true; for (var _i = 0, widgetGroup_1 = widgetGroup; _i < widgetGroup_1.length; _i++) { var widget = widgetGroup_1[_i]; var buttonName = widget.buttonName, buttonClick = widget.buttonClick, buttonText = widget.buttonText, buttonIcon = widget.buttonIcon, buttonHint = widget.buttonHint; if (buttonName === 'title') { isOnlyButtons = false; children.push(createElement("h2", { className: "fc-toolbar-title", id: props.titleId }, props.title)); } else { var isPressed = buttonName === props.activeButton; var isDisabled = (!props.isTodayEnabled && buttonName === 'today') || (!props.isPrevEnabled && buttonName === 'prev') || (!props.isNextEnabled && buttonName === 'next'); var buttonClasses = ["fc-" + buttonName + "-button", theme.getClass('button')]; if (isPressed) { buttonClasses.push(theme.getClass('buttonActive')); } children.push(createElement("button", { type: "button", title: typeof buttonHint === 'function' ? buttonHint(props.navUnit) : buttonHint, disabled: isDisabled, "aria-pressed": isPressed, className: buttonClasses.join(' '), onClick: buttonClick }, buttonText || (buttonIcon ? createElement("span", { className: buttonIcon }) : ''))); } } if (children.length > 1) { var groupClassName = (isOnlyButtons && theme.getClass('buttonGroup')) || ''; return createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['div', { className: groupClassName }], children)); } return children[0]; }; return ToolbarSection; }(main_BaseComponent)); var main_Toolbar = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(Toolbar, _super); function Toolbar() { return _super !== null && _super.apply(this, arguments) || this; } Toolbar.prototype.render = function () { var _a = this.props, model = _a.model, extraClassName = _a.extraClassName; var forceLtr = false; var startContent; var endContent; var sectionWidgets = model.sectionWidgets; var centerContent = sectionWidgets.center; if (sectionWidgets.left) { forceLtr = true; startContent = sectionWidgets.left; } else { startContent = sectionWidgets.start; } if (sectionWidgets.right) { forceLtr = true; endContent = sectionWidgets.right; } else { endContent = sectionWidgets.end; } var classNames = [ extraClassName || '', 'fc-toolbar', forceLtr ? 'fc-toolbar-ltr' : '', ]; return (createElement("div", { className: classNames.join(' ') }, this.renderSection('start', startContent || []), this.renderSection('center', centerContent || []), this.renderSection('end', endContent || []))); }; Toolbar.prototype.renderSection = function (key, widgetGroups) { var props = this.props; return (createElement(main_ToolbarSection, { key: key, widgetGroups: widgetGroups, title: props.title, navUnit: props.navUnit, activeButton: props.activeButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled, titleId: props.titleId })); }; return Toolbar; }(main_BaseComponent)); // TODO: do function component? var main_ViewContainer = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(ViewContainer, _super); function ViewContainer() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { availableWidth: null, }; _this.handleEl = function (el) { _this.el = el; setRef(_this.props.elRef, el); _this.updateAvailableWidth(); }; _this.handleResize = function () { _this.updateAvailableWidth(); }; return _this; } ViewContainer.prototype.render = function () { var _a = this, props = _a.props, state = _a.state; var aspectRatio = props.aspectRatio; var classNames = [ 'fc-view-harness', (aspectRatio || props.liquid || props.height) ? 'fc-view-harness-active' // harness controls the height : 'fc-view-harness-passive', // let the view do the height ]; var height = ''; var paddingBottom = ''; if (aspectRatio) { if (state.availableWidth !== null) { height = state.availableWidth / aspectRatio; } else { // while waiting to know availableWidth, we can't set height to *zero* // because will cause lots of unnecessary scrollbars within scrollgrid. // BETTER: don't start rendering ANYTHING yet until we know container width // NOTE: why not always use paddingBottom? Causes height oscillation (issue 5606) paddingBottom = (1 / aspectRatio) * 100 + "%"; } } else { height = props.height || ''; } return (createElement("div", { "aria-labelledby": props.labeledById, ref: this.handleEl, className: classNames.join(' '), style: { height: height, paddingBottom: paddingBottom } }, props.children)); }; ViewContainer.prototype.componentDidMount = function () { this.context.addResizeHandler(this.handleResize); }; ViewContainer.prototype.componentWillUnmount = function () { this.context.removeResizeHandler(this.handleResize); }; ViewContainer.prototype.updateAvailableWidth = function () { if (this.el && // needed. but why? this.props.aspectRatio // aspectRatio is the only height setting that needs availableWidth ) { this.setState({ availableWidth: this.el.offsetWidth }); } }; return ViewContainer; }(main_BaseComponent)); /* Detects when the user clicks on an event within a DateComponent */ var main_EventClicking = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(EventClicking, _super); function EventClicking(settings) { var _this = _super.call(this, settings) || this; _this.handleSegClick = function (ev, segEl) { var component = _this.component; var context = component.context; var seg = getElSeg(segEl); if (seg && // might be the
surrounding the more link component.isValidSegDownEl(ev.target)) { // our way to simulate a link click for elements that can't be tags // grab before trigger fired in case trigger trashes DOM thru rerendering var hasUrlContainer = elementClosest(ev.target, '.fc-event-forced-url'); var url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : ''; context.emitter.trigger('eventClick', { el: segEl, event: new main_EventApi(component.context, seg.eventRange.def, seg.eventRange.instance), jsEvent: ev, view: context.viewApi, }); if (url && !ev.defaultPrevented) { window.location.href = url; } } }; _this.destroy = listenBySelector(settings.el, 'click', '.fc-event', // on both fg and bg events _this.handleSegClick); return _this; } return EventClicking; }(Interaction)); /* Triggers events and adds/removes core classNames when the user's pointer enters/leaves event-elements of a component. */ var main_EventHovering = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(EventHovering, _super); function EventHovering(settings) { var _this = _super.call(this, settings) || this; // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it _this.handleEventElRemove = function (el) { if (el === _this.currentSegEl) { _this.handleSegLeave(null, _this.currentSegEl); } }; _this.handleSegEnter = function (ev, segEl) { if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper _this.currentSegEl = segEl; _this.triggerEvent('eventMouseEnter', ev, segEl); } }; _this.handleSegLeave = function (ev, segEl) { if (_this.currentSegEl) { _this.currentSegEl = null; _this.triggerEvent('eventMouseLeave', ev, segEl); } }; _this.removeHoverListeners = listenToHoverBySelector(settings.el, '.fc-event', // on both fg and bg events _this.handleSegEnter, _this.handleSegLeave); return _this; } EventHovering.prototype.destroy = function () { this.removeHoverListeners(); }; EventHovering.prototype.triggerEvent = function (publicEvName, ev, segEl) { var component = this.component; var context = component.context; var seg = getElSeg(segEl); if (!ev || component.isValidSegDownEl(ev.target)) { context.emitter.trigger(publicEvName, { el: segEl, event: new main_EventApi(context, seg.eventRange.def, seg.eventRange.instance), jsEvent: ev, view: context.viewApi, }); } }; return EventHovering; }(Interaction)); var main_CalendarContent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(CalendarContent, _super); function CalendarContent() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.buildViewContext = memoize(buildViewContext); _this.buildViewPropTransformers = memoize(buildViewPropTransformers); _this.buildToolbarProps = memoize(buildToolbarProps); _this.headerRef = createRef(); _this.footerRef = createRef(); _this.interactionsStore = {}; // eslint-disable-next-line _this.state = { viewLabelId: getUniqueDomId(), }; // Component Registration // ----------------------------------------------------------------------------------------------------------------- _this.registerInteractiveComponent = function (component, settingsInput) { var settings = parseInteractionSettings(component, settingsInput); var DEFAULT_INTERACTIONS = [ main_EventClicking, main_EventHovering, ]; var interactionClasses = DEFAULT_INTERACTIONS.concat(_this.props.pluginHooks.componentInteractions); var interactions = interactionClasses.map(function (TheInteractionClass) { return new TheInteractionClass(settings); }); _this.interactionsStore[component.uid] = interactions; interactionSettingsStore[component.uid] = settings; }; _this.unregisterInteractiveComponent = function (component) { for (var _i = 0, _a = _this.interactionsStore[component.uid]; _i < _a.length; _i++) { var listener = _a[_i]; listener.destroy(); } delete _this.interactionsStore[component.uid]; delete interactionSettingsStore[component.uid]; }; // Resizing // ----------------------------------------------------------------------------------------------------------------- _this.resizeRunner = new DelayedRunner(function () { _this.props.emitter.trigger('_resize', true); // should window resizes be considered "forced" ? _this.props.emitter.trigger('windowResize', { view: _this.props.viewApi }); }); _this.handleWindowResize = function (ev) { var options = _this.props.options; if (options.handleWindowResize && ev.target === window // avoid jqui events ) { _this.resizeRunner.request(options.windowResizeDelay); } }; return _this; } /* renders INSIDE of an outer div */ CalendarContent.prototype.render = function () { var props = this.props; var toolbarConfig = props.toolbarConfig, options = props.options; var toolbarProps = this.buildToolbarProps(props.viewSpec, props.dateProfile, props.dateProfileGenerator, props.currentDate, getNow(props.options.now, props.dateEnv), // TODO: use NowTimer???? props.viewTitle); var viewVGrow = false; var viewHeight = ''; var viewAspectRatio; if (props.isHeightAuto || props.forPrint) { viewHeight = ''; } else if (options.height != null) { viewVGrow = true; } else if (options.contentHeight != null) { viewHeight = options.contentHeight; } else { viewAspectRatio = Math.max(options.aspectRatio, 0.5); // prevent from getting too tall } var viewContext = this.buildViewContext(props.viewSpec, props.viewApi, props.options, props.dateProfileGenerator, props.dateEnv, props.theme, props.pluginHooks, props.dispatch, props.getCurrentData, props.emitter, props.calendarApi, this.registerInteractiveComponent, this.unregisterInteractiveComponent); var viewLabelId = (toolbarConfig.header && toolbarConfig.header.hasTitle) ? this.state.viewLabelId : ''; return (createElement(ViewContextType.Provider, { value: viewContext }, toolbarConfig.header && (createElement(main_Toolbar, Object(tslib_es6["a" /* __assign */])({ ref: this.headerRef, extraClassName: "fc-header-toolbar", model: toolbarConfig.header, titleId: viewLabelId }, toolbarProps))), createElement(main_ViewContainer, { liquid: viewVGrow, height: viewHeight, aspectRatio: viewAspectRatio, labeledById: viewLabelId }, this.renderView(props), this.buildAppendContent()), toolbarConfig.footer && (createElement(main_Toolbar, Object(tslib_es6["a" /* __assign */])({ ref: this.footerRef, extraClassName: "fc-footer-toolbar", model: toolbarConfig.footer, titleId: "" }, toolbarProps))))); }; CalendarContent.prototype.componentDidMount = function () { var props = this.props; this.calendarInteractions = props.pluginHooks.calendarInteractions .map(function (CalendarInteractionClass) { return new CalendarInteractionClass(props); }); window.addEventListener('resize', this.handleWindowResize); var propSetHandlers = props.pluginHooks.propSetHandlers; for (var propName in propSetHandlers) { propSetHandlers[propName](props[propName], props); } }; CalendarContent.prototype.componentDidUpdate = function (prevProps) { var props = this.props; var propSetHandlers = props.pluginHooks.propSetHandlers; for (var propName in propSetHandlers) { if (props[propName] !== prevProps[propName]) { propSetHandlers[propName](props[propName], props); } } }; CalendarContent.prototype.componentWillUnmount = function () { window.removeEventListener('resize', this.handleWindowResize); this.resizeRunner.clear(); for (var _i = 0, _a = this.calendarInteractions; _i < _a.length; _i++) { var interaction = _a[_i]; interaction.destroy(); } this.props.emitter.trigger('_unmount'); }; CalendarContent.prototype.buildAppendContent = function () { var props = this.props; var children = props.pluginHooks.viewContainerAppends.map(function (buildAppendContent) { return buildAppendContent(props); }); return createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])([Fragment, {}], children)); }; CalendarContent.prototype.renderView = function (props) { var pluginHooks = props.pluginHooks; var viewSpec = props.viewSpec; var viewProps = { dateProfile: props.dateProfile, businessHours: props.businessHours, eventStore: props.renderableEventStore, eventUiBases: props.eventUiBases, dateSelection: props.dateSelection, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, isHeightAuto: props.isHeightAuto, forPrint: props.forPrint, }; var transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers); for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) { var transformer = transformers_1[_i]; Object(tslib_es6["a" /* __assign */])(viewProps, transformer.transform(viewProps, props)); } var ViewComponent = viewSpec.component; return (createElement(ViewComponent, Object(tslib_es6["a" /* __assign */])({}, viewProps))); }; return CalendarContent; }(main_PureComponent)); function buildToolbarProps(viewSpec, dateProfile, dateProfileGenerator, currentDate, now, title) { // don't force any date-profiles to valid date profiles (the `false`) so that we can tell if it's invalid var todayInfo = dateProfileGenerator.build(now, undefined, false); // TODO: need `undefined` or else INFINITE LOOP for some reason var prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate, false); var nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate, false); return { title: title, activeButton: viewSpec.type, navUnit: viewSpec.singleUnit, isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now), isPrevEnabled: prevInfo.isValid, isNextEnabled: nextInfo.isValid, }; } // Plugin // ----------------------------------------------------------------------------------------------------------------- function buildViewPropTransformers(theClasses) { return theClasses.map(function (TheClass) { return new TheClass(); }); } var main_CalendarRoot = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(CalendarRoot, _super); function CalendarRoot() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { forPrint: false, }; _this.handleBeforePrint = function () { _this.setState({ forPrint: true }); }; _this.handleAfterPrint = function () { _this.setState({ forPrint: false }); }; return _this; } CalendarRoot.prototype.render = function () { var props = this.props; var options = props.options; var forPrint = this.state.forPrint; var isHeightAuto = forPrint || options.height === 'auto' || options.contentHeight === 'auto'; var height = (!isHeightAuto && options.height != null) ? options.height : ''; var classNames = [ 'fc', forPrint ? 'fc-media-print' : 'fc-media-screen', "fc-direction-" + options.direction, props.theme.getClass('root'), ]; if (!getCanVGrowWithinCell()) { classNames.push('fc-liquid-hack'); } return props.children(classNames, height, isHeightAuto, forPrint); }; CalendarRoot.prototype.componentDidMount = function () { var emitter = this.props.emitter; emitter.on('_beforeprint', this.handleBeforePrint); emitter.on('_afterprint', this.handleAfterPrint); }; CalendarRoot.prototype.componentWillUnmount = function () { var emitter = this.props.emitter; emitter.off('_beforeprint', this.handleBeforePrint); emitter.off('_afterprint', this.handleAfterPrint); }; return CalendarRoot; }(main_BaseComponent)); // Computes a default column header formatting string if `colFormat` is not explicitly defined function computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt) { // if more than one week row, or if there are a lot of columns with not much space, // put just the day numbers will be in each cell if (!datesRepDistinctDays || dayCnt > 10) { return createFormatter({ weekday: 'short' }); // "Sat" } if (dayCnt > 1) { return createFormatter({ weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }); // "Sat 11/12" } return createFormatter({ weekday: 'long' }); // "Saturday" } var CLASS_NAME = 'fc-col-header-cell'; // do the cushion too? no function renderInner$1(hookProps) { return hookProps.text; } var main_TableDateCell = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(TableDateCell, _super); function TableDateCell() { return _super !== null && _super.apply(this, arguments) || this; } TableDateCell.prototype.render = function () { var _a = this.context, dateEnv = _a.dateEnv, options = _a.options, theme = _a.theme, viewApi = _a.viewApi; var props = this.props; var date = props.date, dateProfile = props.dateProfile; var dayMeta = getDateMeta(date, props.todayRange, null, dateProfile); var classNames = [CLASS_NAME].concat(getDayClassNames(dayMeta, theme)); var text = dateEnv.format(date, props.dayHeaderFormat); // if colCnt is 1, we are already in a day-view and don't need a navlink var navLinkAttrs = (!dayMeta.isDisabled && props.colCnt > 1) ? buildNavLinkAttrs(this.context, date) : {}; var hookProps = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({ date: dateEnv.toDate(date), view: viewApi }, props.extraHookProps), { text: text }), dayMeta); return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInner$1, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("th", Object(tslib_es6["a" /* __assign */])({ ref: rootElRef, role: "columnheader", className: classNames.concat(customClassNames).join(' '), "data-date": !dayMeta.isDisabled ? formatDayString(date) : undefined, colSpan: props.colSpan }, props.extraDataAttrs), createElement("div", { className: "fc-scrollgrid-sync-inner" }, !dayMeta.isDisabled && (createElement("a", Object(tslib_es6["a" /* __assign */])({ ref: innerElRef, className: [ 'fc-col-header-cell-cushion', props.isSticky ? 'fc-sticky' : '', ].join(' ') }, navLinkAttrs), innerContent))))); })); }; return TableDateCell; }(main_BaseComponent)); var WEEKDAY_FORMAT = createFormatter({ weekday: 'long' }); var main_TableDowCell = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(TableDowCell, _super); function TableDowCell() { return _super !== null && _super.apply(this, arguments) || this; } TableDowCell.prototype.render = function () { var props = this.props; var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, viewApi = _a.viewApi, options = _a.options; var date = addDays(new Date(259200000), props.dow); // start with Sun, 04 Jan 1970 00:00:00 GMT var dateMeta = { dow: props.dow, isDisabled: false, isFuture: false, isPast: false, isToday: false, isOther: false, }; var classNames = [CLASS_NAME].concat(getDayClassNames(dateMeta, theme), props.extraClassNames || []); var text = dateEnv.format(date, props.dayHeaderFormat); var hookProps = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({ // TODO: make this public? date: date }, dateMeta), { view: viewApi }), props.extraHookProps), { text: text }); return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInner$1, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("th", Object(tslib_es6["a" /* __assign */])({ ref: rootElRef, role: "columnheader", className: classNames.concat(customClassNames).join(' '), colSpan: props.colSpan }, props.extraDataAttrs), createElement("div", { className: "fc-scrollgrid-sync-inner" }, createElement("a", { "aria-label": dateEnv.format(date, WEEKDAY_FORMAT), className: [ 'fc-col-header-cell-cushion', props.isSticky ? 'fc-sticky' : '', ].join(' '), ref: innerElRef }, innerContent)))); })); }; return TableDowCell; }(main_BaseComponent)); var main_NowTimer = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(NowTimer, _super); function NowTimer(props, context) { var _this = _super.call(this, props, context) || this; _this.initialNowDate = getNow(context.options.now, context.dateEnv); _this.initialNowQueriedMs = new Date().valueOf(); _this.state = _this.computeTiming().currentState; return _this; } NowTimer.prototype.render = function () { var _a = this, props = _a.props, state = _a.state; return props.children(state.nowDate, state.todayRange); }; NowTimer.prototype.componentDidMount = function () { this.setTimeout(); }; NowTimer.prototype.componentDidUpdate = function (prevProps) { if (prevProps.unit !== this.props.unit) { this.clearTimeout(); this.setTimeout(); } }; NowTimer.prototype.componentWillUnmount = function () { this.clearTimeout(); }; NowTimer.prototype.computeTiming = function () { var _a = this, props = _a.props, context = _a.context; var unroundedNow = addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs); var currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit); var nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit)); var waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf(); // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342) // ensure no longer than a day waitMs = Math.min(1000 * 60 * 60 * 24, waitMs); return { currentState: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) }, nextState: { nowDate: nextUnitStart, todayRange: buildDayRange(nextUnitStart) }, waitMs: waitMs, }; }; NowTimer.prototype.setTimeout = function () { var _this = this; var _a = this.computeTiming(), nextState = _a.nextState, waitMs = _a.waitMs; this.timeoutId = setTimeout(function () { _this.setState(nextState, function () { _this.setTimeout(); }); }, waitMs); }; NowTimer.prototype.clearTimeout = function () { if (this.timeoutId) { clearTimeout(this.timeoutId); } }; NowTimer.contextType = ViewContextType; return NowTimer; }(Component)); function buildDayRange(date) { var start = startOfDay(date); var end = addDays(start, 1); return { start: start, end: end }; } var main_DayHeader = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(DayHeader, _super); function DayHeader() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.createDayHeaderFormatter = memoize(createDayHeaderFormatter); return _this; } DayHeader.prototype.render = function () { var context = this.context; var _a = this.props, dates = _a.dates, dateProfile = _a.dateProfile, datesRepDistinctDays = _a.datesRepDistinctDays, renderIntro = _a.renderIntro; var dayHeaderFormat = this.createDayHeaderFormatter(context.options.dayHeaderFormat, datesRepDistinctDays, dates.length); return (createElement(main_NowTimer, { unit: "day" }, function (nowDate, todayRange) { return (createElement("tr", { role: "row" }, renderIntro && renderIntro('day'), dates.map(function (date) { return (datesRepDistinctDays ? (createElement(main_TableDateCell, { key: date.toISOString(), date: date, dateProfile: dateProfile, todayRange: todayRange, colCnt: dates.length, dayHeaderFormat: dayHeaderFormat })) : (createElement(main_TableDowCell, { key: date.getUTCDay(), dow: date.getUTCDay(), dayHeaderFormat: dayHeaderFormat }))); }))); })); }; return DayHeader; }(main_BaseComponent)); function createDayHeaderFormatter(explicitFormat, datesRepDistinctDays, dateCnt) { return explicitFormat || computeFallbackHeaderFormat(datesRepDistinctDays, dateCnt); } var DaySeriesModel = /** @class */ (function () { function DaySeriesModel(range, dateProfileGenerator) { var date = range.start; var end = range.end; var indices = []; var dates = []; var dayIndex = -1; while (date < end) { // loop each day from start to end if (dateProfileGenerator.isHiddenDay(date)) { indices.push(dayIndex + 0.5); // mark that it's between indices } else { dayIndex += 1; indices.push(dayIndex); dates.push(date); } date = addDays(date, 1); } this.dates = dates; this.indices = indices; this.cnt = dates.length; } DaySeriesModel.prototype.sliceRange = function (range) { var firstIndex = this.getDateDayIndex(range.start); // inclusive first index var lastIndex = this.getDateDayIndex(addDays(range.end, -1)); // inclusive last index var clippedFirstIndex = Math.max(0, firstIndex); var clippedLastIndex = Math.min(this.cnt - 1, lastIndex); // deal with in-between indices clippedFirstIndex = Math.ceil(clippedFirstIndex); // in-between starts round to next cell clippedLastIndex = Math.floor(clippedLastIndex); // in-between ends round to prev cell if (clippedFirstIndex <= clippedLastIndex) { return { firstIndex: clippedFirstIndex, lastIndex: clippedLastIndex, isStart: firstIndex === clippedFirstIndex, isEnd: lastIndex === clippedLastIndex, }; } return null; }; // Given a date, returns its chronolocial cell-index from the first cell of the grid. // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets. // If before the first offset, returns a negative number. // If after the last offset, returns an offset past the last cell offset. // Only works for *start* dates of cells. Will not work for exclusive end dates for cells. DaySeriesModel.prototype.getDateDayIndex = function (date) { var indices = this.indices; var dayOffset = Math.floor(diffDays(this.dates[0], date)); if (dayOffset < 0) { return indices[0] - 1; } if (dayOffset >= indices.length) { return indices[indices.length - 1] + 1; } return indices[dayOffset]; }; return DaySeriesModel; }()); var DayTableModel = /** @class */ (function () { function DayTableModel(daySeries, breakOnWeeks) { var dates = daySeries.dates; var daysPerRow; var firstDay; var rowCnt; if (breakOnWeeks) { // count columns until the day-of-week repeats firstDay = dates[0].getUTCDay(); for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow += 1) { if (dates[daysPerRow].getUTCDay() === firstDay) { break; } } rowCnt = Math.ceil(dates.length / daysPerRow); } else { rowCnt = 1; daysPerRow = dates.length; } this.rowCnt = rowCnt; this.colCnt = daysPerRow; this.daySeries = daySeries; this.cells = this.buildCells(); this.headerDates = this.buildHeaderDates(); } DayTableModel.prototype.buildCells = function () { var rows = []; for (var row = 0; row < this.rowCnt; row += 1) { var cells = []; for (var col = 0; col < this.colCnt; col += 1) { cells.push(this.buildCell(row, col)); } rows.push(cells); } return rows; }; DayTableModel.prototype.buildCell = function (row, col) { var date = this.daySeries.dates[row * this.colCnt + col]; return { key: date.toISOString(), date: date, }; }; DayTableModel.prototype.buildHeaderDates = function () { var dates = []; for (var col = 0; col < this.colCnt; col += 1) { dates.push(this.cells[0][col].date); } return dates; }; DayTableModel.prototype.sliceRange = function (range) { var colCnt = this.colCnt; var seriesSeg = this.daySeries.sliceRange(range); var segs = []; if (seriesSeg) { var firstIndex = seriesSeg.firstIndex, lastIndex = seriesSeg.lastIndex; var index = firstIndex; while (index <= lastIndex) { var row = Math.floor(index / colCnt); var nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1); segs.push({ row: row, firstCol: index % colCnt, lastCol: (nextIndex - 1) % colCnt, isStart: seriesSeg.isStart && index === firstIndex, isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex, }); index = nextIndex; } } return segs; }; return DayTableModel; }()); var main_Slicer = /** @class */ (function () { function Slicer() { this.sliceBusinessHours = memoize(this._sliceBusinessHours); this.sliceDateSelection = memoize(this._sliceDateSpan); this.sliceEventStore = memoize(this._sliceEventStore); this.sliceEventDrag = memoize(this._sliceInteraction); this.sliceEventResize = memoize(this._sliceInteraction); this.forceDayIfListItem = false; // hack } Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, context) { var extraArgs = []; for (var _i = 4; _i < arguments.length; _i++) { extraArgs[_i - 4] = arguments[_i]; } var eventUiBases = props.eventUiBases; var eventSegs = this.sliceEventStore.apply(this, Object(tslib_es6["c" /* __spreadArray */])([props.eventStore, eventUiBases, dateProfile, nextDayThreshold], extraArgs)); return { dateSelectionSegs: this.sliceDateSelection.apply(this, Object(tslib_es6["c" /* __spreadArray */])([props.dateSelection, eventUiBases, context], extraArgs)), businessHourSegs: this.sliceBusinessHours.apply(this, Object(tslib_es6["c" /* __spreadArray */])([props.businessHours, dateProfile, nextDayThreshold, context], extraArgs)), fgEventSegs: eventSegs.fg, bgEventSegs: eventSegs.bg, eventDrag: this.sliceEventDrag.apply(this, Object(tslib_es6["c" /* __spreadArray */])([props.eventDrag, eventUiBases, dateProfile, nextDayThreshold], extraArgs)), eventResize: this.sliceEventResize.apply(this, Object(tslib_es6["c" /* __spreadArray */])([props.eventResize, eventUiBases, dateProfile, nextDayThreshold], extraArgs)), eventSelection: props.eventSelection, }; // TODO: give interactionSegs? }; Slicer.prototype.sliceNowDate = function (// does not memoize date, context) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } return this._sliceDateSpan.apply(this, Object(tslib_es6["c" /* __spreadArray */])([{ range: { start: date, end: addMs(date, 1) }, allDay: false }, {}, context], extraArgs)); }; Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, context) { var extraArgs = []; for (var _i = 4; _i < arguments.length; _i++) { extraArgs[_i - 4] = arguments[_i]; } if (!businessHours) { return []; } return this._sliceEventStore.apply(this, Object(tslib_es6["c" /* __spreadArray */])([expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), context), {}, dateProfile, nextDayThreshold], extraArgs)).bg; }; Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold) { var extraArgs = []; for (var _i = 4; _i < arguments.length; _i++) { extraArgs[_i - 4] = arguments[_i]; } if (eventStore) { var rangeRes = sliceEventStore(eventStore, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold); return { bg: this.sliceEventRanges(rangeRes.bg, extraArgs), fg: this.sliceEventRanges(rangeRes.fg, extraArgs), }; } return { bg: [], fg: [] }; }; Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold) { var extraArgs = []; for (var _i = 4; _i < arguments.length; _i++) { extraArgs[_i - 4] = arguments[_i]; } if (!interaction) { return null; } var rangeRes = sliceEventStore(interaction.mutatedEvents, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold); return { segs: this.sliceEventRanges(rangeRes.fg, extraArgs), affectedInstances: interaction.affectedEvents.instances, isEvent: interaction.isEvent, }; }; Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, context) { var extraArgs = []; for (var _i = 3; _i < arguments.length; _i++) { extraArgs[_i - 3] = arguments[_i]; } if (!dateSpan) { return []; } var eventRange = fabricateEventRange(dateSpan, eventUiBases, context); var segs = this.sliceRange.apply(this, Object(tslib_es6["c" /* __spreadArray */])([dateSpan.range], extraArgs)); for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) { var seg = segs_1[_a]; seg.eventRange = eventRange; } return segs; }; /* "complete" seg means it has component and eventRange */ Slicer.prototype.sliceEventRanges = function (eventRanges, extraArgs) { var segs = []; for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) { var eventRange = eventRanges_1[_i]; segs.push.apply(segs, this.sliceEventRange(eventRange, extraArgs)); } return segs; }; /* "complete" seg means it has component and eventRange */ Slicer.prototype.sliceEventRange = function (eventRange, extraArgs) { var dateRange = eventRange.range; // hack to make multi-day events that are being force-displayed as list-items to take up only one day if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') { dateRange = { start: dateRange.start, end: addDays(dateRange.start, 1), }; } var segs = this.sliceRange.apply(this, Object(tslib_es6["c" /* __spreadArray */])([dateRange], extraArgs)); for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) { var seg = segs_2[_i]; seg.eventRange = eventRange; seg.isStart = eventRange.isStart && seg.isStart; seg.isEnd = eventRange.isEnd && seg.isEnd; } return segs; }; return Slicer; }()); /* for incorporating slotMinTime/slotMaxTime if appropriate TODO: should be part of DateProfile! TimelineDateProfile already does this btw */ function computeActiveRange(dateProfile, isComponentAllDay) { var range = dateProfile.activeRange; if (isComponentAllDay) { return range; } return { start: addMs(range.start, dateProfile.slotMinTime.milliseconds), end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5), // 864e5 = ms in a day }; } // high-level segmenting-aware tester functions // ------------------------------------------------------------------------------------------------------------------------ function isInteractionValid(interaction, dateProfile, context) { var instances = interaction.mutatedEvents.instances; for (var instanceId in instances) { if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) { return false; } } return isNewPropsValid({ eventDrag: interaction }, context); // HACK: the eventDrag props is used for ALL interactions } function isDateSelectionValid(dateSelection, dateProfile, context) { if (!rangeContainsRange(dateProfile.validRange, dateSelection.range)) { return false; } return isNewPropsValid({ dateSelection: dateSelection }, context); } function isNewPropsValid(newProps, context) { var calendarState = context.getCurrentData(); var props = Object(tslib_es6["a" /* __assign */])({ businessHours: calendarState.businessHours, dateSelection: '', eventStore: calendarState.eventStore, eventUiBases: calendarState.eventUiBases, eventSelection: '', eventDrag: null, eventResize: null }, newProps); return (context.pluginHooks.isPropsValid || isPropsValid)(props, context); } function isPropsValid(state, context, dateSpanMeta, filterConfig) { if (dateSpanMeta === void 0) { dateSpanMeta = {}; } if (state.eventDrag && !isInteractionPropsValid(state, context, dateSpanMeta, filterConfig)) { return false; } if (state.dateSelection && !isDateSelectionPropsValid(state, context, dateSpanMeta, filterConfig)) { return false; } return true; } // Moving Event Validation // ------------------------------------------------------------------------------------------------------------------------ function isInteractionPropsValid(state, context, dateSpanMeta, filterConfig) { var currentState = context.getCurrentData(); var interaction = state.eventDrag; // HACK: the eventDrag props is used for ALL interactions var subjectEventStore = interaction.mutatedEvents; var subjectDefs = subjectEventStore.defs; var subjectInstances = subjectEventStore.instances; var subjectConfigs = compileEventUis(subjectDefs, interaction.isEvent ? state.eventUiBases : { '': currentState.selectionConfig }); if (filterConfig) { subjectConfigs = mapHash(subjectConfigs, filterConfig); } // exclude the subject events. TODO: exclude defs too? var otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances); var otherDefs = otherEventStore.defs; var otherInstances = otherEventStore.instances; var otherConfigs = compileEventUis(otherDefs, state.eventUiBases); for (var subjectInstanceId in subjectInstances) { var subjectInstance = subjectInstances[subjectInstanceId]; var subjectRange = subjectInstance.range; var subjectConfig = subjectConfigs[subjectInstance.defId]; var subjectDef = subjectDefs[subjectInstance.defId]; // constraint if (!allConstraintsPass(subjectConfig.constraints, subjectRange, otherEventStore, state.businessHours, context)) { return false; } // overlap var eventOverlap = context.options.eventOverlap; var eventOverlapFunc = typeof eventOverlap === 'function' ? eventOverlap : null; for (var otherInstanceId in otherInstances) { var otherInstance = otherInstances[otherInstanceId]; // intersect! evaluate if (rangesIntersect(subjectRange, otherInstance.range)) { var otherOverlap = otherConfigs[otherInstance.defId].overlap; // consider the other event's overlap. only do this if the subject event is a "real" event if (otherOverlap === false && interaction.isEvent) { return false; } if (subjectConfig.overlap === false) { return false; } if (eventOverlapFunc && !eventOverlapFunc(new main_EventApi(context, otherDefs[otherInstance.defId], otherInstance), // still event new main_EventApi(context, subjectDef, subjectInstance))) { return false; } } } // allow (a function) var calendarEventStore = currentState.eventStore; // need global-to-calendar, not local to component (splittable)state for (var _i = 0, _a = subjectConfig.allows; _i < _a.length; _i++) { var subjectAllow = _a[_i]; var subjectDateSpan = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, dateSpanMeta), { range: subjectInstance.range, allDay: subjectDef.allDay }); var origDef = calendarEventStore.defs[subjectDef.defId]; var origInstance = calendarEventStore.instances[subjectInstanceId]; var eventApi = void 0; if (origDef) { // was previously in the calendar eventApi = new main_EventApi(context, origDef, origInstance); } else { // was an external event eventApi = new main_EventApi(context, subjectDef); // no instance, because had no dates } if (!subjectAllow(buildDateSpanApiWithContext(subjectDateSpan, context), eventApi)) { return false; } } } return true; } // Date Selection Validation // ------------------------------------------------------------------------------------------------------------------------ function isDateSelectionPropsValid(state, context, dateSpanMeta, filterConfig) { var relevantEventStore = state.eventStore; var relevantDefs = relevantEventStore.defs; var relevantInstances = relevantEventStore.instances; var selection = state.dateSelection; var selectionRange = selection.range; var selectionConfig = context.getCurrentData().selectionConfig; if (filterConfig) { selectionConfig = filterConfig(selectionConfig); } // constraint if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, context)) { return false; } // overlap var selectOverlap = context.options.selectOverlap; var selectOverlapFunc = typeof selectOverlap === 'function' ? selectOverlap : null; for (var relevantInstanceId in relevantInstances) { var relevantInstance = relevantInstances[relevantInstanceId]; // intersect! evaluate if (rangesIntersect(selectionRange, relevantInstance.range)) { if (selectionConfig.overlap === false) { return false; } if (selectOverlapFunc && !selectOverlapFunc(new main_EventApi(context, relevantDefs[relevantInstance.defId], relevantInstance), null)) { return false; } } } // allow (a function) for (var _i = 0, _a = selectionConfig.allows; _i < _a.length; _i++) { var selectionAllow = _a[_i]; var fullDateSpan = Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({}, dateSpanMeta), selection); if (!selectionAllow(buildDateSpanApiWithContext(fullDateSpan, context), null)) { return false; } } return true; } // Constraint Utils // ------------------------------------------------------------------------------------------------------------------------ function allConstraintsPass(constraints, subjectRange, otherEventStore, businessHoursUnexpanded, context) { for (var _i = 0, constraints_1 = constraints; _i < constraints_1.length; _i++) { var constraint = constraints_1[_i]; if (!anyRangesContainRange(constraintToRanges(constraint, subjectRange, otherEventStore, businessHoursUnexpanded, context), subjectRange)) { return false; } } return true; } function constraintToRanges(constraint, subjectRange, // for expanding a recurring constraint, or expanding business hours otherEventStore, // for if constraint is an even group ID businessHoursUnexpanded, // for if constraint is 'businessHours' context) { if (constraint === 'businessHours') { return eventStoreToRanges(expandRecurring(businessHoursUnexpanded, subjectRange, context)); } if (typeof constraint === 'string') { // an group ID return eventStoreToRanges(filterEventStoreDefs(otherEventStore, function (eventDef) { return eventDef.groupId === constraint; })); } if (typeof constraint === 'object' && constraint) { // non-null object return eventStoreToRanges(expandRecurring(constraint, subjectRange, context)); } return []; // if it's false } // TODO: move to event-store file? function eventStoreToRanges(eventStore) { var instances = eventStore.instances; var ranges = []; for (var instanceId in instances) { ranges.push(instances[instanceId].range); } return ranges; } // TODO: move to geom file? function anyRangesContainRange(outerRanges, innerRange) { for (var _i = 0, outerRanges_1 = outerRanges; _i < outerRanges_1.length; _i++) { var outerRange = outerRanges_1[_i]; if (rangeContainsRange(outerRange, innerRange)) { return true; } } return false; } var VISIBLE_HIDDEN_RE = /^(visible|hidden)$/; var main_Scroller = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(Scroller, _super); function Scroller() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.handleEl = function (el) { _this.el = el; setRef(_this.props.elRef, el); }; return _this; } Scroller.prototype.render = function () { var props = this.props; var liquid = props.liquid, liquidIsAbsolute = props.liquidIsAbsolute; var isAbsolute = liquid && liquidIsAbsolute; var className = ['fc-scroller']; if (liquid) { if (liquidIsAbsolute) { className.push('fc-scroller-liquid-absolute'); } else { className.push('fc-scroller-liquid'); } } return (createElement("div", { ref: this.handleEl, className: className.join(' '), style: { overflowX: props.overflowX, overflowY: props.overflowY, left: (isAbsolute && -(props.overcomeLeft || 0)) || '', right: (isAbsolute && -(props.overcomeRight || 0)) || '', bottom: (isAbsolute && -(props.overcomeBottom || 0)) || '', marginLeft: (!isAbsolute && -(props.overcomeLeft || 0)) || '', marginRight: (!isAbsolute && -(props.overcomeRight || 0)) || '', marginBottom: (!isAbsolute && -(props.overcomeBottom || 0)) || '', maxHeight: props.maxHeight || '', } }, props.children)); }; Scroller.prototype.needsXScrolling = function () { if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) { return false; } // testing scrollWidth>clientWidth is unreliable cross-browser when pixel heights aren't integers. // much more reliable to see if children are taller than the scroller, even tho doesn't account for // inner-child margins and absolute positioning var el = this.el; var realClientWidth = this.el.getBoundingClientRect().width - this.getYScrollbarWidth(); var children = el.children; for (var i = 0; i < children.length; i += 1) { var childEl = children[i]; if (childEl.getBoundingClientRect().width > realClientWidth) { return true; } } return false; }; Scroller.prototype.needsYScrolling = function () { if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) { return false; } // testing scrollHeight>clientHeight is unreliable cross-browser when pixel heights aren't integers. // much more reliable to see if children are taller than the scroller, even tho doesn't account for // inner-child margins and absolute positioning var el = this.el; var realClientHeight = this.el.getBoundingClientRect().height - this.getXScrollbarWidth(); var children = el.children; for (var i = 0; i < children.length; i += 1) { var childEl = children[i]; if (childEl.getBoundingClientRect().height > realClientHeight) { return true; } } return false; }; Scroller.prototype.getXScrollbarWidth = function () { if (VISIBLE_HIDDEN_RE.test(this.props.overflowX)) { return 0; } return this.el.offsetHeight - this.el.clientHeight; // only works because we guarantee no borders. TODO: add to CSS with important? }; Scroller.prototype.getYScrollbarWidth = function () { if (VISIBLE_HIDDEN_RE.test(this.props.overflowY)) { return 0; } return this.el.offsetWidth - this.el.clientWidth; // only works because we guarantee no borders. TODO: add to CSS with important? }; return Scroller; }(main_BaseComponent)); /* TODO: somehow infer OtherArgs from masterCallback? TODO: infer RefType from masterCallback if provided */ var RefMap = /** @class */ (function () { function RefMap(masterCallback) { var _this = this; this.masterCallback = masterCallback; this.currentMap = {}; this.depths = {}; this.callbackMap = {}; this.handleValue = function (val, key) { var _a = _this, depths = _a.depths, currentMap = _a.currentMap; var removed = false; var added = false; if (val !== null) { // for bug... ACTUALLY: can probably do away with this now that callers don't share numeric indices anymore removed = (key in currentMap); currentMap[key] = val; depths[key] = (depths[key] || 0) + 1; added = true; } else { depths[key] -= 1; if (!depths[key]) { delete currentMap[key]; delete _this.callbackMap[key]; removed = true; } } if (_this.masterCallback) { if (removed) { _this.masterCallback(null, String(key)); } if (added) { _this.masterCallback(val, String(key)); } } }; } RefMap.prototype.createRef = function (key) { var _this = this; var refCallback = this.callbackMap[key]; if (!refCallback) { refCallback = this.callbackMap[key] = function (val) { _this.handleValue(val, String(key)); }; } return refCallback; }; // TODO: check callers that don't care about order. should use getAll instead // NOTE: this method has become less valuable now that we are encouraged to map order by some other index // TODO: provide ONE array-export function, buildArray, which fails on non-numeric indexes. caller can manipulate and "collect" RefMap.prototype.collect = function (startIndex, endIndex, step) { return collectFromHash(this.currentMap, startIndex, endIndex, step); }; RefMap.prototype.getAll = function () { return hashValuesToArray(this.currentMap); }; return RefMap; }()); function computeShrinkWidth(chunkEls) { var shrinkCells = findElements(chunkEls, '.fc-scrollgrid-shrink'); var largestWidth = 0; for (var _i = 0, shrinkCells_1 = shrinkCells; _i < shrinkCells_1.length; _i++) { var shrinkCell = shrinkCells_1[_i]; largestWidth = Math.max(largestWidth, computeSmallestCellWidth(shrinkCell)); } return Math.ceil(largestWidth); // elements work best with integers. round up to ensure contents fits } function getSectionHasLiquidHeight(props, sectionConfig) { return props.liquid && sectionConfig.liquid; // does the section do liquid-height? (need to have whole scrollgrid liquid-height as well) } function getAllowYScrolling(props, sectionConfig) { return sectionConfig.maxHeight != null || // if its possible for the height to max out, we might need scrollbars getSectionHasLiquidHeight(props, sectionConfig); // if the section is liquid height, it might condense enough to require scrollbars } // TODO: ONLY use `arg`. force out internal function to use same API function renderChunkContent(sectionConfig, chunkConfig, arg, isHeader) { var expandRows = arg.expandRows; var content = typeof chunkConfig.content === 'function' ? chunkConfig.content(arg) : createElement('table', { role: 'presentation', className: [ chunkConfig.tableClassName, sectionConfig.syncRowHeights ? 'fc-scrollgrid-sync-table' : '', ].join(' '), style: { minWidth: arg.tableMinWidth, width: arg.clientWidth, height: expandRows ? arg.clientHeight : '', // css `height` on a
serves as a min-height }, }, arg.tableColGroupNode, createElement(isHeader ? 'thead' : 'tbody', { role: 'presentation', }, typeof chunkConfig.rowContent === 'function' ? chunkConfig.rowContent(arg) : chunkConfig.rowContent)); return content; } function isColPropsEqual(cols0, cols1) { return isArraysEqual(cols0, cols1, isPropsEqual); } function renderMicroColGroup(cols, shrinkWidth) { var colNodes = []; /* for ColProps with spans, it would have been great to make a single HOWEVER, Chrome was getting messing up distributing the width to elements makes Chrome behave. */ for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) { var colProps = cols_1[_i]; var span = colProps.span || 1; for (var i = 0; i < span; i += 1) { colNodes.push(createElement("col", { style: { width: colProps.width === 'shrink' ? sanitizeShrinkWidth(shrinkWidth) : (colProps.width || ''), minWidth: colProps.minWidth || '', } })); } } return createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['colgroup', {}], colNodes)); } function sanitizeShrinkWidth(shrinkWidth) { /* why 4? if we do 0, it will kill any border, which are needed for computeSmallestCellWidth 4 accounts for 2 2-pixel borders. TODO: better solution? */ return shrinkWidth == null ? 4 : shrinkWidth; } function hasShrinkWidth(cols) { for (var _i = 0, cols_2 = cols; _i < cols_2.length; _i++) { var col = cols_2[_i]; if (col.width === 'shrink') { return true; } } return false; } function getScrollGridClassNames(liquid, context) { var classNames = [ 'fc-scrollgrid', context.theme.getClass('table'), ]; if (liquid) { classNames.push('fc-scrollgrid-liquid'); } return classNames; } function getSectionClassNames(sectionConfig, wholeTableVGrow) { var classNames = [ 'fc-scrollgrid-section', "fc-scrollgrid-section-" + sectionConfig.type, sectionConfig.className, // used? ]; if (wholeTableVGrow && sectionConfig.liquid && sectionConfig.maxHeight == null) { classNames.push('fc-scrollgrid-section-liquid'); } if (sectionConfig.isSticky) { classNames.push('fc-scrollgrid-section-sticky'); } return classNames; } function renderScrollShim(arg) { return (createElement("div", { className: "fc-scrollgrid-sticky-shim", style: { width: arg.clientWidth, minWidth: arg.tableMinWidth, } })); } function getStickyHeaderDates(options) { var stickyHeaderDates = options.stickyHeaderDates; if (stickyHeaderDates == null || stickyHeaderDates === 'auto') { stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto'; } return stickyHeaderDates; } function getStickyFooterScrollbar(options) { var stickyFooterScrollbar = options.stickyFooterScrollbar; if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') { stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto'; } return stickyFooterScrollbar; } var main_SimpleScrollGrid = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(SimpleScrollGrid, _super); function SimpleScrollGrid() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.processCols = memoize(function (a) { return a; }, isColPropsEqual); // so we get same `cols` props every time // yucky to memoize VNodes, but much more efficient for consumers _this.renderMicroColGroup = memoize(renderMicroColGroup); _this.scrollerRefs = new RefMap(); _this.scrollerElRefs = new RefMap(_this._handleScrollerEl.bind(_this)); _this.state = { shrinkWidth: null, forceYScrollbars: false, scrollerClientWidths: {}, scrollerClientHeights: {}, }; // TODO: can do a really simple print-view. dont need to join rows _this.handleSizing = function () { _this.setState(Object(tslib_es6["a" /* __assign */])({ shrinkWidth: _this.computeShrinkWidth() }, _this.computeScrollerDims())); }; return _this; } SimpleScrollGrid.prototype.render = function () { var _a = this, props = _a.props, state = _a.state, context = _a.context; var sectionConfigs = props.sections || []; var cols = this.processCols(props.cols); var microColGroupNode = this.renderMicroColGroup(cols, state.shrinkWidth); var classNames = getScrollGridClassNames(props.liquid, context); if (props.collapsibleWidth) { classNames.push('fc-scrollgrid-collapsible'); } // TODO: make DRY var configCnt = sectionConfigs.length; var configI = 0; var currentConfig; var headSectionNodes = []; var bodySectionNodes = []; var footSectionNodes = []; while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') { headSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true)); configI += 1; } while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') { bodySectionNodes.push(this.renderSection(currentConfig, microColGroupNode, false)); configI += 1; } while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') { footSectionNodes.push(this.renderSection(currentConfig, microColGroupNode, true)); configI += 1; } // firefox bug: when setting height on table and there is a thead or tfoot, // the necessary height:100% on the liquid-height body section forces the *whole* table to be taller. (bug #5524) // use getCanVGrowWithinCell as a way to detect table-stupid firefox. // if so, use a simpler dom structure, jam everything into a lone tbody. var isBuggy = !getCanVGrowWithinCell(); var roleAttrs = { role: 'rowgroup' }; return createElement('table', { role: 'grid', className: classNames.join(' '), style: { height: props.height }, }, Boolean(!isBuggy && headSectionNodes.length) && createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['thead', roleAttrs], headSectionNodes)), Boolean(!isBuggy && bodySectionNodes.length) && createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['tbody', roleAttrs], bodySectionNodes)), Boolean(!isBuggy && footSectionNodes.length) && createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(['tfoot', roleAttrs], footSectionNodes)), isBuggy && createElement.apply(void 0, Object(tslib_es6["c" /* __spreadArray */])(Object(tslib_es6["c" /* __spreadArray */])(Object(tslib_es6["c" /* __spreadArray */])(['tbody', roleAttrs], headSectionNodes), bodySectionNodes), footSectionNodes))); }; SimpleScrollGrid.prototype.renderSection = function (sectionConfig, microColGroupNode, isHeader) { if ('outerContent' in sectionConfig) { return (createElement(Fragment, { key: sectionConfig.key }, sectionConfig.outerContent)); } return (createElement("tr", { key: sectionConfig.key, role: "presentation", className: getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, this.renderChunkTd(sectionConfig, microColGroupNode, sectionConfig.chunk, isHeader))); }; SimpleScrollGrid.prototype.renderChunkTd = function (sectionConfig, microColGroupNode, chunkConfig, isHeader) { if ('outerContent' in chunkConfig) { return chunkConfig.outerContent; } var props = this.props; var _a = this.state, forceYScrollbars = _a.forceYScrollbars, scrollerClientWidths = _a.scrollerClientWidths, scrollerClientHeights = _a.scrollerClientHeights; var needsYScrolling = getAllowYScrolling(props, sectionConfig); // TODO: do lazily. do in section config? var isLiquid = getSectionHasLiquidHeight(props, sectionConfig); // for `!props.liquid` - is WHOLE scrollgrid natural height? // TODO: do same thing in advanced scrollgrid? prolly not b/c always has horizontal scrollbars var overflowY = !props.liquid ? 'visible' : forceYScrollbars ? 'scroll' : !needsYScrolling ? 'hidden' : 'auto'; var sectionKey = sectionConfig.key; var content = renderChunkContent(sectionConfig, chunkConfig, { tableColGroupNode: microColGroupNode, tableMinWidth: '', clientWidth: (!props.collapsibleWidth && scrollerClientWidths[sectionKey] !== undefined) ? scrollerClientWidths[sectionKey] : null, clientHeight: scrollerClientHeights[sectionKey] !== undefined ? scrollerClientHeights[sectionKey] : null, expandRows: sectionConfig.expandRows, syncRowHeights: false, rowSyncHeights: [], reportRowHeightChange: function () { }, }, isHeader); return createElement(isHeader ? 'th' : 'td', { ref: chunkConfig.elRef, role: 'presentation', }, createElement("div", { className: "fc-scroller-harness" + (isLiquid ? ' fc-scroller-harness-liquid' : '') }, createElement(main_Scroller, { ref: this.scrollerRefs.createRef(sectionKey), elRef: this.scrollerElRefs.createRef(sectionKey), overflowY: overflowY, overflowX: !props.liquid ? 'visible' : 'hidden' /* natural height? */, maxHeight: sectionConfig.maxHeight, liquid: isLiquid, liquidIsAbsolute // because its within a harness : true }, content))); }; SimpleScrollGrid.prototype._handleScrollerEl = function (scrollerEl, key) { var section = getSectionByKey(this.props.sections, key); if (section) { setRef(section.chunk.scrollerElRef, scrollerEl); } }; SimpleScrollGrid.prototype.componentDidMount = function () { this.handleSizing(); this.context.addResizeHandler(this.handleSizing); }; SimpleScrollGrid.prototype.componentDidUpdate = function () { // TODO: need better solution when state contains non-sizing things this.handleSizing(); }; SimpleScrollGrid.prototype.componentWillUnmount = function () { this.context.removeResizeHandler(this.handleSizing); }; SimpleScrollGrid.prototype.computeShrinkWidth = function () { return hasShrinkWidth(this.props.cols) ? computeShrinkWidth(this.scrollerElRefs.getAll()) : 0; }; SimpleScrollGrid.prototype.computeScrollerDims = function () { var scrollbarWidth = getScrollbarWidths(); var _a = this, scrollerRefs = _a.scrollerRefs, scrollerElRefs = _a.scrollerElRefs; var forceYScrollbars = false; var scrollerClientWidths = {}; var scrollerClientHeights = {}; for (var sectionKey in scrollerRefs.currentMap) { var scroller = scrollerRefs.currentMap[sectionKey]; if (scroller && scroller.needsYScrolling()) { forceYScrollbars = true; break; } } for (var _i = 0, _b = this.props.sections; _i < _b.length; _i++) { var section = _b[_i]; var sectionKey = section.key; var scrollerEl = scrollerElRefs.currentMap[sectionKey]; if (scrollerEl) { var harnessEl = scrollerEl.parentNode; // TODO: weird way to get this. need harness b/c doesn't include table borders scrollerClientWidths[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().width - (forceYScrollbars ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future : 0)); scrollerClientHeights[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().height); } } return { forceYScrollbars: forceYScrollbars, scrollerClientWidths: scrollerClientWidths, scrollerClientHeights: scrollerClientHeights }; }; return SimpleScrollGrid; }(main_BaseComponent)); main_SimpleScrollGrid.addStateEquality({ scrollerClientWidths: isPropsEqual, scrollerClientHeights: isPropsEqual, }); function getSectionByKey(sections, key) { for (var _i = 0, sections_1 = sections; _i < sections_1.length; _i++) { var section = sections_1[_i]; if (section.key === key) { return section; } } return null; } var main_EventRoot = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(EventRoot, _super); function EventRoot() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.elRef = createRef(); return _this; } EventRoot.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var options = context.options; var seg = props.seg; var eventRange = seg.eventRange; var ui = eventRange.ui; var hookProps = { event: new main_EventApi(context, eventRange.def, eventRange.instance), view: context.viewApi, timeText: props.timeText, textColor: ui.textColor, backgroundColor: ui.backgroundColor, borderColor: ui.borderColor, isDraggable: !props.disableDragging && computeSegDraggable(seg, context), isStartResizable: !props.disableResizing && computeSegStartResizable(seg, context), isEndResizable: !props.disableResizing && computeSegEndResizable(seg), isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting), isStart: Boolean(seg.isStart), isEnd: Boolean(seg.isEnd), isPast: Boolean(props.isPast), isFuture: Boolean(props.isFuture), isToday: Boolean(props.isToday), isSelected: Boolean(props.isSelected), isDragging: Boolean(props.isDragging), isResizing: Boolean(props.isResizing), }; var standardClassNames = getEventClassNames(hookProps).concat(ui.classNames); return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.eventClassNames, content: options.eventContent, defaultContent: props.defaultContent, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount, elRef: this.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, standardClassNames.concat(customClassNames), innerElRef, innerContent, hookProps); })); }; EventRoot.prototype.componentDidMount = function () { setElSeg(this.elRef.current, this.props.seg); }; /* need to re-assign seg to the element if seg changes, even if the element is the same */ EventRoot.prototype.componentDidUpdate = function (prevProps) { var seg = this.props.seg; if (seg !== prevProps.seg) { setElSeg(this.elRef.current, seg); } }; return EventRoot; }(main_BaseComponent)); // should not be a purecomponent var main_StandardEvent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(StandardEvent, _super); function StandardEvent() { return _super !== null && _super.apply(this, arguments) || this; } StandardEvent.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var seg = props.seg; var timeFormat = context.options.eventTimeFormat || props.defaultTimeFormat; var timeText = buildSegTimeText(seg, timeFormat, context, props.defaultDisplayEventTime, props.defaultDisplayEventEnd); return (createElement(main_EventRoot, { seg: seg, timeText: timeText, disableDragging: props.disableDragging, disableResizing: props.disableResizing, defaultContent: props.defaultContent || renderInnerContent$1, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement("a", Object(tslib_es6["a" /* __assign */])({ className: props.extraClassNames.concat(classNames).join(' '), style: { borderColor: hookProps.borderColor, backgroundColor: hookProps.backgroundColor, }, ref: rootElRef }, getSegAnchorAttrs(seg, context)), createElement("div", { className: "fc-event-main", ref: innerElRef, style: { color: hookProps.textColor } }, innerContent), hookProps.isStartResizable && createElement("div", { className: "fc-event-resizer fc-event-resizer-start" }), hookProps.isEndResizable && createElement("div", { className: "fc-event-resizer fc-event-resizer-end" }))); })); }; return StandardEvent; }(main_BaseComponent)); function renderInnerContent$1(innerProps) { return (createElement("div", { className: "fc-event-main-frame" }, innerProps.timeText && (createElement("div", { className: "fc-event-time" }, innerProps.timeText)), createElement("div", { className: "fc-event-title-container" }, createElement("div", { className: "fc-event-title fc-sticky" }, innerProps.event.title || createElement(Fragment, null, "\u00A0"))))); } var NowIndicatorRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) { var options = context.options; var hookProps = { isAxis: props.isAxis, date: context.dateEnv.toDate(props.date), view: context.viewApi, }; return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.nowIndicatorClassNames, content: options.nowIndicatorContent, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount }, props.children)); })); }; var DAY_NUM_FORMAT = createFormatter({ day: 'numeric' }); var main_DayCellContent = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(DayCellContent, _super); function DayCellContent() { return _super !== null && _super.apply(this, arguments) || this; } DayCellContent.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var options = context.options; var hookProps = refineDayCellHookProps({ date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraProps: props.extraHookProps, viewApi: context.viewApi, dateEnv: context.dateEnv, }); return (createElement(ContentHook, { hookProps: hookProps, content: options.dayCellContent, defaultContent: props.defaultContent }, props.children)); }; return DayCellContent; }(main_BaseComponent)); function refineDayCellHookProps(raw) { var date = raw.date, dateEnv = raw.dateEnv; var dayMeta = getDateMeta(date, raw.todayRange, null, raw.dateProfile); return Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])(Object(tslib_es6["a" /* __assign */])({ date: dateEnv.toDate(date), view: raw.viewApi }, dayMeta), { dayNumberText: raw.showDayNumber ? dateEnv.format(date, DAY_NUM_FORMAT) : '' }), raw.extraProps); } var main_DayCellRoot = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(DayCellRoot, _super); function DayCellRoot() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.refineHookProps = memoizeObjArg(refineDayCellHookProps); _this.normalizeClassNames = buildClassNameNormalizer(); return _this; } DayCellRoot.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var options = context.options; var hookProps = this.refineHookProps({ date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraProps: props.extraHookProps, viewApi: context.viewApi, dateEnv: context.dateEnv, }); var classNames = getDayClassNames(hookProps, context.theme).concat(hookProps.isDisabled ? [] // don't use custom classNames if disabled : this.normalizeClassNames(options.dayCellClassNames, hookProps)); var dataAttrs = hookProps.isDisabled ? {} : { 'data-date': formatDayString(props.date), }; return (createElement(main_MountHook, { hookProps: hookProps, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount, elRef: props.elRef }, function (rootElRef) { return props.children(rootElRef, classNames, dataAttrs, hookProps.isDisabled); })); }; return DayCellRoot; }(main_BaseComponent)); function renderFill(fillType) { return (createElement("div", { className: "fc-" + fillType })); } var BgEvent = function (props) { return (createElement(main_EventRoot, { defaultContent: renderInnerContent, seg: props.seg /* uselesss i think */, timeText: "", disableDragging: true, disableResizing: true, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement("div", { ref: rootElRef, className: ['fc-bg-event'].concat(classNames).join(' '), style: { backgroundColor: hookProps.backgroundColor, } }, innerContent)); })); }; function renderInnerContent(props) { var title = props.event.title; return title && (createElement("div", { className: "fc-event-title" }, props.event.title)); } var WeekNumberRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) { var dateEnv = context.dateEnv, options = context.options; var date = props.date; var format = options.weekNumberFormat || props.defaultFormat; var num = dateEnv.computeWeekNumber(date); // TODO: somehow use for formatting as well? var text = dateEnv.format(date, format); var hookProps = { num: num, text: text, date: date }; return (createElement(main_RenderHook, { hookProps: hookProps, classNames: options.weekNumberClassNames, content: options.weekNumberContent, defaultContent: renderInner, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount }, props.children)); })); }; function renderInner(innerProps) { return innerProps.text; } var PADDING_FROM_VIEWPORT = 10; var main_Popover = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(Popover, _super); function Popover() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { titleId: getUniqueDomId(), }; _this.handleRootEl = function (el) { _this.rootEl = el; if (_this.props.elRef) { setRef(_this.props.elRef, el); } }; // Triggered when the user clicks *anywhere* in the document, for the autoHide feature _this.handleDocumentMouseDown = function (ev) { // only hide the popover if the click happened outside the popover var target = getEventTargetViaRoot(ev); if (!_this.rootEl.contains(target)) { _this.handleCloseClick(); } }; _this.handleDocumentKeyDown = function (ev) { if (ev.key === 'Escape') { _this.handleCloseClick(); } }; _this.handleCloseClick = function () { var onClose = _this.props.onClose; if (onClose) { onClose(); } }; return _this; } Popover.prototype.render = function () { var _a = this.context, theme = _a.theme, options = _a.options; var _b = this, props = _b.props, state = _b.state; var classNames = [ 'fc-popover', theme.getClass('popover'), ].concat(props.extraClassNames || []); return createPortal(createElement("div", Object(tslib_es6["a" /* __assign */])({ id: props.id, className: classNames.join(' '), "aria-labelledby": state.titleId }, props.extraAttrs, { ref: this.handleRootEl }), createElement("div", { className: 'fc-popover-header ' + theme.getClass('popoverHeader') }, createElement("span", { className: "fc-popover-title", id: state.titleId }, props.title), createElement("span", { className: 'fc-popover-close ' + theme.getIconClass('close'), title: options.closeHint, onClick: this.handleCloseClick })), createElement("div", { className: 'fc-popover-body ' + theme.getClass('popoverContent') }, props.children)), props.parentEl); }; Popover.prototype.componentDidMount = function () { document.addEventListener('mousedown', this.handleDocumentMouseDown); document.addEventListener('keydown', this.handleDocumentKeyDown); this.updateSize(); }; Popover.prototype.componentWillUnmount = function () { document.removeEventListener('mousedown', this.handleDocumentMouseDown); document.removeEventListener('keydown', this.handleDocumentKeyDown); }; Popover.prototype.updateSize = function () { var isRtl = this.context.isRtl; var _a = this.props, alignmentEl = _a.alignmentEl, alignGridTop = _a.alignGridTop; var rootEl = this.rootEl; var alignmentRect = computeClippedClientRect(alignmentEl); if (alignmentRect) { var popoverDims = rootEl.getBoundingClientRect(); // position relative to viewport var popoverTop = alignGridTop ? elementClosest(alignmentEl, '.fc-scrollgrid').getBoundingClientRect().top : alignmentRect.top; var popoverLeft = isRtl ? alignmentRect.right - popoverDims.width : alignmentRect.left; // constrain popoverTop = Math.max(popoverTop, PADDING_FROM_VIEWPORT); popoverLeft = Math.min(popoverLeft, document.documentElement.clientWidth - PADDING_FROM_VIEWPORT - popoverDims.width); popoverLeft = Math.max(popoverLeft, PADDING_FROM_VIEWPORT); var origin_1 = rootEl.offsetParent.getBoundingClientRect(); applyStyle(rootEl, { top: popoverTop - origin_1.top, left: popoverLeft - origin_1.left, }); } }; return Popover; }(main_BaseComponent)); var main_MorePopover = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(MorePopover, _super); function MorePopover() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.handleRootEl = function (rootEl) { _this.rootEl = rootEl; if (rootEl) { _this.context.registerInteractiveComponent(_this, { el: rootEl, useEventCenter: false, }); } else { _this.context.unregisterInteractiveComponent(_this); } }; return _this; } MorePopover.prototype.render = function () { var _a = this.context, options = _a.options, dateEnv = _a.dateEnv; var props = this.props; var startDate = props.startDate, todayRange = props.todayRange, dateProfile = props.dateProfile; var title = dateEnv.format(startDate, options.dayPopoverFormat); return (createElement(main_DayCellRoot, { date: startDate, dateProfile: dateProfile, todayRange: todayRange, elRef: this.handleRootEl }, function (rootElRef, dayClassNames, dataAttrs) { return (createElement(main_Popover, { elRef: rootElRef, id: props.id, title: title, extraClassNames: ['fc-more-popover'].concat(dayClassNames), extraAttrs: dataAttrs /* TODO: make these time-based when not whole-day? */, parentEl: props.parentEl, alignmentEl: props.alignmentEl, alignGridTop: props.alignGridTop, onClose: props.onClose }, createElement(main_DayCellContent, { date: startDate, dateProfile: dateProfile, todayRange: todayRange }, function (innerElRef, innerContent) { return (innerContent && createElement("div", { className: "fc-more-popover-misc", ref: innerElRef }, innerContent)); }), props.children)); })); }; MorePopover.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) { var _a = this, rootEl = _a.rootEl, props = _a.props; if (positionLeft >= 0 && positionLeft < elWidth && positionTop >= 0 && positionTop < elHeight) { return { dateProfile: props.dateProfile, dateSpan: Object(tslib_es6["a" /* __assign */])({ allDay: true, range: { start: props.startDate, end: props.endDate, } }, props.extraDateSpan), dayEl: rootEl, rect: { left: 0, top: 0, right: elWidth, bottom: elHeight, }, layer: 1, // important when comparing with hits from other components }; } return null; }; return MorePopover; }(main_DateComponent)); var main_MoreLinkRoot = /** @class */ (function (_super) { Object(tslib_es6["b" /* __extends */])(MoreLinkRoot, _super); function MoreLinkRoot() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.linkElRef = createRef(); _this.state = { isPopoverOpen: false, popoverId: getUniqueDomId(), }; _this.handleClick = function (ev) { var _a = _this, props = _a.props, context = _a.context; var moreLinkClick = context.options.moreLinkClick; var date = computeRange(props).start; function buildPublicSeg(seg) { var _a = seg.eventRange, def = _a.def, instance = _a.instance, range = _a.range; return { event: new main_EventApi(context, def, instance), start: context.dateEnv.toDate(range.start), end: context.dateEnv.toDate(range.end), isStart: seg.isStart, isEnd: seg.isEnd, }; } if (typeof moreLinkClick === 'function') { moreLinkClick = moreLinkClick({ date: date, allDay: Boolean(props.allDayDate), allSegs: props.allSegs.map(buildPublicSeg), hiddenSegs: props.hiddenSegs.map(buildPublicSeg), jsEvent: ev, view: context.viewApi, }); } if (!moreLinkClick || moreLinkClick === 'popover') { _this.setState({ isPopoverOpen: true }); } else if (typeof moreLinkClick === 'string') { // a view name context.calendarApi.zoomTo(date, moreLinkClick); } }; _this.handlePopoverClose = function () { _this.setState({ isPopoverOpen: false }); }; return _this; } MoreLinkRoot.prototype.render = function () { var _this = this; var _a = this, props = _a.props, state = _a.state; return (createElement(ViewContextType.Consumer, null, function (context) { var viewApi = context.viewApi, options = context.options, calendarApi = context.calendarApi; var moreLinkText = options.moreLinkText; var moreCnt = props.moreCnt; var range = computeRange(props); var text = typeof moreLinkText === 'function' // TODO: eventually use formatWithOrdinals ? moreLinkText.call(calendarApi, moreCnt) : "+" + moreCnt + " " + moreLinkText; var title = formatWithOrdinals(options.moreLinkHint, [moreCnt], text); var hookProps = { num: moreCnt, shortText: "+" + moreCnt, text: text, view: viewApi, }; return (createElement(Fragment, null, Boolean(props.moreCnt) && (createElement(main_RenderHook, { elRef: _this.linkElRef, hookProps: hookProps, classNames: options.moreLinkClassNames, content: options.moreLinkContent, defaultContent: props.defaultContent || renderMoreLinkInner, didMount: options.moreLinkDidMount, willUnmount: options.moreLinkWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, ['fc-more-link'].concat(customClassNames), innerElRef, innerContent, _this.handleClick, title, state.isPopoverOpen, state.isPopoverOpen ? state.popoverId : ''); })), state.isPopoverOpen && (createElement(main_MorePopover, { id: state.popoverId, startDate: range.start, endDate: range.end, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: props.extraDateSpan, parentEl: _this.parentEl, alignmentEl: props.alignmentElRef.current, alignGridTop: props.alignGridTop, onClose: _this.handlePopoverClose }, props.popoverContent())))); })); }; MoreLinkRoot.prototype.componentDidMount = function () { this.updateParentEl(); }; MoreLinkRoot.prototype.componentDidUpdate = function () { this.updateParentEl(); }; MoreLinkRoot.prototype.updateParentEl = function () { if (this.linkElRef.current) { this.parentEl = elementClosest(this.linkElRef.current, '.fc-view-harness'); } }; return MoreLinkRoot; }(main_BaseComponent)); function renderMoreLinkInner(props) { return props.text; } function computeRange(props) { if (props.allDayDate) { return { start: props.allDayDate, end: addDays(props.allDayDate, 1), }; } var hiddenSegs = props.hiddenSegs; return { start: computeEarliestSegStart(hiddenSegs), end: computeLatestSegEnd(hiddenSegs), }; } function computeEarliestSegStart(segs) { return segs.reduce(pickEarliestStart).eventRange.range.start; } function pickEarliestStart(seg0, seg1) { return seg0.eventRange.range.start < seg1.eventRange.range.start ? seg0 : seg1; } function computeLatestSegEnd(segs) { return segs.reduce(pickLatestEnd).eventRange.range.end; } function pickLatestEnd(seg0, seg1) { return seg0.eventRange.range.end > seg1.eventRange.range.end ? seg0 : seg1; } // exports // -------------------------------------------------------------------------------------------------- var version = '5.10.1'; // important to type it, so .d.ts has generic string //# sourceMappingURL=main.js.map /***/ }), /***/ "d69a": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Filipino [fil] //! author : Dan Hagman : https://github.com/hagmandan //! author : Matthew Co : https://github.com/matthewdeeco ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var fil = moment.defineLocale('fil', { months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split( '_' ), monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split( '_' ), weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'MM/D/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY HH:mm', LLLL: 'dddd, MMMM DD, YYYY HH:mm', }, calendar: { sameDay: 'LT [ngayong araw]', nextDay: '[Bukas ng] LT', nextWeek: 'LT [sa susunod na] dddd', lastDay: 'LT [kahapon]', lastWeek: 'LT [noong nakaraang] dddd', sameElse: 'L', }, relativeTime: { future: 'sa loob ng %s', past: '%s ang nakalipas', s: 'ilang segundo', ss: '%d segundo', m: 'isang minuto', mm: '%d minuto', h: 'isang oras', hh: '%d oras', d: 'isang araw', dd: '%d araw', M: 'isang buwan', MM: '%d buwan', y: 'isang taon', yy: '%d taon', }, dayOfMonthOrdinalParse: /\d{1,2}/, ordinal: function (number) { return number; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return fil; }))); /***/ }), /***/ "d6b6": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Armenian [hy-am] //! author : Armendarabyan : https://github.com/armendarabyan ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var hyAm = moment.defineLocale('hy-am', { months: { format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split( '_' ), standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split( '_' ), }, monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split( '_' ), weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD.MM.YYYY', LL: 'D MMMM YYYY թ.', LLL: 'D MMMM YYYY թ., HH:mm', LLLL: 'dddd, D MMMM YYYY թ., HH:mm', }, calendar: { sameDay: '[այսօր] LT', nextDay: '[վաղը] LT', lastDay: '[երեկ] LT', nextWeek: function () { return 'dddd [օրը ժամը] LT'; }, lastWeek: function () { return '[անցած] dddd [օրը ժամը] LT'; }, sameElse: 'L', }, relativeTime: { future: '%s հետո', past: '%s առաջ', s: 'մի քանի վայրկյան', ss: '%d վայրկյան', m: 'րոպե', mm: '%d րոպե', h: 'ժամ', hh: '%d ժամ', d: 'օր', dd: '%d օր', M: 'ամիս', MM: '%d ամիս', y: 'տարի', yy: '%d տարի', }, meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, isPM: function (input) { return /^(ցերեկվա|երեկոյան)$/.test(input); }, meridiem: function (hour) { if (hour < 4) { return 'գիշերվա'; } else if (hour < 12) { return 'առավոտվա'; } else if (hour < 17) { return 'ցերեկվա'; } else { return 'երեկոյան'; } }, dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, ordinal: function (number, period) { switch (period) { case 'DDD': case 'w': case 'W': case 'DDDo': if (number === 1) { return number + '-ին'; } return number + '-րդ'; default: return number; } }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return hyAm; }))); /***/ }), /***/ "d716": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Catalan [ca] //! author : Juan G. Hurtado : https://github.com/juanghurtado ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ca = moment.defineLocale('ca', { months: { standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split( '_' ), format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split( '_' ), isFormat: /D[oD]?(\s)+MMMM/, }, monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split( '_' ), monthsParseExact: true, weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split( '_' ), weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'), weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM [de] YYYY', ll: 'D MMM YYYY', LLL: 'D MMMM [de] YYYY [a les] H:mm', lll: 'D MMM YYYY, H:mm', LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm', llll: 'ddd D MMM YYYY, H:mm', }, calendar: { sameDay: function () { return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, nextDay: function () { return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, nextWeek: function () { return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, lastDay: function () { return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT'; }, lastWeek: function () { return ( '[el] dddd [passat a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT' ); }, sameElse: 'L', }, relativeTime: { future: "d'aquí %s", past: 'fa %s', s: 'uns segons', ss: '%d segons', m: 'un minut', mm: '%d minuts', h: 'una hora', hh: '%d hores', d: 'un dia', dd: '%d dies', M: 'un mes', MM: '%d mesos', y: 'un any', yy: '%d anys', }, dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/, ordinal: function (number, period) { var output = number === 1 ? 'r' : number === 2 ? 'n' : number === 3 ? 'r' : number === 4 ? 't' : 'è'; if (period === 'w' || period === 'W') { output = 'a'; } return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return ca; }))); /***/ }), /***/ "d815": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7514"); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("a481"); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_1__); /** * Version 2.4.0 Copyright (C) 2013 * Tested in IE 11, FF 28.0 and Chrome 33.0.1750.154 * No official support for other browsers, but will TRY to accommodate challenges in other browsers. * Example: * Print Button: * Print Area :
... html ...
* Javascript : * options are passed as json (example: {mode: "popup", popClose: false}) * * {OPTIONS} | [type] | (default), values | Explanation * --------- | --------- | ---------------------- | ----------- * @mode | [string] | (iframe),popup | printable window is either iframe or browser popup * @popHt | [number] | (500) | popup window height * @popWd | [number] | (400) | popup window width * @popX | [number] | (500) | popup window screen X position * @popY | [number] | (500) | popup window screen Y position * @popTitle | [string] | ('') | popup window title element * @popClose | [boolean] | (false),true | popup window close after printing * @extraCss | [string] | ('') | comma separated list of extra css to include * @retainAttr | [string[]] | ["id","class","style"] | string array of attributes to retain for the containment area. (ie: id, style, class) * @standard | [string] | strict, loose, (html5) | Only for popup. For html 4.01, strict or loose document standard, or html 5 standard * @extraHead | [string] | ('') | comma separated list of extra elements to be appended to the head tag */ (function ($) { var counter = 0; var modes = { iframe: "iframe", popup: "popup" }; var standards = { strict: "strict", loose: "loose", html5: "html5" }; var defaults = { mode: modes.iframe, standard: standards.html5, popHt: 500, popWd: 400, popX: 200, popY: 200, popTitle: '', popClose: false, extraCss: '', extraHead: '', retainAttr: ["id", "class", "style"] }; var settings = {}; //global settings $.fn.printArea = function (options) { $.extend(settings, defaults, options); counter++; var idPrefix = "printArea_"; $("[id^=" + idPrefix + "]").remove(); settings.id = idPrefix + counter; var $printSource = $(this); var PrintAreaWindow = PrintArea.getPrintWindow(); PrintArea.write(PrintAreaWindow.doc, $printSource); setTimeout(function () { PrintArea.print(PrintAreaWindow); }, 1000); }; var PrintArea = { print: function print(PAWindow) { var paWindow = PAWindow.win; $(PAWindow.doc).ready(function () { paWindow.focus(); paWindow.print(); if (settings.mode == modes.popup && settings.popClose) setTimeout(function () { paWindow.close(); }, 2000); }); }, write: function write(PADocument, $ele) { PADocument.open(); PADocument.write(PrintArea.docType() + "" + PrintArea.getHead() + PrintArea.getBody($ele) + ""); PADocument.close(); }, docType: function docType() { if (settings.mode == modes.iframe) return ""; if (settings.standard == standards.html5) return ""; var transitional = settings.standard == standards.loose ? " Transitional" : ""; var dtd = settings.standard == standards.loose ? "loose" : "strict"; return ''; }, getHead: function getHead() { var extraHead = ""; var links = ""; if (settings.extraHead) settings.extraHead.replace(/([^,]+)/g, function (m) { extraHead += m; }); $(document).find("link").filter(function () { // Requirement: element MUST have rel="stylesheet" to be considered in print document var relAttr = $(this).attr("rel"); return $.type(relAttr) === 'undefined' == false && relAttr.toLowerCase() == 'stylesheet'; }).filter(function () { // Include if media is undefined, empty, print or all var mediaAttr = $(this).attr("media"); return $.type(mediaAttr) === 'undefined' || mediaAttr == "" || mediaAttr.toLowerCase() == 'print' || mediaAttr.toLowerCase() == 'all'; }).each(function () { links += ''; }); if (settings.extraCss) settings.extraCss.replace(/([^,\s]+)/g, function (m) { links += ''; }); return "" + settings.popTitle + "" + extraHead + links + ""; }, getBody: function getBody(elements) { var htm = ""; var attrs = settings.retainAttr; elements.each(function () { var ele = PrintArea.getFormData($(this)); var attributes = ""; for (var x = 0; x < attrs.length; x++) { var eleAttr = $(ele).attr(attrs[x]); if (eleAttr) attributes += (attributes.length > 0 ? " " : "") + attrs[x] + "='" + eleAttr + "'"; } htm += '
' + $(ele).html() + '
'; }); return "" + htm + ""; }, getFormData: function getFormData(ele) { var copy = ele.clone(); var copiedInputs = $("input,select,textarea", copy); $("input,select,textarea", ele).each(function (i) { var typeInput = $(this).attr("type"); if ($.type(typeInput) === 'undefined') typeInput = $(this).is("select") ? "select" : $(this).is("textarea") ? "textarea" : ""; var copiedInput = copiedInputs.eq(i); if (typeInput == "radio" || typeInput == "checkbox") copiedInput.attr("checked", $(this).is(":checked"));else if (typeInput == "text") copiedInput.attr("value", $(this).val());else if (typeInput == "select") $(this).find("option").each(function (i) { if ($(this).is(":selected")) $("option", copiedInput).eq(i).attr("selected", true); });else if (typeInput == "textarea") copiedInput.text($(this).val()); }); return copy; }, getPrintWindow: function getPrintWindow() { switch (settings.mode) { case modes.iframe: var f = new PrintArea.Iframe(); return { win: f.contentWindow || f, doc: f.doc }; case modes.popup: var p = new PrintArea.Popup(); return { win: p, doc: p.doc }; } }, Iframe: function Iframe() { var frameId = settings.id; var iframeStyle = 'border:0;position:absolute;width:0px;height:0px;right:0px;top:0px;'; var iframe; try { iframe = document.createElement('iframe'); document.body.appendChild(iframe); $(iframe).attr({ style: iframeStyle, id: frameId, src: "#" + new Date().getTime() }); iframe.doc = null; iframe.doc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow ? iframe.contentWindow.document : iframe.document; } catch (e) { throw e + ". iframes may not be supported in this browser."; } if (iframe.doc == null) throw "Cannot find document."; return iframe; }, Popup: function Popup() { var windowAttr = "location=yes,statusbar=no,directories=no,menubar=no,titlebar=no,toolbar=no,dependent=no"; windowAttr += ",width=" + settings.popWd + ",height=" + settings.popHt; windowAttr += ",resizable=yes,screenX=" + settings.popX + ",screenY=" + settings.popY + ",personalbar=no,scrollbars=yes"; var newWin = window.open("", "_blank", windowAttr); newWin.doc = newWin.document; return newWin; } }; })(jQuery); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "d8a2": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8e6e"); /* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("456d"); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ac6a"); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("7514"); /* harmony import */ var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("96cf"); /* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("1da1"); /* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("ade3"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("c1df"); /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("2f62"); /* harmony import */ var _fullcalendar_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("573d"); /* harmony import */ var _fullcalendar_daygrid__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("3cdd"); /* harmony import */ var _fullcalendar_interaction__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("a20c"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ name: "Calendar", head: { title: function title() { return { inner: "Calendar", separator: " " }; } }, computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_8__[/* mapState */ "b"])({ bookings: function bookings(state) { return state.profile.bookings; } })), data: function data() { return { dateSelected: [], updateFlag: false }; }, methods: { getBookings: function () { var _getBookings = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return this.$store.dispatch("profile/getBookings"); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function getBookings() { return _getBookings.apply(this, arguments); } return getBookings; }(), updateBookings: function () { var _updateBookings = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var _this2 = this; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.next = 2; return this.$store.dispatch("profile/updateBookings", { date: this.dateSelected, callBack: function callBack() { _this2.updateFlag = false; } }); case 2: case "end": return _context2.stop(); } } }, _callee2, this); })); function updateBookings() { return _updateBookings.apply(this, arguments); } return updateBookings; }(), setDate: function setDate(date, checked) { var dateSelected = []; if (this.updateFlag) { dateSelected = this.dateSelected; } else { dateSelected = this.bookings; this.updateFlag = true; } // date to string (yyyy-MM-DD) var stringDate = moment__WEBPACK_IMPORTED_MODULE_7___default()(date).format("YYYY-MM-DD"); var empty = true; if (checked) { for (var i = 0; i < dateSelected.length; i++) { if (dateSelected[i].date === stringDate) { empty = false; this.changeTextColor("#fff", stringDate); dateSelected[i].booked = true; break; } } if (empty) { dateSelected.push({ date: stringDate, booked: true }); this.changeTextColor("#fff", stringDate); } } else { for (var _i = 0; _i < dateSelected.length; _i++) { if (dateSelected[_i].date === stringDate) { dateSelected[_i].booked = false; this.changeTextColor("#8d9498", stringDate); break; } } } this.dateSelected = dateSelected; this.updateFlag = true; }, changeTextColor: function changeTextColor(color, stringDate) { $("td").find("[data-date='" + stringDate + "']").css("color", color); } }, mounted: function () { var _mounted = Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { var setDateSelectedBG, bookings, _this, renderCalendar; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: // Changes Takes Place On Body Resize Event this.$autoSetHeight(); _context3.next = 3; return this.getBookings(); case 3: setDateSelectedBG = function setDateSelectedBG(_this) { if ($(_this).css("background-color") !== "rgb(255, 0, 0)") { $(_this).css("background-color", "rgb(255, 0, 0)"); return true; } else { $(_this).css("background-color", "#ffffff"); return false; } }; bookings = this.bookings; _this = this; renderCalendar = function renderCalendar(viewId, monthForShow) { var thisCal = new _fullcalendar_core__WEBPACK_IMPORTED_MODULE_9__[/* Calendar */ "a"](viewId, { headerToolbar: { left: null, center: "title", right: null }, initialView: "dayGridMonth", initialDate: monthForShow, displayEventTime: false, displayEventEnd: false, expandRows: true, editable: false, height: "auto", contentHeight: "auto", eventDisplay: "block", // https://fullcalendar.io/docs/upgrading-from-v4#event-rendering //dayMinWidth: this.storeScreenIsOrGreater('sm') ? undefined : 150, eventMinHeight: 80, eventMinWidth: 150, eventOverlap: false, slotEventOverlap: false, stickyHeaderDates: true, stickyFooterScrollbar: true, events: [], dateClick: function dateClick(info) { var checked = setDateSelectedBG(info.dayEl); _this.setDate(info.dateStr, checked); }, dayCellDidMount: function dayCellDidMount(args) { bookings.forEach(function (a) { if (moment__WEBPACK_IMPORTED_MODULE_7___default()(args.date).isSame(moment__WEBPACK_IMPORTED_MODULE_7___default()(a.date))) { $(args.el).css("background-color", "rgb(255, 0, 0)").css("color", "#fff"); } }); }, views: { resourceTimelineWeek: { slotDuration: { hours: 3 }, type: "resourceTimeline", duration: { days: 7 } } }, plugins: [_fullcalendar_daygrid__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"], _fullcalendar_interaction__WEBPACK_IMPORTED_MODULE_11__[/* default */ "a"]] }); thisCal.render(); }; $(document).ready(function () { var date = new Date(); var day = date.getDate(); var month = date.getMonth(); var year = date.getFullYear(); var currentMonth = moment__WEBPACK_IMPORTED_MODULE_7___default()(new Date(year, month, day)).toDate(); var nextMonth = moment__WEBPACK_IMPORTED_MODULE_7___default()(new Date(year, month + 1, day)).toDate(); var nextTwoMonth = moment__WEBPACK_IMPORTED_MODULE_7___default()(new Date(year, month + 2, day)).toDate(); renderCalendar(document.getElementById("calendar-1"), currentMonth); renderCalendar(document.getElementById("calendar-2"), nextMonth); renderCalendar(document.getElementById("calendar-3"), nextTwoMonth); // disable scroll view calendar $(".fc-widget-content .fc-scroller").removeAttr("style"); $("td .fc-row").removeAttr("style"); $(".fc-today").removeClass("fc-today"); $(".fc-bgevent").removeAttr("style"); }); case 8: case "end": return _context3.stop(); } } }, _callee3, this); })); function mounted() { return _mounted.apply(this, arguments); } return mounted; }() }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("1157"))) /***/ }), /***/ "d8e8": /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /***/ "d925": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * @returns {boolean} True if the specified URL is absolute, otherwise false */ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); }; /***/ }), /***/ "d9f8": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : French (Canada) [fr-ca] //! author : Jonathan Abourbih : https://github.com/jonbca ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var frCa = moment.defineLocale('fr-ca', { months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split( '_' ), monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split( '_' ), monthsParseExact: true, weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'YYYY-MM-DD', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Aujourd’hui à] LT', nextDay: '[Demain à] LT', nextWeek: 'dddd [à] LT', lastDay: '[Hier à] LT', lastWeek: 'dddd [dernier à] LT', sameElse: 'L', }, relativeTime: { future: 'dans %s', past: 'il y a %s', s: 'quelques secondes', ss: '%d secondes', m: 'une minute', mm: '%d minutes', h: 'une heure', hh: '%d heures', d: 'un jour', dd: '%d jours', M: 'un mois', MM: '%d mois', y: 'un an', yy: '%d ans', }, dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, ordinal: function (number, period) { switch (period) { // Words with masculine grammatical gender: mois, trimestre, jour default: case 'M': case 'Q': case 'D': case 'DDD': case 'd': return number + (number === 1 ? 'er' : 'e'); // Words with feminine grammatical gender: semaine case 'w': case 'W': return number + (number === 1 ? 're' : 'e'); } }, }); return frCa; }))); /***/ }), /***/ "dad7": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("53ca"); /* harmony import */ var core_js_modules_es6_string_sub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("673e"); /* harmony import */ var core_js_modules_es6_string_sub__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_string_sub__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("a481"); /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("6b54"); /* harmony import */ var core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("55dd"); /* harmony import */ var core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_sort__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("3b2b"); /* harmony import */ var core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_constructor__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("ac6a"); /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("456d"); /* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("28a5"); /* harmony import */ var core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("7f7f"); /* harmony import */ var core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_function_name__WEBPACK_IMPORTED_MODULE_9__); (function () { function require(name) { var module = require.modules[name]; if (!module) throw new Error('failed to require "' + name + '"'); if (!("exports" in module) && typeof module.definition === "function") { module.client = module.component = true; module.definition.call(this, module.exports = {}, module); delete module.definition; } return module.exports; } require.loader = "component"; require.helper = {}; require.helper.semVerSort = function (a, b) { var aArray = a.version.split("."); var bArray = b.version.split("."); for (var i = 0; i < aArray.length; ++i) { var aInt = parseInt(aArray[i], 10); var bInt = parseInt(bArray[i], 10); if (aInt === bInt) { var aLex = aArray[i].substr(("" + aInt).length); var bLex = bArray[i].substr(("" + bInt).length); if (aLex === "" && bLex !== "") return 1; if (aLex !== "" && bLex === "") return -1; if (aLex !== "" && bLex !== "") return aLex > bLex ? 1 : -1; continue; } else if (aInt > bInt) { return 1; } else { return -1; } } return 0; }; require.latest = function (name, returnPath) { function showError(name) { throw new Error('failed to find latest module of "' + name + '"'); } var versionRegexp = /(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/; var remoteRegexp = /(.*)~(.*)/; if (!remoteRegexp.test(name)) showError(name); var moduleNames = Object.keys(require.modules); var semVerCandidates = []; var otherCandidates = []; for (var i = 0; i < moduleNames.length; i++) { var moduleName = moduleNames[i]; if (new RegExp(name + "@").test(moduleName)) { var version = moduleName.substr(name.length + 1); var semVerMatch = versionRegexp.exec(moduleName); if (semVerMatch != null) { semVerCandidates.push({ version: version, name: moduleName }); } else { otherCandidates.push({ version: version, name: moduleName }); } } } if (semVerCandidates.concat(otherCandidates).length === 0) { showError(name); } if (semVerCandidates.length > 0) { var module = semVerCandidates.sort(require.helper.semVerSort).pop().name; if (returnPath === true) { return module; } return require(module); } var module = otherCandidates.sort(function (a, b) { return a.name > b.name; })[0].name; if (returnPath === true) { return module; } return require(module); }; require.modules = {}; require.register = function (name, definition) { require.modules[name] = { definition: definition }; }; require.define = function (name, exports) { require.modules[name] = { exports: exports }; }; require.register("abpetkov~transitionize@0.0.3", function (exports, module) { module.exports = Transitionize; function Transitionize(element, props) { if (!(this instanceof Transitionize)) return new Transitionize(element, props); this.element = element; this.props = props || {}; this.init(); } Transitionize.prototype.isSafari = function () { return /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor); }; Transitionize.prototype.init = function () { var transitions = []; for (var key in this.props) { transitions.push(key + " " + this.props[key]); } this.element.style.transition = transitions.join(", "); if (this.isSafari()) this.element.style.webkitTransition = transitions.join(", "); }; }); require.register("ftlabs~fastclick@v0.6.11", function (exports, module) { function FastClick(layer) { "use strict"; var oldOnClick, self = this; this.trackingClick = false; this.trackingClickStart = 0; this.targetElement = null; this.touchStartX = 0; this.touchStartY = 0; this.lastTouchIdentifier = 0; this.touchBoundary = 10; this.layer = layer; if (!layer || !layer.nodeType) { throw new TypeError("Layer must be a document node"); } this.onClick = function () { return FastClick.prototype.onClick.apply(self, arguments); }; this.onMouse = function () { return FastClick.prototype.onMouse.apply(self, arguments); }; this.onTouchStart = function () { return FastClick.prototype.onTouchStart.apply(self, arguments); }; this.onTouchMove = function () { return FastClick.prototype.onTouchMove.apply(self, arguments); }; this.onTouchEnd = function () { return FastClick.prototype.onTouchEnd.apply(self, arguments); }; this.onTouchCancel = function () { return FastClick.prototype.onTouchCancel.apply(self, arguments); }; if (FastClick.notNeeded(layer)) { return; } if (this.deviceIsAndroid) { layer.addEventListener("mouseover", this.onMouse, true); layer.addEventListener("mousedown", this.onMouse, true); layer.addEventListener("mouseup", this.onMouse, true); } layer.addEventListener("click", this.onClick, true); layer.addEventListener("touchstart", this.onTouchStart, false); layer.addEventListener("touchmove", this.onTouchMove, false); layer.addEventListener("touchend", this.onTouchEnd, false); layer.addEventListener("touchcancel", this.onTouchCancel, false); if (!Event.prototype.stopImmediatePropagation) { layer.removeEventListener = function (type, callback, capture) { var rmv = Node.prototype.removeEventListener; if (type === "click") { rmv.call(layer, type, callback.hijacked || callback, capture); } else { rmv.call(layer, type, callback, capture); } }; layer.addEventListener = function (type, callback, capture) { var adv = Node.prototype.addEventListener; if (type === "click") { adv.call(layer, type, callback.hijacked || (callback.hijacked = function (event) { if (!event.propagationStopped) { callback(event); } }), capture); } else { adv.call(layer, type, callback, capture); } }; } if (typeof layer.onclick === "function") { oldOnClick = layer.onclick; layer.addEventListener("click", function (event) { oldOnClick(event); }, false); layer.onclick = null; } } FastClick.prototype.deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0; FastClick.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent); FastClick.prototype.deviceIsIOS4 = FastClick.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent); FastClick.prototype.deviceIsIOSWithBadTarget = FastClick.prototype.deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent); FastClick.prototype.needsClick = function (target) { "use strict"; switch (target.nodeName.toLowerCase()) { case "button": case "select": case "textarea": if (target.disabled) { return true; } break; case "input": if (this.deviceIsIOS && target.type === "file" || target.disabled) { return true; } break; case "label": case "video": return true; } return /\bneedsclick\b/.test(target.className); }; FastClick.prototype.needsFocus = function (target) { "use strict"; switch (target.nodeName.toLowerCase()) { case "textarea": return true; case "select": return !this.deviceIsAndroid; case "input": switch (target.type) { case "button": case "checkbox": case "file": case "image": case "radio": case "submit": return false; } return !target.disabled && !target.readOnly; default: return /\bneedsfocus\b/.test(target.className); } }; FastClick.prototype.sendClick = function (targetElement, event) { "use strict"; var clickEvent, touch; if (document.activeElement && document.activeElement !== targetElement) { document.activeElement.blur(); } touch = event.changedTouches[0]; clickEvent = document.createEvent("MouseEvents"); clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); clickEvent.forwardedTouchEvent = true; targetElement.dispatchEvent(clickEvent); }; FastClick.prototype.determineEventType = function (targetElement) { "use strict"; if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === "select") { return "mousedown"; } return "click"; }; FastClick.prototype.focus = function (targetElement) { "use strict"; var length; if (this.deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf("date") !== 0 && targetElement.type !== "time") { length = targetElement.value.length; targetElement.setSelectionRange(length, length); } else { targetElement.focus(); } }; FastClick.prototype.updateScrollParent = function (targetElement) { "use strict"; var scrollParent, parentElement; scrollParent = targetElement.fastClickScrollParent; if (!scrollParent || !scrollParent.contains(targetElement)) { parentElement = targetElement; do { if (parentElement.scrollHeight > parentElement.offsetHeight) { scrollParent = parentElement; targetElement.fastClickScrollParent = parentElement; break; } parentElement = parentElement.parentElement; } while (parentElement); } if (scrollParent) { scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; } }; FastClick.prototype.getTargetElementFromEventTarget = function (eventTarget) { "use strict"; if (eventTarget.nodeType === Node.TEXT_NODE) { return eventTarget.parentNode; } return eventTarget; }; FastClick.prototype.onTouchStart = function (event) { "use strict"; var targetElement, touch, selection; if (event.targetTouches.length > 1) { return true; } targetElement = this.getTargetElementFromEventTarget(event.target); touch = event.targetTouches[0]; if (this.deviceIsIOS) { selection = window.getSelection(); if (selection.rangeCount && !selection.isCollapsed) { return true; } if (!this.deviceIsIOS4) { if (touch.identifier === this.lastTouchIdentifier) { event.preventDefault(); return false; } this.lastTouchIdentifier = touch.identifier; this.updateScrollParent(targetElement); } } this.trackingClick = true; this.trackingClickStart = event.timeStamp; this.targetElement = targetElement; this.touchStartX = touch.pageX; this.touchStartY = touch.pageY; if (event.timeStamp - this.lastClickTime < 200) { event.preventDefault(); } return true; }; FastClick.prototype.touchHasMoved = function (event) { "use strict"; var touch = event.changedTouches[0], boundary = this.touchBoundary; if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { return true; } return false; }; FastClick.prototype.onTouchMove = function (event) { "use strict"; if (!this.trackingClick) { return true; } if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { this.trackingClick = false; this.targetElement = null; } return true; }; FastClick.prototype.findControl = function (labelElement) { "use strict"; if (labelElement.control !== undefined) { return labelElement.control; } if (labelElement.htmlFor) { return document.getElementById(labelElement.htmlFor); } return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea"); }; FastClick.prototype.onTouchEnd = function (event) { "use strict"; var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; if (!this.trackingClick) { return true; } if (event.timeStamp - this.lastClickTime < 200) { this.cancelNextClick = true; return true; } this.cancelNextClick = false; this.lastClickTime = event.timeStamp; trackingClickStart = this.trackingClickStart; this.trackingClick = false; this.trackingClickStart = 0; if (this.deviceIsIOSWithBadTarget) { touch = event.changedTouches[0]; targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; } targetTagName = targetElement.tagName.toLowerCase(); if (targetTagName === "label") { forElement = this.findControl(targetElement); if (forElement) { this.focus(targetElement); if (this.deviceIsAndroid) { return false; } targetElement = forElement; } } else if (this.needsFocus(targetElement)) { if (event.timeStamp - trackingClickStart > 100 || this.deviceIsIOS && window.top !== window && targetTagName === "input") { this.targetElement = null; return false; } this.focus(targetElement); if (!this.deviceIsIOS4 || targetTagName !== "select") { this.targetElement = null; event.preventDefault(); } return false; } if (this.deviceIsIOS && !this.deviceIsIOS4) { scrollParent = targetElement.fastClickScrollParent; if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { return true; } } if (!this.needsClick(targetElement)) { event.preventDefault(); this.sendClick(targetElement, event); } return false; }; FastClick.prototype.onTouchCancel = function () { "use strict"; this.trackingClick = false; this.targetElement = null; }; FastClick.prototype.onMouse = function (event) { "use strict"; if (!this.targetElement) { return true; } if (event.forwardedTouchEvent) { return true; } if (!event.cancelable) { return true; } if (!this.needsClick(this.targetElement) || this.cancelNextClick) { if (event.stopImmediatePropagation) { event.stopImmediatePropagation(); } else { event.propagationStopped = true; } event.stopPropagation(); event.preventDefault(); return false; } return true; }; FastClick.prototype.onClick = function (event) { "use strict"; var permitted; if (this.trackingClick) { this.targetElement = null; this.trackingClick = false; return true; } if (event.target.type === "submit" && event.detail === 0) { return true; } permitted = this.onMouse(event); if (!permitted) { this.targetElement = null; } return permitted; }; FastClick.prototype.destroy = function () { "use strict"; var layer = this.layer; if (this.deviceIsAndroid) { layer.removeEventListener("mouseover", this.onMouse, true); layer.removeEventListener("mousedown", this.onMouse, true); layer.removeEventListener("mouseup", this.onMouse, true); } layer.removeEventListener("click", this.onClick, true); layer.removeEventListener("touchstart", this.onTouchStart, false); layer.removeEventListener("touchmove", this.onTouchMove, false); layer.removeEventListener("touchend", this.onTouchEnd, false); layer.removeEventListener("touchcancel", this.onTouchCancel, false); }; FastClick.notNeeded = function (layer) { "use strict"; var metaViewport; var chromeVersion; if (typeof window.ontouchstart === "undefined") { return true; } chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]; if (chromeVersion) { if (FastClick.prototype.deviceIsAndroid) { metaViewport = document.querySelector("meta[name=viewport]"); if (metaViewport) { if (metaViewport.content.indexOf("user-scalable=no") !== -1) { return true; } if (chromeVersion > 31 && window.innerWidth <= window.screen.width) { return true; } } } else { return true; } } if (layer.style.msTouchAction === "none") { return true; } return false; }; FastClick.attach = function (layer) { "use strict"; return new FastClick(layer); }; if (typeof define !== "undefined" && __webpack_require__("3c35")) { define(function () { "use strict"; return FastClick; }); } else if (typeof module !== "undefined" && module.exports) { module.exports = FastClick.attach; module.exports.FastClick = FastClick; } else { window.FastClick = FastClick; } }); require.register("component~indexof@0.0.3", function (exports, module) { module.exports = function (arr, obj) { if (arr.indexOf) return arr.indexOf(obj); for (var i = 0; i < arr.length; ++i) { if (arr[i] === obj) return i; } return -1; }; }); require.register("component~classes@1.2.1", function (exports, module) { var index = require("component~indexof@0.0.3"); var re = /\s+/; var toString = Object.prototype.toString; module.exports = function (el) { return new ClassList(el); }; function ClassList(el) { if (!el) throw new Error("A DOM element reference is required"); this.el = el; this.list = el.classList; } ClassList.prototype.add = function (name) { if (this.list) { this.list.add(name); return this; } var arr = this.array(); var i = index(arr, name); if (!~i) arr.push(name); this.el.className = arr.join(" "); return this; }; ClassList.prototype.remove = function (name) { if ("[object RegExp]" == toString.call(name)) { return this.removeMatching(name); } if (this.list) { this.list.remove(name); return this; } var arr = this.array(); var i = index(arr, name); if (~i) arr.splice(i, 1); this.el.className = arr.join(" "); return this; }; ClassList.prototype.removeMatching = function (re) { var arr = this.array(); for (var i = 0; i < arr.length; i++) { if (re.test(arr[i])) { this.remove(arr[i]); } } return this; }; ClassList.prototype.toggle = function (name, force) { if (this.list) { if ("undefined" !== typeof force) { if (force !== this.list.toggle(name, force)) { this.list.toggle(name); } } else { this.list.toggle(name); } return this; } if ("undefined" !== typeof force) { if (!force) { this.remove(name); } else { this.add(name); } } else { if (this.has(name)) { this.remove(name); } else { this.add(name); } } return this; }; ClassList.prototype.array = function () { var str = this.el.className.replace(/^\s+|\s+$/g, ""); var arr = str.split(re); if ("" === arr[0]) arr.shift(); return arr; }; ClassList.prototype.has = ClassList.prototype.contains = function (name) { return this.list ? this.list.contains(name) : !!~index(this.array(), name); }; }); require.register("component~event@0.1.4", function (exports, module) { var bind = window.addEventListener ? "addEventListener" : "attachEvent", unbind = window.removeEventListener ? "removeEventListener" : "detachEvent", prefix = bind !== "addEventListener" ? "on" : ""; exports.bind = function (el, type, fn, capture) { el[bind](prefix + type, fn, capture || false); return fn; }; exports.unbind = function (el, type, fn, capture) { el[unbind](prefix + type, fn, capture || false); return fn; }; }); require.register("component~query@0.0.3", function (exports, module) { function one(selector, el) { return el.querySelector(selector); } exports = module.exports = function (selector, el) { el = el || document; return one(selector, el); }; exports.all = function (selector, el) { el = el || document; return el.querySelectorAll(selector); }; exports.engine = function (obj) { if (!obj.one) throw new Error(".one callback required"); if (!obj.all) throw new Error(".all callback required"); one = obj.one; exports.all = obj.all; return exports; }; }); require.register("component~matches-selector@0.1.5", function (exports, module) { var query = require("component~query@0.0.3"); var proto = Element.prototype; var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector; module.exports = match; function match(el, selector) { if (!el || el.nodeType !== 1) return false; if (vendor) return vendor.call(el, selector); var nodes = query.all(selector, el.parentNode); for (var i = 0; i < nodes.length; ++i) { if (nodes[i] == el) return true; } return false; } }); require.register("component~closest@0.1.4", function (exports, module) { var matches = require("component~matches-selector@0.1.5"); module.exports = function (element, selector, checkYoSelf, root) { element = checkYoSelf ? { parentNode: element } : element; root = root || document; while ((element = element.parentNode) && element !== document) { if (matches(element, selector)) return element; if (element === root) return; } }; }); require.register("component~delegate@0.2.3", function (exports, module) { var closest = require("component~closest@0.1.4"), event = require("component~event@0.1.4"); exports.bind = function (el, selector, type, fn, capture) { return event.bind(el, type, function (e) { var target = e.target || e.srcElement; e.delegateTarget = closest(target, selector, true, el); if (e.delegateTarget) fn.call(el, e); }, capture); }; exports.unbind = function (el, type, fn, capture) { event.unbind(el, type, fn, capture); }; }); require.register("component~events@1.0.9", function (exports, module) { var events = require("component~event@0.1.4"); var delegate = require("component~delegate@0.2.3"); module.exports = Events; function Events(el, obj) { if (!(this instanceof Events)) return new Events(el, obj); if (!el) throw new Error("element required"); if (!obj) throw new Error("object required"); this.el = el; this.obj = obj; this._events = {}; } Events.prototype.sub = function (event, method, cb) { this._events[event] = this._events[event] || {}; this._events[event][method] = cb; }; Events.prototype.bind = function (event, method) { var e = parse(event); var el = this.el; var obj = this.obj; var name = e.name; var method = method || "on" + name; var args = [].slice.call(arguments, 2); function cb() { var a = [].slice.call(arguments).concat(args); obj[method].apply(obj, a); } if (e.selector) { cb = delegate.bind(el, e.selector, name, cb); } else { events.bind(el, name, cb); } this.sub(name, method, cb); return cb; }; Events.prototype.unbind = function (event, method) { if (0 == arguments.length) return this.unbindAll(); if (1 == arguments.length) return this.unbindAllOf(event); var bindings = this._events[event]; if (!bindings) return; var cb = bindings[method]; if (!cb) return; events.unbind(this.el, event, cb); }; Events.prototype.unbindAll = function () { for (var event in this._events) { this.unbindAllOf(event); } }; Events.prototype.unbindAllOf = function (event) { var bindings = this._events[event]; if (!bindings) return; for (var method in bindings) { this.unbind(event, method); } }; function parse(event) { var parts = event.split(/ +/); return { name: parts.shift(), selector: parts.join(" ") }; } }); require.register("switchery", function (exports, module) { var transitionize = require("abpetkov~transitionize@0.0.3"), fastclick = require("ftlabs~fastclick@v0.6.11"), classes = require("component~classes@1.2.1"), events = require("component~events@1.0.9"); module.exports = Switchery; var defaults = { color: "#64bd63", secondaryColor: "#dfdfdf", jackColor: "#fff", jackSecondaryColor: null, className: "switchery", disabled: false, disabledOpacity: .5, speed: "0.4s", size: "default" }; function Switchery(element, options) { if (!(this instanceof Switchery)) return new Switchery(element, options); this.element = element; this.options = options || {}; for (var i in defaults) { if (this.options[i] == null) { this.options[i] = defaults[i]; } } if (this.element != null && this.element.type == "checkbox") this.init(); if (this.isDisabled() === true) this.disable(); } Switchery.prototype.hide = function () { this.element.style.display = "none"; }; Switchery.prototype.show = function () { var switcher = this.create(); this.insertAfter(this.element, switcher); }; Switchery.prototype.create = function () { this.switcher = document.createElement("span"); this.jack = document.createElement("small"); this.switcher.appendChild(this.jack); this.switcher.className = this.options.className; this.events = events(this.switcher, this); return this.switcher; }; Switchery.prototype.insertAfter = function (reference, target) { reference.parentNode.insertBefore(target, reference.nextSibling); }; Switchery.prototype.setPosition = function (clicked) { var checked = this.isChecked(), switcher = this.switcher, jack = this.jack; if (clicked && checked) checked = false;else if (clicked && !checked) checked = true; if (checked === true) { this.element.checked = true; if (window.getComputedStyle) jack.style.left = parseInt(window.getComputedStyle(switcher).width) - parseInt(window.getComputedStyle(jack).width) + "px";else jack.style.left = parseInt(switcher.currentStyle["width"]) - parseInt(jack.currentStyle["width"]) + "px"; if (this.options.color) this.colorize(); this.setSpeed(); } else { jack.style.left = 0; this.element.checked = false; this.switcher.style.boxShadow = "inset 0 0 0 0 " + this.options.secondaryColor; this.switcher.style.borderColor = this.options.secondaryColor; this.switcher.style.backgroundColor = this.options.secondaryColor !== defaults.secondaryColor ? this.options.secondaryColor : "#fff"; this.jack.style.backgroundColor = this.options.jackSecondaryColor !== this.options.jackColor ? this.options.jackSecondaryColor : this.options.jackColor; this.setSpeed(); } }; Switchery.prototype.setSpeed = function () { var switcherProp = {}, jackProp = { "background-color": this.options.speed, left: this.options.speed.replace(/[a-z]/, "") / 2 + "s" }; if (this.isChecked()) { switcherProp = { border: this.options.speed, "box-shadow": this.options.speed, "background-color": this.options.speed.replace(/[a-z]/, "") * 3 + "s" }; } else { switcherProp = { border: this.options.speed, "box-shadow": this.options.speed }; } transitionize(this.switcher, switcherProp); transitionize(this.jack, jackProp); }; Switchery.prototype.setSize = function () { var small = "switchery-small", normal = "switchery-default", large = "switchery-large"; switch (this.options.size) { case "small": classes(this.switcher).add(small); break; case "large": classes(this.switcher).add(large); break; default: classes(this.switcher).add(normal); break; } }; Switchery.prototype.colorize = function () { var switcherHeight = this.switcher.offsetHeight / 2; this.switcher.style.backgroundColor = this.options.color; this.switcher.style.borderColor = this.options.color; this.switcher.style.boxShadow = "inset 0 0 0 " + switcherHeight + "px " + this.options.color; this.jack.style.backgroundColor = this.options.jackColor; }; Switchery.prototype.handleOnchange = function (state) { if (document.dispatchEvent) { var event = document.createEvent("HTMLEvents"); event.initEvent("change", true, true); this.element.dispatchEvent(event); } else { this.element.fireEvent("onchange"); } }; Switchery.prototype.handleChange = function () { var self = this, el = this.element; if (el.addEventListener) { el.addEventListener("change", function () { self.setPosition(); }); } else { el.attachEvent("onchange", function () { self.setPosition(); }); } }; Switchery.prototype.handleClick = function () { var switcher = this.switcher; fastclick(switcher); this.events.bind("click", "bindClick"); }; Switchery.prototype.bindClick = function () { var parent = this.element.parentNode.tagName.toLowerCase(), labelParent = parent === "label" ? false : true; this.setPosition(labelParent); this.handleOnchange(this.element.checked); }; Switchery.prototype.markAsSwitched = function () { this.element.setAttribute("data-switchery", true); }; Switchery.prototype.markedAsSwitched = function () { return this.element.getAttribute("data-switchery"); }; Switchery.prototype.init = function () { this.hide(); this.show(); this.setSize(); this.setPosition(); this.markAsSwitched(); this.handleChange(); this.handleClick(); }; Switchery.prototype.isChecked = function () { return this.element.checked; }; Switchery.prototype.isDisabled = function () { return this.options.disabled || this.element.disabled || this.element.readOnly; }; Switchery.prototype.destroy = function () { this.events.unbind(); }; Switchery.prototype.enable = function () { if (this.options.disabled) this.options.disabled = false; if (this.element.disabled) this.element.disabled = false; if (this.element.readOnly) this.element.readOnly = false; this.switcher.style.opacity = 1; this.events.bind("click", "bindClick"); }; Switchery.prototype.disable = function () { if (!this.options.disabled) this.options.disabled = true; if (!this.element.disabled) this.element.disabled = true; if (!this.element.readOnly) this.element.readOnly = true; this.switcher.style.opacity = this.options.disabledOpacity; this.destroy(); }; }); if ((typeof exports === "undefined" ? "undefined" : Object(E_FlyContract_com_New_Projects_Website_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(exports)) == "object") { module.exports = require("switchery"); } else if (typeof define == "function" && __webpack_require__("3c35")) { define("Switchery", [], function () { return require("switchery"); }); } else { (this || window)["Switchery"] = require("switchery"); } })(); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("dd40")(module))) /***/ }), /***/ "db29": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Dutch (Belgium) [nl-be] //! author : Joris Röling : https://github.com/jorisroling //! author : Jacob Middag : https://github.com/middagj ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split( '_' ), monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split( '_' ), monthsParse = [ /^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i, ], monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; var nlBe = moment.defineLocale('nl-be', { months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split( '_' ), monthsShort: function (m, format) { if (!m) { return monthsShortWithDots; } else if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; } else { return monthsShortWithDots[m.month()]; } }, monthsRegex: monthsRegex, monthsShortRegex: monthsRegex, monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: monthsParse, weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split( '_' ), weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[vandaag om] LT', nextDay: '[morgen om] LT', nextWeek: 'dddd [om] LT', lastDay: '[gisteren om] LT', lastWeek: '[afgelopen] dddd [om] LT', sameElse: 'L', }, relativeTime: { future: 'over %s', past: '%s geleden', s: 'een paar seconden', ss: '%d seconden', m: 'één minuut', mm: '%d minuten', h: 'één uur', hh: '%d uur', d: 'één dag', dd: '%d dagen', M: 'één maand', MM: '%d maanden', y: 'één jaar', yy: '%d jaar', }, dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, ordinal: function (number) { return ( number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de') ); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return nlBe; }))); /***/ }), /***/ "dc4d": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Hindi [hi] //! author : Mayank Singhal : https://github.com/mayanksinghal ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { 1: '१', 2: '२', 3: '३', 4: '४', 5: '५', 6: '६', 7: '७', 8: '८', 9: '९', 0: '०', }, numberMap = { '१': '1', '२': '2', '३': '3', '४': '4', '५': '5', '६': '6', '७': '7', '८': '8', '९': '9', '०': '0', }, monthsParse = [ /^जन/i, /^फ़र|फर/i, /^मार्च/i, /^अप्रै/i, /^मई/i, /^जून/i, /^जुल/i, /^अग/i, /^सितं|सित/i, /^अक्टू/i, /^नव|नवं/i, /^दिसं|दिस/i, ], shortMonthsParse = [ /^जन/i, /^फ़र/i, /^मार्च/i, /^अप्रै/i, /^मई/i, /^जून/i, /^जुल/i, /^अग/i, /^सित/i, /^अक्टू/i, /^नव/i, /^दिस/i, ]; var hi = moment.defineLocale('hi', { months: { format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split( '_' ), standalone: 'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split( '_' ), }, monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split( '_' ), weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'), longDateFormat: { LT: 'A h:mm बजे', LTS: 'A h:mm:ss बजे', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm बजे', LLLL: 'dddd, D MMMM YYYY, A h:mm बजे', }, monthsParse: monthsParse, longMonthsParse: monthsParse, shortMonthsParse: shortMonthsParse, monthsRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i, monthsShortRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i, monthsStrictRegex: /^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i, monthsShortStrictRegex: /^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i, calendar: { sameDay: '[आज] LT', nextDay: '[कल] LT', nextWeek: 'dddd, LT', lastDay: '[कल] LT', lastWeek: '[पिछले] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s में', past: '%s पहले', s: 'कुछ ही क्षण', ss: '%d सेकंड', m: 'एक मिनट', mm: '%d मिनट', h: 'एक घंटा', hh: '%d घंटे', d: 'एक दिन', dd: '%d दिन', M: 'एक महीने', MM: '%d महीने', y: 'एक वर्ष', yy: '%d वर्ष', }, preparse: function (string) { return string.replace(/[१२३४५६७८९०]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Hindi notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. meridiemParse: /रात|सुबह|दोपहर|शाम/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'रात') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'सुबह') { return hour; } else if (meridiem === 'दोपहर') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'शाम') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'रात'; } else if (hour < 10) { return 'सुबह'; } else if (hour < 17) { return 'दोपहर'; } else if (hour < 20) { return 'शाम'; } else { return 'रात'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return hi; }))); /***/ }), /***/ "dc60": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2f62"); var VueGlobalVariable = { install: function (Vue, options) { options = options || {}; // const store = options.store || {state:{}} Vue.use(vuex__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]); var store = new vuex__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].Store({ state: {} }); var globals = options.globals || {}; Object.keys(globals).forEach(function (key) { window["" + key] = globals[key]; Vue.set(store.state, key, globals[key]); }); var computed = {}; Object.keys(globals).forEach(function (key) { computed["" + key] = function () { return globals[key]; }; }); Vue.mixin({ computed: computed }); } }; /* harmony default export */ __webpack_exports__["a"] = (VueGlobalVariable); /***/ }), /***/ "dcbc": /***/ (function(module, exports, __webpack_require__) { var redefine = __webpack_require__("2aba"); module.exports = function (target, src, safe) { for (var key in src) redefine(target, key, src[key], safe); return target; }; /***/ }), /***/ "dd40": /***/ (function(module, exports) { module.exports = function(originalModule) { if (!originalModule.webpackPolyfill) { var module = Object.create(originalModule); // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); Object.defineProperty(module, "exports", { enumerable: true }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "df54": /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ "e0c5": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Gujarati [gu] //! author : Kaushik Thanki : https://github.com/Kaushik1987 ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { 1: '૧', 2: '૨', 3: '૩', 4: '૪', 5: '૫', 6: '૬', 7: '૭', 8: '૮', 9: '૯', 0: '૦', }, numberMap = { '૧': '1', '૨': '2', '૩': '3', '૪': '4', '૫': '5', '૬': '6', '૭': '7', '૮': '8', '૯': '9', '૦': '0', }; var gu = moment.defineLocale('gu', { months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split( '_' ), monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split( '_' ), monthsParseExact: true, weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split( '_' ), weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'), weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'), longDateFormat: { LT: 'A h:mm વાગ્યે', LTS: 'A h:mm:ss વાગ્યે', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm વાગ્યે', LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે', }, calendar: { sameDay: '[આજ] LT', nextDay: '[કાલે] LT', nextWeek: 'dddd, LT', lastDay: '[ગઇકાલે] LT', lastWeek: '[પાછલા] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s મા', past: '%s પહેલા', s: 'અમુક પળો', ss: '%d સેકંડ', m: 'એક મિનિટ', mm: '%d મિનિટ', h: 'એક કલાક', hh: '%d કલાક', d: 'એક દિવસ', dd: '%d દિવસ', M: 'એક મહિનો', MM: '%d મહિનો', y: 'એક વર્ષ', yy: '%d વર્ષ', }, preparse: function (string) { return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Gujarati notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati. meridiemParse: /રાત|બપોર|સવાર|સાંજ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'રાત') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'સવાર') { return hour; } else if (meridiem === 'બપોર') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'સાંજ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'રાત'; } else if (hour < 10) { return 'સવાર'; } else if (hour < 17) { return 'બપોર'; } else if (hour < 20) { return 'સાંજ'; } else { return 'રાત'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return gu; }))); /***/ }), /***/ "e11e": /***/ (function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }), /***/ "e1d3": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (Ireland) [en-ie] //! author : Chris Cartlidge : https://github.com/chriscartlidge ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enIe = moment.defineLocale('en-ie', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd D MMMM YYYY HH:mm', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return enIe; }))); /***/ }), /***/ "e3db": /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /***/ "e683": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * @returns {string} The combined URL */ module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; }; /***/ }), /***/ "e81d": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Cambodian [km] //! author : Kruy Vanna : https://github.com/kruyvanna ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { 1: '១', 2: '២', 3: '៣', 4: '៤', 5: '៥', 6: '៦', 7: '៧', 8: '៨', 9: '៩', 0: '០', }, numberMap = { '១': '1', '២': '2', '៣': '3', '៤': '4', '៥': '5', '៦': '6', '៧': '7', '៨': '8', '៩': '9', '០': '0', }; var km = moment.defineLocale('km', { months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( '_' ), monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( '_' ), weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm', }, meridiemParse: /ព្រឹក|ល្ងាច/, isPM: function (input) { return input === 'ល្ងាច'; }, meridiem: function (hour, minute, isLower) { if (hour < 12) { return 'ព្រឹក'; } else { return 'ល្ងាច'; } }, calendar: { sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', nextDay: '[ស្អែក ម៉ោង] LT', nextWeek: 'dddd [ម៉ោង] LT', lastDay: '[ម្សិលមិញ ម៉ោង] LT', lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', sameElse: 'L', }, relativeTime: { future: '%sទៀត', past: '%sមុន', s: 'ប៉ុន្មានវិនាទី', ss: '%d វិនាទី', m: 'មួយនាទី', mm: '%d នាទី', h: 'មួយម៉ោង', hh: '%d ម៉ោង', d: 'មួយថ្ងៃ', dd: '%d ថ្ងៃ', M: 'មួយខែ', MM: '%d ខែ', y: 'មួយឆ្នាំ', yy: '%d ឆ្នាំ', }, dayOfMonthOrdinalParse: /ទី\d{1,2}/, ordinal: 'ទី%d', preparse: function (string) { return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return km; }))); /***/ }), /***/ "e853": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("d3f4"); var isArray = __webpack_require__("1169"); var SPECIES = __webpack_require__("2b4c")('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; /***/ }), /***/ "e94d": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Subscriptions_vue_vue_type_style_index_0_id_10c5bb3c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5ad4"); /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Subscriptions_vue_vue_type_style_index_0_id_10c5bb3c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Subscriptions_vue_vue_type_style_index_0_id_10c5bb3c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); /* unused harmony reexport * */ /***/ }), /***/ "ea76": /***/ (function(module, exports, __webpack_require__) { !function(e,t){ true?module.exports=t():undefined}(window,function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var a;!function(i){"use strict";var r={},s=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o=/\d\d?/,l=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,u=/\[([^]*?)\]/gm,c=function(){};function d(e,t){for(var n=[],a=0,i=e.length;a3?0:(e-e%10!=10)*e%10]}};var y={D:function(e){return e.getDate()},DD:function(e){return p(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return e.getDay()},dd:function(e){return p(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return p(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return String(e.getFullYear()).substr(2)},YYYY:function(e){return p(e.getFullYear(),4)},h:function(e){return e.getHours()%12||12},hh:function(e){return p(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return p(e.getHours())},m:function(e){return e.getMinutes()},mm:function(e){return p(e.getMinutes())},s:function(e){return e.getSeconds()},ss:function(e){return p(e.getSeconds())},S:function(e){return Math.round(e.getMilliseconds()/100)},SS:function(e){return p(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return p(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+p(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},b={D:[o,function(e,t){e.day=t}],Do:[new RegExp(o.source+l.source),function(e,t){e.day=parseInt(t,10)}],M:[o,function(e,t){e.month=t-1}],YY:[o,function(e,t){var n=+(""+(new Date).getFullYear()).substr(0,2);e.year=""+(t>68?n-1:n)+t}],h:[o,function(e,t){e.hour=t}],m:[o,function(e,t){e.minute=t}],s:[o,function(e,t){e.second=t}],YYYY:[/\d{4}/,function(e,t){e.year=t}],S:[/\d/,function(e,t){e.millisecond=100*t}],SS:[/\d{2}/,function(e,t){e.millisecond=10*t}],SSS:[/\d{3}/,function(e,t){e.millisecond=t}],d:[o,c],ddd:[l,c],MMM:[l,h("monthNamesShort")],MMMM:[l,h("monthNames")],a:[l,function(e,t,n){var a=t.toLowerCase();a===n.amPm[0]?e.isPm=!1:a===n.amPm[1]&&(e.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(e,t){"Z"===t&&(t="+00:00");var n,a=(t+"").match(/([\+\-]|\d\d)/gi);a&&(n=60*a[1]+parseInt(a[2],10),e.timezoneOffset="+"===a[0]?n:-n)}]};b.dd=b.d,b.dddd=b.ddd,b.DD=b.D,b.mm=b.m,b.hh=b.H=b.HH=b.h,b.MM=b.M,b.ss=b.s,b.A=b.a,r.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},r.format=function(e,t,n){var a=n||r.i18n;if("number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");var i=[];return(t=(t=(t=r.masks[t]||t||r.masks.default).replace(u,function(e,t){return i.push(t),"??"})).replace(s,function(t){return t in y?y[t](e,a):t.slice(1,t.length-1)})).replace(/\?\?/g,function(){return i.shift()})},r.parse=function(e,t,n){var a=n||r.i18n;if("string"!=typeof t)throw new Error("Invalid format in fecha.parse");if(t=r.masks[t]||t,e.length>1e3)return!1;var i=!0,o={};if(t.replace(s,function(t){if(b[t]){var n=b[t],r=e.search(n[0]);~r?e.replace(n[0],function(t){return n[1](o,t,a),e=e.substr(r+t.length),t}):i=!1}return b[t]?"":t.slice(1,t.length-1)}),!i)return!1;var l,u=new Date;return!0===o.isPm&&null!=o.hour&&12!=+o.hour?o.hour=+o.hour+12:!1===o.isPm&&12==+o.hour&&(o.hour=0),null!=o.timezoneOffset?(o.minute=+(o.minute||0)-+o.timezoneOffset,l=new Date(Date.UTC(o.year||u.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):l=new Date(o.year||u.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),l},void 0!==e&&e.exports?e.exports=r:void 0===(a=function(){return r}.call(t,n,t,e))||(e.exports=a)}()},function(e,t){var n=/^(attrs|props|on|nativeOn|class|style|hook)$/;function a(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}}e.exports=function(e){return e.reduce(function(e,t){var i,r,s,o,l;for(s in t)if(i=e[s],r=t[s],i&&n.test(s))if("class"===s&&("string"==typeof i&&(l=i,e[s]=i={},i[l]=!0),"string"==typeof r&&(l=r,t[s]=r={},r[l]=!0)),"on"===s||"nativeOn"===s||"hook"===s)for(o in r)i[o]=a(i[o],r[o]);else if(Array.isArray(i))e[s]=i.concat(r);else if(Array.isArray(r))e[s]=[i].concat(r);else for(o in r)i[o]=r[o];else e[s]=t[s];return e},{})}},function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{var s=[];for(i=0;i=2?{hours:parseInt(t[0],10),minutes:parseInt(t[1],10)}:null}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"24",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"a",a=e.hours,i=(a=(a="24"===t?a:a%12||12)<10?"0"+a:a)+":"+(e.minutes<10?"0"+e.minutes:e.minutes);if("12"===t){var r=e.hours>=12?"pm":"am";"A"===n&&(r=r.toUpperCase()),i=i+" "+r}return i}function c(e,t){if(!e)return"";try{return i.a.format(new Date(e),t)}catch(e){return""}}var d={date:{value2date:function(e){return o(e)?new Date(e):null},date2value:function(e){return e}},timestamp:{value2date:function(e){return o(e)?new Date(e):null},date2value:function(e){return e&&new Date(e).getTime()}}},h={zh:{days:["日","一","二","三","四","五","六"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],pickers:["未来7天","未来30天","最近7天","最近30天"],placeholder:{date:"请选择日期",dateRange:"请选择日期范围"}},en:{days:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pickers:["next 7 days","next 30 days","previous 7 days","previous 30 days"],placeholder:{date:"Select Date",dateRange:"Select Date Range"}},ro:{days:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm"],months:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Noi","Dec"],pickers:["urmatoarele 7 zile","urmatoarele 30 zile","ultimele 7 zile","ultimele 30 zile"],placeholder:{date:"Selectați Data",dateRange:"Selectați Intervalul De Date"}},fr:{days:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec"],pickers:["7 jours suivants","30 jours suivants","7 jours précédents","30 jours précédents"],placeholder:{date:"Sélectionnez une date",dateRange:"Sélectionnez une période"}},es:{days:["Dom","Lun","Mar","Mie","Jue","Vie","Sab"],months:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],pickers:["próximos 7 días","próximos 30 días","7 días anteriores","30 días anteriores"],placeholder:{date:"Seleccionar fecha",dateRange:"Seleccionar un rango de fechas"}},"pt-br":{days:["Dom","Seg","Ter","Qua","Quin","Sex","Sáb"],months:["Jan","Fev","Mar","Abr","Maio","Jun","Jul","Ago","Set","Out","Nov","Dez"],pickers:["próximos 7 dias","próximos 30 dias","7 dias anteriores"," 30 dias anteriores"],placeholder:{date:"Selecione uma data",dateRange:"Selecione um período"}},ru:{days:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],pickers:["след. 7 дней","след. 30 дней","прош. 7 дней","прош. 30 дней"],placeholder:{date:"Выберите дату",dateRange:"Выберите период"}},de:{days:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],pickers:["nächsten 7 Tage","nächsten 30 Tage","vorigen 7 Tage","vorigen 30 Tage"],placeholder:{date:"Datum auswählen",dateRange:"Zeitraum auswählen"}},it:{days:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],months:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],pickers:["successivi 7 giorni","successivi 30 giorni","precedenti 7 giorni","precedenti 30 giorni"],placeholder:{date:"Seleziona una data",dateRange:"Seleziona un intervallo date"}},cs:{days:["Ned","Pon","Úte","Stř","Čtv","Pát","Sob"],months:["Led","Úno","Bře","Dub","Kvě","Čer","Čerc","Srp","Zář","Říj","Lis","Pro"],pickers:["příštích 7 dní","příštích 30 dní","předchozích 7 dní","předchozích 30 dní"],placeholder:{date:"Vyberte datum",dateRange:"Vyberte časové rozmezí"}},sl:{days:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],months:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],pickers:["naslednjih 7 dni","naslednjih 30 dni","prejšnjih 7 dni","prejšnjih 30 dni"],placeholder:{date:"Izberite datum",dateRange:"Izberite razpon med 2 datumoma"}}},p=h.zh,m={methods:{t:function(e){for(var t=this,n=t.$options.name;t&&(!n||"DatePicker"!==n);)(t=t.$parent)&&(n=t.$options.name);for(var a=t&&t.language||p,i=e.split("."),r=a,s=void 0,o=0,l=i.length;oo&&(e.scrollTop=r-e.clientHeight)}else e.scrollTop=0}var g=n(1),v=n.n(g),y={name:"panelDate",mixins:[m],props:{value:null,startAt:null,endAt:null,dateFormat:{type:String,default:"YYYY-MM-DD"},calendarMonth:{default:(new Date).getMonth()},calendarYear:{default:(new Date).getFullYear()},firstDayOfWeek:{default:7,type:Number,validator:function(e){return e>=1&&e<=7}},disabledDate:{type:Function,default:function(){return!1}}},methods:{selectDate:function(e){var t=e.year,n=e.month,a=e.day,i=new Date(t,n,a);this.disabledDate(i)||this.$emit("select",i)},getDays:function(e){var t=this.t("days"),n=parseInt(e,10);return t.concat(t).slice(n,n+7)},getDates:function(e,t,n){var a=[],i=new Date(e,t);i.setDate(0);for(var r=(i.getDay()+7-n)%7+1,s=i.getDate()-(r-1),o=0;othis.calendarMonth?i.push("next-month"):i.push("cur-month"),r===s&&i.push("today"),this.disabledDate(r)&&i.push("disabled"),o&&(r===o?i.push("actived"):l&&r<=o?i.push("inrange"):u&&r>=o&&i.push("inrange")),i},getCellTitle:function(e){var t=e.year,n=e.month,a=e.day;return c(new Date(t,n,a),this.dateFormat)}},render:function(e){var t=this,n=this.getDays(this.firstDayOfWeek).map(function(t){return e("th",[t])}),a=this.getDates(this.calendarYear,this.calendarMonth,this.firstDayOfWeek),i=Array.apply(null,{length:6}).map(function(n,i){var r=a.slice(7*i,7*i+7).map(function(n){var a={class:t.getCellClasses(n)};return e("td",v()([{class:"cell"},a,{attrs:{"data-year":n.year,"data-month":n.month,title:t.getCellTitle(n)},on:{click:t.selectDate.bind(t,n)}}]),[n.day])});return e("tr",[r])});return e("table",{class:"mx-panel mx-panel-date"},[e("thead",[e("tr",[n])]),e("tbody",[i])])}},b={name:"panelYear",props:{value:null,firstYear:Number,disabledYear:Function},methods:{isDisabled:function(e){return!("function"!=typeof this.disabledYear||!this.disabledYear(e))},selectYear:function(e){this.isDisabled(e)||this.$emit("select",e)}},render:function(e){var t=this,n=10*Math.floor(this.firstYear/10),a=this.value&&new Date(this.value).getFullYear(),i=Array.apply(null,{length:10}).map(function(i,r){var s=n+r;return e("span",{class:{cell:!0,actived:a===s,disabled:t.isDisabled(s)},on:{click:t.selectYear.bind(t,s)}},[s])});return e("div",{class:"mx-panel mx-panel-year"},[i])}},x={name:"panelMonth",mixins:[m],props:{value:null,calendarYear:{default:(new Date).getFullYear()},disabledMonth:Function},methods:{isDisabled:function(e){return!("function"!=typeof this.disabledMonth||!this.disabledMonth(e))},selectMonth:function(e){this.isDisabled(e)||this.$emit("select",e)}},render:function(e){var t=this,n=this.t("months"),a=this.value&&new Date(this.value).getFullYear(),i=this.value&&new Date(this.value).getMonth();return n=n.map(function(n,r){return e("span",{class:{cell:!0,actived:a===t.calendarYear&&i===r,disabled:t.isDisabled(r)},on:{click:t.selectMonth.bind(t,r)}},[n])}),e("div",{class:"mx-panel mx-panel-month"},[n])}},w=Object.assign||function(e){for(var t=1;t=0&&e<=60}},value:null,timeType:{type:Array,default:function(){return["24","a"]}},disabledTime:Function},computed:{currentHours:function(){return this.value?new Date(this.value).getHours():0},currentMinutes:function(){return this.value?new Date(this.value).getMinutes():0},currentSeconds:function(){return this.value?new Date(this.value).getSeconds():0}},methods:{stringifyText:function(e){return("00"+e).slice(String(e).length)},selectTime:function(e){"function"==typeof this.disabledTime&&this.disabledTime(e)||this.$emit("select",new Date(e))},pickTime:function(e){"function"==typeof this.disabledTime&&this.disabledTime(e)||this.$emit("pick",new Date(e))},getTimePickerOptions:function(){var e=[],t=this.timePickerOptions;if(!t)return[];if("function"==typeof t)return t()||[];var n=l(t.start),a=l(t.end),i=l(t.step);if(n&&a&&i)for(var r=n.minutes+60*n.hours,s=a.minutes+60*a.hours,o=i.minutes+60*i.hours,c=Math.floor((s-r)/o),d=0;d<=c;d++){var h=r+d*o,p={hours:Math.floor(h/60),minutes:h%60};e.push({value:p,label:u.apply(void 0,[p].concat(M(this.timeType)))})}return e}},render:function(e){var t=this,n=this.value?new Date(this.value):(new Date).setHours(0,0,0,0),a="function"==typeof this.disabledTime&&this.disabledTime,i=this.getTimePickerOptions();if(Array.isArray(i)&&i.length)return i=i.map(function(i){var r=i.value.hours,s=i.value.minutes,o=new Date(n).setHours(r,s,0);return e("li",{class:{"mx-time-picker-item":!0,cell:!0,actived:r===t.currentHours&&s===t.currentMinutes,disabled:a&&a(o)},on:{click:t.pickTime.bind(t,o)}},[i.label])}),e("div",{class:"mx-panel mx-panel-time"},[e("ul",{class:"mx-time-list"},[i])]);var r=this.minuteStep||1,s=parseInt(60/r),o={hours:Array.apply(null,{length:24}).map(function(e,t){return t}),minutes:Array.apply(null,{length:s}).map(function(e,t){return t*r}),seconds:0===this.minuteStep?Array.apply(null,{length:60}).map(function(e,t){return t}):[]};this.timeSelectOptions&&"object"===D(this.timeSelectOptions)&&(o=w({},o,this.timeSelectOptions));var l=[o.hours.map(function(i){var r=new Date(n).setHours(i);return e("li",{class:{cell:!0,actived:i===t.currentHours,disabled:a&&a(r)},on:{click:t.selectTime.bind(t,r)}},[t.stringifyText(i)])}),o.minutes.map(function(i){var r=new Date(n).setMinutes(i);return e("li",{class:{cell:!0,actived:i===t.currentMinutes,disabled:a&&a(r)},on:{click:t.selectTime.bind(t,r)}},[t.stringifyText(i)])}),o.seconds.map(function(i){var r=new Date(n).setSeconds(i);return e("li",{class:{cell:!0,actived:i===t.currentSeconds,disabled:a&&a(r)},on:{click:t.selectTime.bind(t,r)}},[t.stringifyText(i)])})].filter(function(e){return e.length>0});return l=l.map(function(t){return e("ul",{class:"mx-time-list",style:{width:100/l.length+"%"}},[t])}),e("div",{class:"mx-panel mx-panel-time"},[l])}}},mixins:[m,{methods:{dispatch:function(e,t,n){for(var a=this.$parent||this.$root,i=a.$options.name;a&&(!i||i!==e);)(a=a.$parent)&&(i=a.$options.name);i&&i===e&&(a=a||this).$emit.apply(a,[t].concat(n))}}}],props:{value:{default:null,validator:function(e){return null===e||o(e)}},startAt:null,endAt:null,visible:{type:Boolean,default:!1},type:{type:String,default:"date"},dateFormat:{type:String,default:"YYYY-MM-DD"},index:Number,defaultValue:{validator:function(e){return o(e)}},firstDayOfWeek:{default:7,type:Number,validator:function(e){return e>=1&&e<=7}},notBefore:{default:null,validator:function(e){return!e||o(e)}},notAfter:{default:null,validator:function(e){return!e||o(e)}},disabledDays:{type:[Array,Function],default:function(){return[]}},minuteStep:{type:Number,default:0,validator:function(e){return e>=0&&e<=60}},timeSelectOptions:{type:Object,default:function(){return null}},timePickerOptions:{type:[Object,Function],default:function(){return null}}},data:function(){var e=this.getNow(this.value),t=e.getFullYear();return{panel:"NONE",dates:[],calendarMonth:e.getMonth(),calendarYear:t,firstYear:10*Math.floor(t/10)}},computed:{now:{get:function(){return new Date(this.calendarYear,this.calendarMonth).getTime()},set:function(e){var t=new Date(e);this.calendarYear=t.getFullYear(),this.calendarMonth=t.getMonth()}},timeType:function(){return[/h+/.test(this.$parent.format)?"12":"24",/A/.test(this.$parent.format)?"A":"a"]},timeHeader:function(){return"time"===this.type?this.$parent.format:this.value&&c(this.value,this.dateFormat)},yearHeader:function(){return this.firstYear+" ~ "+(this.firstYear+9)},months:function(){return this.t("months")},notBeforeTime:function(){return this.getCriticalTime(this.notBefore)},notAfterTime:function(){return this.getCriticalTime(this.notAfter)}},watch:{value:{immediate:!0,handler:"updateNow"},defaultValue:{handler:"updateNow"},visible:{immediate:!0,handler:"init"},panel:{handler:"handelPanelChange"}},methods:{handelPanelChange:function(e,t){var n=this;this.dispatch("DatePicker","panel-change",[e,t]),"YEAR"===e?this.firstYear=10*Math.floor(this.calendarYear/10):"TIME"===e&&this.$nextTick(function(){for(var e=n.$el.querySelectorAll(".mx-panel-time .mx-time-list"),t=0,a=e.length;tthis.notAfterTime||t&&e>this.getCriticalTime(t)},inDisabledDays:function(e){var t=this;return Array.isArray(this.disabledDays)?this.disabledDays.some(function(n){return t.getCriticalTime(n)===e}):"function"==typeof this.disabledDays&&this.disabledDays(new Date(e))},isDisabledYear:function(e){var t=new Date(e,0).getTime(),n=new Date(e+1,0).getTime()-1;return this.inBefore(n)||this.inAfter(t)||"year"===this.type&&this.inDisabledDays(t)},isDisabledMonth:function(e){var t=new Date(this.calendarYear,e).getTime(),n=new Date(this.calendarYear,e+1).getTime()-1;return this.inBefore(n)||this.inAfter(t)||"month"===this.type&&this.inDisabledDays(t)},isDisabledDate:function(e){var t=new Date(e).getTime(),n=new Date(e).setHours(23,59,59,999);return this.inBefore(n)||this.inAfter(t)||this.inDisabledDays(t)},isDisabledTime:function(e,t,n){var a=new Date(e).getTime();return this.inBefore(a,t)||this.inAfter(a,n)||this.inDisabledDays(a)},selectDate:function(e){if("datetime"===this.type){var t=new Date(e);return s(this.value)&&t.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds()),this.isDisabledTime(t)&&(t.setHours(0,0,0,0),this.notBefore&&t.getTime()=n?s():i=setTimeout(s,n)}}),window.addEventListener("resize",this._displayPopup),window.addEventListener("scroll",this._displayPopup)},beforeDestroy:function(){this.popupElm&&this.popupElm.parentNode===document.body&&document.body.removeChild(this.popupElm),document.removeEventListener(this._startEvt,this._bindDocmentMousedown),document.removeEventListener(this._endEvt,this._bindDocumentMouseup),window.removeEventListener("resize",this._displayPopup),window.removeEventListener("scroll",this._displayPopup)},methods:{initCalendar:function(){this.handleValueChange(this.value),this.displayPopup()},stringify:function(e){return r(this.format)&&"function"==typeof this.format.stringify?this.format.stringify(e):c(e,this.format)},parse:function(e){return r(this.format)&&"function"==typeof this.format.parse?this.format.parse(e):function(e,t){try{return i.a.parse(e,t)||null}catch(e){return null}}(e,this.format)},isValidValue:function(e){return o((0,this.transform.value2date)(e))},isValidRangeValue:function(e){var t=this.transform.value2date;return Array.isArray(e)&&2===e.length&&this.isValidValue(e[0])&&this.isValidValue(e[1])&&t(e[1]).getTime()>=t(e[0]).getTime()},dateEqual:function(e,t){return s(e)&&s(t)&&e.getTime()===t.getTime()},rangeEqual:function(e,t){var n=this;return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(function(e,a){return n.dateEqual(e,t[a])})},selectRange:function(e){"function"==typeof e.onClick?!1!==e.onClick(this)&&this.closePopup():(this.currentValue=[new Date(e.start),new Date(e.end)],this.updateDate(!0),this.closePopup())},clearDate:function(){var e=this.range?[null,null]:null;this.currentValue=e,this.updateDate(!0),this.$emit("clear")},confirmDate:function(){var e;(this.range?(e=this.currentValue,Array.isArray(e)&&2===e.length&&o(e[0])&&o(e[1])&&new Date(e[1]).getTime()>=new Date(e[0]).getTime()):o(this.currentValue))&&this.updateDate(!0),this.emitDate("confirm"),this.closePopup()},updateDate:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!(this.confirm&&!e||this.disabled)&&((this.range?!this.rangeEqual(this.value,this.currentValue):!this.dateEqual(this.value,this.currentValue))&&(this.emitDate("input"),this.emitDate("change"),!0))},emitDate:function(e){var t=this.transform.date2value,n=this.range?this.currentValue.map(t):t(this.currentValue);this.$emit(e,n)},handleValueChange:function(e){var t=this.transform.value2date;this.range?this.currentValue=this.isValidRangeValue(e)?e.map(t):[null,null]:this.currentValue=this.isValidValue(e)?t(e):null},selectDate:function(e){this.currentValue=e,this.updateDate()&&this.closePopup()},selectStartDate:function(e){this.$set(this.currentValue,0,e),this.currentValue[1]&&this.updateDate()},selectEndDate:function(e){this.$set(this.currentValue,1,e),this.currentValue[0]&&this.updateDate()},selectTime:function(e,t){this.currentValue=e,this.updateDate()&&t&&this.closePopup()},selectStartTime:function(e){this.selectStartDate(e)},selectEndTime:function(e){this.selectEndDate(e)},showPopup:function(){this.disabled||(this.popupVisible=!0)},closePopup:function(){this.popupVisible=!1},getPopupSize:function(e){var t=e.style.display,n=e.style.visibility;e.style.display="block",e.style.visibility="hidden";var a=window.getComputedStyle(e),i={width:e.offsetWidth+parseInt(a.marginLeft)+parseInt(a.marginRight),height:e.offsetHeight+parseInt(a.marginTop)+parseInt(a.marginBottom)};return e.style.display=t,e.style.visibility=n,i},displayPopup:function(){var e=document.documentElement.clientWidth,t=document.documentElement.clientHeight,n=this.$el.getBoundingClientRect(),a=this._popupRect||(this._popupRect=this.getPopupSize(this.$refs.calendar)),i={},r=0,s=0;this.appendToBody&&(r=window.pageXOffset+n.left,s=window.pageYOffset+n.top),e-n.left a {\n color: inherit;\n text-decoration: none;\n cursor: pointer; }\n .mx-calendar-header > a:hover {\n color: #419dec; }\n .mx-icon-last-month, .mx-icon-last-year,\n .mx-icon-next-month,\n .mx-icon-next-year {\n padding: 0 6px;\n font-size: 20px;\n line-height: 30px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n .mx-icon-last-month, .mx-icon-last-year {\n float: left; }\n \n .mx-icon-next-month,\n .mx-icon-next-year {\n float: right; }\n\n.mx-calendar-content {\n width: 224px;\n height: 224px; }\n .mx-calendar-content .cell {\n vertical-align: middle;\n cursor: pointer; }\n .mx-calendar-content .cell:hover {\n background-color: #eaf8fe; }\n .mx-calendar-content .cell.actived {\n color: #fff;\n background-color: #1284e7; }\n .mx-calendar-content .cell.inrange {\n background-color: #eaf8fe; }\n .mx-calendar-content .cell.disabled {\n cursor: not-allowed;\n color: #ccc;\n background-color: #f3f3f3; }\n\n.mx-panel {\n width: 100%;\n height: 100%;\n text-align: center; }\n\n.mx-panel-date {\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0; }\n .mx-panel-date td,\n .mx-panel-date th {\n font-size: 12px;\n width: 32px;\n height: 32px;\n padding: 0;\n overflow: hidden;\n text-align: center; }\n .mx-panel-date td.today {\n color: #2a90e9; }\n .mx-panel-date td.last-month, .mx-panel-date td.next-month {\n color: #ddd; }\n\n.mx-panel-year {\n padding: 7px 0; }\n .mx-panel-year .cell {\n display: inline-block;\n width: 40%;\n margin: 1px 5%;\n line-height: 40px; }\n\n.mx-panel-month .cell {\n display: inline-block;\n width: 30%;\n line-height: 40px;\n margin: 8px 1.5%; }\n\n.mx-time-list {\n position: relative;\n float: left;\n margin: 0;\n padding: 0;\n list-style: none;\n width: 100%;\n height: 100%;\n border-top: 1px solid rgba(0, 0, 0, 0.05);\n border-left: 1px solid rgba(0, 0, 0, 0.05);\n overflow-y: auto;\n /* 滚动条滑块 */ }\n .mx-time-list .mx-time-picker-item {\n display: block;\n text-align: left;\n padding-left: 10px; }\n .mx-time-list:first-child {\n border-left: 0; }\n .mx-time-list .cell {\n width: 100%;\n font-size: 12px;\n height: 30px;\n line-height: 30px; }\n .mx-time-list::-webkit-scrollbar {\n width: 8px;\n height: 8px; }\n .mx-time-list::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.05);\n border-radius: 10px;\n -webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);\n box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1); }\n .mx-time-list:hover::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.2); }\n",""])},function(e,t,n){var a=n(5);"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n(2).default)("511dbeb0",a,!0,{})}])}); /***/ }), /***/ "ead5": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * vue-local-storage v0.6.0 * (c) 2017 Alexander Avakov * @license MIT */ (function (global, factory) { true ? module.exports = factory() : undefined; }(this, (function () { 'use strict'; var VueLocalStorage = function VueLocalStorage () { this._properties = {}; this._namespace = ''; this._isSupported = true; }; var prototypeAccessors = { namespace: {} }; /** * Namespace getter. * * @returns {string} */ prototypeAccessors.namespace.get = function () { return this._namespace }; /** * Namespace setter. * * @param {string} value */ prototypeAccessors.namespace.set = function (value) { this._namespace = value ? (value + ".") : ''; }; /** * Concatenates localStorage key with namespace prefix. * * @param {string} lsKey * @returns {string} * @private */ VueLocalStorage.prototype._getLsKey = function _getLsKey (lsKey) { return ("" + (this._namespace) + lsKey) }; /** * Set a value to localStorage giving respect to the namespace. * * @param {string} lsKey * @param {*} rawValue * @param {*} type * @private */ VueLocalStorage.prototype._lsSet = function _lsSet (lsKey, rawValue, type) { var key = this._getLsKey(lsKey); var value = type && [Array, Object].includes(type) ? JSON.stringify(rawValue) : rawValue; window.localStorage.setItem(key, value); }; /** * Get value from localStorage giving respect to the namespace. * * @param {string} lsKey * @returns {any} * @private */ VueLocalStorage.prototype._lsGet = function _lsGet (lsKey) { var key = this._getLsKey(lsKey); return window.localStorage[key] }; /** * Get value from localStorage * * @param {String} lsKey * @param {*} defaultValue * @param {*} defaultType * @returns {*} */ VueLocalStorage.prototype.get = function get (lsKey, defaultValue, defaultType) { var this$1 = this; if ( defaultValue === void 0 ) defaultValue = null; if ( defaultType === void 0 ) defaultType = String; if (!this._isSupported) { return null } if (this._lsGet(lsKey)) { var type = defaultType; for (var key in this$1._properties) { if (key === lsKey) { type = this$1._properties[key].type; break } } return this._process(type, this._lsGet(lsKey)) } return defaultValue !== null ? defaultValue : null }; /** * Set localStorage value * * @param {String} lsKey * @param {*} value * @returns {*} */ VueLocalStorage.prototype.set = function set (lsKey, value) { var this$1 = this; if (!this._isSupported) { return null } for (var key in this$1._properties) { var type = this$1._properties[key].type; if ((key === lsKey)) { this$1._lsSet(lsKey, value, type); return value } } this._lsSet(lsKey, value); return value }; /** * Remove value from localStorage * * @param {String} lsKey */ VueLocalStorage.prototype.remove = function remove (lsKey) { if (!this._isSupported) { return null } return window.localStorage.removeItem(lsKey) }; /** * Add new property to localStorage * * @param {String} key * @param {function} type * @param {*} defaultValue */ VueLocalStorage.prototype.addProperty = function addProperty (key, type, defaultValue) { if ( defaultValue === void 0 ) defaultValue = undefined; type = type || String; this._properties[key] = { type: type }; if (!this._lsGet(key) && defaultValue !== null) { this._lsSet(key, defaultValue, type); } }; /** * Process the value before return it from localStorage * * @param {String} type * @param {*} value * @returns {*} * @private */ VueLocalStorage.prototype._process = function _process (type, value) { switch (type) { case Boolean: return value === 'true' case Number: return parseFloat(value) case Array: try { var array = JSON.parse(value); return Array.isArray(array) ? array : [] } catch (e) { return [] } case Object: try { return JSON.parse(value) } catch (e) { return {} } default: return value } }; Object.defineProperties( VueLocalStorage.prototype, prototypeAccessors ); var vueLocalStorage = new VueLocalStorage(); var index = { /** * Install vue-local-storage plugin * * @param {Vue} Vue * @param {Object} options */ install: function (Vue, options) { if ( options === void 0 ) options = {}; if (typeof process !== 'undefined' && ( process.server || process.SERVER_BUILD || ( true && Object({"NODE_ENV":"production","BASE_URL":"/"}).VUE_ENV === 'server') ) ) { return } var isSupported = true; try { var test = '__vue-localstorage-test__'; window.localStorage.setItem(test, test); window.localStorage.removeItem(test); } catch (e) { isSupported = false; vueLocalStorage._isSupported = false; console.error('Local storage is not supported'); } var name = options.name || 'localStorage'; var bind = options.bind; if (options.namespace) { vueLocalStorage.namespace = options.namespace; } Vue.mixin({ beforeCreate: function beforeCreate () { var this$1 = this; if (!isSupported) { return } if (this.$options[name]) { Object.keys(this.$options[name]).forEach(function (key) { var config = this$1.$options[name][key]; var ref = [config.type, config.default]; var type = ref[0]; var defaultValue = ref[1]; vueLocalStorage.addProperty(key, type, defaultValue); var existingProp = Object.getOwnPropertyDescriptor(vueLocalStorage, key); if (!existingProp) { var prop = { get: function () { return Vue.localStorage.get(key, defaultValue); }, set: function (val) { return Vue.localStorage.set(key, val); }, configurable: true }; Object.defineProperty(vueLocalStorage, key, prop); Vue.util.defineReactive(vueLocalStorage, key, defaultValue); } else if (!Vue.config.silent) { console.log((key + ": is already defined and will be reused")); } if ((bind || config.bind) && config.bind !== false) { this$1.$options.computed = this$1.$options.computed || {}; if (!this$1.$options.computed[key]) { this$1.$options.computed[key] = { get: function () { return Vue.localStorage[key]; }, set: function (val) { Vue.localStorage[key] = val; } }; } } }); } } }); Vue[name] = vueLocalStorage; Vue.prototype[("$" + name)] = vueLocalStorage; } }; return index; }))); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("f28c"))) /***/ }), /***/ "ebd6": /***/ (function(module, exports, __webpack_require__) { // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = __webpack_require__("cb7c"); var aFunction = __webpack_require__("d8e8"); var SPECIES = __webpack_require__("2b4c")('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; /***/ }), /***/ "ebe4": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malay [ms] //! author : Weldan Jamili : https://github.com/weldan ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ms = moment.defineLocale('ms', { months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split( '_' ), monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), longDateFormat: { LT: 'HH.mm', LTS: 'HH.mm.ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY [pukul] HH.mm', LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm', }, meridiemParse: /pagi|tengahari|petang|malam/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'pagi') { return hour; } else if (meridiem === 'tengahari') { return hour >= 11 ? hour : hour + 12; } else if (meridiem === 'petang' || meridiem === 'malam') { return hour + 12; } }, meridiem: function (hours, minutes, isLower) { if (hours < 11) { return 'pagi'; } else if (hours < 15) { return 'tengahari'; } else if (hours < 19) { return 'petang'; } else { return 'malam'; } }, calendar: { sameDay: '[Hari ini pukul] LT', nextDay: '[Esok pukul] LT', nextWeek: 'dddd [pukul] LT', lastDay: '[Kelmarin pukul] LT', lastWeek: 'dddd [lepas pukul] LT', sameElse: 'L', }, relativeTime: { future: 'dalam %s', past: '%s yang lepas', s: 'beberapa saat', ss: '%d saat', m: 'seminit', mm: '%d minit', h: 'sejam', hh: '%d jam', d: 'sehari', dd: '%d hari', M: 'sebulan', MM: '%d bulan', y: 'setahun', yy: '%d tahun', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return ms; }))); /***/ }), /***/ "ec18": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Estonian [et] //! author : Henry Kehlmann : https://github.com/madhenry //! improvements : Illimar Tambek : https://github.com/ragulka ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration function processRelativeTime(number, withoutSuffix, key, isFuture) { var format = { s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'], ss: [number + 'sekundi', number + 'sekundit'], m: ['ühe minuti', 'üks minut'], mm: [number + ' minuti', number + ' minutit'], h: ['ühe tunni', 'tund aega', 'üks tund'], hh: [number + ' tunni', number + ' tundi'], d: ['ühe päeva', 'üks päev'], M: ['kuu aja', 'kuu aega', 'üks kuu'], MM: [number + ' kuu', number + ' kuud'], y: ['ühe aasta', 'aasta', 'üks aasta'], yy: [number + ' aasta', number + ' aastat'], }; if (withoutSuffix) { return format[key][2] ? format[key][2] : format[key][1]; } return isFuture ? format[key][0] : format[key][1]; } var et = moment.defineLocale('et', { months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split( '_' ), monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split( '_' ), weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split( '_' ), weekdaysShort: 'P_E_T_K_N_R_L'.split('_'), weekdaysMin: 'P_E_T_K_N_R_L'.split('_'), longDateFormat: { LT: 'H:mm', LTS: 'H:mm:ss', L: 'DD.MM.YYYY', LL: 'D. MMMM YYYY', LLL: 'D. MMMM YYYY H:mm', LLLL: 'dddd, D. MMMM YYYY H:mm', }, calendar: { sameDay: '[Täna,] LT', nextDay: '[Homme,] LT', nextWeek: '[Järgmine] dddd LT', lastDay: '[Eile,] LT', lastWeek: '[Eelmine] dddd LT', sameElse: 'L', }, relativeTime: { future: '%s pärast', past: '%s tagasi', s: processRelativeTime, ss: processRelativeTime, m: processRelativeTime, mm: processRelativeTime, h: processRelativeTime, hh: processRelativeTime, d: processRelativeTime, dd: '%d päeva', M: processRelativeTime, MM: processRelativeTime, y: processRelativeTime, yy: processRelativeTime, }, dayOfMonthOrdinalParse: /\d{1,2}\./, ordinal: '%d.', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return et; }))); /***/ }), /***/ "ec2e": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : English (India) [en-in] //! author : Jatin Agrawal : https://github.com/jatinag22 ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var enIn = moment.defineLocale('en-in', { months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split( '_' ), weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat: { LT: 'h:mm A', LTS: 'h:mm:ss A', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY h:mm A', LLLL: 'dddd, D MMMM YYYY h:mm A', }, calendar: { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }, relativeTime: { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }, dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal: function (number) { var b = number % 10, output = ~~((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 1st is the first week of the year. }, }); return enIn; }))); /***/ }), /***/ "ed08": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ validation_namespaceObject; }); // NAMESPACE OBJECT: ./src/utils/validation/index.js var validation_namespaceObject = {}; __webpack_require__.r(validation_namespaceObject); __webpack_require__.d(validation_namespaceObject, "validateEmail", function() { return validateEmail; }); // CONCATENATED MODULE: ./src/utils/validation/index.js /** * Validate email using regex. * @param {*} email */ function validateEmail(email) { var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return emailRegex.test(email.toLowerCase()); } // CONCATENATED MODULE: ./src/utils/index.js /***/ }), /***/ "eda5": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Sinhalese [si] //! author : Sampath Sitinamaluwa : https://github.com/sampathsris ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration /*jshint -W100*/ var si = moment.defineLocale('si', { months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split( '_' ), monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split( '_' ), weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split( '_' ), weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'), weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'a h:mm', LTS: 'a h:mm:ss', L: 'YYYY/MM/DD', LL: 'YYYY MMMM D', LLL: 'YYYY MMMM D, a h:mm', LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss', }, calendar: { sameDay: '[අද] LT[ට]', nextDay: '[හෙට] LT[ට]', nextWeek: 'dddd LT[ට]', lastDay: '[ඊයේ] LT[ට]', lastWeek: '[පසුගිය] dddd LT[ට]', sameElse: 'L', }, relativeTime: { future: '%sකින්', past: '%sකට පෙර', s: 'තත්පර කිහිපය', ss: 'තත්පර %d', m: 'මිනිත්තුව', mm: 'මිනිත්තු %d', h: 'පැය', hh: 'පැය %d', d: 'දිනය', dd: 'දින %d', M: 'මාසය', MM: 'මාස %d', y: 'වසර', yy: 'වසර %d', }, dayOfMonthOrdinalParse: /\d{1,2} වැනි/, ordinal: function (number) { return number + ' වැනි'; }, meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, isPM: function (input) { return input === 'ප.ව.' || input === 'පස් වරු'; }, meridiem: function (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'ප.ව.' : 'පස් වරු'; } else { return isLower ? 'පෙ.ව.' : 'පෙර වරු'; } }, }); return si; }))); /***/ }), /***/ "f0bd": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(global) {/**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.1 * @license * Copyright (c) 2016 Federico Zivolo and contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; var timeoutDuration = function () { var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { return 1; } } return 0; }(); function microtaskDebounce(fn) { var called = false; return function () { if (called) { return; } called = true; window.Promise.resolve().then(function () { called = false; fn(); }); }; } function taskDebounce(fn) { var scheduled = false; return function () { if (!scheduled) { scheduled = true; setTimeout(function () { scheduled = false; fn(); }, timeoutDuration); } }; } var supportsMicroTasks = isBrowser && window.Promise; /** * Create a debounced version of a method, that's asynchronously deferred * but called in the minimum time possible. * * @method * @memberof Popper.Utils * @argument {Function} fn * @returns {Function} */ var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; /** * Check if the given variable is a function * @method * @memberof Popper.Utils * @argument {Any} functionToCheck - variable to check * @returns {Boolean} answer to: is a function? */ function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; } /** * Get CSS computed property of the given element * @method * @memberof Popper.Utils * @argument {Eement} element * @argument {String} property */ function getStyleComputedProperty(element, property) { if (element.nodeType !== 1) { return []; } // NOTE: 1 DOM access here var window = element.ownerDocument.defaultView; var css = window.getComputedStyle(element, null); return property ? css[property] : css; } /** * Returns the parentNode or the host of the element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} parent */ function getParentNode(element) { if (element.nodeName === 'HTML') { return element; } return element.parentNode || element.host; } /** * Returns the scrolling parent of the given element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} scroll parent */ function getScrollParent(element) { // Return body, `getScroll` will take care to get the correct `scrollTop` from it if (!element) { return document.body; } switch (element.nodeName) { case 'HTML': case 'BODY': return element.ownerDocument.body; case '#document': return element.body; } // Firefox want us to check `-x` and `-y` variations as well var _getStyleComputedProp = getStyleComputedProperty(element), overflow = _getStyleComputedProp.overflow, overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY; if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { return element; } return getScrollParent(getParentNode(element)); } /** * Returns the reference node of the reference object, or the reference object itself. * @method * @memberof Popper.Utils * @param {Element|Object} reference - the reference element (the popper will be relative to this) * @returns {Element} parent */ function getReferenceNode(reference) { return reference && reference.referenceNode ? reference.referenceNode : reference; } var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); /** * Determines if the browser is Internet Explorer * @method * @memberof Popper.Utils * @param {Number} version to check * @returns {Boolean} isIE */ function isIE(version) { if (version === 11) { return isIE11; } if (version === 10) { return isIE10; } return isIE11 || isIE10; } /** * Returns the offset parent of the given element * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} offset parent */ function getOffsetParent(element) { if (!element) { return document.documentElement; } var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent while (offsetParent === noOffsetParent && element.nextElementSibling) { offsetParent = (element = element.nextElementSibling).offsetParent; } var nodeName = offsetParent && offsetParent.nodeName; if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { return element ? element.ownerDocument.documentElement : document.documentElement; } // .offsetParent will return the closest TH, TD or TABLE in case // no offsetParent is present, I hate this job... if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { return getOffsetParent(offsetParent); } return offsetParent; } function isOffsetContainer(element) { var nodeName = element.nodeName; if (nodeName === 'BODY') { return false; } return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; } /** * Finds the root node (document, shadowDOM root) of the given element * @method * @memberof Popper.Utils * @argument {Element} node * @returns {Element} root node */ function getRoot(node) { if (node.parentNode !== null) { return getRoot(node.parentNode); } return node; } /** * Finds the offset parent common to the two provided nodes * @method * @memberof Popper.Utils * @argument {Element} element1 * @argument {Element} element2 * @returns {Element} common offset parent */ function findCommonOffsetParent(element1, element2) { // This check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { return document.documentElement; } // Here we make sure to give as "start" the element that comes first in the DOM var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; var start = order ? element1 : element2; var end = order ? element2 : element1; // Get common ancestor container var range = document.createRange(); range.setStart(start, 0); range.setEnd(end, 0); var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { if (isOffsetContainer(commonAncestorContainer)) { return commonAncestorContainer; } return getOffsetParent(commonAncestorContainer); } // one of the nodes is inside shadowDOM, find which one var element1root = getRoot(element1); if (element1root.host) { return findCommonOffsetParent(element1root.host, element2); } else { return findCommonOffsetParent(element1, getRoot(element2).host); } } /** * Gets the scroll value of the given element in the given side (top and left) * @method * @memberof Popper.Utils * @argument {Element} element * @argument {String} side `top` or `left` * @returns {number} amount of scrolled pixels */ function getScroll(element) { var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { var html = element.ownerDocument.documentElement; var scrollingElement = element.ownerDocument.scrollingElement || html; return scrollingElement[upperSide]; } return element[upperSide]; } /* * Sum or subtract the element scroll values (left and top) from a given rect object * @method * @memberof Popper.Utils * @param {Object} rect - Rect object you want to change * @param {HTMLElement} element - The element from the function reads the scroll values * @param {Boolean} subtract - set to true if you want to subtract the scroll values * @return {Object} rect - The modifier rect object */ function includeScroll(rect, element) { var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); var modifier = subtract ? -1 : 1; rect.top += scrollTop * modifier; rect.bottom += scrollTop * modifier; rect.left += scrollLeft * modifier; rect.right += scrollLeft * modifier; return rect; } /* * Helper to detect borders of a given element * @method * @memberof Popper.Utils * @param {CSSStyleDeclaration} styles * Result of `getStyleComputedProperty` on the given element * @param {String} axis - `x` or `y` * @return {number} borders - The borders size of the given axis */ function getBordersSize(styles, axis) { var sideA = axis === 'x' ? 'Left' : 'Top'; var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); } function getSize(axis, body, html, computedStyle) { return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); } function getWindowSizes(document) { var body = document.body; var html = document.documentElement; var computedStyle = isIE(10) && getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), width: getSize('Width', body, html, computedStyle) }; } var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Given element offsets, generate an output similar to getBoundingClientRect * @method * @memberof Popper.Utils * @argument {Object} offsets * @returns {Object} ClientRect like output */ function getClientRect(offsets) { return _extends({}, offsets, { right: offsets.left + offsets.width, bottom: offsets.top + offsets.height }); } /** * Get bounding client rect of given element * @method * @memberof Popper.Utils * @param {HTMLElement} element * @return {Object} client rect */ function getBoundingClientRect(element) { var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't // considered in DOM in some circumstances... // This isn't reproducible in IE10 compatibility mode of IE11 try { if (isIE(10)) { rect = element.getBoundingClientRect(); var scrollTop = getScroll(element, 'top'); var scrollLeft = getScroll(element, 'left'); rect.top += scrollTop; rect.left += scrollLeft; rect.bottom += scrollTop; rect.right += scrollLeft; } else { rect = element.getBoundingClientRect(); } } catch (e) {} var result = { left: rect.left, top: rect.top, width: rect.right - rect.left, height: rect.bottom - rect.top }; // subtract scrollbar size from sizes var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; var width = sizes.width || element.clientWidth || result.width; var height = sizes.height || element.clientHeight || result.height; var horizScrollbar = element.offsetWidth - width; var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` // we make this check conditional for performance reasons if (horizScrollbar || vertScrollbar) { var styles = getStyleComputedProperty(element); horizScrollbar -= getBordersSize(styles, 'x'); vertScrollbar -= getBordersSize(styles, 'y'); result.width -= horizScrollbar; result.height -= vertScrollbar; } return getClientRect(result); } function getOffsetRectRelativeToArbitraryNode(children, parent) { var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isIE10 = isIE(10); var isHTML = parent.nodeName === 'HTML'; var childrenRect = getBoundingClientRect(children); var parentRect = getBoundingClientRect(parent); var scrollParent = getScrollParent(children); var styles = getStyleComputedProperty(parent); var borderTopWidth = parseFloat(styles.borderTopWidth); var borderLeftWidth = parseFloat(styles.borderLeftWidth); // In cases where the parent is fixed, we must ignore negative scroll in offset calc if (fixedPosition && isHTML) { parentRect.top = Math.max(parentRect.top, 0); parentRect.left = Math.max(parentRect.left, 0); } var offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, left: childrenRect.left - parentRect.left - borderLeftWidth, width: childrenRect.width, height: childrenRect.height }); offsets.marginTop = 0; offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent // we do this only on HTML because it's the only element that behaves // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { var marginTop = parseFloat(styles.marginTop); var marginLeft = parseFloat(styles.marginLeft); offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; offsets.left -= borderLeftWidth - marginLeft; offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them offsets.marginTop = marginTop; offsets.marginLeft = marginLeft; } if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { offsets = includeScroll(offsets, parent); } return offsets; } function getViewportOffsetRectRelativeToArtbitraryNode(element) { var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var html = element.ownerDocument.documentElement; var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); var width = Math.max(html.clientWidth, window.innerWidth || 0); var height = Math.max(html.clientHeight, window.innerHeight || 0); var scrollTop = !excludeScroll ? getScroll(html) : 0; var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, width: width, height: height }; return getClientRect(offset); } /** * Check if the given element is fixed or is inside a fixed parent * @method * @memberof Popper.Utils * @argument {Element} element * @argument {Element} customContainer * @returns {Boolean} answer to "isFixed?" */ function isFixed(element) { var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { return false; } if (getStyleComputedProperty(element, 'position') === 'fixed') { return true; } var parentNode = getParentNode(element); if (!parentNode) { return false; } return isFixed(parentNode); } /** * Finds the first parent of an element that has a transformed property defined * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Element} first transformed parent or documentElement */ function getFixedPositionOffsetParent(element) { // This check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element || !element.parentElement || isIE()) { return document.documentElement; } var el = element.parentElement; while (el && getStyleComputedProperty(el, 'transform') === 'none') { el = el.parentElement; } return el || document.documentElement; } /** * Computed the boundaries limits and return them * @method * @memberof Popper.Utils * @param {HTMLElement} popper * @param {HTMLElement} reference * @param {number} padding * @param {HTMLElement} boundariesElement - Element used to define the boundaries * @param {Boolean} fixedPosition - Is in fixed position mode * @returns {Object} Coordinates of the boundaries */ function getBoundaries(popper, reference, padding, boundariesElement) { var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here var boundaries = { top: 0, left: 0 }; var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); // Handle viewport case if (boundariesElement === 'viewport') { boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); } else { // Handle other cases based on DOM element used as boundaries var boundariesNode = void 0; if (boundariesElement === 'scrollParent') { boundariesNode = getScrollParent(getParentNode(reference)); if (boundariesNode.nodeName === 'BODY') { boundariesNode = popper.ownerDocument.documentElement; } } else if (boundariesElement === 'window') { boundariesNode = popper.ownerDocument.documentElement; } else { boundariesNode = boundariesElement; } var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { var _getWindowSizes = getWindowSizes(popper.ownerDocument), height = _getWindowSizes.height, width = _getWindowSizes.width; boundaries.top += offsets.top - offsets.marginTop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginLeft; boundaries.right = width + offsets.left; } else { // for all the other DOM elements, this one is good boundaries = offsets; } } // Add paddings padding = padding || 0; var isPaddingNumber = typeof padding === 'number'; boundaries.left += isPaddingNumber ? padding : padding.left || 0; boundaries.top += isPaddingNumber ? padding : padding.top || 0; boundaries.right -= isPaddingNumber ? padding : padding.right || 0; boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; return boundaries; } function getArea(_ref) { var width = _ref.width, height = _ref.height; return width * height; } /** * Utility used to transform the `auto` placement to the placement with more * available space. * @method * @memberof Popper.Utils * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; if (placement.indexOf('auto') === -1) { return placement; } var boundaries = getBoundaries(popper, reference, padding, boundariesElement); var rects = { top: { width: boundaries.width, height: refRect.top - boundaries.top }, right: { width: boundaries.right - refRect.right, height: boundaries.height }, bottom: { width: boundaries.width, height: boundaries.bottom - refRect.bottom }, left: { width: refRect.left - boundaries.left, height: boundaries.height } }; var sortedAreas = Object.keys(rects).map(function (key) { return _extends({ key: key }, rects[key], { area: getArea(rects[key]) }); }).sort(function (a, b) { return b.area - a.area; }); var filteredAreas = sortedAreas.filter(function (_ref2) { var width = _ref2.width, height = _ref2.height; return width >= popper.clientWidth && height >= popper.clientHeight; }); var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; var variation = placement.split('-')[1]; return computedPlacement + (variation ? '-' + variation : ''); } /** * Get offsets to the reference element * @method * @memberof Popper.Utils * @param {Object} state * @param {Element} popper - the popper element * @param {Element} reference - the reference element (the popper will be relative to this) * @param {Element} fixedPosition - is in fixed position mode * @returns {Object} An object containing the offsets which will be applied to the popper */ function getReferenceOffsets(state, popper, reference) { var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); } /** * Get the outer sizes of the given element (offset size + margins) * @method * @memberof Popper.Utils * @argument {Element} element * @returns {Object} object containing width and height properties */ function getOuterSizes(element) { var window = element.ownerDocument.defaultView; var styles = window.getComputedStyle(element); var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); var result = { width: element.offsetWidth + y, height: element.offsetHeight + x }; return result; } /** * Get the opposite placement of the given one * @method * @memberof Popper.Utils * @argument {String} placement * @returns {String} flipped placement */ function getOppositePlacement(placement) { var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, function (matched) { return hash[matched]; }); } /** * Get offsets to the popper * @method * @memberof Popper.Utils * @param {Object} position - CSS position the Popper will get applied * @param {HTMLElement} popper - the popper element * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) * @param {String} placement - one of the valid placement options * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper */ function getPopperOffsets(popper, referenceOffsets, placement) { placement = placement.split('-')[0]; // Get popper node sizes var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object var popperOffsets = { width: popperRect.width, height: popperRect.height }; // depending by the popper placement we have to compute its offsets slightly differently var isHoriz = ['right', 'left'].indexOf(placement) !== -1; var mainSide = isHoriz ? 'top' : 'left'; var secondarySide = isHoriz ? 'left' : 'top'; var measurement = isHoriz ? 'height' : 'width'; var secondaryMeasurement = !isHoriz ? 'height' : 'width'; popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; if (placement === secondarySide) { popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; } else { popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; } return popperOffsets; } /** * Mimics the `find` method of Array * @method * @memberof Popper.Utils * @argument {Array} arr * @argument prop * @argument value * @returns index or -1 */ function find(arr, check) { // use native find if supported if (Array.prototype.find) { return arr.find(check); } // use `filter` to obtain the same behavior of `find` return arr.filter(check)[0]; } /** * Return the index of the matching object * @method * @memberof Popper.Utils * @argument {Array} arr * @argument prop * @argument value * @returns index or -1 */ function findIndex(arr, prop, value) { // use native findIndex if supported if (Array.prototype.findIndex) { return arr.findIndex(function (cur) { return cur[prop] === value; }); } // use `find` + `indexOf` if `findIndex` isn't supported var match = find(arr, function (obj) { return obj[prop] === value; }); return arr.indexOf(match); } /** * Loop trough the list of modifiers and run them in order, * each of them will then edit the data object. * @method * @memberof Popper.Utils * @param {dataObject} data * @param {Array} modifiers * @param {String} ends - Optional modifier name used as stopper * @returns {dataObject} */ function runModifiers(modifiers, data, ends) { var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); modifiersToRun.forEach(function (modifier) { if (modifier['function']) { // eslint-disable-line dot-notation console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); } var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation if (modifier.enabled && isFunction(fn)) { // Add properties to offsets to make them a complete clientRect object // we do this before each modifier to make sure the previous one doesn't // mess with these values data.offsets.popper = getClientRect(data.offsets.popper); data.offsets.reference = getClientRect(data.offsets.reference); data = fn(data, modifier); } }); return data; } /** * Updates the position of the popper, computing the new offsets and applying * the new style.
* Prefer `scheduleUpdate` over `update` because of performance reasons. * @method * @memberof Popper */ function update() { // if popper is destroyed, don't perform any further update if (this.state.isDestroyed) { return; } var data = { instance: this, styles: {}, arrowStyles: {}, attributes: {}, flipped: false, offsets: {} }; // compute reference element offsets data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalPlacement to know the original value data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement` data.originalPlacement = data.placement; data.positionFixed = this.options.positionFixed; // compute the popper offsets data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback // the other ones will call `onUpdate` callback if (!this.state.isCreated) { this.state.isCreated = true; this.options.onCreate(data); } else { this.options.onUpdate(data); } } /** * Helper used to know if the given modifier is enabled. * @method * @memberof Popper.Utils * @returns {Boolean} */ function isModifierEnabled(modifiers, modifierName) { return modifiers.some(function (_ref) { var name = _ref.name, enabled = _ref.enabled; return enabled && name === modifierName; }); } /** * Get the prefixed supported property name * @method * @memberof Popper.Utils * @argument {String} property (camelCase) * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) */ function getSupportedPropertyName(property) { var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; var upperProp = property.charAt(0).toUpperCase() + property.slice(1); for (var i = 0; i < prefixes.length; i++) { var prefix = prefixes[i]; var toCheck = prefix ? '' + prefix + upperProp : property; if (typeof document.body.style[toCheck] !== 'undefined') { return toCheck; } } return null; } /** * Destroys the popper. * @method * @memberof Popper */ function destroy() { this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled if (isModifierEnabled(this.modifiers, 'applyStyle')) { this.popper.removeAttribute('x-placement'); this.popper.style.position = ''; this.popper.style.top = ''; this.popper.style.left = ''; this.popper.style.right = ''; this.popper.style.bottom = ''; this.popper.style.willChange = ''; this.popper.style[getSupportedPropertyName('transform')] = ''; } this.disableEventListeners(); // remove the popper if user explicitly asked for the deletion on destroy // do not use `remove` because IE11 doesn't support it if (this.options.removeOnDestroy) { this.popper.parentNode.removeChild(this.popper); } return this; } /** * Get the window associated with the element * @argument {Element} element * @returns {Window} */ function getWindow(element) { var ownerDocument = element.ownerDocument; return ownerDocument ? ownerDocument.defaultView : window; } function attachToScrollParents(scrollParent, event, callback, scrollParents) { var isBody = scrollParent.nodeName === 'BODY'; var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; target.addEventListener(event, callback, { passive: true }); if (!isBody) { attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); } scrollParents.push(target); } /** * Setup needed event listeners used to update the popper position * @method * @memberof Popper.Utils * @private */ function setupEventListeners(reference, options, state, updateBound) { // Resize event listener on window state.updateBound = updateBound; getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); // Scroll event listener on scroll parents var scrollElement = getScrollParent(reference); attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); state.scrollElement = scrollElement; state.eventsEnabled = true; return state; } /** * It will add resize/scroll events and start recalculating * position of the popper element when they are triggered. * @method * @memberof Popper */ function enableEventListeners() { if (!this.state.eventsEnabled) { this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); } } /** * Remove event listeners used to update the popper position * @method * @memberof Popper.Utils * @private */ function removeEventListeners(reference, state) { // Remove resize event listener on window getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents state.scrollParents.forEach(function (target) { target.removeEventListener('scroll', state.updateBound); }); // Reset state state.updateBound = null; state.scrollParents = []; state.scrollElement = null; state.eventsEnabled = false; return state; } /** * It will remove resize/scroll events and won't recalculate popper position * when they are triggered. It also won't trigger `onUpdate` callback anymore, * unless you call `update` method manually. * @method * @memberof Popper */ function disableEventListeners() { if (this.state.eventsEnabled) { cancelAnimationFrame(this.scheduleUpdate); this.state = removeEventListeners(this.reference, this.state); } } /** * Tells if a given input is a number * @method * @memberof Popper.Utils * @param {*} input to check * @return {Boolean} */ function isNumeric(n) { return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); } /** * Set the style to the given popper * @method * @memberof Popper.Utils * @argument {Element} element - Element to apply the style to * @argument {Object} styles * Object with a list of properties and values which will be applied to the element */ function setStyles(element, styles) { Object.keys(styles).forEach(function (prop) { var unit = ''; // add unit if the value is numeric and is one of the following if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { unit = 'px'; } element.style[prop] = styles[prop] + unit; }); } /** * Set the attributes to the given popper * @method * @memberof Popper.Utils * @argument {Element} element - Element to apply the attributes to * @argument {Object} styles * Object with a list of properties and values which will be applied to the element */ function setAttributes(element, attributes) { Object.keys(attributes).forEach(function (prop) { var value = attributes[prop]; if (value !== false) { element.setAttribute(prop, attributes[prop]); } else { element.removeAttribute(prop); } }); } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} data.styles - List of style properties - values to apply to popper element * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element * @argument {Object} options - Modifiers configuration and options * @returns {Object} The same data object */ function applyStyle(data) { // any property present in `data.styles` will be applied to the popper, // in this way we can make the 3rd party modifiers add custom styles to it // Be aware, modifiers could override the properties defined in the previous // lines of this modifier! setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper, // they will be set as HTML attributes of the element setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties if (data.arrowElement && Object.keys(data.arrowStyles).length) { setStyles(data.arrowElement, data.arrowStyles); } return data; } /** * Set the x-placement attribute before everything else because it could be used * to add margins to the popper margins needs to be calculated to get the * correct popper offsets. * @method * @memberof Popper.modifiers * @param {HTMLElement} reference - The reference element used to position the popper * @param {HTMLElement} popper - The HTML element used as popper * @param {Object} options - Popper.js options */ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { // compute reference element offsets var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalPlacement to know the original value var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because // without the position applied we can't guarantee correct computations setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); return options; } /** * @function * @memberof Popper.Utils * @argument {Object} data - The data object generated by `update` method * @argument {Boolean} shouldRound - If the offsets should be rounded at all * @returns {Object} The popper's position offsets rounded * * The tale of pixel-perfect positioning. It's still not 100% perfect, but as * good as it can be within reason. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 * * Low DPI screens cause a popper to be blurry if not using full pixels (Safari * as well on High DPI screens). * * Firefox prefers no rounding for positioning and does not have blurriness on * high DPI screens. * * Only horizontal placement and left/right values need to be considered. */ function getRoundedOffsets(data, shouldRound) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var round = Math.round, floor = Math.floor; var noRound = function noRound(v) { return v; }; var referenceWidth = round(reference.width); var popperWidth = round(popper.width); var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; var isVariation = data.placement.indexOf('-') !== -1; var sameWidthParity = referenceWidth % 2 === popperWidth % 2; var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; var verticalToInteger = !shouldRound ? noRound : round; return { left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), top: verticalToInteger(popper.top), bottom: verticalToInteger(popper.bottom), right: horizontalToInteger(popper.right) }; } var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function computeStyle(data, options) { var x = options.x, y = options.y; var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { return modifier.name === 'applyStyle'; }).gpuAcceleration; if (legacyGpuAccelerationOption !== undefined) { console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); } var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; var offsetParent = getOffsetParent(data.instance.popper); var offsetParentRect = getBoundingClientRect(offsetParent); // Styles var styles = { position: popper.position }; var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); var sideA = x === 'bottom' ? 'top' : 'bottom'; var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported, // we use `translate3d` to apply the position to the popper we // automatically use the supported prefixed version if needed var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?) // If the content of the popper grows once it's been positioned, it // may happen that the popper gets misplaced because of the new content // overflowing its reference element // To avoid this problem, we provide two options (x and y), which allow // the consumer to define the offset origin. // If we position a popper on top of a reference element, we can set // `x` to `top` to make the popper grow towards its top instead of // its bottom. var left = void 0, top = void 0; if (sideA === 'bottom') { // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar) // and not the bottom of the html element if (offsetParent.nodeName === 'HTML') { top = -offsetParent.clientHeight + offsets.bottom; } else { top = -offsetParentRect.height + offsets.bottom; } } else { top = offsets.top; } if (sideB === 'right') { if (offsetParent.nodeName === 'HTML') { left = -offsetParent.clientWidth + offsets.right; } else { left = -offsetParentRect.width + offsets.right; } } else { left = offsets.left; } if (gpuAcceleration && prefixedProperty) { styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; styles[sideA] = 0; styles[sideB] = 0; styles.willChange = 'transform'; } else { // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties var invertTop = sideA === 'bottom' ? -1 : 1; var invertLeft = sideB === 'right' ? -1 : 1; styles[sideA] = top * invertTop; styles[sideB] = left * invertLeft; styles.willChange = sideA + ', ' + sideB; } // Attributes var attributes = { 'x-placement': data.placement }; // Update `data` attributes, styles and arrowStyles data.attributes = _extends({}, attributes, data.attributes); data.styles = _extends({}, styles, data.styles); data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); return data; } /** * Helper used to know if the given modifier depends from another one.
* It checks if the needed modifier is listed and enabled. * @method * @memberof Popper.Utils * @param {Array} modifiers - list of modifiers * @param {String} requestingName - name of requesting modifier * @param {String} requestedName - name of requested modifier * @returns {Boolean} */ function isModifierRequired(modifiers, requestingName, requestedName) { var requesting = find(modifiers, function (_ref) { var name = _ref.name; return name === requestingName; }); var isRequired = !!requesting && modifiers.some(function (modifier) { return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; }); if (!isRequired) { var _requesting = '`' + requestingName + '`'; var requested = '`' + requestedName + '`'; console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); } return isRequired; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function arrow(data, options) { var _data$offsets$arrow; // arrow depends on keepTogether in order to work if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { return data; } var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector if (typeof arrowElement === 'string') { arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier if (!arrowElement) { return data; } } else { // if the arrowElement isn't a query selector we must check that the // provided DOM node is child of its popper node if (!data.instance.popper.contains(arrowElement)) { console.warn('WARNING: `arrow.element` must be child of its popper element!'); return data; } } var placement = data.placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var isVertical = ['left', 'right'].indexOf(placement) !== -1; var len = isVertical ? 'height' : 'width'; var sideCapitalized = isVertical ? 'Top' : 'Left'; var side = sideCapitalized.toLowerCase(); var altSide = isVertical ? 'left' : 'top'; var opSide = isVertical ? 'bottom' : 'right'; var arrowElementSize = getOuterSizes(arrowElement)[len]; // // extends keepTogether behavior making sure the popper and its // reference have enough pixels in conjunction // // top/left side if (reference[opSide] - arrowElementSize < popper[side]) { data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); } // bottom/right side if (reference[side] + arrowElementSize > popper[opSide]) { data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; } data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets // take popper margin in account because we don't have this info available var css = getStyleComputedProperty(data.instance.popper); var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); data.arrowElement = arrowElement; data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); return data; } /** * Get the opposite placement variation of the given one * @method * @memberof Popper.Utils * @argument {String} placement variation * @returns {String} flipped placement variation */ function getOppositeVariation(variation) { if (variation === 'end') { return 'start'; } else if (variation === 'start') { return 'end'; } return variation; } /** * List of accepted placements to use as values of the `placement` option.
* Valid placements are: * - `auto` * - `top` * - `right` * - `bottom` * - `left` * * Each placement can have a variation from this list: * - `-start` * - `-end` * * Variations are interpreted easily if you think of them as the left to right * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` * is right.
* Vertically (`left` and `right`), `start` is top and `end` is bottom. * * Some valid examples are: * - `top-end` (on top of reference, right aligned) * - `right-start` (on right of reference, top aligned) * - `bottom` (on bottom, centered) * - `auto-end` (on the side with more space available, alignment depends by placement) * * @static * @type {Array} * @enum {String} * @readonly * @method placements * @memberof Popper */ var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // Get rid of `auto` `auto-start` and `auto-end` var validPlacements = placements.slice(3); /** * Given an initial placement, returns all the subsequent placements * clockwise (or counter-clockwise). * * @method * @memberof Popper.Utils * @argument {String} placement - A valid placement (it accepts variations) * @argument {Boolean} counter - Set to true to walk the placements counterclockwise * @returns {Array} placements including their variations */ function clockwise(placement) { var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var index = validPlacements.indexOf(placement); var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); return counter ? arr.reverse() : arr; } var BEHAVIORS = { FLIP: 'flip', CLOCKWISE: 'clockwise', COUNTERCLOCKWISE: 'counterclockwise' }; /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function flip(data, options) { // if `inner` modifier is enabled, we can't use the `flip` modifier if (isModifierEnabled(data.instance.modifiers, 'inner')) { return data; } if (data.flipped && data.placement === data.originalPlacement) { // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides return data; } var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); var placement = data.placement.split('-')[0]; var placementOpposite = getOppositePlacement(placement); var variation = data.placement.split('-')[1] || ''; var flipOrder = []; switch (options.behavior) { case BEHAVIORS.FLIP: flipOrder = [placement, placementOpposite]; break; case BEHAVIORS.CLOCKWISE: flipOrder = clockwise(placement); break; case BEHAVIORS.COUNTERCLOCKWISE: flipOrder = clockwise(placement, true); break; default: flipOrder = options.behavior; } flipOrder.forEach(function (step, index) { if (placement !== step || flipOrder.length === index + 1) { return data; } placement = data.placement.split('-')[0]; placementOpposite = getOppositePlacement(placement); var popperOffsets = data.offsets.popper; var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here var floor = Math.floor; var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; // flips variation if reference element overflows boundaries var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); // flips variation if popper content overflows boundaries var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); var flippedVariation = flippedVariationByRef || flippedVariationByContent; if (overlapsRef || overflowsBoundaries || flippedVariation) { // this boolean to detect any flip loop data.flipped = true; if (overlapsRef || overflowsBoundaries) { placement = flipOrder[index + 1]; } if (flippedVariation) { variation = getOppositeVariation(variation); } data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with // any additional property we may add in the future data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); data = runModifiers(data.instance.modifiers, data, 'flip'); } }); return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function keepTogether(data) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var placement = data.placement.split('-')[0]; var floor = Math.floor; var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; var side = isVertical ? 'right' : 'bottom'; var opSide = isVertical ? 'left' : 'top'; var measurement = isVertical ? 'width' : 'height'; if (popper[side] < floor(reference[opSide])) { data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; } if (popper[opSide] > floor(reference[side])) { data.offsets.popper[opSide] = floor(reference[side]); } return data; } /** * Converts a string containing value + unit into a px value number * @function * @memberof {modifiers~offset} * @private * @argument {String} str - Value + unit string * @argument {String} measurement - `height` or `width` * @argument {Object} popperOffsets * @argument {Object} referenceOffsets * @returns {Number|String} * Value in pixels, or original string if no values were extracted */ function toValue(str, measurement, popperOffsets, referenceOffsets) { // separate value from unit var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); var value = +split[1]; var unit = split[2]; // If it's not a number it's an operator, I guess if (!value) { return str; } if (unit.indexOf('%') === 0) { var element = void 0; switch (unit) { case '%p': element = popperOffsets; break; case '%': case '%r': default: element = referenceOffsets; } var rect = getClientRect(element); return rect[measurement] / 100 * value; } else if (unit === 'vh' || unit === 'vw') { // if is a vh or vw, we calculate the size based on the viewport var size = void 0; if (unit === 'vh') { size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); } else { size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); } return size / 100 * value; } else { // if is an explicit pixel unit, we get rid of the unit and keep the value // if is an implicit unit, it's px, and we return just the value return value; } } /** * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. * @function * @memberof {modifiers~offset} * @private * @argument {String} offset * @argument {Object} popperOffsets * @argument {Object} referenceOffsets * @argument {String} basePlacement * @returns {Array} a two cells array with x and y offsets in numbers */ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width // in this way the first offset will use an axis and the second one // will use the other one var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands // The regex addresses values with the plus or minus sign in front (+10, -20, etc) var fragments = offset.split(/(\+|\-)/).map(function (frag) { return frag.trim(); }); // Detect if the offset string contains a pair of values or a single one // they could be separated by comma or space var divider = fragments.indexOf(find(fragments, function (frag) { return frag.search(/,|\s/) !== -1; })); if (fragments[divider] && fragments[divider].indexOf(',') === -1) { console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); } // If divider is found, we divide the list of values and operands to divide // them by ofset X and Y. var splitRegex = /\s*,\s*|\s+/; var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // Convert the values with units to absolute pixels to allow our computations ops = ops.map(function (op, index) { // Most of the units rely on the orientation of the popper var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; var mergeWithPrevious = false; return op // This aggregates any `+` or `-` sign that aren't considered operators // e.g.: 10 + +5 => [10, +, +5] .reduce(function (a, b) { if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { a[a.length - 1] = b; mergeWithPrevious = true; return a; } else if (mergeWithPrevious) { a[a.length - 1] += b; mergeWithPrevious = false; return a; } else { return a.concat(b); } }, []) // Here we convert the string values into number values (in px) .map(function (str) { return toValue(str, measurement, popperOffsets, referenceOffsets); }); }); // Loop trough the offsets arrays and execute the operations ops.forEach(function (op, index) { op.forEach(function (frag, index2) { if (isNumeric(frag)) { offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); } }); }); return offsets; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @argument {Number|String} options.offset=0 * The offset value as described in the modifier description * @returns {Object} The data object, properly modified */ function offset(data, _ref) { var offset = _ref.offset; var placement = data.placement, _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var basePlacement = placement.split('-')[0]; var offsets = void 0; if (isNumeric(+offset)) { offsets = [+offset, 0]; } else { offsets = parseOffset(offset, popper, reference, basePlacement); } if (basePlacement === 'left') { popper.top += offsets[0]; popper.left -= offsets[1]; } else if (basePlacement === 'right') { popper.top += offsets[0]; popper.left += offsets[1]; } else if (basePlacement === 'top') { popper.left += offsets[0]; popper.top -= offsets[1]; } else if (basePlacement === 'bottom') { popper.left += offsets[0]; popper.top += offsets[1]; } data.popper = popper; return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function preventOverflow(data, options) { var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to // go one step up and use the next offsetParent as reference to // avoid to make this modifier completely useless and look like broken if (data.instance.reference === boundariesElement) { boundariesElement = getOffsetParent(boundariesElement); } // NOTE: DOM access here // resets the popper's position so that the document size can be calculated excluding // the size of the popper element itself var transformProp = getSupportedPropertyName('transform'); var popperStyles = data.instance.popper.style; // assignment to help minification var top = popperStyles.top, left = popperStyles.left, transform = popperStyles[transformProp]; popperStyles.top = ''; popperStyles.left = ''; popperStyles[transformProp] = ''; var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here // restores the original style properties after the offsets have been computed popperStyles.top = top; popperStyles.left = left; popperStyles[transformProp] = transform; options.boundaries = boundaries; var order = options.priority; var popper = data.offsets.popper; var check = { primary: function primary(placement) { var value = popper[placement]; if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { value = Math.max(popper[placement], boundaries[placement]); } return defineProperty({}, placement, value); }, secondary: function secondary(placement) { var mainSide = placement === 'right' ? 'left' : 'top'; var value = popper[mainSide]; if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); } return defineProperty({}, mainSide, value); } }; order.forEach(function (placement) { var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; popper = _extends({}, popper, check[side](placement)); }); data.offsets.popper = popper; return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function shift(data) { var placement = data.placement; var basePlacement = placement.split('-')[0]; var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier if (shiftvariation) { var _data$offsets = data.offsets, reference = _data$offsets.reference, popper = _data$offsets.popper; var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; var side = isVertical ? 'left' : 'top'; var measurement = isVertical ? 'width' : 'height'; var shiftOffsets = { start: defineProperty({}, side, reference[side]), end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) }; data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); } return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by update method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function hide(data) { if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { return data; } var refRect = data.offsets.reference; var bound = find(data.instance.modifiers, function (modifier) { return modifier.name === 'preventOverflow'; }).boundaries; if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { // Avoid unnecessary DOM access if visibility hasn't changed if (data.hide === true) { return data; } data.hide = true; data.attributes['x-out-of-boundaries'] = ''; } else { // Avoid unnecessary DOM access if visibility hasn't changed if (data.hide === false) { return data; } data.hide = false; data.attributes['x-out-of-boundaries'] = false; } return data; } /** * @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ function inner(data) { var placement = data.placement; var basePlacement = placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); data.placement = getOppositePlacement(placement); data.offsets.popper = getClientRect(popper); return data; } /** * Modifier function, each modifier can have a function of this type assigned * to its `fn` property.
* These functions will be called on each update, this means that you must * make sure they are performant enough to avoid performance bottlenecks. * * @function ModifierFn * @argument {dataObject} data - The data object generated by `update` method * @argument {Object} options - Modifiers configuration and options * @returns {dataObject} The data object, properly modified */ /** * Modifiers are plugins used to alter the behavior of your poppers.
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities * needed by the library. * * Usually you don't want to override the `order`, `fn` and `onLoad` props. * All the other properties are configurations that could be tweaked. * @namespace modifiers */ var modifiers = { /** * Modifier used to shift the popper on the start or end of its reference * element.
* It will read the variation of the `placement` property.
* It can be one either `-end` or `-start`. * @memberof modifiers * @inner */ shift: { /** @prop {number} order=100 - Index used to define the order of execution */ order: 100, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: shift }, /** * The `offset` modifier can shift your popper on both its axis. * * It accepts the following units: * - `px` or unit-less, interpreted as pixels * - `%` or `%r`, percentage relative to the length of the reference element * - `%p`, percentage relative to the length of the popper element * - `vw`, CSS viewport width unit * - `vh`, CSS viewport height unit * * For length is intended the main axis relative to the placement of the popper.
* This means that if the placement is `top` or `bottom`, the length will be the * `width`. In case of `left` or `right`, it will be the `height`. * * You can provide a single value (as `Number` or `String`), or a pair of values * as `String` divided by a comma or one (or more) white spaces.
* The latter is a deprecated method because it leads to confusion and will be * removed in v2.
* Additionally, it accepts additions and subtractions between different units. * Note that multiplications and divisions aren't supported. * * Valid examples are: * ``` * 10 * '10%' * '10, 10' * '10%, 10' * '10 + 10%' * '10 - 5vh + 3%' * '-10px + 5vh, 5px - 6%' * ``` * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap * > with their reference element, unfortunately, you will have to disable the `flip` modifier. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). * * @memberof modifiers * @inner */ offset: { /** @prop {number} order=200 - Index used to define the order of execution */ order: 200, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: offset, /** @prop {Number|String} offset=0 * The offset value as described in the modifier description */ offset: 0 }, /** * Modifier used to prevent the popper from being positioned outside the boundary. * * A scenario exists where the reference itself is not within the boundaries.
* We can say it has "escaped the boundaries" — or just "escaped".
* In this case we need to decide whether the popper should either: * * - detach from the reference and remain "trapped" in the boundaries, or * - if it should ignore the boundary and "escape with its reference" * * When `escapeWithReference` is set to`true` and reference is completely * outside its boundaries, the popper will overflow (or completely leave) * the boundaries in order to remain attached to the edge of the reference. * * @memberof modifiers * @inner */ preventOverflow: { /** @prop {number} order=300 - Index used to define the order of execution */ order: 300, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: preventOverflow, /** * @prop {Array} [priority=['left','right','top','bottom']] * Popper will try to prevent overflow following these priorities by default, * then, it could overflow on the left and on top of the `boundariesElement` */ priority: ['left', 'right', 'top', 'bottom'], /** * @prop {number} padding=5 * Amount of pixel used to define a minimum distance between the boundaries * and the popper. This makes sure the popper always has a little padding * between the edges of its container */ padding: 5, /** * @prop {String|HTMLElement} boundariesElement='scrollParent' * Boundaries used by the modifier. Can be `scrollParent`, `window`, * `viewport` or any DOM element. */ boundariesElement: 'scrollParent' }, /** * Modifier used to make sure the reference and its popper stay near each other * without leaving any gap between the two. Especially useful when the arrow is * enabled and you want to ensure that it points to its reference element. * It cares only about the first axis. You can still have poppers with margin * between the popper and its reference element. * @memberof modifiers * @inner */ keepTogether: { /** @prop {number} order=400 - Index used to define the order of execution */ order: 400, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: keepTogether }, /** * This modifier is used to move the `arrowElement` of the popper to make * sure it is positioned between the reference element and its popper element. * It will read the outer size of the `arrowElement` node to detect how many * pixels of conjunction are needed. * * It has no effect if no `arrowElement` is provided. * @memberof modifiers * @inner */ arrow: { /** @prop {number} order=500 - Index used to define the order of execution */ order: 500, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: arrow, /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ element: '[x-arrow]' }, /** * Modifier used to flip the popper's placement when it starts to overlap its * reference element. * * Requires the `preventOverflow` modifier before it in order to work. * * **NOTE:** this modifier will interrupt the current update cycle and will * restart it if it detects the need to flip the placement. * @memberof modifiers * @inner */ flip: { /** @prop {number} order=600 - Index used to define the order of execution */ order: 600, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: flip, /** * @prop {String|Array} behavior='flip' * The behavior used to change the popper's placement. It can be one of * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid * placements (with optional variations) */ behavior: 'flip', /** * @prop {number} padding=5 * The popper will flip if it hits the edges of the `boundariesElement` */ padding: 5, /** * @prop {String|HTMLElement} boundariesElement='viewport' * The element which will define the boundaries of the popper position. * The popper will never be placed outside of the defined boundaries * (except if `keepTogether` is enabled) */ boundariesElement: 'viewport', /** * @prop {Boolean} flipVariations=false * The popper will switch placement variation between `-start` and `-end` when * the reference element overlaps its boundaries. * * The original placement should have a set variation. */ flipVariations: false, /** * @prop {Boolean} flipVariationsByContent=false * The popper will switch placement variation between `-start` and `-end` when * the popper element overlaps its reference boundaries. * * The original placement should have a set variation. */ flipVariationsByContent: false }, /** * Modifier used to make the popper flow toward the inner of the reference element. * By default, when this modifier is disabled, the popper will be placed outside * the reference element. * @memberof modifiers * @inner */ inner: { /** @prop {number} order=700 - Index used to define the order of execution */ order: 700, /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ enabled: false, /** @prop {ModifierFn} */ fn: inner }, /** * Modifier used to hide the popper when its reference element is outside of the * popper boundaries. It will set a `x-out-of-boundaries` attribute which can * be used to hide with a CSS selector the popper when its reference is * out of boundaries. * * Requires the `preventOverflow` modifier before it in order to work. * @memberof modifiers * @inner */ hide: { /** @prop {number} order=800 - Index used to define the order of execution */ order: 800, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: hide }, /** * Computes the style that will be applied to the popper element to gets * properly positioned. * * Note that this modifier will not touch the DOM, it just prepares the styles * so that `applyStyle` modifier can apply it. This separation is useful * in case you need to replace `applyStyle` with a custom implementation. * * This modifier has `850` as `order` value to maintain backward compatibility * with previous versions of Popper.js. Expect the modifiers ordering method * to change in future major versions of the library. * * @memberof modifiers * @inner */ computeStyle: { /** @prop {number} order=850 - Index used to define the order of execution */ order: 850, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: computeStyle, /** * @prop {Boolean} gpuAcceleration=true * If true, it uses the CSS 3D transformation to position the popper. * Otherwise, it will use the `top` and `left` properties */ gpuAcceleration: true, /** * @prop {string} [x='bottom'] * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. * Change this if your popper should grow in a direction different from `bottom` */ x: 'bottom', /** * @prop {string} [x='left'] * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. * Change this if your popper should grow in a direction different from `right` */ y: 'right' }, /** * Applies the computed styles to the popper element. * * All the DOM manipulations are limited to this modifier. This is useful in case * you want to integrate Popper.js inside a framework or view library and you * want to delegate all the DOM manipulations to it. * * Note that if you disable this modifier, you must make sure the popper element * has its position set to `absolute` before Popper.js can do its work! * * Just disable this modifier and define your own to achieve the desired effect. * * @memberof modifiers * @inner */ applyStyle: { /** @prop {number} order=900 - Index used to define the order of execution */ order: 900, /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ enabled: true, /** @prop {ModifierFn} */ fn: applyStyle, /** @prop {Function} */ onLoad: applyStyleOnLoad, /** * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier * @prop {Boolean} gpuAcceleration=true * If true, it uses the CSS 3D transformation to position the popper. * Otherwise, it will use the `top` and `left` properties */ gpuAcceleration: undefined } }; /** * The `dataObject` is an object containing all the information used by Popper.js. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. * @name dataObject * @property {Object} data.instance The Popper.js instance * @property {String} data.placement Placement applied to popper * @property {String} data.originalPlacement Placement originally defined on init * @property {Boolean} data.flipped True if popper has been flipped by flip modifier * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) * @property {Object} data.boundaries Offsets of the popper boundaries * @property {Object} data.offsets The measurements of popper, reference and arrow elements * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 */ /** * Default options provided to Popper.js constructor.
* These can be overridden using the `options` argument of Popper.js.
* To override an option, simply pass an object with the same * structure of the `options` object, as the 3rd argument. For example: * ``` * new Popper(ref, pop, { * modifiers: { * preventOverflow: { enabled: false } * } * }) * ``` * @type {Object} * @static * @memberof Popper */ var Defaults = { /** * Popper's placement. * @prop {Popper.placements} placement='bottom' */ placement: 'bottom', /** * Set this to true if you want popper to position it self in 'fixed' mode * @prop {Boolean} positionFixed=false */ positionFixed: false, /** * Whether events (resize, scroll) are initially enabled. * @prop {Boolean} eventsEnabled=true */ eventsEnabled: true, /** * Set to true if you want to automatically remove the popper when * you call the `destroy` method. * @prop {Boolean} removeOnDestroy=false */ removeOnDestroy: false, /** * Callback called when the popper is created.
* By default, it is set to no-op.
* Access Popper.js instance with `data.instance`. * @prop {onCreate} */ onCreate: function onCreate() {}, /** * Callback called when the popper is updated. This callback is not called * on the initialization/creation of the popper, but only on subsequent * updates.
* By default, it is set to no-op.
* Access Popper.js instance with `data.instance`. * @prop {onUpdate} */ onUpdate: function onUpdate() {}, /** * List of modifiers used to modify the offsets before they are applied to the popper. * They provide most of the functionalities of Popper.js. * @prop {modifiers} */ modifiers: modifiers }; /** * @callback onCreate * @param {dataObject} data */ /** * @callback onUpdate * @param {dataObject} data */ // Utils // Methods var Popper = function () { /** * Creates a new Popper.js instance. * @class Popper * @param {Element|referenceObject} reference - The reference element used to position the popper * @param {Element} popper - The HTML / XML element used as the popper * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) * @return {Object} instance - The generated Popper.js instance */ function Popper(reference, popper) { var _this = this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; classCallCheck(this, Popper); this.scheduleUpdate = function () { return requestAnimationFrame(_this.update); }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it this.options = _extends({}, Popper.Defaults, options); // init state this.state = { isDestroyed: false, isCreated: false, scrollParents: [] }; // get reference and popper elements (allow jQuery wrappers) this.reference = reference && reference.jquery ? reference[0] : reference; this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options this.options.modifiers = {}; Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); }); // Refactoring modifiers' list (Object => Array) this.modifiers = Object.keys(this.options.modifiers).map(function (name) { return _extends({ name: name }, _this.options.modifiers[name]); }) // sort the modifiers by order .sort(function (a, b) { return a.order - b.order; }); // modifiers have the ability to execute arbitrary code when Popper.js get inited // such code is executed in the same order of its modifier // they could add new properties to their options configuration // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! this.modifiers.forEach(function (modifierOptions) { if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); } }); // fire the first update to position the popper in the right place this.update(); var eventsEnabled = this.options.eventsEnabled; if (eventsEnabled) { // setup event listeners, they will take care of update the position in specific situations this.enableEventListeners(); } this.state.eventsEnabled = eventsEnabled; } // We can't use class properties because they don't get listed in the // class prototype and break stuff like Sinon stubs createClass(Popper, [{ key: 'update', value: function update$$1() { return update.call(this); } }, { key: 'destroy', value: function destroy$$1() { return destroy.call(this); } }, { key: 'enableEventListeners', value: function enableEventListeners$$1() { return enableEventListeners.call(this); } }, { key: 'disableEventListeners', value: function disableEventListeners$$1() { return disableEventListeners.call(this); } /** * Schedules an update. It will run on the next UI update available. * @method scheduleUpdate * @memberof Popper */ /** * Collection of utilities useful when writing custom modifiers. * Starting from version 1.7, this method is available only if you * include `popper-utils.js` before `popper.js`. * * **DEPRECATION**: This way to access PopperUtils is deprecated * and will be removed in v2! Use the PopperUtils module directly instead. * Due to the high instability of the methods contained in Utils, we can't * guarantee them to follow semver. Use them at your own risk! * @static * @private * @type {Object} * @deprecated since version 1.8 * @member Utils * @memberof Popper */ }]); return Popper; }(); /** * The `referenceObject` is an object that provides an interface compatible with Popper.js * and lets you use it as replacement of a real DOM node.
* You can use this method to position a popper relatively to a set of coordinates * in case you don't have a DOM node to use as reference. * * ``` * new Popper(referenceObject, popperNode); * ``` * * NB: This feature isn't supported in Internet Explorer 10. * @name referenceObject * @property {Function} data.getBoundingClientRect * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. * @property {number} data.clientWidth * An ES6 getter that will return the width of the virtual reference element. * @property {number} data.clientHeight * An ES6 getter that will return the height of the virtual reference element. */ Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; Popper.placements = placements; Popper.Defaults = Defaults; /* harmony default export */ __webpack_exports__["default"] = (Popper); //# sourceMappingURL=popper.js.map /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba"))) /***/ }), /***/ "f1ae": /***/ (function(module, exports, __webpack_require__) { "use strict"; var $defineProperty = __webpack_require__("86cc"); var createDesc = __webpack_require__("4630"); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; /***/ }), /***/ "f260": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Portuguese [pt] //! author : Jefferson : https://github.com/jalex79 ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var pt = moment.defineLocale('pt', { months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split( '_' ), monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split( '_' ), weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D [de] MMMM [de] YYYY', LLL: 'D [de] MMMM [de] YYYY HH:mm', LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm', }, calendar: { sameDay: '[Hoje às] LT', nextDay: '[Amanhã às] LT', nextWeek: 'dddd [às] LT', lastDay: '[Ontem às] LT', lastWeek: function () { return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' // Saturday + Sunday : '[Última] dddd [às] LT'; // Monday - Friday }, sameElse: 'L', }, relativeTime: { future: 'em %s', past: 'há %s', s: 'segundos', ss: '%d segundos', m: 'um minuto', mm: '%d minutos', h: 'uma hora', hh: '%d horas', d: 'um dia', dd: '%d dias', w: 'uma semana', ww: '%d semanas', M: 'um mês', MM: '%d meses', y: 'um ano', yy: '%d anos', }, dayOfMonthOrdinalParse: /\d{1,2}º/, ordinal: '%dº', week: { dow: 1, // Monday is the first day of the week. doy: 4, // The week that contains Jan 4th is the first week of the year. }, }); return pt; }))); /***/ }), /***/ "f28c": /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /***/ "f2ad": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_About_vue_vue_type_style_index_0_id_6003dacb_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8387"); /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_About_vue_vue_type_style_index_0_id_6003dacb_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_About_vue_vue_type_style_index_0_id_6003dacb_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); /* unused harmony reexport * */ /***/ }), /***/ "f3ff": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Punjabi (India) [pa-in] //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var symbolMap = { 1: '੧', 2: '੨', 3: '੩', 4: '੪', 5: '੫', 6: '੬', 7: '੭', 8: '੮', 9: '੯', 0: '੦', }, numberMap = { '੧': '1', '੨': '2', '੩': '3', '੪': '4', '੫': '5', '੬': '6', '੭': '7', '੮': '8', '੯': '9', '੦': '0', }; var paIn = moment.defineLocale('pa-in', { // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi. months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split( '_' ), monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split( '_' ), weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split( '_' ), weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), longDateFormat: { LT: 'A h:mm ਵਜੇ', LTS: 'A h:mm:ss ਵਜੇ', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm ਵਜੇ', LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', }, calendar: { sameDay: '[ਅਜ] LT', nextDay: '[ਕਲ] LT', nextWeek: '[ਅਗਲਾ] dddd, LT', lastDay: '[ਕਲ] LT', lastWeek: '[ਪਿਛਲੇ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s ਵਿੱਚ', past: '%s ਪਿਛਲੇ', s: 'ਕੁਝ ਸਕਿੰਟ', ss: '%d ਸਕਿੰਟ', m: 'ਇਕ ਮਿੰਟ', mm: '%d ਮਿੰਟ', h: 'ਇੱਕ ਘੰਟਾ', hh: '%d ਘੰਟੇ', d: 'ਇੱਕ ਦਿਨ', dd: '%d ਦਿਨ', M: 'ਇੱਕ ਮਹੀਨਾ', MM: '%d ਮਹੀਨੇ', y: 'ਇੱਕ ਸਾਲ', yy: '%d ਸਾਲ', }, preparse: function (string) { return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { return numberMap[match]; }); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }); }, // Punjabi notation for meridiems are quite fuzzy in practice. While there exists // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if (meridiem === 'ਰਾਤ') { return hour < 4 ? hour : hour + 12; } else if (meridiem === 'ਸਵੇਰ') { return hour; } else if (meridiem === 'ਦੁਪਹਿਰ') { return hour >= 10 ? hour : hour + 12; } else if (meridiem === 'ਸ਼ਾਮ') { return hour + 12; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'ਰਾਤ'; } else if (hour < 10) { return 'ਸਵੇਰ'; } else if (hour < 17) { return 'ਦੁਪਹਿਰ'; } else if (hour < 20) { return 'ਸ਼ਾਮ'; } else { return 'ਰਾਤ'; } }, week: { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }, }); return paIn; }))); /***/ }), /***/ "f45b": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Tablesaw - v3.1.2 - 2019-03-19 * https://github.com/filamentgroup/tablesaw * Copyright (c) 2019 Filament Group; Licensed MIT */ /*! Shoestring - v2.0.0 - 2017-02-14 * http://github.com/filamentgroup/shoestring/ * Copyright (c) 2017 Scott Jehl, Filament Group, Inc; Licensed MIT & GPLv2 */ (function( factory ) { if( true ) { // AMD. Register as an anonymous module. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__("28b7") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(function () { var win = typeof window !== "undefined" ? window : this; var doc = win.document; /** * The shoestring object constructor. * * @param {string,object} prim The selector to find or element to wrap. * @param {object} sec The context in which to match the `prim` selector. * @returns shoestring * @this window */ function shoestring( prim, sec ){ var pType = typeof( prim ), ret = [], sel; // return an empty shoestring object if( !prim ){ return new Shoestring( ret ); } // ready calls if( prim.call ){ return shoestring.ready( prim ); } // handle re-wrapping shoestring objects if( prim.constructor === Shoestring && !sec ){ return prim; } // if string starting with <, make html if( pType === "string" && prim.indexOf( "<" ) === 0 ){ var dfrag = doc.createElement( "div" ); dfrag.innerHTML = prim; // TODO depends on children (circular) return shoestring( dfrag ).children().each(function(){ dfrag.removeChild( this ); }); } // if string, it's a selector, use qsa if( pType === "string" ){ if( sec ){ return shoestring( sec ).find( prim ); } sel = doc.querySelectorAll( prim ); return new Shoestring( sel, prim ); } // array like objects or node lists if( Object.prototype.toString.call( pType ) === '[object Array]' || (win.NodeList && prim instanceof win.NodeList) ){ return new Shoestring( prim, prim ); } // if it's an array, use all the elements if( prim.constructor === Array ){ return new Shoestring( prim, prim ); } // otherwise assume it's an object the we want at an index return new Shoestring( [prim], prim ); } var Shoestring = function( ret, prim ) { this.length = 0; this.selector = prim; shoestring.merge(this, ret); }; // TODO only required for tests Shoestring.prototype.reverse = [].reverse; // For adding element set methods shoestring.fn = Shoestring.prototype; shoestring.Shoestring = Shoestring; // For extending objects // TODO move to separate module when we use prototypes shoestring.extend = function( first, second ){ for( var i in second ){ if( second.hasOwnProperty( i ) ){ first[ i ] = second[ i ]; } } return first; }; // taken directly from jQuery shoestring.merge = function( first, second ) { var len, j, i; len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }; // expose win.shoestring = shoestring; /** * Iterates over `shoestring` collections. * * @param {function} callback The callback to be invoked on each element and index * @return shoestring * @this shoestring */ shoestring.fn.each = function( callback ){ return shoestring.each( this, callback ); }; shoestring.each = function( collection, callback ) { var val; for( var i = 0, il = collection.length; i < il; i++ ){ val = callback.call( collection[i], i, collection[i] ); if( val === false ){ break; } } return collection; }; /** * Check for array membership. * * @param {object} needle The thing to find. * @param {object} haystack The thing to find the needle in. * @return {boolean} * @this window */ shoestring.inArray = function( needle, haystack ){ var isin = -1; for( var i = 0, il = haystack.length; i < il; i++ ){ if( haystack.hasOwnProperty( i ) && haystack[ i ] === needle ){ isin = i; } } return isin; }; /** * Bind callbacks to be run when the DOM is "ready". * * @param {function} fn The callback to be run * @return shoestring * @this shoestring */ shoestring.ready = function( fn ){ if( ready && fn ){ fn.call( doc ); } else if( fn ){ readyQueue.push( fn ); } else { runReady(); } return [doc]; }; // TODO necessary? shoestring.fn.ready = function( fn ){ shoestring.ready( fn ); return this; }; // Empty and exec the ready queue var ready = false, readyQueue = [], runReady = function(){ if( !ready ){ while( readyQueue.length ){ readyQueue.shift().call( doc ); } ready = true; } }; // If DOM is already ready at exec time, depends on the browser. // From: https://github.com/mobify/mobifyjs/blob/526841be5509e28fc949038021799e4223479f8d/src/capture.js#L128 if (doc.attachEvent ? doc.readyState === "complete" : doc.readyState !== "loading") { runReady(); } else { doc.addEventListener( "DOMContentLoaded", runReady, false ); doc.addEventListener( "readystatechange", runReady, false ); win.addEventListener( "load", runReady, false ); } /** * Checks the current set of elements against the selector, if one matches return `true`. * * @param {string} selector The selector to check. * @return {boolean} * @this {shoestring} */ shoestring.fn.is = function( selector ){ var ret = false, self = this, parents, check; // assume a dom element if( typeof selector !== "string" ){ // array-like, ie shoestring objects or element arrays if( selector.length && selector[0] ){ check = selector; } else { check = [selector]; } return _checkElements(this, check); } parents = this.parent(); if( !parents.length ){ parents = shoestring( doc ); } parents.each(function( i, e ) { var children; children = e.querySelectorAll( selector ); ret = _checkElements( self, children ); }); return ret; }; function _checkElements(needles, haystack){ var ret = false; needles.each(function() { var j = 0; while( j < haystack.length ){ if( this === haystack[j] ){ ret = true; } j++; } }); return ret; } /** * Get data attached to the first element or set data values on all elements in the current set. * * @param {string} name The data attribute name. * @param {any} value The value assigned to the data attribute. * @return {any|shoestring} * @this shoestring */ shoestring.fn.data = function( name, value ){ if( name !== undefined ){ if( value !== undefined ){ return this.each(function(){ if( !this.shoestringData ){ this.shoestringData = {}; } this.shoestringData[ name ] = value; }); } else { if( this[ 0 ] ) { if( this[ 0 ].shoestringData ) { return this[ 0 ].shoestringData[ name ]; } } } } else { return this[ 0 ] ? this[ 0 ].shoestringData || {} : undefined; } }; /** * Remove data associated with `name` or all the data, for each element in the current set. * * @param {string} name The data attribute name. * @return shoestring * @this shoestring */ shoestring.fn.removeData = function( name ){ return this.each(function(){ if( name !== undefined && this.shoestringData ){ this.shoestringData[ name ] = undefined; delete this.shoestringData[ name ]; } else { this[ 0 ].shoestringData = {}; } }); }; /** * An alias for the `shoestring` constructor. */ win.$ = shoestring; /** * Add a class to each DOM element in the set of elements. * * @param {string} className The name of the class to be added. * @return shoestring * @this shoestring */ shoestring.fn.addClass = function( className ){ var classes = className.replace(/^\s+|\s+$/g, '').split( " " ); return this.each(function(){ for( var i = 0, il = classes.length; i < il; i++ ){ if( this.className !== undefined && (this.className === "" || !this.className.match( new RegExp( "(^|\\s)" + classes[ i ] + "($|\\s)"))) ){ this.className += " " + classes[ i ]; } } }); }; /** * Add elements matching the selector to the current set. * * @param {string} selector The selector for the elements to add from the DOM * @return shoestring * @this shoestring */ shoestring.fn.add = function( selector ){ var ret = []; this.each(function(){ ret.push( this ); }); shoestring( selector ).each(function(){ ret.push( this ); }); return shoestring( ret ); }; /** * Insert an element or HTML string as the last child of each element in the set. * * @param {string|HTMLElement} fragment The HTML or HTMLElement to insert. * @return shoestring * @this shoestring */ shoestring.fn.append = function( fragment ){ if( typeof( fragment ) === "string" || fragment.nodeType !== undefined ){ fragment = shoestring( fragment ); } return this.each(function( i ){ for( var j = 0, jl = fragment.length; j < jl; j++ ){ this.appendChild( i > 0 ? fragment[ j ].cloneNode( true ) : fragment[ j ] ); } }); }; /** * Insert the current set as the last child of the elements matching the selector. * * @param {string} selector The selector after which to append the current set. * @return shoestring * @this shoestring */ shoestring.fn.appendTo = function( selector ){ return this.each(function(){ shoestring( selector ).append( this ); }); }; /** * Get the value of the first element of the set or set the value of all the elements in the set. * * @param {string} name The attribute name. * @param {string} value The new value for the attribute. * @return {shoestring|string|undefined} * @this {shoestring} */ shoestring.fn.attr = function( name, value ){ var nameStr = typeof( name ) === "string"; if( value !== undefined || !nameStr ){ return this.each(function(){ if( nameStr ){ this.setAttribute( name, value ); } else { for( var i in name ){ if( name.hasOwnProperty( i ) ){ this.setAttribute( i, name[ i ] ); } } } }); } else { return this[ 0 ] ? this[ 0 ].getAttribute( name ) : undefined; } }; /** * Insert an element or HTML string before each element in the current set. * * @param {string|HTMLElement} fragment The HTML or HTMLElement to insert. * @return shoestring * @this shoestring */ shoestring.fn.before = function( fragment ){ if( typeof( fragment ) === "string" || fragment.nodeType !== undefined ){ fragment = shoestring( fragment ); } return this.each(function( i ){ for( var j = 0, jl = fragment.length; j < jl; j++ ){ this.parentNode.insertBefore( i > 0 ? fragment[ j ].cloneNode( true ) : fragment[ j ], this ); } }); }; /** * Get the children of the current collection. * @return shoestring * @this shoestring */ shoestring.fn.children = function(){ var ret = [], childs, j; this.each(function(){ childs = this.children; j = -1; while( j++ < childs.length-1 ){ if( shoestring.inArray( childs[ j ], ret ) === -1 ){ ret.push( childs[ j ] ); } } }); return shoestring(ret); }; /** * Find an element matching the selector in the set of the current element and its parents. * * @param {string} selector The selector used to identify the target element. * @return shoestring * @this shoestring */ shoestring.fn.closest = function( selector ){ var ret = []; if( !selector ){ return shoestring( ret ); } this.each(function(){ var element, $self = shoestring( element = this ); if( $self.is(selector) ){ ret.push( this ); return; } while( element.parentElement ) { if( shoestring(element.parentElement).is(selector) ){ ret.push( element.parentElement ); break; } element = element.parentElement; } }); return shoestring( ret ); }; shoestring.cssExceptions = { 'float': [ 'cssFloat' ] }; (function() { var cssExceptions = shoestring.cssExceptions; // IE8 uses marginRight instead of margin-right function convertPropertyName( str ) { return str.replace( /\-([A-Za-z])/g, function ( match, character ) { return character.toUpperCase(); }); } function _getStyle( element, property ) { return win.getComputedStyle( element, null ).getPropertyValue( property ); } var vendorPrefixes = [ '', '-webkit-', '-ms-', '-moz-', '-o-', '-khtml-' ]; /** * Private function for getting the computed style of an element. * * **NOTE** Please use the [css](../css.js.html) method instead. * * @method _getStyle * @param {HTMLElement} element The element we want the style property for. * @param {string} property The css property we want the style for. */ shoestring._getStyle = function( element, property ) { var convert, value, j, k; if( cssExceptions[ property ] ) { for( j = 0, k = cssExceptions[ property ].length; j < k; j++ ) { value = _getStyle( element, cssExceptions[ property ][ j ] ); if( value ) { return value; } } } for( j = 0, k = vendorPrefixes.length; j < k; j++ ) { convert = convertPropertyName( vendorPrefixes[ j ] + property ); // VendorprefixKeyName || key-name value = _getStyle( element, convert ); if( convert !== property ) { value = value || _getStyle( element, property ); } if( vendorPrefixes[ j ] ) { // -vendorprefix-key-name value = value || _getStyle( element, vendorPrefixes[ j ] + property ); } if( value ) { return value; } } return undefined; }; })(); (function() { var cssExceptions = shoestring.cssExceptions; // IE8 uses marginRight instead of margin-right function convertPropertyName( str ) { return str.replace( /\-([A-Za-z])/g, function ( match, character ) { return character.toUpperCase(); }); } /** * Private function for setting the style of an element. * * **NOTE** Please use the [css](../css.js.html) method instead. * * @method _setStyle * @param {HTMLElement} element The element we want to style. * @param {string} property The property being used to style the element. * @param {string} value The css value for the style property. */ shoestring._setStyle = function( element, property, value ) { var convertedProperty = convertPropertyName(property); element.style[ property ] = value; if( convertedProperty !== property ) { element.style[ convertedProperty ] = value; } if( cssExceptions[ property ] ) { for( var j = 0, k = cssExceptions[ property ].length; j -1 ){ ret.push( this ); } } }); return shoestring( ret ); }; /** * Find descendant elements of the current collection. * * @param {string} selector The selector used to find the children * @return shoestring * @this shoestring */ shoestring.fn.find = function( selector ){ var ret = [], finds; this.each(function(){ finds = this.querySelectorAll( selector ); for( var i = 0, il = finds.length; i < il; i++ ){ ret = ret.concat( finds[i] ); } }); return shoestring( ret ); }; /** * Returns the first element of the set wrapped in a new `shoestring` object. * * @return shoestring * @this shoestring */ shoestring.fn.first = function(){ return this.eq( 0 ); }; /** * Returns the raw DOM node at the passed index. * * @param {integer} index The index of the element to wrap and return. * @return {HTMLElement|undefined|array} * @this shoestring */ shoestring.fn.get = function( index ){ // return an array of elements if index is undefined if( index === undefined ){ var elements = []; for( var i = 0; i < this.length; i++ ){ elements.push( this[ i ] ); } return elements; } else { return this[ index ]; } }; var set = function( html ){ if( typeof html === "string" || typeof html === "number" ){ return this.each(function(){ this.innerHTML = "" + html; }); } else { var h = ""; if( typeof html.length !== "undefined" ){ for( var i = 0, l = html.length; i < l; i++ ){ h += html[i].outerHTML; } } else { h = html.outerHTML; } return this.each(function(){ this.innerHTML = h; }); } }; /** * Gets or sets the `innerHTML` from all the elements in the set. * * @param {string|undefined} html The html to assign * @return {string|shoestring} * @this shoestring */ shoestring.fn.html = function( html ){ if( typeof html !== "undefined" ){ return set.call( this, html ); } else { // get var pile = ""; this.each(function(){ pile += this.innerHTML; }); return pile; } }; (function() { function _getIndex( set, test ) { var i, result, element; for( i = result = 0; i < set.length; i++ ) { element = set.item ? set.item(i) : set[i]; if( test(element) ){ return result; } // ignore text nodes, etc // NOTE may need to be more permissive if( element.nodeType === 1 ){ result++; } } return -1; } /** * Find the index in the current set for the passed selector. * Without a selector it returns the index of the first node within the array of its siblings. * * @param {string|undefined} selector The selector used to search for the index. * @return {integer} * @this {shoestring} */ shoestring.fn.index = function( selector ){ var self, children; self = this; // no arg? check the children, otherwise check each element that matches if( selector === undefined ){ children = ( ( this[ 0 ] && this[0].parentNode ) || doc.documentElement).childNodes; // check if the element matches the first of the set return _getIndex(children, function( element ) { return self[0] === element; }); } else { // check if the element matches the first selected node from the parent return _getIndex(self, function( element ) { return element === (shoestring( selector, element.parentNode )[ 0 ]); }); } }; })(); /** * Insert the current set before the elements matching the selector. * * @param {string} selector The selector before which to insert the current set. * @return shoestring * @this shoestring */ shoestring.fn.insertBefore = function( selector ){ return this.each(function(){ shoestring( selector ).before( this ); }); }; /** * Returns the last element of the set wrapped in a new `shoestring` object. * * @return shoestring * @this shoestring */ shoestring.fn.last = function(){ return this.eq( this.length - 1 ); }; /** * Returns a `shoestring` object with the set of siblings of each element in the original set. * * @return shoestring * @this shoestring */ shoestring.fn.next = function(){ var result = []; // TODO need to implement map this.each(function() { var children, item, found; // get the child nodes for this member of the set children = shoestring( this.parentNode )[0].childNodes; for( var i = 0; i < children.length; i++ ){ item = children.item( i ); // found the item we needed (found) which means current item value is // the next node in the list, as long as it's viable grab it // NOTE may need to be more permissive if( found && item.nodeType === 1 ){ result.push( item ); break; } // find the current item and mark it as found if( item === this ){ found = true; } } }); return shoestring( result ); }; /** * Removes elements from the current set. * * @param {string} selector The selector to use when removing the elements. * @return shoestring * @this shoestring */ shoestring.fn.not = function( selector ){ var ret = []; this.each(function(){ var found = shoestring( selector, this.parentNode ); if( shoestring.inArray(this, found) === -1 ){ ret.push( this ); } }); return shoestring( ret ); }; /** * Returns the set of first parents for each element in the current set. * * @return shoestring * @this shoestring */ shoestring.fn.parent = function(){ var ret = [], parent; this.each(function(){ // no parent node, assume top level // jQuery parent: return the document object for or the parent node if it exists parent = (this === doc.documentElement ? doc : this.parentNode); // if there is a parent and it's not a document fragment if( parent && parent.nodeType !== 11 ){ ret.push( parent ); } }); return shoestring(ret); }; /** * Add an HTML string or element before the children of each element in the current set. * * @param {string|HTMLElement} fragment The HTML string or element to add. * @return shoestring * @this shoestring */ shoestring.fn.prepend = function( fragment ){ if( typeof( fragment ) === "string" || fragment.nodeType !== undefined ){ fragment = shoestring( fragment ); } return this.each(function( i ){ for( var j = 0, jl = fragment.length; j < jl; j++ ){ var insertEl = i > 0 ? fragment[ j ].cloneNode( true ) : fragment[ j ]; if ( this.firstChild ){ this.insertBefore( insertEl, this.firstChild ); } else { this.appendChild( insertEl ); } } }); }; /** * Returns a `shoestring` object with the set of *one* siblingx before each element in the original set. * * @return shoestring * @this shoestring */ shoestring.fn.prev = function(){ var result = []; // TODO need to implement map this.each(function() { var children, item, found; // get the child nodes for this member of the set children = shoestring( this.parentNode )[0].childNodes; for( var i = children.length -1; i >= 0; i-- ){ item = children.item( i ); // found the item we needed (found) which means current item value is // the next node in the list, as long as it's viable grab it // NOTE may need to be more permissive if( found && item.nodeType === 1 ){ result.push( item ); break; } // find the current item and mark it as found if( item === this ){ found = true; } } }); return shoestring( result ); }; /** * Returns a `shoestring` object with the set of *all* siblings before each element in the original set. * * @return shoestring * @this shoestring */ shoestring.fn.prevAll = function(){ var result = []; this.each(function() { var $previous = shoestring( this ).prev(); while( $previous.length ){ result.push( $previous[0] ); $previous = $previous.prev(); } }); return shoestring( result ); }; /** * Remove an attribute from each element in the current set. * * @param {string} name The name of the attribute. * @return shoestring * @this shoestring */ shoestring.fn.removeAttr = function( name ){ return this.each(function(){ this.removeAttribute( name ); }); }; /** * Remove a class from each DOM element in the set of elements. * * @param {string} className The name of the class to be removed. * @return shoestring * @this shoestring */ shoestring.fn.removeClass = function( cname ){ var classes = cname.replace(/^\s+|\s+$/g, '').split( " " ); return this.each(function(){ var newClassName, regex; for( var i = 0, il = classes.length; i < il; i++ ){ if( this.className !== undefined ){ regex = new RegExp( "(^|\\s)" + classes[ i ] + "($|\\s)", "gmi" ); newClassName = this.className.replace( regex, " " ); this.className = newClassName.replace(/^\s+|\s+$/g, ''); } } }); }; /** * Remove the current set of elements from the DOM. * * @return shoestring * @this shoestring */ shoestring.fn.remove = function(){ return this.each(function(){ if( this.parentNode ) { this.parentNode.removeChild( this ); } }); }; /** * Replace each element in the current set with that argument HTML string or HTMLElement. * * @param {string|HTMLElement} fragment The value to assign. * @return shoestring * @this shoestring */ shoestring.fn.replaceWith = function( fragment ){ if( typeof( fragment ) === "string" ){ fragment = shoestring( fragment ); } var ret = []; if( fragment.length > 1 ){ fragment = fragment.reverse(); } this.each(function( i ){ var clone = this.cloneNode( true ), insertEl; ret.push( clone ); // If there is no parentNode, this is pointless, drop it. if( !this.parentNode ){ return; } if( fragment.length === 1 ){ insertEl = i > 0 ? fragment[ 0 ].cloneNode( true ) : fragment[ 0 ]; this.parentNode.replaceChild( insertEl, this ); } else { for( var j = 0, jl = fragment.length; j < jl; j++ ){ insertEl = i > 0 ? fragment[ j ].cloneNode( true ) : fragment[ j ]; this.parentNode.insertBefore( insertEl, this.nextSibling ); } this.parentNode.removeChild( this ); } }); return shoestring( ret ); }; /** * Get all of the sibling elements for each element in the current set. * * @return shoestring * @this shoestring */ shoestring.fn.siblings = function(){ if( !this.length ) { return shoestring( [] ); } var sibs = [], el = this[ 0 ].parentNode.firstChild; do { if( el.nodeType === 1 && el !== this[ 0 ] ) { sibs.push( el ); } el = el.nextSibling; } while( el ); return shoestring( sibs ); }; var getText = function( elem ){ var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; /** * Recursively retrieve the text content of the each element in the current set. * * @return shoestring * @this shoestring */ shoestring.fn.text = function() { return getText( this ); }; /** * Get the value of the first element or set the value of all elements in the current set. * * @param {string} value The value to set. * @return shoestring * @this shoestring */ shoestring.fn.val = function( value ){ var el; if( value !== undefined ){ return this.each(function(){ if( this.tagName === "SELECT" ){ var optionSet, option, options = this.options, values = [], i = options.length, newIndex; values[0] = value; while ( i-- ) { option = options[ i ]; if ( (option.selected = shoestring.inArray( option.value, values ) >= 0) ) { optionSet = true; newIndex = i; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { this.selectedIndex = -1; } else { this.selectedIndex = newIndex; } } else { this.value = value; } }); } else { el = this[0]; if( el.tagName === "SELECT" ){ if( el.selectedIndex < 0 ){ return ""; } return el.options[ el.selectedIndex ].value; } else { return el.value; } } }; /** * Private function for setting/getting the offset property for height/width. * * **NOTE** Please use the [width](width.js.html) or [height](height.js.html) methods instead. * * @param {shoestring} set The set of elements. * @param {string} name The string "height" or "width". * @param {float|undefined} value The value to assign. * @return shoestring * @this window */ shoestring._dimension = function( set, name, value ){ var offsetName; if( value === undefined ){ offsetName = name.replace(/^[a-z]/, function( letter ) { return letter.toUpperCase(); }); return set[ 0 ][ "offset" + offsetName ]; } else { // support integer values as pixels value = typeof value === "string" ? value : value + "px"; return set.each(function(){ this.style[ name ] = value; }); } }; /** * Gets the width value of the first element or sets the width for the whole set. * * @param {float|undefined} value The value to assign. * @return shoestring * @this shoestring */ shoestring.fn.width = function( value ){ return shoestring._dimension( this, "width", value ); }; /** * Wraps the child elements in the provided HTML. * * @param {string} html The wrapping HTML. * @return shoestring * @this shoestring */ shoestring.fn.wrapInner = function( html ){ return this.each(function(){ var inH = this.innerHTML; this.innerHTML = ""; shoestring( this ).append( shoestring( html ).html( inH ) ); }); }; function initEventCache( el, evt ) { if ( !el.shoestringData ) { el.shoestringData = {}; } if ( !el.shoestringData.events ) { el.shoestringData.events = {}; } if ( !el.shoestringData.loop ) { el.shoestringData.loop = {}; } if ( !el.shoestringData.events[ evt ] ) { el.shoestringData.events[ evt ] = []; } } function addToEventCache( el, evt, eventInfo ) { var obj = {}; obj.isCustomEvent = eventInfo.isCustomEvent; obj.callback = eventInfo.callfunc; obj.originalCallback = eventInfo.originalCallback; obj.namespace = eventInfo.namespace; el.shoestringData.events[ evt ].push( obj ); if( eventInfo.customEventLoop ) { el.shoestringData.loop[ evt ] = eventInfo.customEventLoop; } } /** * Bind a callback to an event for the currrent set of elements. * * @param {string} evt The event(s) to watch for. * @param {object,function} data Data to be included with each event or the callback. * @param {function} originalCallback Callback to be invoked when data is define.d. * @return shoestring * @this shoestring */ shoestring.fn.bind = function( evt, data, originalCallback ){ if( typeof data === "function" ){ originalCallback = data; data = null; } var evts = evt.split( " " ); // NOTE the `triggeredElement` is purely for custom events from IE function encasedCallback( e, namespace, triggeredElement ){ var result; if( e._namespace && e._namespace !== namespace ) { return; } e.data = data; e.namespace = e._namespace; var returnTrue = function(){ return true; }; e.isDefaultPrevented = function(){ return false; }; var originalPreventDefault = e.preventDefault; var preventDefaultConstructor = function(){ if( originalPreventDefault ) { return function(){ e.isDefaultPrevented = returnTrue; originalPreventDefault.call(e); }; } else { return function(){ e.isDefaultPrevented = returnTrue; e.returnValue = false; }; } }; // thanks https://github.com/jonathantneal/EventListener e.target = triggeredElement || e.target || e.srcElement; e.preventDefault = preventDefaultConstructor(); e.stopPropagation = e.stopPropagation || function () { e.cancelBubble = true; }; result = originalCallback.apply(this, [ e ].concat( e._args ) ); if( result === false ){ e.preventDefault(); e.stopPropagation(); } return result; } return this.each(function(){ var domEventCallback, customEventCallback, customEventLoop, oEl = this; for( var i = 0, il = evts.length; i < il; i++ ){ var split = evts[ i ].split( "." ), evt = split[ 0 ], namespace = split.length > 0 ? split[ 1 ] : null; domEventCallback = function( originalEvent ) { if( oEl.ssEventTrigger ) { originalEvent._namespace = oEl.ssEventTrigger._namespace; originalEvent._args = oEl.ssEventTrigger._args; oEl.ssEventTrigger = null; } return encasedCallback.call( oEl, originalEvent, namespace ); }; customEventCallback = null; customEventLoop = null; initEventCache( this, evt ); this.addEventListener( evt, domEventCallback, false ); addToEventCache( this, evt, { callfunc: customEventCallback || domEventCallback, isCustomEvent: !!customEventCallback, customEventLoop: customEventLoop, originalCallback: originalCallback, namespace: namespace }); } }); }; shoestring.fn.on = shoestring.fn.bind; /** * Unbind a previous bound callback for an event. * * @param {string} event The event(s) the callback was bound to.. * @param {function} callback Callback to unbind. * @return shoestring * @this shoestring */ shoestring.fn.unbind = function( event, callback ){ var evts = event ? event.split( " " ) : []; return this.each(function(){ if( !this.shoestringData || !this.shoestringData.events ) { return; } if( !evts.length ) { unbindAll.call( this ); } else { var split, evt, namespace; for( var i = 0, il = evts.length; i < il; i++ ){ split = evts[ i ].split( "." ), evt = split[ 0 ], namespace = split.length > 0 ? split[ 1 ] : null; if( evt ) { unbind.call( this, evt, namespace, callback ); } else { unbindAll.call( this, namespace, callback ); } } } }); }; function unbind( evt, namespace, callback ) { var bound = this.shoestringData.events[ evt ]; if( !(bound && bound.length) ) { return; } var matched = [], j, jl; for( j = 0, jl = bound.length; j < jl; j++ ) { if( !namespace || namespace === bound[ j ].namespace ) { if( callback === undefined || callback === bound[ j ].originalCallback ) { this.removeEventListener( evt, bound[ j ].callback, false ); matched.push( j ); } } } for( j = 0, jl = matched.length; j < jl; j++ ) { this.shoestringData.events[ evt ].splice( j, 1 ); } } function unbindAll( namespace, callback ) { for( var evtKey in this.shoestringData.events ) { unbind.call( this, evtKey, namespace, callback ); } } shoestring.fn.off = shoestring.fn.unbind; /** * Bind a callback to an event for the currrent set of elements, unbind after one occurence. * * @param {string} event The event(s) to watch for. * @param {function} callback Callback to invoke on the event. * @return shoestring * @this shoestring */ shoestring.fn.one = function( event, callback ){ var evts = event.split( " " ); return this.each(function(){ var thisevt, cbs = {}, $t = shoestring( this ); for( var i = 0, il = evts.length; i < il; i++ ){ thisevt = evts[ i ]; cbs[ thisevt ] = function( e ){ var $t = shoestring( this ); for( var j in cbs ) { $t.unbind( j, cbs[ j ] ); } return callback.apply( this, [ e ].concat( e._args ) ); }; $t.bind( thisevt, cbs[ thisevt ] ); } }); }; /** * Trigger an event on the first element in the set, no bubbling, no defaults. * * @param {string} event The event(s) to trigger. * @param {object} args Arguments to append to callback invocations. * @return shoestring * @this shoestring */ shoestring.fn.triggerHandler = function( event, args ){ var e = event.split( " " )[ 0 ], el = this[ 0 ], ret; // See this.fireEvent( 'on' + evts[ i ], document.createEventObject() ); instead of click() etc in trigger. if( doc.createEvent && el.shoestringData && el.shoestringData.events && el.shoestringData.events[ e ] ){ var bindings = el.shoestringData.events[ e ]; for (var i in bindings ){ if( bindings.hasOwnProperty( i ) ){ event = doc.createEvent( "Event" ); event.initEvent( e, true, true ); event._args = args; args.unshift( event ); ret = bindings[ i ].originalCallback.apply( event.target, args ); } } } return ret; }; /** * Trigger an event on each of the DOM elements in the current set. * * @param {string} event The event(s) to trigger. * @param {object} args Arguments to append to callback invocations. * @return shoestring * @this shoestring */ shoestring.fn.trigger = function( event, args ){ var evts = event.split( " " ); return this.each(function(){ var split, evt, namespace; for( var i = 0, il = evts.length; i < il; i++ ){ split = evts[ i ].split( "." ), evt = split[ 0 ], namespace = split.length > 0 ? split[ 1 ] : null; if( evt === "click" ){ if( this.tagName === "INPUT" && this.type === "checkbox" && this.click ){ this.click(); return false; } } if( doc.createEvent ){ var event = doc.createEvent( "Event" ); event.initEvent( evt, true, true ); event._args = args; event._namespace = namespace; this.dispatchEvent( event ); } } }); }; return shoestring; })); (function (root, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("28b7")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (shoestring) { return (root.Tablesaw = factory(shoestring, root)); }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }(typeof window !== "undefined" ? window : this, function ($, window) { "use strict"; var document = window.document; // Account for Tablesaw being loaded either before or after the DOMContentLoaded event is fired. var domContentLoadedTriggered = /complete|loaded/.test(document.readyState); document.addEventListener("DOMContentLoaded", function() { domContentLoadedTriggered = true; }); var Tablesaw = { i18n: { modeStack: "Stack", modeSwipe: "Swipe", modeToggle: "Toggle", modeSwitchColumnsAbbreviated: "Cols", modeSwitchColumns: "Columns", columnToggleButton: "Columns", columnToggleError: "No eligible columns.", sort: "Sort", swipePreviousColumn: "Previous column", swipeNextColumn: "Next column" }, // cut the mustard mustard: "head" in document && // IE9+, Firefox 4+, Safari 5.1+, Mobile Safari 4.1+, Opera 11.5+, Android 2.3+ (!window.blackberry || window.WebKitPoint) && // only WebKit Blackberry (OS 6+) !window.operamini, $: $, _init: function(element) { Tablesaw.$(element || document).trigger("enhance.tablesaw"); }, init: function(element) { // Account for Tablesaw being loaded either before or after the DOMContentLoaded event is fired. domContentLoadedTriggered = domContentLoadedTriggered || /complete|loaded/.test(document.readyState); if (!domContentLoadedTriggered) { if ("addEventListener" in document) { // Use raw DOMContentLoaded instead of shoestring (may have issues in Android 2.3, exhibited by stack table) document.addEventListener("DOMContentLoaded", function() { Tablesaw._init(element); }); } } else { Tablesaw._init(element); } } }; $(document).on("enhance.tablesaw", function() { // Extend i18n config, if one exists. if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { Tablesaw.i18n = $.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); } Tablesaw.i18n.modes = [ Tablesaw.i18n.modeStack, Tablesaw.i18n.modeSwipe, Tablesaw.i18n.modeToggle ]; }); if (Tablesaw.mustard) { $(document.documentElement).addClass("tablesaw-enhanced"); } (function() { var pluginName = "tablesaw"; var classes = { toolbar: "tablesaw-bar" }; var events = { create: "tablesawcreate", destroy: "tablesawdestroy", refresh: "tablesawrefresh", resize: "tablesawresize" }; var defaultMode = "stack"; var initSelector = "table"; var initFilterSelector = "[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]"; var defaultConfig = {}; Tablesaw.events = events; var Table = function(element) { if (!element) { throw new Error("Tablesaw requires an element."); } this.table = element; this.$table = $(element); // only one
and are allowed, per the specification this.$thead = this.$table .children() .filter("thead") .eq(0); // multiple are allowed, per the specification this.$tbody = this.$table.children().filter("tbody"); this.mode = this.$table.attr("data-tablesaw-mode") || defaultMode; this.$toolbar = null; this.attributes = { subrow: "data-tablesaw-subrow", ignorerow: "data-tablesaw-ignorerow" }; this.init(); }; Table.prototype.init = function() { if (!this.$thead.length) { throw new Error("tablesaw: a is required, but none was found."); } if (!this.$thead.find("th").length) { throw new Error("tablesaw: no header cells found. Are you using ?"); } // assign an id if there is none if (!this.$table.attr("id")) { this.$table.attr("id", pluginName + "-" + Math.round(Math.random() * 10000)); } this.createToolbar(); this._initCells(); this.$table.data(pluginName, this); this.$table.trigger(events.create, [this]); }; Table.prototype.getConfig = function(pluginSpecificConfig) { // shoestring extend doesn’t support arbitrary args var configs = $.extend(defaultConfig, pluginSpecificConfig || {}); return $.extend(configs, typeof TablesawConfig !== "undefined" ? TablesawConfig : {}); }; Table.prototype._getPrimaryHeaderRow = function() { return this._getHeaderRows().eq(0); }; Table.prototype._getHeaderRows = function() { return this.$thead .children() .filter("tr") .filter(function() { return !$(this).is("[data-tablesaw-ignorerow]"); }); }; Table.prototype._getRowIndex = function($row) { return $row.prevAll().length; }; Table.prototype._getHeaderRowIndeces = function() { var self = this; var indeces = []; this._getHeaderRows().each(function() { indeces.push(self._getRowIndex($(this))); }); return indeces; }; Table.prototype._getPrimaryHeaderCells = function($row) { return ($row || this._getPrimaryHeaderRow()).find("th"); }; Table.prototype._$getCells = function(th) { var self = this; return $(th) .add(th.cells) .filter(function() { var $t = $(this); var $row = $t.parent(); var hasColspan = $t.is("[colspan]"); // no subrows or ignored rows (keep cells in ignored rows that do not have a colspan) return ( !$row.is("[" + self.attributes.subrow + "]") && (!$row.is("[" + self.attributes.ignorerow + "]") || !hasColspan) ); }); }; Table.prototype._getVisibleColspan = function() { var colspan = 0; this._getPrimaryHeaderCells().each(function() { var $t = $(this); if ($t.css("display") !== "none") { colspan += parseInt($t.attr("colspan"), 10) || 1; } }); return colspan; }; Table.prototype.getColspanForCell = function($cell) { var visibleColspan = this._getVisibleColspan(); var visibleSiblingColumns = 0; if ($cell.closest("tr").data("tablesaw-rowspanned")) { visibleSiblingColumns++; } $cell.siblings().each(function() { var $t = $(this); var colColspan = parseInt($t.attr("colspan"), 10) || 1; if ($t.css("display") !== "none") { visibleSiblingColumns += colColspan; } }); // console.log( $cell[ 0 ], visibleColspan, visibleSiblingColumns ); return visibleColspan - visibleSiblingColumns; }; Table.prototype.isCellInColumn = function(header, cell) { return $(header) .add(header.cells) .filter(function() { return this === cell; }).length; }; Table.prototype.updateColspanCells = function(cls, header, userAction) { var self = this; var primaryHeaderRow = self._getPrimaryHeaderRow(); // find persistent column rowspans this.$table.find("[rowspan][data-tablesaw-priority]").each(function() { var $t = $(this); if ($t.attr("data-tablesaw-priority") !== "persist") { return; } var $row = $t.closest("tr"); var rowspan = parseInt($t.attr("rowspan"), 10); if (rowspan > 1) { $row = $row.next(); $row.data("tablesaw-rowspanned", true); rowspan--; } }); this.$table .find("[colspan],[data-tablesaw-maxcolspan]") .filter(function() { // is not in primary header row return $(this).closest("tr")[0] !== primaryHeaderRow[0]; }) .each(function() { var $cell = $(this); if (userAction === undefined || self.isCellInColumn(header, this)) { } else { // if is not a user action AND the cell is not in the updating column, kill it return; } var colspan = self.getColspanForCell($cell); if (cls && userAction !== undefined) { // console.log( colspan === 0 ? "addClass" : "removeClass", $cell ); $cell[colspan === 0 ? "addClass" : "removeClass"](cls); } // cache original colspan var maxColspan = parseInt($cell.attr("data-tablesaw-maxcolspan"), 10); if (!maxColspan) { $cell.attr("data-tablesaw-maxcolspan", $cell.attr("colspan")); } else if (colspan > maxColspan) { colspan = maxColspan; } // console.log( this, "setting colspan to ", colspan ); $cell.attr("colspan", colspan); }); }; Table.prototype._findPrimaryHeadersForCell = function(cell) { var $headerRow = this._getPrimaryHeaderRow(); var headerRowIndex = this._getRowIndex($headerRow); var results = []; for (var rowNumber = 0; rowNumber < this.headerMapping.length; rowNumber++) { if (rowNumber === headerRowIndex) { continue; } for (var colNumber = 0; colNumber < this.headerMapping[rowNumber].length; colNumber++) { if (this.headerMapping[rowNumber][colNumber] === cell) { results.push(this.headerMapping[headerRowIndex][colNumber]); } } } return results; }; // used by init cells Table.prototype.getRows = function() { var self = this; return this.$table.find("tr").filter(function() { return $(this) .closest("table") .is(self.$table); }); }; // used by sortable Table.prototype.getBodyRows = function(tbody) { return (tbody ? $(tbody) : this.$tbody).children().filter("tr"); }; Table.prototype.getHeaderCellIndex = function(cell) { var lookup = this.headerMapping[0]; for (var colIndex = 0; colIndex < lookup.length; colIndex++) { if (lookup[colIndex] === cell) { return colIndex; } } return -1; }; Table.prototype._initCells = function() { // re-establish original colspans this.$table.find("[data-tablesaw-maxcolspan]").each(function() { var $t = $(this); $t.attr("colspan", $t.attr("data-tablesaw-maxcolspan")); }); var $rows = this.getRows(); var columnLookup = []; $rows.each(function(rowNumber) { columnLookup[rowNumber] = []; }); $rows.each(function(rowNumber) { var coltally = 0; var $t = $(this); var children = $t.children(); children.each(function() { var colspan = parseInt( this.getAttribute("data-tablesaw-maxcolspan") || this.getAttribute("colspan"), 10 ); var rowspan = parseInt(this.getAttribute("rowspan"), 10); // set in a previous rowspan while (columnLookup[rowNumber][coltally]) { coltally++; } columnLookup[rowNumber][coltally] = this; // TODO? both colspan and rowspan if (colspan) { for (var k = 0; k < colspan - 1; k++) { coltally++; columnLookup[rowNumber][coltally] = this; } } if (rowspan) { for (var j = 1; j < rowspan; j++) { columnLookup[rowNumber + j][coltally] = this; } } coltally++; }); }); var headerRowIndeces = this._getHeaderRowIndeces(); for (var colNumber = 0; colNumber < columnLookup[0].length; colNumber++) { for (var headerIndex = 0, k = headerRowIndeces.length; headerIndex < k; headerIndex++) { var headerCol = columnLookup[headerRowIndeces[headerIndex]][colNumber]; var rowNumber = headerRowIndeces[headerIndex]; var rowCell; if (!headerCol.cells) { headerCol.cells = []; } while (rowNumber < columnLookup.length) { rowCell = columnLookup[rowNumber][colNumber]; if (headerCol !== rowCell) { headerCol.cells.push(rowCell); } rowNumber++; } } } this.headerMapping = columnLookup; }; Table.prototype.refresh = function() { this._initCells(); this.$table.trigger(events.refresh, [this]); }; Table.prototype._getToolbarAnchor = function() { var $parent = this.$table.parent(); if ($parent.is(".tablesaw-overflow")) { return $parent; } return this.$table; }; Table.prototype._getToolbar = function($anchor) { if (!$anchor) { $anchor = this._getToolbarAnchor(); } return $anchor.prev().filter("." + classes.toolbar); }; Table.prototype.createToolbar = function() { // Insert the toolbar // TODO move this into a separate component var $anchor = this._getToolbarAnchor(); var $toolbar = this._getToolbar($anchor); if (!$toolbar.length) { $toolbar = $("
") .addClass(classes.toolbar) .insertBefore($anchor); } this.$toolbar = $toolbar; if (this.mode) { this.$toolbar.addClass("tablesaw-mode-" + this.mode); } }; Table.prototype.destroy = function() { // Don’t remove the toolbar, just erase the classes on it. // Some of the table features are not yet destroy-friendly. this._getToolbar().each(function() { this.className = this.className.replace(/\btablesaw-mode\-\w*\b/gi, ""); }); var tableId = this.$table.attr("id"); $(document).off("." + tableId); $(window).off("." + tableId); // other plugins this.$table.trigger(events.destroy, [this]); this.$table.removeData(pluginName); }; // Collection method. $.fn[pluginName] = function() { return this.each(function() { var $t = $(this); if ($t.data(pluginName)) { return; } new Table(this); }); }; var $doc = $(document); $doc.on("enhance.tablesaw", function(e) { // Cut the mustard if (Tablesaw.mustard) { var $target = $(e.target); if ($target.parent().length) { $target = $target.parent(); } $target .find(initSelector) .filter(initFilterSelector) [pluginName](); } }); // Avoid a resize during scroll: // Some Mobile devices trigger a resize during scroll (sometimes when // doing elastic stretch at the end of the document or from the // location bar hide) var isScrolling = false; var scrollTimeout; $doc.on("scroll.tablesaw", function() { isScrolling = true; window.clearTimeout(scrollTimeout); scrollTimeout = window.setTimeout(function() { isScrolling = false; }, 300); // must be greater than the resize timeout below }); var resizeTimeout; $(window).on("resize", function() { if (!isScrolling) { window.clearTimeout(resizeTimeout); resizeTimeout = window.setTimeout(function() { $doc.trigger(events.resize); }, 150); // must be less than the scrolling timeout above. } }); Tablesaw.Table = Table; })(); (function() { var classes = { stackTable: "tablesaw-stack", cellLabels: "tablesaw-cell-label", cellContentLabels: "tablesaw-cell-content" }; var data = { key: "tablesaw-stack" }; var attrs = { labelless: "data-tablesaw-no-labels", hideempty: "data-tablesaw-hide-empty" }; var Stack = function(element, tablesaw) { this.tablesaw = tablesaw; this.$table = $(element); this.labelless = this.$table.is("[" + attrs.labelless + "]"); this.hideempty = this.$table.is("[" + attrs.hideempty + "]"); this.$table.data(data.key, this); }; Stack.prototype.init = function() { this.$table.addClass(classes.stackTable); if (this.labelless) { return; } var self = this; this.$table .find("th, td") .filter(function() { return !$(this).closest("thead").length; }) .filter(function() { return ( !$(this).is("[" + attrs.labelless + "]") && !$(this) .closest("tr") .is("[" + attrs.labelless + "]") && (!self.hideempty || !!$(this).html()) ); }) .each(function() { var $newHeader = $(document.createElement("b")).addClass(classes.cellLabels); var $cell = $(this); $(self.tablesaw._findPrimaryHeadersForCell(this)).each(function(index) { var $header = $(this.cloneNode(true)); // TODO decouple from sortable better // Changed from .text() in https://github.com/filamentgroup/tablesaw/commit/b9c12a8f893ec192830ec3ba2d75f062642f935b // to preserve structural html in headers, like var $sortableButton = $header.find(".tablesaw-sortable-btn"); $header.find(".tablesaw-sortable-arrow").remove(); // TODO decouple from checkall better var $checkall = $header.find("[data-tablesaw-checkall]"); $checkall.closest("label").remove(); if ($checkall.length) { $newHeader = $([]); return; } if (index > 0) { $newHeader.append(document.createTextNode(", ")); } var parentNode = $sortableButton.length ? $sortableButton[0] : $header[0]; var el; while ((el = parentNode.firstChild)) { $newHeader[0].appendChild(el); } }); if ($newHeader.length && !$cell.find("." + classes.cellContentLabels).length) { $cell.wrapInner(""); } // Update if already exists. var $label = $cell.find("." + classes.cellLabels); if (!$label.length) { $cell.prepend(document.createTextNode(" ")); $cell.prepend($newHeader); } else { // only if changed $label.replaceWith($newHeader); } }); }; Stack.prototype.destroy = function() { this.$table.removeClass(classes.stackTable); this.$table.find("." + classes.cellLabels).remove(); this.$table.find("." + classes.cellContentLabels).each(function() { $(this).replaceWith($(this.childNodes)); }); }; // on tablecreate, init $(document) .on(Tablesaw.events.create, function(e, tablesaw) { if (tablesaw.mode === "stack") { var table = new Stack(tablesaw.table, tablesaw); table.init(); } }) .on(Tablesaw.events.refresh, function(e, tablesaw) { if (tablesaw.mode === "stack") { $(tablesaw.table) .data(data.key) .init(); } }) .on(Tablesaw.events.destroy, function(e, tablesaw) { if (tablesaw.mode === "stack") { $(tablesaw.table) .data(data.key) .destroy(); } }); Tablesaw.Stack = Stack; })(); (function() { var pluginName = "tablesawbtn", methods = { _create: function() { return $(this).each(function() { $(this) .trigger("beforecreate." + pluginName) [pluginName]("_init") .trigger("create." + pluginName); }); }, _init: function() { var oEl = $(this), sel = this.getElementsByTagName("select")[0]; if (sel) { // TODO next major version: remove .btn-select $(this) .addClass("btn-select tablesaw-btn-select") [pluginName]("_select", sel); } return oEl; }, _select: function(sel) { var update = function(oEl, sel) { var opts = $(sel).find("option"); var label = document.createElement("span"); var el; var children; var found = false; label.setAttribute("aria-hidden", "true"); label.innerHTML = " "; opts.each(function() { var opt = this; if (opt.selected) { label.innerHTML = opt.text; } }); children = oEl.childNodes; if (opts.length > 0) { for (var i = 0, l = children.length; i < l; i++) { el = children[i]; if (el && el.nodeName.toUpperCase() === "SPAN") { oEl.replaceChild(label, el); found = true; } } if (!found) { oEl.insertBefore(label, oEl.firstChild); } } }; update(this, sel); // todo should this be tablesawrefresh? $(this).on("change refresh", function() { update(this, sel); }); } }; // Collection method. $.fn[pluginName] = function(arrg, a, b, c) { return this.each(function() { // if it's a method if (arrg && typeof arrg === "string") { return $.fn[pluginName].prototype[arrg].call(this, a, b, c); } // don't re-init if ($(this).data(pluginName + "active")) { return $(this); } $(this).data(pluginName + "active", true); $.fn[pluginName].prototype._create.call(this); }); }; // add methods $.extend($.fn[pluginName].prototype, methods); // TODO OOP this and add to Tablesaw object })(); (function() { var data = { key: "tablesaw-coltoggle" }; var ColumnToggle = function(element) { this.$table = $(element); if (!this.$table.length) { return; } this.tablesaw = this.$table.data("tablesaw"); this.attributes = { btnTarget: "data-tablesaw-columntoggle-btn-target", set: "data-tablesaw-columntoggle-set" }; this.classes = { columnToggleTable: "tablesaw-columntoggle", columnBtnContain: "tablesaw-columntoggle-btnwrap tablesaw-advance", columnBtn: "tablesaw-columntoggle-btn tablesaw-nav-btn down", popup: "tablesaw-columntoggle-popup", priorityPrefix: "tablesaw-priority-" }; this.set = []; this.$headers = this.tablesaw._getPrimaryHeaderCells(); this.$table.data(data.key, this); }; // Column Toggle Sets (one column chooser can control multiple tables) ColumnToggle.prototype.initSet = function() { var set = this.$table.attr(this.attributes.set); if (set) { // Should not include the current table var table = this.$table[0]; this.set = $("table[" + this.attributes.set + "='" + set + "']") .filter(function() { return this !== table; }) .get(); } }; ColumnToggle.prototype.init = function() { if (!this.$table.length) { return; } var tableId, id, $menuButton, $popup, $menu, $btnContain, self = this; var cfg = this.tablesaw.getConfig({ getColumnToggleLabelTemplate: function(text) { return ""; } }); this.$table.addClass(this.classes.columnToggleTable); tableId = this.$table.attr("id"); id = tableId + "-popup"; $btnContain = $("
"); // TODO next major version: remove .btn $menuButton = $( "
" + "" + Tablesaw.i18n.columnToggleButton + "" ); $popup = $("
"); $menu = $("
"); this.$popup = $popup; var hasNonPersistentHeaders = false; this.$headers.each(function() { var $this = $(this), priority = $this.attr("data-tablesaw-priority"), $cells = self.tablesaw._$getCells(this); if (priority && priority !== "persist") { $cells.addClass(self.classes.priorityPrefix + priority); $(cfg.getColumnToggleLabelTemplate($this.text())) .appendTo($menu) .find('input[type="checkbox"]') .data("tablesaw-header", this); hasNonPersistentHeaders = true; } }); if (!hasNonPersistentHeaders) { $menu.append(""); } $menu.appendTo($popup); function onToggleCheckboxChange(checkbox) { var checked = checkbox.checked; var header = self.getHeaderFromCheckbox(checkbox); var $cells = self.tablesaw._$getCells(header); $cells[!checked ? "addClass" : "removeClass"]("tablesaw-toggle-cellhidden"); $cells[checked ? "addClass" : "removeClass"]("tablesaw-toggle-cellvisible"); self.updateColspanCells(header, checked); self.$table.trigger("tablesawcolumns"); } // bind change event listeners to inputs - TODO: move to a private method? $menu.find('input[type="checkbox"]').on("change", function(e) { onToggleCheckboxChange(e.target); if (self.set.length) { var index; $(self.$popup) .find("input[type='checkbox']") .each(function(j) { if (this === e.target) { index = j; return false; } }); $(self.set).each(function() { var checkbox = $(this) .data(data.key) .$popup.find("input[type='checkbox']") .get(index); if (checkbox) { checkbox.checked = e.target.checked; onToggleCheckboxChange(checkbox); } }); } }); $menuButton.appendTo($btnContain); // Use a different target than the toolbar var $btnTarget = $(this.$table.attr(this.attributes.btnTarget)); $btnContain.appendTo($btnTarget.length ? $btnTarget : this.tablesaw.$toolbar); function closePopup(event) { // Click came from inside the popup, ignore. if (event && $(event.target).closest("." + self.classes.popup).length) { return; } $(document).off("click." + tableId); $menuButton.removeClass("up").addClass("down"); $btnContain.removeClass("visible"); } var closeTimeout; function openPopup() { $btnContain.addClass("visible"); $menuButton.removeClass("down").addClass("up"); $(document).off("click." + tableId, closePopup); window.clearTimeout(closeTimeout); closeTimeout = window.setTimeout(function() { $(document).on("click." + tableId, closePopup); }, 15); } $menuButton.on("click.tablesaw", function(event) { event.preventDefault(); if (!$btnContain.is(".visible")) { openPopup(); } else { closePopup(); } }); $popup.appendTo($btnContain); this.$menu = $menu; // Fix for iOS not rendering shadows correctly when using `-webkit-overflow-scrolling` var $overflow = this.$table.closest(".tablesaw-overflow"); if ($overflow.css("-webkit-overflow-scrolling")) { var timeout; $overflow.on("scroll", function() { var $div = $(this); window.clearTimeout(timeout); timeout = window.setTimeout(function() { $div.css("-webkit-overflow-scrolling", "auto"); window.setTimeout(function() { $div.css("-webkit-overflow-scrolling", "touch"); }, 0); }, 100); }); } $(window).on(Tablesaw.events.resize + "." + tableId, function() { self.refreshToggle(); }); this.initSet(); this.refreshToggle(); }; ColumnToggle.prototype.getHeaderFromCheckbox = function(checkbox) { return $(checkbox).data("tablesaw-header"); }; ColumnToggle.prototype.refreshToggle = function() { var self = this; var invisibleColumns = 0; this.$menu.find("input").each(function() { var header = self.getHeaderFromCheckbox(this); this.checked = self.tablesaw ._$getCells(header) .eq(0) .css("display") === "table-cell"; }); this.updateColspanCells(); }; ColumnToggle.prototype.updateColspanCells = function(header, userAction) { this.tablesaw.updateColspanCells("tablesaw-toggle-cellhidden", header, userAction); }; ColumnToggle.prototype.destroy = function() { this.$table.removeClass(this.classes.columnToggleTable); this.$table.find("th, td").each(function() { var $cell = $(this); $cell.removeClass("tablesaw-toggle-cellhidden").removeClass("tablesaw-toggle-cellvisible"); this.className = this.className.replace(/\bui\-table\-priority\-\d\b/g, ""); }); }; // on tablecreate, init $(document).on(Tablesaw.events.create, function(e, tablesaw) { if (tablesaw.mode === "columntoggle") { var table = new ColumnToggle(tablesaw.table); table.init(); } }); $(document).on(Tablesaw.events.destroy, function(e, tablesaw) { if (tablesaw.mode === "columntoggle") { $(tablesaw.table) .data(data.key) .destroy(); } }); $(document).on(Tablesaw.events.refresh, function(e, tablesaw) { if (tablesaw.mode === "columntoggle") { $(tablesaw.table) .data(data.key) .refreshToggle(); } }); Tablesaw.ColumnToggle = ColumnToggle; })(); (function() { function getSortValue(cell) { var text = []; $(cell.childNodes).each(function() { var $el = $(this); if ($el.is("input, select")) { text.push($el.val()); } else if ($el.is(".tablesaw-cell-label")) { } else { text.push(($el.text() || "").replace(/^\s+|\s+$/g, "")); } }); return text.join(""); } var pluginName = "tablesaw-sortable", initSelector = "table[data-" + pluginName + "]", sortableSwitchSelector = "[data-" + pluginName + "-switch]", attrs = { sortCol: "data-tablesaw-sortable-col", defaultCol: "data-tablesaw-sortable-default-col", numericCol: "data-tablesaw-sortable-numeric", subRow: "data-tablesaw-subrow", ignoreRow: "data-tablesaw-ignorerow" }, classes = { head: pluginName + "-head", ascend: pluginName + "-ascending", descend: pluginName + "-descending", switcher: pluginName + "-switch", tableToolbar: "tablesaw-bar-section", sortButton: pluginName + "-btn" }, methods = { _create: function(o) { return $(this).each(function() { var init = $(this).data(pluginName + "-init"); if (init) { return false; } $(this) .data(pluginName + "-init", true) .trigger("beforecreate." + pluginName) [pluginName]("_init", o) .trigger("create." + pluginName); }); }, _init: function() { var el = $(this); var tblsaw = el.data("tablesaw"); var heads; var $switcher; function addClassToHeads(h) { $.each(h, function(i, v) { $(v).addClass(classes.head); }); } function makeHeadsActionable(h, fn) { $.each(h, function(i, col) { var b = $("
/ elements with colspans. SOLUTION: making individual
inside of