From 61dc87cfab56ffa871670f1a8a65bce1ce4b60e5 Mon Sep 17 00:00:00 2001 From: Jorge Soares Date: Tue, 11 May 2021 19:20:10 -0300 Subject: [PATCH 1/7] Corrigindo testes --- .gitignore | 1 - dist/index.js | 1 + dist/vue-datetime.common.js | 940 + dist/vue-datetime.css | 2136 + dist/vue-datetime.esm.js | 933 + dist/vue-datetime.js | 944 + dist/vue-datetime.min.css | 1 + dist/vue-datetime.min.js | 7 + src/Datetime.vue | 10 + src/DatetimePopup.vue | 30 +- test/dist/vuePluginTemplateDeps.dll.js | 52013 +++++++++++++++++++ test/dist/vuePluginTemplateDeps.dll.js.map | 1 + test/dist/vuePluginTemplateDeps.json | 1 + test/specs/Datetime.spec.js | 2 +- test/specs/DatetimeCalendar.spec.js | 2 +- 15 files changed, 57008 insertions(+), 14 deletions(-) create mode 100644 dist/index.js create mode 100644 dist/vue-datetime.common.js create mode 100644 dist/vue-datetime.css create mode 100644 dist/vue-datetime.esm.js create mode 100644 dist/vue-datetime.js create mode 100644 dist/vue-datetime.min.css create mode 100644 dist/vue-datetime.min.js create mode 100644 test/dist/vuePluginTemplateDeps.dll.js create mode 100644 test/dist/vuePluginTemplateDeps.dll.js.map create mode 100644 test/dist/vuePluginTemplateDeps.json diff --git a/.gitignore b/.gitignore index 8807004..4e3ed61 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ node_modules/ npm-debug.log test/coverage -dist yarn-error.log reports demo/dist diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..4cddf7f --- /dev/null +++ b/dist/index.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports["vue-datetime"]=e(require("vue")):t["vue-datetime"]=e(t.vue)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=55)}([function(t,e){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){t.exports=!n(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(40),i=n(32),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(75),o=n(20);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(1),o=n(0),i=n(38),u=n(7),a=function(t,e,n){var s,c,f,l=t&a.F,p=t&a.G,d=t&a.S,h=t&a.P,v=t&a.B,y=t&a.W,_=p?o:o[e]||(o[e]={}),m=_.prototype,w=p?r:d?r[e]:(r[e]||{}).prototype;p&&(n=e);for(s in n)(c=!l&&w&&void 0!==w[s])&&s in _||(f=c?w[s]:n[s],_[s]=p&&"function"!=typeof w[s]?n[s]:v&&c?i(f,r):y&&w[s]==f?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(f):h&&"function"==typeof f?i(Function.call,f):f,h&&((_.virtual||(_.virtual={}))[s]=f,t&a.R&&m&&!m[s]&&u(m,s,f)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var r=n(4),o=n(15);t.exports=n(2)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(30)("wks"),o=n(16),i=n(1).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports={default:n(66),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(58),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default=function(){function t(t,e){for(var n=0;ndocument.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[i[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[u]=t):n=s(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(27),o=n(15),i=n(5),u=n(32),a=n(3),s=n(40),c=Object.getOwnPropertyDescriptor;e.f=n(2)?c:function(t,e){if(t=i(t),e=u(e,!0),s)try{return c(t,e)}catch(t){}if(a(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(45),o=n(21);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(4).f,o=n(3),i=n(8)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(30)("keys"),o=n(16);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(1),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(1),o=n(0),i=n(23),u=n(34),a=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:u.f(t)})}},function(t,e,n){e.f=n(8)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(12),i=r(o),u=n(59),a=r(u);e.default=function t(e,n,r){null===e&&(e=Function.prototype);var o=(0,a.default)(e,n);if(void 0===o){var u=(0,i.default)(e);return null===u?void 0:t(u,n,r)}if("value"in o)return o.value;var s=o.get;if(void 0!==s)return s.call(r)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(62),i=r(o),u=n(61),a=r(u),s="function"==typeof a.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===s(i.default)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":void 0===t?"undefined":s(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(70);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(11),o=n(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){t.exports=!n(2)&&!n(10)(function(){return 7!=Object.defineProperty(n(39)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var r=n(23),o=n(6),i=n(47),u=n(7),a=n(3),s=n(22),c=n(77),f=n(28),l=n(44),p=n(8)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,v,y,_,m){c(n,e,v);var w,b,g,k=function(t){if(!d&&t in O)return O[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",M="values"==y,D=!1,O=t.prototype,S=O[p]||O["@@iterator"]||y&&O[y],P=S||k(y),C=y?M?k("entries"):P:void 0,j="Array"==e?O.entries||S:S;if(j&&(g=l(j.call(new t)))!==Object.prototype&&g.next&&(f(g,x,!0),r||a(g,p)||u(g,p,h)),M&&S&&"values"!==S.name&&(D=!0,P=function(){return S.call(this)}),r&&!m||!d&&!D&&O[p]||u(O,p,P),s[e]=P,s[x]=h,y)if(w={values:M?P:k("values"),keys:_?P:k("keys"),entries:C},m)for(b in w)b in O||i(O,b,w[b]);else o(o.P+o.F*(d||D),e,w);return w}},function(t,e,n){var r=n(45),o=n(21).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(3),o=n(48),i=n(29)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r=n(3),o=n(5),i=n(72)(!1),u=n(29)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),s=0,c=[];for(n in a)n!=u&&r(a,n)&&c.push(n);for(;e.length>s;)r(a,n=e[s++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(6),o=n(0),i=n(10);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],u={};u[t]=e(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},function(t,e,n){t.exports=n(7)},function(t,e,n){var r=n(20);t.exports=function(t){return Object(r(t))}},function(t,e,n){function r(t){n(!function(){var t=new Error('Cannot find module "!!vue-style-loader!css-loader?minimize!../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-0a922d56","scoped":false,"hasInlineConfig":false}!sass-loader!../node_modules/vue-loader/lib/selector?type=styles&index=0!./Datetime.vue"');throw t.code="MODULE_NOT_FOUND",t}())}var o=n(98)(n(50),n(99),r,null,null);t.exports=o.exports},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(100),i=(r(o),n(!function(){var t=new Error('Cannot find module "moment"');throw t.code="MODULE_NOT_FOUND",t}())),u=r(i),a=n(56),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(a),c=n(54),f=r(c);e.default={props:{value:{type:String,required:!0},type:{type:String,default:"date"},inputFormat:{type:String,default:""},wrapperClass:{type:String},inputClass:{type:String},placeholder:{type:String},momentLocale:{type:String,default:null},minDate:{type:String,default:null},maxDate:{type:String,default:null},disabledDates:{type:Array,default:function(){return[]}},mondayFirst:{type:Boolean,default:!1},autoContinue:{type:Boolean,default:!1},autoClose:{type:Boolean,default:!1},required:{type:Boolean,default:!1},i18n:{type:Object,default:function(){return{ok:"Ok",cancel:"Cancel"}}}},data:function(){var t=this.getDate();return{isOpen:!1,show:null,date:t,newDate:null,currentMonthDate:null,typeFlow:(0,f.default)(this.type,this,t?t.clone():(0,u.default)().locale(this.momentLocale)),datePickerItemHeight:null}},watch:{value:function(t){this.date=this.getDate(),this.typeFlow.setDate(this.date?this.date.clone():(0,u.default)().locale(this.momentLocale)),this.newDate=this.getNewDate(),this.currentMonthDate=this.getCurrentMonthDate()}},created:function(){this.date&&this.$emit("input",this.typeFlow.isoDate())},computed:{inputValue:function(){return this.typeFlow.format(this.date,this.inputFormat||this.typeFlow.inputFormat())},newDay:function(){return this.newDate.format("ddd, MMM D")},newYear:function(){return this.newDate.format("YYYY")},currentMonth:function(){return this.currentMonthDate.format("MMMM YYYY")},weekdays:function(){return s.weekdays(this.momentLocale,this.mondayFirst)},currentMonthDays:function(){var t=this,e=this.currentMonthDate.year(),n=this.currentMonthDate.month(),r=e===this.newDate.year()&&n===this.newDate.month();return s.monthDays(n,e,this.mondayFirst).map(function(o){return{number:o||"",selected:!!o&&r&&o===t.newDate.date(),disabled:!o||t.isDisabled((0,u.default)([e,n,o]))}})},years:function(){var t=this;return s.years().map(function(e){return{number:e,selected:e===t.newDate.year()}})},hours:function(){var t=this;return s.hours().map(function(e){return{number:e,selected:parseInt(e)===parseInt(t.newDate.hour())}})},minutes:function(){var t=this;return s.minutes().map(function(e){return{number:e,selected:parseInt(e)===t.newDate.minute()}})},disabledDatesRanges:function(){return this.disabledDates.map(function(t){return Array.isArray(t)?[(0,u.default)(t[0]),(0,u.default)(t[1])]:[(0,u.default)(t),(0,u.default)(t).add(1,"day")]})},datePickerHeight:function(){var t=(Math.ceil(this.currentMonthDays.length/7)+1)*this.datePickerItemHeight;return t?t+"px":"auto"}},methods:{getDate:function(){return this.value.length?(0,u.default)(this.value,"time"===this.type?"HH:mm":null).locale(this.momentLocale):null},getNewDate:function(){for(var t=this.date?this.date.clone():(0,u.default)().locale(this.momentLocale),e=0;e<1e5&&this.isDisabled(t);e++)t=t.clone().add(1,"day");return t},getCurrentMonthDate:function(){return(0,u.default)([this.newDate.year(),this.newDate.month(),1]).locale(this.momentLocale)},open:function(){var t=this;this.newDate=this.getNewDate(),this.currentMonthDate=this.getCurrentMonthDate(),this.isOpen=!0,this.$refs.input.blur(),this.typeFlow.open(),this.$nextTick(function(){var e=t.$refs.popupBody.clientHeight-25+"px";t.$refs.hourPicker.style.height=e,t.$refs.minutePicker.style.height=e,t.$refs.yearPicker.style.height=e})},close:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.typeFlow.close(),!0===t&&(this.date=this.typeFlow.date.clone(),this.$emit("input",this.typeFlow.isoDate())),this.isOpen=!1},ok:function(){"year"===this.show?this.showDatePicker():this.typeFlow.ok()},showDatePicker:function(){var t=this;this.show="date",this.$nextTick(function(){t.datePickerItemHeight=t.$refs.popupBody.getElementsByClassName("vdatetime-popup__date-picker__item")[7].offsetHeight})},showTimePicker:function(){var t=this;this.show="time",this.$nextTick(function(){var e=t.$refs.hourPicker.querySelector(".vdatetime-popup__list-picker__item--selected"),n=t.$refs.minutePicker.querySelector(".vdatetime-popup__list-picker__item--selected");t.$refs.hourPicker.scrollTop=e?e.offsetTop-250:0,t.$refs.minutePicker.scrollTop=n?n.offsetTop-250:0})},showYearPicker:function(){var t=this;this.show="year",this.$nextTick(function(){var e=t.$refs.yearPicker.querySelector(".vdatetime-popup__list-picker__item--selected");t.$refs.yearPicker.scrollTop=e?e.offsetTop-250:0})},previousMonth:function(){this.currentMonthDate=this.currentMonthDate.clone().subtract(1,"month")},nextMonth:function(){this.currentMonthDate=this.currentMonthDate.clone().add(1,"month")},selectYear:function(t){this.currentMonthDate=this.currentMonthDate.clone().year(t),this.newDate=this.newDate.clone().year(t),this.autoContinue&&this.showDatePicker()},selectDay:function(t){this.typeFlow.selectDay(this.currentMonthDate.year(),this.currentMonthDate.month(),t),this.newDate=this.typeFlow.date.clone()},selectHour:function(t){this.typeFlow.selectHour(t),this.newDate=this.typeFlow.date.clone()},selectMinute:function(t){this.typeFlow.selectMinute(t),this.newDate=this.typeFlow.date.clone()},isDisabled:function(t){return this.minDate&&t.isBefore(this.minDate,"day")||this.maxDate&&t.isAfter(this.maxDate,"day")||this.disabledDatesRanges&&void 0!==this.disabledDatesRanges.find(function(e){return t.isBetween(e[0],e[1],"day","[)")})}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(12),i=r(o),u=n(13),a=r(u),s=n(14),c=r(s),f=n(19),l=r(f),p=n(35),d=r(p),h=n(18),v=r(h),y=n(17),_=r(y),m=function(t){function e(){return(0,a.default)(this,e),(0,l.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,v.default)(e,t),(0,c.default)(e,[{key:"inputFormat",value:function(){return"YYYY-MM-DD"}},{key:"open",value:function(){this.component.showDatePicker()}},{key:"selectDay",value:function(t,n,r){(0,d.default)(e.prototype.__proto__||(0,i.default)(e.prototype),"selectDay",this).call(this,t,n,r),this.component.autoClose&&this.component.close()}}]),e}(_.default);e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(12),i=r(o),u=n(13),a=r(u),s=n(14),c=r(s),f=n(19),l=r(f),p=n(35),d=r(p),h=n(18),v=r(h),y=n(17),_=r(y),m=function(t){function e(){return(0,a.default)(this,e),(0,l.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,v.default)(e,t),(0,c.default)(e,[{key:"inputFormat",value:function(){return"YYYY-MM-DD HH:mm"}},{key:"open",value:function(){this.component.showDatePicker(),this.timeSelected=!1}},{key:"ok",value:function(){"date"===this.component.show?this.component.showTimePicker():this.component.close()}},{key:"selectDay",value:function(t,n,r){(0,d.default)(e.prototype.__proto__||(0,i.default)(e.prototype),"selectDay",this).call(this,t,n,r),this.component.autoContinue&&this.component.showTimePicker()}}]),e}(_.default);e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(12),i=r(o),u=n(13),a=r(u),s=n(14),c=r(s),f=n(19),l=r(f),p=n(18),d=r(p),h=n(17),v=r(h),y=function(t){function e(){return(0,a.default)(this,e),(0,l.default)(this,(e.__proto__||(0,i.default)(e)).apply(this,arguments))}return(0,d.default)(e,t),(0,c.default)(e,[{key:"inputFormat",value:function(){return"HH:mm"}},{key:"open",value:function(){this.component.showTimePicker()}},{key:"isoDate",value:function(){return this.date.format("HH:mm")+":00Z"}}]),e}(v.default);e.default=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){var r=void 0;switch(t){case"datetime":r=new a.default(e,n);break;case"time":r=new c.default(e,n);break;case"date":default:r=new i.default(e,n)}return r};var o=n(51),i=r(o),u=n(52),a=r(u),s=n(53),c=r(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Datetime=void 0;var r=n(49),o=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={install:function(t){t.component("datetime",o.default)}},e.Datetime=o.default},function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=c.default.localeData(t).weekdaysMin();return e?n.slice(1).concat(n[0]):n}function o(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=(0,c.default)([e,t,1]),o=r.day()-(n?1:0);return-1===o&&(o=6),new Array(r.daysInMonth()+o).fill(null).map(function(t,e){return e+1f;)if((a=s[f++])!=a)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(26),o=n(43),i=n(27);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var u,a=n(t),s=i.f,c=0;a.length>c;)s.call(t,u=a[c++])&&e.push(u);return e}},function(t,e,n){var r=n(1).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(37);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(37);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(24),o=n(15),i=n(28),u={};n(7)(u,n(8)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(16)("meta"),o=n(11),i=n(3),u=n(4).f,a=0,s=Object.isExtensible||function(){return!0},c=!n(10)(function(){return s(Object.preventExtensions({}))}),f=function(t){u(t,r,{value:{i:"O"+ ++a,w:{}}})},l=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},p=function(t,e){if(!i(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},d=function(t){return c&&h.NEED&&s(t)&&!i(t,r)&&f(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:d}},function(t,e,n){var r=n(4),o=n(9),i=n(26);t.exports=n(2)?Object.defineProperties:function(t,e){o(t);for(var n,u=i(e),a=u.length,s=0;a>s;)r.f(t,n=u[s++],e[n]);return t}},function(t,e,n){var r=n(5),o=n(42).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(t){return u.slice()}};t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?a(t):o(r(t))}},function(t,e,n){var r=n(11),o=n(9),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(38)(Function.call,n(25).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},function(t,e,n){var r=n(31),o=n(20);t.exports=function(t){return function(e,n){var i,u,a=String(o(e)),s=r(n),c=a.length;return s<0||s>=c?t?"":void 0:(i=a.charCodeAt(s),i<55296||i>56319||s+1===c||(u=a.charCodeAt(s+1))<56320||u>57343?t?a.charAt(s):i:t?a.slice(s,s+2):u-56320+(i-55296<<10)+65536)}}},function(t,e,n){var r=n(31),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(31),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=n(71),o=n(78),i=n(22),u=n(5);t.exports=n(41)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(t,e,n){var r=n(6);r(r.S,"Object",{create:n(24)})},function(t,e,n){var r=n(6);r(r.S+r.F*!n(2),"Object",{defineProperty:n(4).f})},function(t,e,n){var r=n(5),o=n(25).f;n(46)("getOwnPropertyDescriptor",function(){return function(t,e){return o(r(t),e)}})},function(t,e,n){var r=n(48),o=n(44);n(46)("getPrototypeOf",function(){return function(t){return o(r(t))}})},function(t,e,n){var r=n(6);r(r.S,"Object",{setPrototypeOf:n(82).set})},function(t,e){},function(t,e,n){"use strict";var r=n(83)(!0);n(41)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(1),o=n(3),i=n(2),u=n(6),a=n(47),s=n(79).KEY,c=n(10),f=n(30),l=n(28),p=n(16),d=n(8),h=n(34),v=n(33),y=n(73),_=n(76),m=n(9),w=n(5),b=n(32),g=n(15),k=n(24),x=n(81),M=n(25),D=n(4),O=n(26),S=M.f,P=D.f,C=x.f,j=r.Symbol,F=r.JSON,T=F&&F.stringify,E=d("_hidden"),L=d("toPrimitive"),N={}.propertyIsEnumerable,$=f("symbol-registry"),Y=f("symbols"),A=f("op-symbols"),H=Object.prototype,I="function"==typeof j,R=r.QObject,B=!R||!R.prototype||!R.prototype.findChild,V=i&&c(function(){return 7!=k(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=S(H,e);r&&delete H[e],P(t,e,n),r&&t!==H&&P(H,e,r)}:P,q=function(t){var e=Y[t]=k(j.prototype);return e._k=t,e},G=I&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},U=function(t,e,n){return t===H&&U(A,e,n),m(t),e=b(e,!0),m(n),o(Y,e)?(n.enumerable?(o(t,E)&&t[E][e]&&(t[E][e]=!1),n=k(n,{enumerable:g(0,!1)})):(o(t,E)||P(t,E,g(1,{})),t[E][e]=!0),V(t,e,n)):P(t,e,n)},W=function(t,e){m(t);for(var n,r=y(e=w(e)),o=0,i=r.length;i>o;)U(t,n=r[o++],e[n]);return t},J=function(t,e){return void 0===e?k(t):W(k(t),e)},z=function(t){var e=N.call(this,t=b(t,!0));return!(this===H&&o(Y,t)&&!o(A,t))&&(!(e||!o(this,t)||!o(Y,t)||o(this,E)&&this[E][t])||e)},K=function(t,e){if(t=w(t),e=b(e,!0),t!==H||!o(Y,e)||o(A,e)){var n=S(t,e);return!n||!o(Y,e)||o(t,E)&&t[E][e]||(n.enumerable=!0),n}},X=function(t){for(var e,n=C(w(t)),r=[],i=0;n.length>i;)o(Y,e=n[i++])||e==E||e==s||r.push(e);return r},Q=function(t){for(var e,n=t===H,r=C(n?A:w(t)),i=[],u=0;r.length>u;)!o(Y,e=r[u++])||n&&!o(H,e)||i.push(Y[e]);return i};I||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===H&&e.call(A,n),o(this,E)&&o(this[E],t)&&(this[E][t]=!1),V(this,t,g(1,n))};return i&&B&&V(H,t,{configurable:!0,set:e}),q(t)},a(j.prototype,"toString",function(){return this._k}),M.f=K,D.f=U,n(42).f=x.f=X,n(27).f=z,n(43).f=Q,i&&!n(23)&&a(H,"propertyIsEnumerable",z,!0),h.f=function(t){return q(d(t))}),u(u.G+u.W+u.F*!I,{Symbol:j});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)d(Z[tt++]);for(var et=O(d.store),nt=0;et.length>nt;)v(et[nt++]);u(u.S+u.F*!I,"Symbol",{for:function(t){return o($,t+="")?$[t]:$[t]=j(t)},keyFor:function(t){if(!G(t))throw TypeError(t+" is not a symbol!");for(var e in $)if($[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),u(u.S+u.F*!I,"Object",{create:J,defineProperty:U,defineProperties:W,getOwnPropertyDescriptor:K,getOwnPropertyNames:X,getOwnPropertySymbols:Q}),F&&u(u.S+u.F*(!I||c(function(){var t=j();return"[null]"!=T([t])||"{}"!=T({a:t})||"{}"!=T(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!G(t)){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return e=r[1],"function"==typeof e&&(n=e),!n&&_(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!G(e))return e}),r[1]=e,T.apply(F,r)}}}),j.prototype[L]||n(7)(j.prototype,L,j.prototype.valueOf),l(j,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(t,e,n){n(33)("asyncIterator")},function(t,e,n){n(33)("observable")},function(t,e,n){n(86);for(var r=n(1),o=n(7),i=n(22),u=n(8)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s index ? this.flow[index] : this.endStatus +}; + +FlowManager.prototype.first = function first () { + return this.step(0) +}; + +FlowManager.prototype.next = function next (current) { + if (this.diversionNext) { + var next = this.diversionNext; + this.diversionNext = null; + + return next + } + + return this.step(this.flow.indexOf(current) + 1) +}; + +FlowManager.prototype.diversion = function diversion (next) { + this.diversionNext = next; +}; + +function capitalize (string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} + +function datetimeFromISO (string) { + var datetime = luxon.DateTime.fromISO(string).toUTC(); + + return datetime.isValid ? datetime : null +} + +function monthDays (year, month, weekStart) { + var monthDate = luxon.DateTime.local(year, month, 1); + var firstDay = monthDate.weekday - weekStart; + + if (firstDay < 0) { + firstDay += 7; + } + var lastDay = (weekStart - monthDate.weekday - monthDate.daysInMonth) % 7; + if (lastDay < 0) { + lastDay += 7; + } + + return Array.apply(null, Array(monthDate.daysInMonth + firstDay + lastDay)) + .map(function (value, index) { return (index + 1 <= firstDay || index >= firstDay + monthDate.daysInMonth) ? null : (index + 1 - firstDay); } + ) +} + +function monthDayIsDisabled (minDate, maxDate, year, month, day) { + var date = luxon.DateTime.fromObject({ year: year, month: month, day: day, zone: 'UTC' }); + + minDate = minDate ? startOfDay(minDate.setZone('UTC', { keepLocalTime: true })) : null; + maxDate = maxDate ? startOfDay(maxDate.setZone('UTC', { keepLocalTime: true })) : null; + + return (minDate && date < minDate) || + (maxDate && date > maxDate) +} + +function monthIsDisabled (minDate, maxDate, year, month) { + return (minDate && minDate > luxon.DateTime.utc(year, month, luxon.DateTime.utc(year, month).daysInMonth)) || + (maxDate && maxDate < luxon.DateTime.utc(year, month, 1)) +} + +function yearIsDisabled (minDate, maxDate, year) { + var minYear = minDate ? minDate.year : null; + var maxYear = maxDate ? maxDate.year : null; + + return (minYear && year < minYear) || + (maxYear && year > maxYear) +} + +function timeComponentIsDisabled (min, max, component) { + return (min !== null && component < min) || + (max !== null && component > max) +} + +function weekdays (weekStart) { + if (--weekStart < 0) { + weekStart = 6; + } + + var weekDays = luxon.Info.weekdays('short').map(function (weekday) { return capitalize(weekday); }); + + weekDays = weekDays.concat(weekDays.splice(0, weekStart)); + + return weekDays +} + +function months () { + return luxon.Info.months().map(function (month) { return capitalize(month); }) +} + +function hours (step) { + return Array.apply(null, Array(Math.ceil(24 / step))).map(function (item, index) { return index * step; }) +} + +function minutes (step) { + return Array.apply(null, Array(Math.ceil(60 / step))).map(function (item, index) { return index * step; }) +} + +function years (current) { + return Array.apply(null, Array(201)).map(function (item, index) { return current - 100 + index; }) +} + +function pad (number) { + return number < 10 ? '0' + number : number +} + +function startOfDay (datetime) { + return datetime.startOf('day') +} + +function createFlowManager (flow) { + return new FlowManager(flow, 'end') +} + +function createFlowManagerFromType (type) { + var flow = []; + + switch (type) { + case 'datetime': + flow = ['date', 'time']; + break + case 'time': + flow = ['time']; + break + default: + flow = ['date']; + } + + return new FlowManager(flow, 'end') +} + +function weekStart () { + var weekstart; + + try { + weekstart = require('weekstart/package.json').version ? require('weekstart') : null; + } catch (e) { + weekstart = window.weekstart; + } + + var firstDay = weekstart ? weekstart.getWeekStartByLocale(luxon.Settings.defaultLocale) : 1; + + return firstDay === 0 ? 7 : firstDay +} + +var DatetimeCalendar = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-calendar"},[_c('div',{staticClass:"vdatetime-calendar__navigation"},[_c('div',{staticClass:"vdatetime-calendar__navigation--previous",on:{"click":_vm.previousMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__current--month"},[_vm._v(_vm._s(_vm.monthName)+" "+_vm._s(_vm.newYear))]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__navigation--next",on:{"click":_vm.nextMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__month"},[_vm._l((_vm.weekdays),function(weekday){return _c('div',{staticClass:"vdatetime-calendar__month__weekday"},[_vm._v(_vm._s(weekday))])}),_vm._v(" "),_vm._l((_vm.days),function(day){return _c('div',{staticClass:"vdatetime-calendar__month__day",class:{'vdatetime-calendar__month__day--selected': day.selected, 'vdatetime-calendar__month__day--disabled': day.disabled},on:{"click":function($event){_vm.selectDay(day);}}},[_c('span',[_c('span',[_vm._v(_vm._s(day.number))])])])})],2)])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + day: { + type: Number, + default: null + }, + disabled: { + type: Array + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + }, + weekStart: { + type: Number, + default: 1 + } + }, + + data: function data () { + return { + newDate: luxon.DateTime.fromObject({ year: this.year, month: this.month, zone: 'UTC' }), + weekdays: weekdays(this.weekStart), + months: months() + } + }, + + computed: { + newYear: function newYear () { + return this.newDate.year + }, + newMonth: function newMonth () { + return this.newDate.month + }, + monthName: function monthName () { + return this.months[this.newMonth - 1] + }, + days: function days () { + var this$1 = this; + + return monthDays(this.newYear, this.newMonth, this.weekStart).map(function (day) { return ({ + number: day, + selected: day && this$1.year === this$1.newYear && this$1.month === this$1.newMonth && this$1.day === day, + disabled: !day || monthDayIsDisabled(this$1.minDate, this$1.maxDate, this$1.newYear, this$1.newMonth, day) + }); }) + } + }, + + methods: { + selectDay: function selectDay (day) { + if (day.disabled) { + return + } + + this.$emit('change', this.newYear, this.newMonth, day.number); + }, + previousMonth: function previousMonth () { + this.newDate = this.newDate.minus({ months: 1 }); + }, + nextMonth: function nextMonth () { + this.newDate = this.newDate.plus({ months: 1 }); + } + } +}; + +var DatetimeTimePicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'vdatetime-time-picker': true, 'vdatetime-time-picker__with-suffix': _vm.use12Hour}},[_c('div',{ref:"hourList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--hours"},_vm._l((_vm.hours),function(hour){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': hour.selected, 'vdatetime-time-picker__item--disabled': hour.disabled},on:{"click":function($event){_vm.selectHour(hour);}}},[_vm._v(_vm._s(_vm.formatHour(hour.number)))])})),_vm._v(" "),_c('div',{ref:"minuteList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--minutes"},_vm._l((_vm.minutes),function(minute){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': minute.selected, 'vdatetime-time-picker__item--disabled': minute.disabled},on:{"click":function($event){_vm.selectMinute(minute);}}},[_vm._v(_vm._s(minute.number))])})),_vm._v(" "),(_vm.use12Hour)?_c('div',{ref:"suffixList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--suffix"},[_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour < 12},on:{"click":function($event){_vm.selectSuffix('am');}}},[_vm._v("am")]),_vm._v(" "),_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour >= 12},on:{"click":function($event){_vm.selectSuffix('pm');}}},[_vm._v("pm")])]):_vm._e()])},staticRenderFns: [], + props: { + hour: { + type: Number, + required: true + }, + minute: { + type: Number, + required: true + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + } + }, + + computed: { + hours: function hours$1 () { + var this$1 = this; + + return hours(this.hourStep).filter(function (hour) { + if (!this$1.use12Hour) { + return true + } else { + if (this$1.hour < 12) { + return hour < 12 + } else { + return hour >= 12 + } + } + }).map(function (hour) { return ({ + number: pad(hour), + selected: hour === this$1.hour, + disabled: timeComponentIsDisabled(this$1.minHour, this$1.maxHour, hour) + }); }) + }, + minutes: function minutes$1 () { + var this$1 = this; + + return minutes(this.minuteStep).map(function (minute) { return ({ + number: pad(minute), + selected: minute === this$1.minute, + disabled: timeComponentIsDisabled(this$1.minMinute, this$1.maxMinute, minute) + }); }) + }, + minHour: function minHour () { + return this.minTime ? parseInt(this.minTime.split(':')[0]) : null + }, + minMinute: function minMinute () { + return this.minTime && this.minHour === this.hour ? parseInt(this.minTime.split(':')[1]) : null + }, + maxHour: function maxHour () { + return this.maxTime ? parseInt(this.maxTime.split(':')[0]) : null + }, + maxMinute: function maxMinute () { + return this.maxTime && this.maxHour === this.hour ? parseInt(this.maxTime.split(':')[1]) : null + } + }, + + methods: { + selectHour: function selectHour (hour) { + if (hour.disabled) { + return + } + + this.$emit('change', { hour: parseInt(hour.number) }); + }, + selectMinute: function selectMinute (minute) { + if (minute.disabled) { + return + } + + this.$emit('change', { minute: parseInt(minute.number) }); + }, + selectSuffix: function selectSuffix (suffix) { + if (suffix === 'am') { + if (this.hour >= 12) { + this.$emit('change', { hour: parseInt(this.hour - 12), suffixTouched: true }); + } + } + if (suffix === 'pm') { + if (this.hour < 12) { + this.$emit('change', { hour: parseInt(this.hour + 12), suffixTouched: true }); + } + } + }, + formatHour: function formatHour (hour) { + var numHour = Number(hour); + if (this.use12Hour) { + if (numHour === 0) { + return 12 + } + if (numHour > 12) { + return numHour - 12 + } + return numHour + } + return hour + } + }, + + mounted: function mounted () { + var selectedHour = this.$refs.hourList.querySelector('.vdatetime-time-picker__item--selected'); + var selectedMinute = this.$refs.minuteList.querySelector('.vdatetime-time-picker__item--selected'); + this.$refs.hourList.scrollTop = selectedHour ? selectedHour.offsetTop - 250 : 0; + this.$refs.minuteList.scrollTop = selectedMinute ? selectedMinute.offsetTop - 250 : 0; + } +}; + +var DatetimeYearPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-year-picker"},[_c('div',{ref:"yearList",staticClass:"vdatetime-year-picker__list vdatetime-year-picker__list"},_vm._l((_vm.years),function(year){return _c('div',{staticClass:"vdatetime-year-picker__item",class:{'vdatetime-year-picker__item--selected': year.selected, 'vdatetime-year-picker__item--disabled': year.disabled},on:{"click":function($event){_vm.select(year);}}},[_vm._v(_vm._s(year.number)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + } + }, + + computed: { + years: function years$1 () { + var this$1 = this; + + return years(this.year).map(function (year) { return ({ + number: year, + selected: year === this$1.year, + disabled: !year || yearIsDisabled(this$1.minDate, this$1.maxDate, year) + }); }) + } + }, + + methods: { + select: function select (year) { + if (year.disabled) { + return + } + + this.$emit('change', parseInt(year.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + if (this.$refs.yearList) { + var selectedYear = this.$refs.yearList.querySelector('.vdatetime-year-picker__item--selected'); + this.$refs.yearList.scrollTop = selectedYear ? selectedYear.offsetTop - 250 : 0; + } + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var DatetimeMonthPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-month-picker"},[_c('div',{ref:"monthList",staticClass:"vdatetime-month-picker__list vdatetime-month-picker__list"},_vm._l((_vm.months),function(month){return _c('div',{staticClass:"vdatetime-month-picker__item",class:{'vdatetime-month-picker__item--selected': month.selected, 'vdatetime-month-picker__item--disabled': month.disabled},on:{"click":function($event){_vm.select(month);}}},[_vm._v(_vm._s(month.label)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + } + }, + + computed: { + months: function months$1 () { + var this$1 = this; + + return months(this.month).map(function (month, index) { return ({ + number: ++index, + label: month, + selected: index === this$1.month, + disabled: !index || monthIsDisabled(this$1.minDate, this$1.maxDate, this$1.year, index) + }); }) + } + }, + + methods: { + select: function select (month) { + if (month.disabled) { + return + } + + this.$emit('change', parseInt(month.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + var selectedMonth = this.$refs.monthList.querySelector('.vdatetime-month-picker__item--selected'); + this.$refs.monthList.scrollTop = selectedMonth ? selectedMonth.offsetTop - 250 : 0; + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var KEY_TAB = 9; +var KEY_ENTER = 13; +var KEY_ESC = 27; + +var DatetimePopup = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-popup"},[_c('div',{staticClass:"vdatetime-popup__header"},[(_vm.title)?_c('div',{staticClass:"vdatetime-popup__title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__year",on:{"click":_vm.showYear}},[_vm._v(_vm._s(_vm.year))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__date",on:{"click":_vm.showMonth}},[_vm._v(_vm._s(_vm.dateFormatted))]):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__body"},[(_vm.step === 'year')?_c('datetime-year-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year},on:{"change":_vm.onChangeYear}}):_vm._e(),_vm._v(" "),(_vm.step === 'month')?_c('datetime-month-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year,"month":_vm.month},on:{"change":_vm.onChangeMonth}}):_vm._e(),_vm._v(" "),(_vm.step === 'date')?_c('datetime-calendar',{attrs:{"year":_vm.year,"month":_vm.month,"day":_vm.day,"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"week-start":_vm.weekStart},on:{"change":_vm.onChangeDate}}):_vm._e(),_vm._v(" "),(_vm.step === 'time')?_c('datetime-time-picker',{attrs:{"hour":_vm.hour,"minute":_vm.minute,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-time":_vm.handleMinTime(),"max-time":_vm.handleMaxTime()},on:{"change":_vm.onChangeTime}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions"},[_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--cancel",on:{"click":_vm.cancel}},[_vm._t("button-cancel__internal",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:_vm.step})],2),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--confirm",on:{"click":_vm.confirm}},[_vm._t("button-confirm__internal",[_vm._v(_vm._s(_vm.phrases.ok))],{step:_vm.step})],2)])])},staticRenderFns: [], + components: { + DatetimeCalendar: DatetimeCalendar, + DatetimeTimePicker: DatetimeTimePicker, + DatetimeYearPicker: DatetimeYearPicker, + DatetimeMonthPicker: DatetimeMonthPicker + }, + + props: { + datetime: { + type: luxon.DateTime, + required: true + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + type: { + type: String, + default: 'date' + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: luxon.DateTime, + default: null + }, + maxDatetime: { + type: luxon.DateTime, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: 1 + }, + flow: { + type: Array + }, + title: { + type: String + } + }, + + data: function data () { + var flowManager = this.flow + ? createFlowManager(this.flow) + : createFlowManagerFromType(this.type); + + return { + newDatetime: this.datetime, + flowManager: flowManager, + step: flowManager.first(), + timePartsTouched: [] + } + }, + + created: function created () { + document.addEventListener('keydown', this.onKeyDown); + }, + + beforeDestroy: function beforeDestroy () { + document.removeEventListener('keydown', this.onKeyDown); + }, + + computed: { + year: function year () { + return this.newDatetime.year + }, + month: function month () { + return this.newDatetime.month + }, + day: function day () { + return this.newDatetime.day + }, + hour: function hour () { + return this.newDatetime.hour + }, + minute: function minute () { + return this.newDatetime.minute + }, + dateFormatted: function dateFormatted () { + return this.newDatetime.toLocaleString({ + month: 'long', + day: 'numeric' + }) + } + }, + + methods: { + handleMinTime: function handleMinTime () { + alert(this.minTime); + return this.minTime ? this.minTime : ( + this.minDatetime && + this.minDatetime.year === this.year && + this.minDatetime.month === this.month && + this.minDatetime.day === this.day + ) ? this.minDatetime.toFormat('HH:mm') : null + }, + handleMaxTime: function handleMaxTime () { + return this.maxTime ? this.maxTime : ( + this.maxDatetime && + this.maxDatetime.year === this.year && + this.maxDatetime.month === this.month && + this.maxDatetime.day === this.day + ) ? this.maxDatetime.toFormat('HH:mm') : null + }, + nextStep: function nextStep () { + this.step = this.flowManager.next(this.step); + this.timePartsTouched = []; + + if (this.step === 'end') { + this.$emit('confirm', this.newDatetime); + } + }, + showYear: function showYear () { + this.step = 'year'; + this.flowManager.diversion('date'); + }, + showMonth: function showMonth () { + this.step = 'month'; + this.flowManager.diversion('date'); + }, + confirm: function confirm () { + this.nextStep(); + }, + cancel: function cancel () { + this.$emit('cancel'); + }, + onChangeYear: function onChangeYear (year) { + this.newDatetime = this.newDatetime.set({ year: year }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeMonth: function onChangeMonth (month) { + this.newDatetime = this.newDatetime.set({ month: month }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeDate: function onChangeDate (year, month, day) { + this.newDatetime = this.newDatetime.set({ year: year, month: month, day: day }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeTime: function onChangeTime (ref) { + var hour = ref.hour; + var minute = ref.minute; + var suffixTouched = ref.suffixTouched; + + if (suffixTouched) { + this.timePartsTouched['suffix'] = true; + } + + if (Number.isInteger(hour)) { + this.newDatetime = this.newDatetime.set({ hour: hour }); + this.timePartsTouched['hour'] = true; + } + + if (Number.isInteger(minute)) { + this.newDatetime = this.newDatetime.set({ minute: minute }); + this.timePartsTouched['minute'] = true; + } + + var goNext = this.auto && this.timePartsTouched['hour'] && this.timePartsTouched['minute'] && ( + this.timePartsTouched['suffix'] || + !this.use12Hour + ); + + if (goNext) { + this.nextStep(); + } + }, + onKeyDown: function onKeyDown (event) { + switch (event.keyCode) { + case KEY_ESC: + case KEY_TAB: + this.cancel(); + break + + case KEY_ENTER: + this.nextStep(); + break + } + } + } +}; + +var Datetime = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime"},[_vm._t("before"),_vm._v(" "),_c('input',_vm._g(_vm._b({staticClass:"vdatetime-input",class:_vm.inputClass,style:(_vm.inputStyle),attrs:{"id":_vm.inputId,"type":"text"},domProps:{"value":_vm.inputValue},on:{"click":_vm.open,"focus":_vm.open}},'input',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.hiddenName)?_c('input',{attrs:{"type":"hidden","name":_vm.hiddenName},domProps:{"value":_vm.value},on:{"input":_vm.setValue}}):_vm._e(),_vm._v(" "),_vm._t("after"),_vm._v(" "),_c('transition-group',{attrs:{"name":"vdatetime-fade","tag":"div"}},[(_vm.isOpen && !_vm.hideBackdrop)?_c('div',{key:"overlay",staticClass:"vdatetime-overlay",on:{"click":function($event){if($event.target !== $event.currentTarget){ return null; }_vm.clickOutside($event);}}}):_vm._e(),_vm._v(" "),(_vm.isOpen)?_c('datetime-popup',{key:"popup",attrs:{"type":_vm.type,"datetime":_vm.popupDate,"phrases":_vm.phrases,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-datetime":_vm.popupMinDatetime,"max-datetime":_vm.popupMaxDatetime,"min-time":_vm.minTime,"max-time":_vm.maxTime,"auto":_vm.auto,"week-start":_vm.weekStart,"flow":_vm.flow,"title":_vm.title},on:{"confirm":_vm.confirm,"cancel":_vm.cancel},scopedSlots:_vm._u([{key:"button-cancel__internal",fn:function(scope){return [_vm._t("button-cancel",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:scope.step})]}},{key:"button-confirm__internal",fn:function(scope){return [_vm._t("button-confirm",[_vm._v(_vm._s(_vm.phrases.ok))],{step:scope.step})]}}])}):_vm._e()],1)],2)},staticRenderFns: [], + components: { + DatetimePopup: DatetimePopup + }, + + inheritAttrs: false, + + props: { + value: { + type: String + }, + valueZone: { + type: String, + default: 'UTC' + }, + inputId: { + type: String, + default: null + }, + inputClass: { + type: [Object, Array, String], + default: '' + }, + inputStyle: { + type: [Object, Array, String], + default: '' + }, + hiddenName: { + type: String + }, + zone: { + type: String, + default: 'local' + }, + format: { + type: [Object, String], + default: null + }, + type: { + type: String, + default: 'date' + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: String, + default: null + }, + maxDatetime: { + type: String, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: function default$2 () { + return weekStart() + } + }, + flow: { + type: Array + }, + title: { + type: String + }, + hideBackdrop: { + type: Boolean, + default: false + }, + backdropClick: { + type: Boolean, + default: true + } + }, + + data: function data () { + return { + isOpen: false, + datetime: datetimeFromISO(this.value) + } + }, + + watch: { + value: function value (newValue) { + this.datetime = datetimeFromISO(newValue); + } + }, + + created: function created () { + this.emitInput(); + }, + + computed: { + inputValue: function inputValue () { + var format = this.format; + + if (!format) { + switch (this.type) { + case 'date': + format = luxon.DateTime.DATE_MED; + break + case 'time': + format = luxon.DateTime.TIME_24_SIMPLE; + break + case 'datetime': + case 'default': + format = luxon.DateTime.DATETIME_MED; + break + } + } + + if (typeof format === 'string') { + return this.datetime ? luxon.DateTime.fromISO(this.datetime).setZone(this.zone).toFormat(format) : '' + } else { + return this.datetime ? this.datetime.setZone(this.zone).toLocaleString(format) : '' + } + }, + popupDate: function popupDate () { + return this.datetime ? this.datetime.setZone(this.zone) : this.newPopupDatetime() + }, + popupMinDatetime: function popupMinDatetime () { + return this.minDatetime ? luxon.DateTime.fromISO(this.minDatetime).setZone(this.zone) : null + }, + popupMaxDatetime: function popupMaxDatetime () { + return this.maxDatetime ? luxon.DateTime.fromISO(this.maxDatetime).setZone(this.zone) : null + } + }, + + methods: { + emitInput: function emitInput () { + var datetime = this.datetime ? this.datetime.setZone(this.valueZone) : null; + + if (datetime && this.type === 'date') { + datetime = startOfDay(datetime); + } + + this.$emit('input', datetime ? datetime.toISO() : ''); + }, + open: function open (event) { + event.target.blur(); + + this.isOpen = true; + }, + close: function close () { + this.isOpen = false; + this.$emit('close'); + }, + confirm: function confirm (datetime) { + this.datetime = datetime.toUTC(); + this.emitInput(); + this.close(); + }, + cancel: function cancel () { + this.close(); + }, + clickOutside: function clickOutside () { + if (this.backdropClick === true) { this.cancel(); } + }, + newPopupDatetime: function newPopupDatetime () { + var datetime = luxon.DateTime.utc().setZone(this.zone).set({ seconds: 0, milliseconds: 0 }); + + if (this.popupMinDatetime && datetime < this.popupMinDatetime) { + datetime = this.popupMinDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.popupMaxDatetime && datetime > this.popupMaxDatetime) { + datetime = this.popupMaxDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.minuteStep === 1) { + return datetime + } + + var roundedMinute = Math.round(datetime.minute / this.minuteStep) * this.minuteStep; + + if (roundedMinute === 60) { + return datetime.plus({ hours: 1 }).set({ minute: 0 }) + } + + return datetime.set({ minute: roundedMinute }) + }, + setValue: function setValue (event) { + this.datetime = datetimeFromISO(event.target.value); + this.emitInput(); + } + } +}; + +function plugin (Vue) { + Vue.component('datetime', Datetime); + Vue.component('datetime-popup', DatetimePopup); +} + +// Install by default if using the script tag +if (typeof window !== 'undefined' && window.Vue) { + window.Vue.use(plugin); +} + +var version = '1.0.0-beta.13'; + +exports['default'] = plugin; +exports.Datetime = Datetime; +exports.DatetimePopup = DatetimePopup; +exports.version = version; diff --git a/dist/vue-datetime.css b/dist/vue-datetime.css new file mode 100644 index 0000000..20b2e68 --- /dev/null +++ b/dist/vue-datetime.css @@ -0,0 +1,2136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-fade-enter-active, +.vdatetime-fade-leave-active { + transition: opacity .4s; +} + +.vdatetime-fade-enter, +.vdatetime-fade-leave-to { + opacity: 0; +} + +.vdatetime-overlay { + z-index: 999; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0, 0, 0, .5); + transition: opacity .5s; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-popup { + box-sizing: border-box; + z-index: 1000; + position: fixed; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + width: 340px; + max-width: calc(100% - 30px); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .3); + color: #444; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + line-height: 1.18; + background: #fff; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0) +} + +.vdatetime-popup * { + box-sizing: border-box +} + +.vdatetime-popup__header { + padding: 18px 30px; + background: #3f51b5; + color: #fff; + font-size: 32px; +} + +.vdatetime-popup__title { + margin-bottom: 8px; + font-size: 21px; + font-weight: 300; +} + +.vdatetime-popup__year { + font-weight: 300; + font-size: 14px; + opacity: 0.7; + cursor: pointer; + transition: opacity .3s +} + +.vdatetime-popup__year:hover { + opacity: 1 +} + +.vdatetime-popup__date { + line-height: 1; + cursor: pointer; +} + +.vdatetime-popup__actions { + padding: 0 20px 10px 30px; + text-align: right; +} + +.vdatetime-popup__actions__button { + display: inline-block; + border: none; + padding: 10px 20px; + background: transparent; + font-size: 16px; + color: #3f51b5; + cursor: pointer; + transition: color .3s +} + +.vdatetime-popup__actions__button:hover { + color: #444 +} +.vdatetime-calendar__navigation--previous:hover svg path, .vdatetime-calendar__navigation--next:hover svg path { + stroke: #888; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-calendar__navigation, +.vdatetime-calendar__navigation * { + box-sizing: border-box; +} + +.vdatetime-calendar__navigation { + position: relative; + margin: 15px 0; + padding: 0 30px; + width: 100%; +} + +.vdatetime-calendar__navigation--previous, +.vdatetime-calendar__navigation--next { + position: absolute; + top: 0; + padding: 0 5px; + width: 18px; + cursor: pointer +} + +.vdatetime-calendar__navigation--previous svg, .vdatetime-calendar__navigation--next svg { + width: 8px; + height: 13px; +} + +.vdatetime-calendar__navigation--previous svg path, .vdatetime-calendar__navigation--next svg path { + transition: stroke .3s; +} + +.vdatetime-calendar__navigation--previous { + left: 25px; +} + +.vdatetime-calendar__navigation--next { + right: 25px; + -webkit-transform: scaleX(-1); + transform: scaleX(-1); +} + +.vdatetime-calendar__current--month { + text-align: center; + text-transform: capitalize; +} + +.vdatetime-calendar__month { + padding: 0 20px; + transition: height .2s; +} + +.vdatetime-calendar__month__weekday, +.vdatetime-calendar__month__day { + display: inline-block; + width: 14.28571%; + line-height: 36px; + text-align: center; + font-size: 15px; + font-weight: 300; + cursor: pointer +} + +.vdatetime-calendar__month__weekday > span, .vdatetime-calendar__month__day > span { + display: block; + width: 100%; + position: relative; + height: 0; + padding: 0 0 100%; + overflow: hidden; +} + +.vdatetime-calendar__month__weekday > span > span, .vdatetime-calendar__month__day > span > span { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border: 0; + border-radius: 50%; + transition: background-color .3s, color .3s; +} + +.vdatetime-calendar__month__weekday { + font-weight: bold; +} + +.vdatetime-calendar__month__day:hover > span > span { + background: #eee; +} + +.vdatetime-calendar__month__day--selected { +} + +.vdatetime-calendar__month__day--selected > span > span, + .vdatetime-calendar__month__day--selected:hover > span > span { + color: #fff; + background: #3f51b5; +} + +.vdatetime-calendar__month__day--disabled { + opacity: 0.4; + cursor: default +} + +.vdatetime-calendar__month__day--disabled:hover > span > span { + color: inherit; + background: transparent; +} +.vdatetime-time-picker__list::-webkit-scrollbar-thumb { + background: #ccc +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-time-picker__list::-webkit-scrollbar-track { + background: #efefef +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-time-picker * { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-time-picker { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-time-picker::after { + content: ''; + display: table; + clear: both +} + +.vdatetime-time-picker__list { + float: left; + width: 50%; + height: 305px; + overflow-y: scroll; + -webkit-overflow-scrolling: touch +} + +.vdatetime-time-picker__list::-webkit-scrollbar { + width: 3px +} + +.vdatetime-time-picker__with-suffix .vdatetime-time-picker__list { + width: 33.3%; +} + +.vdatetime-time-picker__item { + padding: 10px 0; + font-size: 20px; + text-align: center; + cursor: pointer; + transition: font-size .3s; +} + +.vdatetime-time-picker__item:hover { + font-size: 32px; +} + +.vdatetime-time-picker__item--selected { + color: #3f51b5; + font-size: 32px; +} + +.vdatetime-time-picker__item--disabled { + opacity: 0.4; + cursor: default; + font-size: 20px !important; +} +.vdatetime-year-picker__list::-webkit-scrollbar-thumb { + background: #ccc +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-year-picker__list::-webkit-scrollbar-track { + background: #efefef +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-year-picker * { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-year-picker { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-year-picker::after { + content: ''; + display: table; + clear: both +} + +.vdatetime-year-picker__list { + float: left; + width: 100%; + height: 305px; + overflow-y: scroll; + -webkit-overflow-scrolling: touch +} + +.vdatetime-year-picker__list::-webkit-scrollbar { + width: 3px +} + +.vdatetime-year-picker__item { + padding: 10px 0; + font-size: 20px; + text-align: center; + cursor: pointer; + transition: font-size .3s; +} + +.vdatetime-year-picker__item:hover { + font-size: 32px; +} + +.vdatetime-year-picker__item--selected { + color: #3f51b5; + font-size: 32px; +} + +.vdatetime-year-picker__item--disabled { + opacity: 0.4; + cursor: default +} + +.vdatetime-year-picker__item--disabled:hover { + color: inherit; + background: transparent +} +.vdatetime-month-picker__list::-webkit-scrollbar-thumb { + background: #ccc +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-month-picker__list::-webkit-scrollbar-track { + background: #efefef +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-month-picker * { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-month-picker { + box-sizing: border-box +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.vdatetime-month-picker::after { + content: ''; + display: table; + clear: both +} + +.vdatetime-month-picker__list { + float: left; + width: 100%; + height: 305px; + overflow-y: scroll; + -webkit-overflow-scrolling: touch +} + +.vdatetime-month-picker__list::-webkit-scrollbar { + width: 3px +} + +.vdatetime-month-picker__item { + padding: 10px 0; + font-size: 20px; + text-align: center; + cursor: pointer; + transition: font-size .3s; +} + +.vdatetime-month-picker__item:hover { + font-size: 32px; +} + +.vdatetime-month-picker__item--selected { + color: #3f51b5; + font-size: 32px; +} + +.vdatetime-month-picker__item--disabled { + opacity: 0.4; + cursor: default +} + +.vdatetime-month-picker__item--disabled:hover { + color: inherit; + background: transparent +} diff --git a/dist/vue-datetime.esm.js b/dist/vue-datetime.esm.js new file mode 100644 index 0000000..dc2edcd --- /dev/null +++ b/dist/vue-datetime.esm.js @@ -0,0 +1,933 @@ +/*! + * vue-datetime v1.0.0-beta.13 + * (c) 2021 Mario Juárez + * Released under the MIT License. + */ + +import { DateTime, Info, Settings } from 'luxon'; + +var FlowManager = function FlowManager (flow, endStatus) { + if ( flow === void 0 ) flow = []; + if ( endStatus === void 0 ) endStatus = null; + + this.flow = flow; + this.endStatus = endStatus; + this.diversionNext = null; +}; + +FlowManager.prototype.step = function step (index) { + return this.flow.length > index ? this.flow[index] : this.endStatus +}; + +FlowManager.prototype.first = function first () { + return this.step(0) +}; + +FlowManager.prototype.next = function next (current) { + if (this.diversionNext) { + var next = this.diversionNext; + this.diversionNext = null; + + return next + } + + return this.step(this.flow.indexOf(current) + 1) +}; + +FlowManager.prototype.diversion = function diversion (next) { + this.diversionNext = next; +}; + +function capitalize (string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} + +function datetimeFromISO (string) { + var datetime = DateTime.fromISO(string).toUTC(); + + return datetime.isValid ? datetime : null +} + +function monthDays (year, month, weekStart) { + var monthDate = DateTime.local(year, month, 1); + var firstDay = monthDate.weekday - weekStart; + + if (firstDay < 0) { + firstDay += 7; + } + var lastDay = (weekStart - monthDate.weekday - monthDate.daysInMonth) % 7; + if (lastDay < 0) { + lastDay += 7; + } + + return Array.apply(null, Array(monthDate.daysInMonth + firstDay + lastDay)) + .map(function (value, index) { return (index + 1 <= firstDay || index >= firstDay + monthDate.daysInMonth) ? null : (index + 1 - firstDay); } + ) +} + +function monthDayIsDisabled (minDate, maxDate, year, month, day) { + var date = DateTime.fromObject({ year: year, month: month, day: day, zone: 'UTC' }); + + minDate = minDate ? startOfDay(minDate.setZone('UTC', { keepLocalTime: true })) : null; + maxDate = maxDate ? startOfDay(maxDate.setZone('UTC', { keepLocalTime: true })) : null; + + return (minDate && date < minDate) || + (maxDate && date > maxDate) +} + +function monthIsDisabled (minDate, maxDate, year, month) { + return (minDate && minDate > DateTime.utc(year, month, DateTime.utc(year, month).daysInMonth)) || + (maxDate && maxDate < DateTime.utc(year, month, 1)) +} + +function yearIsDisabled (minDate, maxDate, year) { + var minYear = minDate ? minDate.year : null; + var maxYear = maxDate ? maxDate.year : null; + + return (minYear && year < minYear) || + (maxYear && year > maxYear) +} + +function timeComponentIsDisabled (min, max, component) { + return (min !== null && component < min) || + (max !== null && component > max) +} + +function weekdays (weekStart) { + if (--weekStart < 0) { + weekStart = 6; + } + + var weekDays = Info.weekdays('short').map(function (weekday) { return capitalize(weekday); }); + + weekDays = weekDays.concat(weekDays.splice(0, weekStart)); + + return weekDays +} + +function months () { + return Info.months().map(function (month) { return capitalize(month); }) +} + +function hours (step) { + return Array.apply(null, Array(Math.ceil(24 / step))).map(function (item, index) { return index * step; }) +} + +function minutes (step) { + return Array.apply(null, Array(Math.ceil(60 / step))).map(function (item, index) { return index * step; }) +} + +function years (current) { + return Array.apply(null, Array(201)).map(function (item, index) { return current - 100 + index; }) +} + +function pad (number) { + return number < 10 ? '0' + number : number +} + +function startOfDay (datetime) { + return datetime.startOf('day') +} + +function createFlowManager (flow) { + return new FlowManager(flow, 'end') +} + +function createFlowManagerFromType (type) { + var flow = []; + + switch (type) { + case 'datetime': + flow = ['date', 'time']; + break + case 'time': + flow = ['time']; + break + default: + flow = ['date']; + } + + return new FlowManager(flow, 'end') +} + +function weekStart () { + var weekstart; + + try { + weekstart = require('weekstart/package.json').version ? require('weekstart') : null; + } catch (e) { + weekstart = window.weekstart; + } + + var firstDay = weekstart ? weekstart.getWeekStartByLocale(Settings.defaultLocale) : 1; + + return firstDay === 0 ? 7 : firstDay +} + +var DatetimeCalendar = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-calendar"},[_c('div',{staticClass:"vdatetime-calendar__navigation"},[_c('div',{staticClass:"vdatetime-calendar__navigation--previous",on:{"click":_vm.previousMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__current--month"},[_vm._v(_vm._s(_vm.monthName)+" "+_vm._s(_vm.newYear))]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__navigation--next",on:{"click":_vm.nextMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__month"},[_vm._l((_vm.weekdays),function(weekday){return _c('div',{staticClass:"vdatetime-calendar__month__weekday"},[_vm._v(_vm._s(weekday))])}),_vm._v(" "),_vm._l((_vm.days),function(day){return _c('div',{staticClass:"vdatetime-calendar__month__day",class:{'vdatetime-calendar__month__day--selected': day.selected, 'vdatetime-calendar__month__day--disabled': day.disabled},on:{"click":function($event){_vm.selectDay(day);}}},[_c('span',[_c('span',[_vm._v(_vm._s(day.number))])])])})],2)])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + day: { + type: Number, + default: null + }, + disabled: { + type: Array + }, + minDate: { + type: DateTime, + default: null + }, + maxDate: { + type: DateTime, + default: null + }, + weekStart: { + type: Number, + default: 1 + } + }, + + data: function data () { + return { + newDate: DateTime.fromObject({ year: this.year, month: this.month, zone: 'UTC' }), + weekdays: weekdays(this.weekStart), + months: months() + } + }, + + computed: { + newYear: function newYear () { + return this.newDate.year + }, + newMonth: function newMonth () { + return this.newDate.month + }, + monthName: function monthName () { + return this.months[this.newMonth - 1] + }, + days: function days () { + var this$1 = this; + + return monthDays(this.newYear, this.newMonth, this.weekStart).map(function (day) { return ({ + number: day, + selected: day && this$1.year === this$1.newYear && this$1.month === this$1.newMonth && this$1.day === day, + disabled: !day || monthDayIsDisabled(this$1.minDate, this$1.maxDate, this$1.newYear, this$1.newMonth, day) + }); }) + } + }, + + methods: { + selectDay: function selectDay (day) { + if (day.disabled) { + return + } + + this.$emit('change', this.newYear, this.newMonth, day.number); + }, + previousMonth: function previousMonth () { + this.newDate = this.newDate.minus({ months: 1 }); + }, + nextMonth: function nextMonth () { + this.newDate = this.newDate.plus({ months: 1 }); + } + } +}; + +var DatetimeTimePicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'vdatetime-time-picker': true, 'vdatetime-time-picker__with-suffix': _vm.use12Hour}},[_c('div',{ref:"hourList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--hours"},_vm._l((_vm.hours),function(hour){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': hour.selected, 'vdatetime-time-picker__item--disabled': hour.disabled},on:{"click":function($event){_vm.selectHour(hour);}}},[_vm._v(_vm._s(_vm.formatHour(hour.number)))])})),_vm._v(" "),_c('div',{ref:"minuteList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--minutes"},_vm._l((_vm.minutes),function(minute){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': minute.selected, 'vdatetime-time-picker__item--disabled': minute.disabled},on:{"click":function($event){_vm.selectMinute(minute);}}},[_vm._v(_vm._s(minute.number))])})),_vm._v(" "),(_vm.use12Hour)?_c('div',{ref:"suffixList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--suffix"},[_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour < 12},on:{"click":function($event){_vm.selectSuffix('am');}}},[_vm._v("am")]),_vm._v(" "),_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour >= 12},on:{"click":function($event){_vm.selectSuffix('pm');}}},[_vm._v("pm")])]):_vm._e()])},staticRenderFns: [], + props: { + hour: { + type: Number, + required: true + }, + minute: { + type: Number, + required: true + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + } + }, + + computed: { + hours: function hours$1 () { + var this$1 = this; + + return hours(this.hourStep).filter(function (hour) { + if (!this$1.use12Hour) { + return true + } else { + if (this$1.hour < 12) { + return hour < 12 + } else { + return hour >= 12 + } + } + }).map(function (hour) { return ({ + number: pad(hour), + selected: hour === this$1.hour, + disabled: timeComponentIsDisabled(this$1.minHour, this$1.maxHour, hour) + }); }) + }, + minutes: function minutes$1 () { + var this$1 = this; + + return minutes(this.minuteStep).map(function (minute) { return ({ + number: pad(minute), + selected: minute === this$1.minute, + disabled: timeComponentIsDisabled(this$1.minMinute, this$1.maxMinute, minute) + }); }) + }, + minHour: function minHour () { + return this.minTime ? parseInt(this.minTime.split(':')[0]) : null + }, + minMinute: function minMinute () { + return this.minTime && this.minHour === this.hour ? parseInt(this.minTime.split(':')[1]) : null + }, + maxHour: function maxHour () { + return this.maxTime ? parseInt(this.maxTime.split(':')[0]) : null + }, + maxMinute: function maxMinute () { + return this.maxTime && this.maxHour === this.hour ? parseInt(this.maxTime.split(':')[1]) : null + } + }, + + methods: { + selectHour: function selectHour (hour) { + if (hour.disabled) { + return + } + + this.$emit('change', { hour: parseInt(hour.number) }); + }, + selectMinute: function selectMinute (minute) { + if (minute.disabled) { + return + } + + this.$emit('change', { minute: parseInt(minute.number) }); + }, + selectSuffix: function selectSuffix (suffix) { + if (suffix === 'am') { + if (this.hour >= 12) { + this.$emit('change', { hour: parseInt(this.hour - 12), suffixTouched: true }); + } + } + if (suffix === 'pm') { + if (this.hour < 12) { + this.$emit('change', { hour: parseInt(this.hour + 12), suffixTouched: true }); + } + } + }, + formatHour: function formatHour (hour) { + var numHour = Number(hour); + if (this.use12Hour) { + if (numHour === 0) { + return 12 + } + if (numHour > 12) { + return numHour - 12 + } + return numHour + } + return hour + } + }, + + mounted: function mounted () { + var selectedHour = this.$refs.hourList.querySelector('.vdatetime-time-picker__item--selected'); + var selectedMinute = this.$refs.minuteList.querySelector('.vdatetime-time-picker__item--selected'); + this.$refs.hourList.scrollTop = selectedHour ? selectedHour.offsetTop - 250 : 0; + this.$refs.minuteList.scrollTop = selectedMinute ? selectedMinute.offsetTop - 250 : 0; + } +}; + +var DatetimeYearPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-year-picker"},[_c('div',{ref:"yearList",staticClass:"vdatetime-year-picker__list vdatetime-year-picker__list"},_vm._l((_vm.years),function(year){return _c('div',{staticClass:"vdatetime-year-picker__item",class:{'vdatetime-year-picker__item--selected': year.selected, 'vdatetime-year-picker__item--disabled': year.disabled},on:{"click":function($event){_vm.select(year);}}},[_vm._v(_vm._s(year.number)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + minDate: { + type: DateTime, + default: null + }, + maxDate: { + type: DateTime, + default: null + } + }, + + computed: { + years: function years$1 () { + var this$1 = this; + + return years(this.year).map(function (year) { return ({ + number: year, + selected: year === this$1.year, + disabled: !year || yearIsDisabled(this$1.minDate, this$1.maxDate, year) + }); }) + } + }, + + methods: { + select: function select (year) { + if (year.disabled) { + return + } + + this.$emit('change', parseInt(year.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + if (this.$refs.yearList) { + var selectedYear = this.$refs.yearList.querySelector('.vdatetime-year-picker__item--selected'); + this.$refs.yearList.scrollTop = selectedYear ? selectedYear.offsetTop - 250 : 0; + } + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var DatetimeMonthPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-month-picker"},[_c('div',{ref:"monthList",staticClass:"vdatetime-month-picker__list vdatetime-month-picker__list"},_vm._l((_vm.months),function(month){return _c('div',{staticClass:"vdatetime-month-picker__item",class:{'vdatetime-month-picker__item--selected': month.selected, 'vdatetime-month-picker__item--disabled': month.disabled},on:{"click":function($event){_vm.select(month);}}},[_vm._v(_vm._s(month.label)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + minDate: { + type: DateTime, + default: null + }, + maxDate: { + type: DateTime, + default: null + } + }, + + computed: { + months: function months$1 () { + var this$1 = this; + + return months(this.month).map(function (month, index) { return ({ + number: ++index, + label: month, + selected: index === this$1.month, + disabled: !index || monthIsDisabled(this$1.minDate, this$1.maxDate, this$1.year, index) + }); }) + } + }, + + methods: { + select: function select (month) { + if (month.disabled) { + return + } + + this.$emit('change', parseInt(month.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + var selectedMonth = this.$refs.monthList.querySelector('.vdatetime-month-picker__item--selected'); + this.$refs.monthList.scrollTop = selectedMonth ? selectedMonth.offsetTop - 250 : 0; + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var KEY_TAB = 9; +var KEY_ENTER = 13; +var KEY_ESC = 27; + +var DatetimePopup = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-popup"},[_c('div',{staticClass:"vdatetime-popup__header"},[(_vm.title)?_c('div',{staticClass:"vdatetime-popup__title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__year",on:{"click":_vm.showYear}},[_vm._v(_vm._s(_vm.year))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__date",on:{"click":_vm.showMonth}},[_vm._v(_vm._s(_vm.dateFormatted))]):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__body"},[(_vm.step === 'year')?_c('datetime-year-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year},on:{"change":_vm.onChangeYear}}):_vm._e(),_vm._v(" "),(_vm.step === 'month')?_c('datetime-month-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year,"month":_vm.month},on:{"change":_vm.onChangeMonth}}):_vm._e(),_vm._v(" "),(_vm.step === 'date')?_c('datetime-calendar',{attrs:{"year":_vm.year,"month":_vm.month,"day":_vm.day,"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"week-start":_vm.weekStart},on:{"change":_vm.onChangeDate}}):_vm._e(),_vm._v(" "),(_vm.step === 'time')?_c('datetime-time-picker',{attrs:{"hour":_vm.hour,"minute":_vm.minute,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-time":_vm.handleMinTime(),"max-time":_vm.handleMaxTime()},on:{"change":_vm.onChangeTime}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions"},[_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--cancel",on:{"click":_vm.cancel}},[_vm._t("button-cancel__internal",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:_vm.step})],2),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--confirm",on:{"click":_vm.confirm}},[_vm._t("button-confirm__internal",[_vm._v(_vm._s(_vm.phrases.ok))],{step:_vm.step})],2)])])},staticRenderFns: [], + components: { + DatetimeCalendar: DatetimeCalendar, + DatetimeTimePicker: DatetimeTimePicker, + DatetimeYearPicker: DatetimeYearPicker, + DatetimeMonthPicker: DatetimeMonthPicker + }, + + props: { + datetime: { + type: DateTime, + required: true + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + type: { + type: String, + default: 'date' + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: DateTime, + default: null + }, + maxDatetime: { + type: DateTime, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: 1 + }, + flow: { + type: Array + }, + title: { + type: String + } + }, + + data: function data () { + var flowManager = this.flow + ? createFlowManager(this.flow) + : createFlowManagerFromType(this.type); + + return { + newDatetime: this.datetime, + flowManager: flowManager, + step: flowManager.first(), + timePartsTouched: [] + } + }, + + created: function created () { + document.addEventListener('keydown', this.onKeyDown); + }, + + beforeDestroy: function beforeDestroy () { + document.removeEventListener('keydown', this.onKeyDown); + }, + + computed: { + year: function year () { + return this.newDatetime.year + }, + month: function month () { + return this.newDatetime.month + }, + day: function day () { + return this.newDatetime.day + }, + hour: function hour () { + return this.newDatetime.hour + }, + minute: function minute () { + return this.newDatetime.minute + }, + dateFormatted: function dateFormatted () { + return this.newDatetime.toLocaleString({ + month: 'long', + day: 'numeric' + }) + } + }, + + methods: { + handleMinTime: function handleMinTime () { + alert(this.minTime); + return this.minTime ? this.minTime : ( + this.minDatetime && + this.minDatetime.year === this.year && + this.minDatetime.month === this.month && + this.minDatetime.day === this.day + ) ? this.minDatetime.toFormat('HH:mm') : null + }, + handleMaxTime: function handleMaxTime () { + return this.maxTime ? this.maxTime : ( + this.maxDatetime && + this.maxDatetime.year === this.year && + this.maxDatetime.month === this.month && + this.maxDatetime.day === this.day + ) ? this.maxDatetime.toFormat('HH:mm') : null + }, + nextStep: function nextStep () { + this.step = this.flowManager.next(this.step); + this.timePartsTouched = []; + + if (this.step === 'end') { + this.$emit('confirm', this.newDatetime); + } + }, + showYear: function showYear () { + this.step = 'year'; + this.flowManager.diversion('date'); + }, + showMonth: function showMonth () { + this.step = 'month'; + this.flowManager.diversion('date'); + }, + confirm: function confirm () { + this.nextStep(); + }, + cancel: function cancel () { + this.$emit('cancel'); + }, + onChangeYear: function onChangeYear (year) { + this.newDatetime = this.newDatetime.set({ year: year }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeMonth: function onChangeMonth (month) { + this.newDatetime = this.newDatetime.set({ month: month }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeDate: function onChangeDate (year, month, day) { + this.newDatetime = this.newDatetime.set({ year: year, month: month, day: day }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeTime: function onChangeTime (ref) { + var hour = ref.hour; + var minute = ref.minute; + var suffixTouched = ref.suffixTouched; + + if (suffixTouched) { + this.timePartsTouched['suffix'] = true; + } + + if (Number.isInteger(hour)) { + this.newDatetime = this.newDatetime.set({ hour: hour }); + this.timePartsTouched['hour'] = true; + } + + if (Number.isInteger(minute)) { + this.newDatetime = this.newDatetime.set({ minute: minute }); + this.timePartsTouched['minute'] = true; + } + + var goNext = this.auto && this.timePartsTouched['hour'] && this.timePartsTouched['minute'] && ( + this.timePartsTouched['suffix'] || + !this.use12Hour + ); + + if (goNext) { + this.nextStep(); + } + }, + onKeyDown: function onKeyDown (event) { + switch (event.keyCode) { + case KEY_ESC: + case KEY_TAB: + this.cancel(); + break + + case KEY_ENTER: + this.nextStep(); + break + } + } + } +}; + +var Datetime = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime"},[_vm._t("before"),_vm._v(" "),_c('input',_vm._g(_vm._b({staticClass:"vdatetime-input",class:_vm.inputClass,style:(_vm.inputStyle),attrs:{"id":_vm.inputId,"type":"text"},domProps:{"value":_vm.inputValue},on:{"click":_vm.open,"focus":_vm.open}},'input',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.hiddenName)?_c('input',{attrs:{"type":"hidden","name":_vm.hiddenName},domProps:{"value":_vm.value},on:{"input":_vm.setValue}}):_vm._e(),_vm._v(" "),_vm._t("after"),_vm._v(" "),_c('transition-group',{attrs:{"name":"vdatetime-fade","tag":"div"}},[(_vm.isOpen && !_vm.hideBackdrop)?_c('div',{key:"overlay",staticClass:"vdatetime-overlay",on:{"click":function($event){if($event.target !== $event.currentTarget){ return null; }_vm.clickOutside($event);}}}):_vm._e(),_vm._v(" "),(_vm.isOpen)?_c('datetime-popup',{key:"popup",attrs:{"type":_vm.type,"datetime":_vm.popupDate,"phrases":_vm.phrases,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-datetime":_vm.popupMinDatetime,"max-datetime":_vm.popupMaxDatetime,"min-time":_vm.minTime,"max-time":_vm.maxTime,"auto":_vm.auto,"week-start":_vm.weekStart,"flow":_vm.flow,"title":_vm.title},on:{"confirm":_vm.confirm,"cancel":_vm.cancel},scopedSlots:_vm._u([{key:"button-cancel__internal",fn:function(scope){return [_vm._t("button-cancel",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:scope.step})]}},{key:"button-confirm__internal",fn:function(scope){return [_vm._t("button-confirm",[_vm._v(_vm._s(_vm.phrases.ok))],{step:scope.step})]}}])}):_vm._e()],1)],2)},staticRenderFns: [], + components: { + DatetimePopup: DatetimePopup + }, + + inheritAttrs: false, + + props: { + value: { + type: String + }, + valueZone: { + type: String, + default: 'UTC' + }, + inputId: { + type: String, + default: null + }, + inputClass: { + type: [Object, Array, String], + default: '' + }, + inputStyle: { + type: [Object, Array, String], + default: '' + }, + hiddenName: { + type: String + }, + zone: { + type: String, + default: 'local' + }, + format: { + type: [Object, String], + default: null + }, + type: { + type: String, + default: 'date' + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: String, + default: null + }, + maxDatetime: { + type: String, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: function default$2 () { + return weekStart() + } + }, + flow: { + type: Array + }, + title: { + type: String + }, + hideBackdrop: { + type: Boolean, + default: false + }, + backdropClick: { + type: Boolean, + default: true + } + }, + + data: function data () { + return { + isOpen: false, + datetime: datetimeFromISO(this.value) + } + }, + + watch: { + value: function value (newValue) { + this.datetime = datetimeFromISO(newValue); + } + }, + + created: function created () { + this.emitInput(); + }, + + computed: { + inputValue: function inputValue () { + var format = this.format; + + if (!format) { + switch (this.type) { + case 'date': + format = DateTime.DATE_MED; + break + case 'time': + format = DateTime.TIME_24_SIMPLE; + break + case 'datetime': + case 'default': + format = DateTime.DATETIME_MED; + break + } + } + + if (typeof format === 'string') { + return this.datetime ? DateTime.fromISO(this.datetime).setZone(this.zone).toFormat(format) : '' + } else { + return this.datetime ? this.datetime.setZone(this.zone).toLocaleString(format) : '' + } + }, + popupDate: function popupDate () { + return this.datetime ? this.datetime.setZone(this.zone) : this.newPopupDatetime() + }, + popupMinDatetime: function popupMinDatetime () { + return this.minDatetime ? DateTime.fromISO(this.minDatetime).setZone(this.zone) : null + }, + popupMaxDatetime: function popupMaxDatetime () { + return this.maxDatetime ? DateTime.fromISO(this.maxDatetime).setZone(this.zone) : null + } + }, + + methods: { + emitInput: function emitInput () { + var datetime = this.datetime ? this.datetime.setZone(this.valueZone) : null; + + if (datetime && this.type === 'date') { + datetime = startOfDay(datetime); + } + + this.$emit('input', datetime ? datetime.toISO() : ''); + }, + open: function open (event) { + event.target.blur(); + + this.isOpen = true; + }, + close: function close () { + this.isOpen = false; + this.$emit('close'); + }, + confirm: function confirm (datetime) { + this.datetime = datetime.toUTC(); + this.emitInput(); + this.close(); + }, + cancel: function cancel () { + this.close(); + }, + clickOutside: function clickOutside () { + if (this.backdropClick === true) { this.cancel(); } + }, + newPopupDatetime: function newPopupDatetime () { + var datetime = DateTime.utc().setZone(this.zone).set({ seconds: 0, milliseconds: 0 }); + + if (this.popupMinDatetime && datetime < this.popupMinDatetime) { + datetime = this.popupMinDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.popupMaxDatetime && datetime > this.popupMaxDatetime) { + datetime = this.popupMaxDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.minuteStep === 1) { + return datetime + } + + var roundedMinute = Math.round(datetime.minute / this.minuteStep) * this.minuteStep; + + if (roundedMinute === 60) { + return datetime.plus({ hours: 1 }).set({ minute: 0 }) + } + + return datetime.set({ minute: roundedMinute }) + }, + setValue: function setValue (event) { + this.datetime = datetimeFromISO(event.target.value); + this.emitInput(); + } + } +}; + +function plugin (Vue) { + Vue.component('datetime', Datetime); + Vue.component('datetime-popup', DatetimePopup); +} + +// Install by default if using the script tag +if (typeof window !== 'undefined' && window.Vue) { + window.Vue.use(plugin); +} + +var version = '1.0.0-beta.13'; + +export { Datetime, DatetimePopup, version };export default plugin; diff --git a/dist/vue-datetime.js b/dist/vue-datetime.js new file mode 100644 index 0000000..8437b0d --- /dev/null +++ b/dist/vue-datetime.js @@ -0,0 +1,944 @@ +/*! + * vue-datetime v1.0.0-beta.13 + * (c) 2021 Mario Juárez + * Released under the MIT License. + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('luxon')) : + typeof define === 'function' && define.amd ? define(['exports', 'luxon'], factory) : + (factory((global.VueDatetime = global.VueDatetime || {}),global.luxon)); +}(this, (function (exports,luxon) { 'use strict'; + +var FlowManager = function FlowManager (flow, endStatus) { + if ( flow === void 0 ) flow = []; + if ( endStatus === void 0 ) endStatus = null; + + this.flow = flow; + this.endStatus = endStatus; + this.diversionNext = null; +}; + +FlowManager.prototype.step = function step (index) { + return this.flow.length > index ? this.flow[index] : this.endStatus +}; + +FlowManager.prototype.first = function first () { + return this.step(0) +}; + +FlowManager.prototype.next = function next (current) { + if (this.diversionNext) { + var next = this.diversionNext; + this.diversionNext = null; + + return next + } + + return this.step(this.flow.indexOf(current) + 1) +}; + +FlowManager.prototype.diversion = function diversion (next) { + this.diversionNext = next; +}; + +function capitalize (string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} + +function datetimeFromISO (string) { + var datetime = luxon.DateTime.fromISO(string).toUTC(); + + return datetime.isValid ? datetime : null +} + +function monthDays (year, month, weekStart) { + var monthDate = luxon.DateTime.local(year, month, 1); + var firstDay = monthDate.weekday - weekStart; + + if (firstDay < 0) { + firstDay += 7; + } + var lastDay = (weekStart - monthDate.weekday - monthDate.daysInMonth) % 7; + if (lastDay < 0) { + lastDay += 7; + } + + return Array.apply(null, Array(monthDate.daysInMonth + firstDay + lastDay)) + .map(function (value, index) { return (index + 1 <= firstDay || index >= firstDay + monthDate.daysInMonth) ? null : (index + 1 - firstDay); } + ) +} + +function monthDayIsDisabled (minDate, maxDate, year, month, day) { + var date = luxon.DateTime.fromObject({ year: year, month: month, day: day, zone: 'UTC' }); + + minDate = minDate ? startOfDay(minDate.setZone('UTC', { keepLocalTime: true })) : null; + maxDate = maxDate ? startOfDay(maxDate.setZone('UTC', { keepLocalTime: true })) : null; + + return (minDate && date < minDate) || + (maxDate && date > maxDate) +} + +function monthIsDisabled (minDate, maxDate, year, month) { + return (minDate && minDate > luxon.DateTime.utc(year, month, luxon.DateTime.utc(year, month).daysInMonth)) || + (maxDate && maxDate < luxon.DateTime.utc(year, month, 1)) +} + +function yearIsDisabled (minDate, maxDate, year) { + var minYear = minDate ? minDate.year : null; + var maxYear = maxDate ? maxDate.year : null; + + return (minYear && year < minYear) || + (maxYear && year > maxYear) +} + +function timeComponentIsDisabled (min, max, component) { + return (min !== null && component < min) || + (max !== null && component > max) +} + +function weekdays (weekStart) { + if (--weekStart < 0) { + weekStart = 6; + } + + var weekDays = luxon.Info.weekdays('short').map(function (weekday) { return capitalize(weekday); }); + + weekDays = weekDays.concat(weekDays.splice(0, weekStart)); + + return weekDays +} + +function months () { + return luxon.Info.months().map(function (month) { return capitalize(month); }) +} + +function hours (step) { + return Array.apply(null, Array(Math.ceil(24 / step))).map(function (item, index) { return index * step; }) +} + +function minutes (step) { + return Array.apply(null, Array(Math.ceil(60 / step))).map(function (item, index) { return index * step; }) +} + +function years (current) { + return Array.apply(null, Array(201)).map(function (item, index) { return current - 100 + index; }) +} + +function pad (number) { + return number < 10 ? '0' + number : number +} + +function startOfDay (datetime) { + return datetime.startOf('day') +} + +function createFlowManager (flow) { + return new FlowManager(flow, 'end') +} + +function createFlowManagerFromType (type) { + var flow = []; + + switch (type) { + case 'datetime': + flow = ['date', 'time']; + break + case 'time': + flow = ['time']; + break + default: + flow = ['date']; + } + + return new FlowManager(flow, 'end') +} + +function weekStart () { + var weekstart; + + try { + weekstart = require('weekstart/package.json').version ? require('weekstart') : null; + } catch (e) { + weekstart = window.weekstart; + } + + var firstDay = weekstart ? weekstart.getWeekStartByLocale(luxon.Settings.defaultLocale) : 1; + + return firstDay === 0 ? 7 : firstDay +} + +var DatetimeCalendar = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-calendar"},[_c('div',{staticClass:"vdatetime-calendar__navigation"},[_c('div',{staticClass:"vdatetime-calendar__navigation--previous",on:{"click":_vm.previousMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__current--month"},[_vm._v(_vm._s(_vm.monthName)+" "+_vm._s(_vm.newYear))]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__navigation--next",on:{"click":_vm.nextMonth}},[_c('svg',{attrs:{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 61.3 102.8"}},[_c('path',{attrs:{"fill":"none","stroke":"#444","stroke-width":"14","stroke-miterlimit":"10","d":"M56.3 97.8L9.9 51.4 56.3 5"}})])])]),_vm._v(" "),_c('div',{staticClass:"vdatetime-calendar__month"},[_vm._l((_vm.weekdays),function(weekday){return _c('div',{staticClass:"vdatetime-calendar__month__weekday"},[_vm._v(_vm._s(weekday))])}),_vm._v(" "),_vm._l((_vm.days),function(day){return _c('div',{staticClass:"vdatetime-calendar__month__day",class:{'vdatetime-calendar__month__day--selected': day.selected, 'vdatetime-calendar__month__day--disabled': day.disabled},on:{"click":function($event){_vm.selectDay(day);}}},[_c('span',[_c('span',[_vm._v(_vm._s(day.number))])])])})],2)])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + day: { + type: Number, + default: null + }, + disabled: { + type: Array + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + }, + weekStart: { + type: Number, + default: 1 + } + }, + + data: function data () { + return { + newDate: luxon.DateTime.fromObject({ year: this.year, month: this.month, zone: 'UTC' }), + weekdays: weekdays(this.weekStart), + months: months() + } + }, + + computed: { + newYear: function newYear () { + return this.newDate.year + }, + newMonth: function newMonth () { + return this.newDate.month + }, + monthName: function monthName () { + return this.months[this.newMonth - 1] + }, + days: function days () { + var this$1 = this; + + return monthDays(this.newYear, this.newMonth, this.weekStart).map(function (day) { return ({ + number: day, + selected: day && this$1.year === this$1.newYear && this$1.month === this$1.newMonth && this$1.day === day, + disabled: !day || monthDayIsDisabled(this$1.minDate, this$1.maxDate, this$1.newYear, this$1.newMonth, day) + }); }) + } + }, + + methods: { + selectDay: function selectDay (day) { + if (day.disabled) { + return + } + + this.$emit('change', this.newYear, this.newMonth, day.number); + }, + previousMonth: function previousMonth () { + this.newDate = this.newDate.minus({ months: 1 }); + }, + nextMonth: function nextMonth () { + this.newDate = this.newDate.plus({ months: 1 }); + } + } +}; + +var DatetimeTimePicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'vdatetime-time-picker': true, 'vdatetime-time-picker__with-suffix': _vm.use12Hour}},[_c('div',{ref:"hourList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--hours"},_vm._l((_vm.hours),function(hour){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': hour.selected, 'vdatetime-time-picker__item--disabled': hour.disabled},on:{"click":function($event){_vm.selectHour(hour);}}},[_vm._v(_vm._s(_vm.formatHour(hour.number)))])})),_vm._v(" "),_c('div',{ref:"minuteList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--minutes"},_vm._l((_vm.minutes),function(minute){return _c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': minute.selected, 'vdatetime-time-picker__item--disabled': minute.disabled},on:{"click":function($event){_vm.selectMinute(minute);}}},[_vm._v(_vm._s(minute.number))])})),_vm._v(" "),(_vm.use12Hour)?_c('div',{ref:"suffixList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--suffix"},[_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour < 12},on:{"click":function($event){_vm.selectSuffix('am');}}},[_vm._v("am")]),_vm._v(" "),_c('div',{staticClass:"vdatetime-time-picker__item",class:{'vdatetime-time-picker__item--selected': _vm.hour >= 12},on:{"click":function($event){_vm.selectSuffix('pm');}}},[_vm._v("pm")])]):_vm._e()])},staticRenderFns: [], + props: { + hour: { + type: Number, + required: true + }, + minute: { + type: Number, + required: true + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + } + }, + + computed: { + hours: function hours$1 () { + var this$1 = this; + + return hours(this.hourStep).filter(function (hour) { + if (!this$1.use12Hour) { + return true + } else { + if (this$1.hour < 12) { + return hour < 12 + } else { + return hour >= 12 + } + } + }).map(function (hour) { return ({ + number: pad(hour), + selected: hour === this$1.hour, + disabled: timeComponentIsDisabled(this$1.minHour, this$1.maxHour, hour) + }); }) + }, + minutes: function minutes$1 () { + var this$1 = this; + + return minutes(this.minuteStep).map(function (minute) { return ({ + number: pad(minute), + selected: minute === this$1.minute, + disabled: timeComponentIsDisabled(this$1.minMinute, this$1.maxMinute, minute) + }); }) + }, + minHour: function minHour () { + return this.minTime ? parseInt(this.minTime.split(':')[0]) : null + }, + minMinute: function minMinute () { + return this.minTime && this.minHour === this.hour ? parseInt(this.minTime.split(':')[1]) : null + }, + maxHour: function maxHour () { + return this.maxTime ? parseInt(this.maxTime.split(':')[0]) : null + }, + maxMinute: function maxMinute () { + return this.maxTime && this.maxHour === this.hour ? parseInt(this.maxTime.split(':')[1]) : null + } + }, + + methods: { + selectHour: function selectHour (hour) { + if (hour.disabled) { + return + } + + this.$emit('change', { hour: parseInt(hour.number) }); + }, + selectMinute: function selectMinute (minute) { + if (minute.disabled) { + return + } + + this.$emit('change', { minute: parseInt(minute.number) }); + }, + selectSuffix: function selectSuffix (suffix) { + if (suffix === 'am') { + if (this.hour >= 12) { + this.$emit('change', { hour: parseInt(this.hour - 12), suffixTouched: true }); + } + } + if (suffix === 'pm') { + if (this.hour < 12) { + this.$emit('change', { hour: parseInt(this.hour + 12), suffixTouched: true }); + } + } + }, + formatHour: function formatHour (hour) { + var numHour = Number(hour); + if (this.use12Hour) { + if (numHour === 0) { + return 12 + } + if (numHour > 12) { + return numHour - 12 + } + return numHour + } + return hour + } + }, + + mounted: function mounted () { + var selectedHour = this.$refs.hourList.querySelector('.vdatetime-time-picker__item--selected'); + var selectedMinute = this.$refs.minuteList.querySelector('.vdatetime-time-picker__item--selected'); + this.$refs.hourList.scrollTop = selectedHour ? selectedHour.offsetTop - 250 : 0; + this.$refs.minuteList.scrollTop = selectedMinute ? selectedMinute.offsetTop - 250 : 0; + } +}; + +var DatetimeYearPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-year-picker"},[_c('div',{ref:"yearList",staticClass:"vdatetime-year-picker__list vdatetime-year-picker__list"},_vm._l((_vm.years),function(year){return _c('div',{staticClass:"vdatetime-year-picker__item",class:{'vdatetime-year-picker__item--selected': year.selected, 'vdatetime-year-picker__item--disabled': year.disabled},on:{"click":function($event){_vm.select(year);}}},[_vm._v(_vm._s(year.number)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + } + }, + + computed: { + years: function years$1 () { + var this$1 = this; + + return years(this.year).map(function (year) { return ({ + number: year, + selected: year === this$1.year, + disabled: !year || yearIsDisabled(this$1.minDate, this$1.maxDate, year) + }); }) + } + }, + + methods: { + select: function select (year) { + if (year.disabled) { + return + } + + this.$emit('change', parseInt(year.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + if (this.$refs.yearList) { + var selectedYear = this.$refs.yearList.querySelector('.vdatetime-year-picker__item--selected'); + this.$refs.yearList.scrollTop = selectedYear ? selectedYear.offsetTop - 250 : 0; + } + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var DatetimeMonthPicker = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-month-picker"},[_c('div',{ref:"monthList",staticClass:"vdatetime-month-picker__list vdatetime-month-picker__list"},_vm._l((_vm.months),function(month){return _c('div',{staticClass:"vdatetime-month-picker__item",class:{'vdatetime-month-picker__item--selected': month.selected, 'vdatetime-month-picker__item--disabled': month.disabled},on:{"click":function($event){_vm.select(month);}}},[_vm._v(_vm._s(month.label)+" ")])}))])},staticRenderFns: [], + props: { + year: { + type: Number, + required: true + }, + month: { + type: Number, + required: true + }, + minDate: { + type: luxon.DateTime, + default: null + }, + maxDate: { + type: luxon.DateTime, + default: null + } + }, + + computed: { + months: function months$1 () { + var this$1 = this; + + return months(this.month).map(function (month, index) { return ({ + number: ++index, + label: month, + selected: index === this$1.month, + disabled: !index || monthIsDisabled(this$1.minDate, this$1.maxDate, this$1.year, index) + }); }) + } + }, + + methods: { + select: function select (month) { + if (month.disabled) { + return + } + + this.$emit('change', parseInt(month.number)); + }, + + scrollToCurrent: function scrollToCurrent () { + var selectedMonth = this.$refs.monthList.querySelector('.vdatetime-month-picker__item--selected'); + this.$refs.monthList.scrollTop = selectedMonth ? selectedMonth.offsetTop - 250 : 0; + } + }, + + mounted: function mounted () { + this.scrollToCurrent(); + }, + + updated: function updated () { + this.scrollToCurrent(); + } +}; + +var KEY_TAB = 9; +var KEY_ENTER = 13; +var KEY_ESC = 27; + +var DatetimePopup = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime-popup"},[_c('div',{staticClass:"vdatetime-popup__header"},[(_vm.title)?_c('div',{staticClass:"vdatetime-popup__title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__year",on:{"click":_vm.showYear}},[_vm._v(_vm._s(_vm.year))]):_vm._e(),_vm._v(" "),(_vm.type !== 'time')?_c('div',{staticClass:"vdatetime-popup__date",on:{"click":_vm.showMonth}},[_vm._v(_vm._s(_vm.dateFormatted))]):_vm._e()]),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__body"},[(_vm.step === 'year')?_c('datetime-year-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year},on:{"change":_vm.onChangeYear}}):_vm._e(),_vm._v(" "),(_vm.step === 'month')?_c('datetime-month-picker',{attrs:{"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"year":_vm.year,"month":_vm.month},on:{"change":_vm.onChangeMonth}}):_vm._e(),_vm._v(" "),(_vm.step === 'date')?_c('datetime-calendar',{attrs:{"year":_vm.year,"month":_vm.month,"day":_vm.day,"min-date":_vm.minDatetime,"max-date":_vm.maxDatetime,"week-start":_vm.weekStart},on:{"change":_vm.onChangeDate}}):_vm._e(),_vm._v(" "),(_vm.step === 'time')?_c('datetime-time-picker',{attrs:{"hour":_vm.hour,"minute":_vm.minute,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-time":_vm.handleMinTime(),"max-time":_vm.handleMaxTime()},on:{"change":_vm.onChangeTime}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions"},[_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--cancel",on:{"click":_vm.cancel}},[_vm._t("button-cancel__internal",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:_vm.step})],2),_vm._v(" "),_c('div',{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--confirm",on:{"click":_vm.confirm}},[_vm._t("button-confirm__internal",[_vm._v(_vm._s(_vm.phrases.ok))],{step:_vm.step})],2)])])},staticRenderFns: [], + components: { + DatetimeCalendar: DatetimeCalendar, + DatetimeTimePicker: DatetimeTimePicker, + DatetimeYearPicker: DatetimeYearPicker, + DatetimeMonthPicker: DatetimeMonthPicker + }, + + props: { + datetime: { + type: luxon.DateTime, + required: true + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + type: { + type: String, + default: 'date' + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: luxon.DateTime, + default: null + }, + maxDatetime: { + type: luxon.DateTime, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: 1 + }, + flow: { + type: Array + }, + title: { + type: String + } + }, + + data: function data () { + var flowManager = this.flow + ? createFlowManager(this.flow) + : createFlowManagerFromType(this.type); + + return { + newDatetime: this.datetime, + flowManager: flowManager, + step: flowManager.first(), + timePartsTouched: [] + } + }, + + created: function created () { + document.addEventListener('keydown', this.onKeyDown); + }, + + beforeDestroy: function beforeDestroy () { + document.removeEventListener('keydown', this.onKeyDown); + }, + + computed: { + year: function year () { + return this.newDatetime.year + }, + month: function month () { + return this.newDatetime.month + }, + day: function day () { + return this.newDatetime.day + }, + hour: function hour () { + return this.newDatetime.hour + }, + minute: function minute () { + return this.newDatetime.minute + }, + dateFormatted: function dateFormatted () { + return this.newDatetime.toLocaleString({ + month: 'long', + day: 'numeric' + }) + } + }, + + methods: { + handleMinTime: function handleMinTime () { + alert(this.minTime); + return this.minTime ? this.minTime : ( + this.minDatetime && + this.minDatetime.year === this.year && + this.minDatetime.month === this.month && + this.minDatetime.day === this.day + ) ? this.minDatetime.toFormat('HH:mm') : null + }, + handleMaxTime: function handleMaxTime () { + return this.maxTime ? this.maxTime : ( + this.maxDatetime && + this.maxDatetime.year === this.year && + this.maxDatetime.month === this.month && + this.maxDatetime.day === this.day + ) ? this.maxDatetime.toFormat('HH:mm') : null + }, + nextStep: function nextStep () { + this.step = this.flowManager.next(this.step); + this.timePartsTouched = []; + + if (this.step === 'end') { + this.$emit('confirm', this.newDatetime); + } + }, + showYear: function showYear () { + this.step = 'year'; + this.flowManager.diversion('date'); + }, + showMonth: function showMonth () { + this.step = 'month'; + this.flowManager.diversion('date'); + }, + confirm: function confirm () { + this.nextStep(); + }, + cancel: function cancel () { + this.$emit('cancel'); + }, + onChangeYear: function onChangeYear (year) { + this.newDatetime = this.newDatetime.set({ year: year }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeMonth: function onChangeMonth (month) { + this.newDatetime = this.newDatetime.set({ month: month }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeDate: function onChangeDate (year, month, day) { + this.newDatetime = this.newDatetime.set({ year: year, month: month, day: day }); + + if (this.auto) { + this.nextStep(); + } + }, + onChangeTime: function onChangeTime (ref) { + var hour = ref.hour; + var minute = ref.minute; + var suffixTouched = ref.suffixTouched; + + if (suffixTouched) { + this.timePartsTouched['suffix'] = true; + } + + if (Number.isInteger(hour)) { + this.newDatetime = this.newDatetime.set({ hour: hour }); + this.timePartsTouched['hour'] = true; + } + + if (Number.isInteger(minute)) { + this.newDatetime = this.newDatetime.set({ minute: minute }); + this.timePartsTouched['minute'] = true; + } + + var goNext = this.auto && this.timePartsTouched['hour'] && this.timePartsTouched['minute'] && ( + this.timePartsTouched['suffix'] || + !this.use12Hour + ); + + if (goNext) { + this.nextStep(); + } + }, + onKeyDown: function onKeyDown (event) { + switch (event.keyCode) { + case KEY_ESC: + case KEY_TAB: + this.cancel(); + break + + case KEY_ENTER: + this.nextStep(); + break + } + } + } +}; + +var Datetime = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vdatetime"},[_vm._t("before"),_vm._v(" "),_c('input',_vm._g(_vm._b({staticClass:"vdatetime-input",class:_vm.inputClass,style:(_vm.inputStyle),attrs:{"id":_vm.inputId,"type":"text"},domProps:{"value":_vm.inputValue},on:{"click":_vm.open,"focus":_vm.open}},'input',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.hiddenName)?_c('input',{attrs:{"type":"hidden","name":_vm.hiddenName},domProps:{"value":_vm.value},on:{"input":_vm.setValue}}):_vm._e(),_vm._v(" "),_vm._t("after"),_vm._v(" "),_c('transition-group',{attrs:{"name":"vdatetime-fade","tag":"div"}},[(_vm.isOpen && !_vm.hideBackdrop)?_c('div',{key:"overlay",staticClass:"vdatetime-overlay",on:{"click":function($event){if($event.target !== $event.currentTarget){ return null; }_vm.clickOutside($event);}}}):_vm._e(),_vm._v(" "),(_vm.isOpen)?_c('datetime-popup',{key:"popup",attrs:{"type":_vm.type,"datetime":_vm.popupDate,"phrases":_vm.phrases,"use12-hour":_vm.use12Hour,"hour-step":_vm.hourStep,"minute-step":_vm.minuteStep,"min-datetime":_vm.popupMinDatetime,"max-datetime":_vm.popupMaxDatetime,"min-time":_vm.minTime,"max-time":_vm.maxTime,"auto":_vm.auto,"week-start":_vm.weekStart,"flow":_vm.flow,"title":_vm.title},on:{"confirm":_vm.confirm,"cancel":_vm.cancel},scopedSlots:_vm._u([{key:"button-cancel__internal",fn:function(scope){return [_vm._t("button-cancel",[_vm._v(_vm._s(_vm.phrases.cancel))],{step:scope.step})]}},{key:"button-confirm__internal",fn:function(scope){return [_vm._t("button-confirm",[_vm._v(_vm._s(_vm.phrases.ok))],{step:scope.step})]}}])}):_vm._e()],1)],2)},staticRenderFns: [], + components: { + DatetimePopup: DatetimePopup + }, + + inheritAttrs: false, + + props: { + value: { + type: String + }, + valueZone: { + type: String, + default: 'UTC' + }, + inputId: { + type: String, + default: null + }, + inputClass: { + type: [Object, Array, String], + default: '' + }, + inputStyle: { + type: [Object, Array, String], + default: '' + }, + hiddenName: { + type: String + }, + zone: { + type: String, + default: 'local' + }, + format: { + type: [Object, String], + default: null + }, + type: { + type: String, + default: 'date' + }, + phrases: { + type: Object, + default: function default$1 () { + return { + cancel: 'Cancel', + ok: 'Ok' + } + } + }, + use12Hour: { + type: Boolean, + default: false + }, + hourStep: { + type: Number, + default: 1 + }, + minuteStep: { + type: Number, + default: 1 + }, + minDatetime: { + type: String, + default: null + }, + maxDatetime: { + type: String, + default: null + }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, + auto: { + type: Boolean, + default: false + }, + weekStart: { + type: Number, + default: function default$2 () { + return weekStart() + } + }, + flow: { + type: Array + }, + title: { + type: String + }, + hideBackdrop: { + type: Boolean, + default: false + }, + backdropClick: { + type: Boolean, + default: true + } + }, + + data: function data () { + return { + isOpen: false, + datetime: datetimeFromISO(this.value) + } + }, + + watch: { + value: function value (newValue) { + this.datetime = datetimeFromISO(newValue); + } + }, + + created: function created () { + this.emitInput(); + }, + + computed: { + inputValue: function inputValue () { + var format = this.format; + + if (!format) { + switch (this.type) { + case 'date': + format = luxon.DateTime.DATE_MED; + break + case 'time': + format = luxon.DateTime.TIME_24_SIMPLE; + break + case 'datetime': + case 'default': + format = luxon.DateTime.DATETIME_MED; + break + } + } + + if (typeof format === 'string') { + return this.datetime ? luxon.DateTime.fromISO(this.datetime).setZone(this.zone).toFormat(format) : '' + } else { + return this.datetime ? this.datetime.setZone(this.zone).toLocaleString(format) : '' + } + }, + popupDate: function popupDate () { + return this.datetime ? this.datetime.setZone(this.zone) : this.newPopupDatetime() + }, + popupMinDatetime: function popupMinDatetime () { + return this.minDatetime ? luxon.DateTime.fromISO(this.minDatetime).setZone(this.zone) : null + }, + popupMaxDatetime: function popupMaxDatetime () { + return this.maxDatetime ? luxon.DateTime.fromISO(this.maxDatetime).setZone(this.zone) : null + } + }, + + methods: { + emitInput: function emitInput () { + var datetime = this.datetime ? this.datetime.setZone(this.valueZone) : null; + + if (datetime && this.type === 'date') { + datetime = startOfDay(datetime); + } + + this.$emit('input', datetime ? datetime.toISO() : ''); + }, + open: function open (event) { + event.target.blur(); + + this.isOpen = true; + }, + close: function close () { + this.isOpen = false; + this.$emit('close'); + }, + confirm: function confirm (datetime) { + this.datetime = datetime.toUTC(); + this.emitInput(); + this.close(); + }, + cancel: function cancel () { + this.close(); + }, + clickOutside: function clickOutside () { + if (this.backdropClick === true) { this.cancel(); } + }, + newPopupDatetime: function newPopupDatetime () { + var datetime = luxon.DateTime.utc().setZone(this.zone).set({ seconds: 0, milliseconds: 0 }); + + if (this.popupMinDatetime && datetime < this.popupMinDatetime) { + datetime = this.popupMinDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.popupMaxDatetime && datetime > this.popupMaxDatetime) { + datetime = this.popupMaxDatetime.set({ seconds: 0, milliseconds: 0 }); + } + + if (this.minuteStep === 1) { + return datetime + } + + var roundedMinute = Math.round(datetime.minute / this.minuteStep) * this.minuteStep; + + if (roundedMinute === 60) { + return datetime.plus({ hours: 1 }).set({ minute: 0 }) + } + + return datetime.set({ minute: roundedMinute }) + }, + setValue: function setValue (event) { + this.datetime = datetimeFromISO(event.target.value); + this.emitInput(); + } + } +}; + +function plugin (Vue) { + Vue.component('datetime', Datetime); + Vue.component('datetime-popup', DatetimePopup); +} + +// Install by default if using the script tag +if (typeof window !== 'undefined' && window.Vue) { + window.Vue.use(plugin); +} + +var version = '1.0.0-beta.13'; + +exports['default'] = plugin; +exports.Datetime = Datetime; +exports.DatetimePopup = DatetimePopup; +exports.version = version; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/dist/vue-datetime.min.css b/dist/vue-datetime.min.css new file mode 100644 index 0000000..55d8dca --- /dev/null +++ b/dist/vue-datetime.min.css @@ -0,0 +1 @@ +.vdatetime-fade-enter-active,.vdatetime-fade-leave-active{transition:opacity .4s}.vdatetime-fade-enter,.vdatetime-fade-leave-to{opacity:0}.vdatetime-overlay{z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);transition:opacity .5s}.vdatetime-popup{box-sizing:border-box;z-index:1000;position:fixed;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:340px;max-width:calc(100% - 30px);box-shadow:0 1px 3px 0 rgba(0,0,0,.3);color:#444;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;line-height:1.18;background:#fff;-webkit-tap-highlight-color:transparent}.vdatetime-popup *{box-sizing:border-box}.vdatetime-popup__header{padding:18px 30px;background:#3f51b5;color:#fff;font-size:32px}.vdatetime-popup__title{margin-bottom:8px;font-size:21px;font-weight:300}.vdatetime-popup__year{font-weight:300;font-size:14px;opacity:.7;cursor:pointer;transition:opacity .3s}.vdatetime-popup__year:hover{opacity:1}.vdatetime-popup__date{line-height:1;cursor:pointer}.vdatetime-popup__actions{padding:0 20px 10px 30px;text-align:right}.vdatetime-popup__actions__button{display:inline-block;border:none;padding:10px 20px;background:0 0;font-size:16px;color:#3f51b5;cursor:pointer;transition:color .3s}.vdatetime-popup__actions__button:hover{color:#444}.vdatetime-calendar__navigation--next:hover svg path,.vdatetime-calendar__navigation--previous:hover svg path{stroke:#888}.vdatetime-calendar__navigation,.vdatetime-calendar__navigation *{box-sizing:border-box}.vdatetime-calendar__navigation{position:relative;margin:15px 0;padding:0 30px;width:100%}.vdatetime-calendar__navigation--next,.vdatetime-calendar__navigation--previous{position:absolute;top:0;padding:0 5px;width:18px;cursor:pointer}.vdatetime-calendar__navigation--next svg,.vdatetime-calendar__navigation--previous svg{width:8px;height:13px}.vdatetime-calendar__navigation--next svg path,.vdatetime-calendar__navigation--previous svg path{transition:stroke .3s}.vdatetime-calendar__navigation--previous{left:25px}.vdatetime-calendar__navigation--next{right:25px;-webkit-transform:scaleX(-1);transform:scaleX(-1)}.vdatetime-calendar__current--month{text-align:center;text-transform:capitalize}.vdatetime-calendar__month{padding:0 20px;transition:height .2s}.vdatetime-calendar__month__day,.vdatetime-calendar__month__weekday{display:inline-block;width:14.28571%;line-height:36px;text-align:center;font-size:15px;font-weight:300;cursor:pointer}.vdatetime-calendar__month__day>span,.vdatetime-calendar__month__weekday>span{display:block;width:100%;position:relative;height:0;padding:0 0 100%;overflow:hidden}.vdatetime-calendar__month__day>span>span,.vdatetime-calendar__month__weekday>span>span{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;border:0;border-radius:50%;transition:background-color .3s,color .3s}.vdatetime-calendar__month__weekday{font-weight:700}.vdatetime-calendar__month__day:hover>span>span{background:#eee}.vdatetime-calendar__month__day--selected:hover>span>span,.vdatetime-calendar__month__day--selected>span>span{color:#fff;background:#3f51b5}.vdatetime-calendar__month__day--disabled{opacity:.4;cursor:default}.vdatetime-calendar__month__day--disabled:hover>span>span{color:inherit;background:0 0}.vdatetime-time-picker__list::-webkit-scrollbar-thumb{background:#ccc}.vdatetime-time-picker__list::-webkit-scrollbar-track{background:#efefef}.vdatetime-time-picker *{box-sizing:border-box}.vdatetime-time-picker{box-sizing:border-box}.vdatetime-time-picker::after{content:'';display:table;clear:both}.vdatetime-time-picker__list{float:left;width:50%;height:305px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.vdatetime-time-picker__list::-webkit-scrollbar{width:3px}.vdatetime-time-picker__with-suffix .vdatetime-time-picker__list{width:33.3%}.vdatetime-time-picker__item{padding:10px 0;font-size:20px;text-align:center;cursor:pointer;transition:font-size .3s}.vdatetime-time-picker__item:hover{font-size:32px}.vdatetime-time-picker__item--selected{color:#3f51b5;font-size:32px}.vdatetime-time-picker__item--disabled{opacity:.4;cursor:default;font-size:20px!important}.vdatetime-year-picker__list::-webkit-scrollbar-thumb{background:#ccc}.vdatetime-year-picker__list::-webkit-scrollbar-track{background:#efefef}.vdatetime-year-picker *{box-sizing:border-box}.vdatetime-year-picker{box-sizing:border-box}.vdatetime-year-picker::after{content:'';display:table;clear:both}.vdatetime-year-picker__list{float:left;width:100%;height:305px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.vdatetime-year-picker__list::-webkit-scrollbar{width:3px}.vdatetime-year-picker__item{padding:10px 0;font-size:20px;text-align:center;cursor:pointer;transition:font-size .3s}.vdatetime-year-picker__item:hover{font-size:32px}.vdatetime-year-picker__item--selected{color:#3f51b5;font-size:32px}.vdatetime-year-picker__item--disabled{opacity:.4;cursor:default}.vdatetime-year-picker__item--disabled:hover{color:inherit;background:0 0}.vdatetime-month-picker__list::-webkit-scrollbar-thumb{background:#ccc}.vdatetime-month-picker__list::-webkit-scrollbar-track{background:#efefef}.vdatetime-month-picker *{box-sizing:border-box}.vdatetime-month-picker{box-sizing:border-box}.vdatetime-month-picker::after{content:'';display:table;clear:both}.vdatetime-month-picker__list{float:left;width:100%;height:305px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.vdatetime-month-picker__list::-webkit-scrollbar{width:3px}.vdatetime-month-picker__item{padding:10px 0;font-size:20px;text-align:center;cursor:pointer;transition:font-size .3s}.vdatetime-month-picker__item:hover{font-size:32px}.vdatetime-month-picker__item--selected{color:#3f51b5;font-size:32px}.vdatetime-month-picker__item--disabled{opacity:.4;cursor:default}.vdatetime-month-picker__item--disabled:hover{color:inherit;background:0 0} \ No newline at end of file diff --git a/dist/vue-datetime.min.js b/dist/vue-datetime.min.js new file mode 100644 index 0000000..cc78df0 --- /dev/null +++ b/dist/vue-datetime.min.js @@ -0,0 +1,7 @@ +/*! + * vue-datetime v1.0.0-beta.13 + * (c) 2021 Mario Juárez + * Released under the MIT License. + */ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("luxon")):"function"==typeof define&&define.amd?define(["exports","luxon"],e):e(t.VueDatetime=t.VueDatetime||{},t.luxon)}(this,function(t,e){"use strict";function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function n(t){var i=e.DateTime.fromISO(t).toUTC();return i.isValid?i:null}function a(t,e,i){return null!==t&&ie}function s(){return e.Info.months().map(function(t){return i(t)})}function r(t){return t<10?"0"+t:t}function o(t){return t.startOf("day")}function u(t){t.component("datetime",h),t.component("datetime-popup",c)}var m=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this.flow=t,this.endStatus=e,this.diversionNext=null};m.prototype.step=function(t){return this.flow.length>t?this.flow[t]:this.endStatus},m.prototype.first=function(){return this.step(0)},m.prototype.next=function(t){if(this.diversionNext){var e=this.diversionNext;return this.diversionNext=null,e}return this.step(this.flow.indexOf(t)+1)},m.prototype.diversion=function(t){this.diversionNext=t};var c={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"vdatetime-popup"},[e("div",{staticClass:"vdatetime-popup__header"},[this.title?e("div",{staticClass:"vdatetime-popup__title"},[this._v(this._s(this.title))]):this._e(),this._v(" "),"time"!==this.type?e("div",{staticClass:"vdatetime-popup__year",on:{click:this.showYear}},[this._v(this._s(this.year))]):this._e(),this._v(" "),"time"!==this.type?e("div",{staticClass:"vdatetime-popup__date",on:{click:this.showMonth}},[this._v(this._s(this.dateFormatted))]):this._e()]),this._v(" "),e("div",{staticClass:"vdatetime-popup__body"},["year"===this.step?e("datetime-year-picker",{attrs:{"min-date":this.minDatetime,"max-date":this.maxDatetime,year:this.year},on:{change:this.onChangeYear}}):this._e(),this._v(" "),"month"===this.step?e("datetime-month-picker",{attrs:{"min-date":this.minDatetime,"max-date":this.maxDatetime,year:this.year,month:this.month},on:{change:this.onChangeMonth}}):this._e(),this._v(" "),"date"===this.step?e("datetime-calendar",{attrs:{year:this.year,month:this.month,day:this.day,"min-date":this.minDatetime,"max-date":this.maxDatetime,"week-start":this.weekStart},on:{change:this.onChangeDate}}):this._e(),this._v(" "),"time"===this.step?e("datetime-time-picker",{attrs:{hour:this.hour,minute:this.minute,"use12-hour":this.use12Hour,"hour-step":this.hourStep,"minute-step":this.minuteStep,"min-time":this.handleMinTime(),"max-time":this.handleMaxTime()},on:{change:this.onChangeTime}}):this._e()],1),this._v(" "),e("div",{staticClass:"vdatetime-popup__actions"},[e("div",{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--cancel",on:{click:this.cancel}},[this._t("button-cancel__internal",[this._v(this._s(this.phrases.cancel))],{step:this.step})],2),this._v(" "),e("div",{staticClass:"vdatetime-popup__actions__button vdatetime-popup__actions__button--confirm",on:{click:this.confirm}},[this._t("button-confirm__internal",[this._v(this._s(this.phrases.ok))],{step:this.step})],2)])])},staticRenderFns:[],components:{DatetimeCalendar:{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"vdatetime-calendar"},[i("div",{staticClass:"vdatetime-calendar__navigation"},[i("div",{staticClass:"vdatetime-calendar__navigation--previous",on:{click:t.previousMonth}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 61.3 102.8"}},[i("path",{attrs:{fill:"none",stroke:"#444","stroke-width":"14","stroke-miterlimit":"10",d:"M56.3 97.8L9.9 51.4 56.3 5"}})])]),t._v(" "),i("div",{staticClass:"vdatetime-calendar__current--month"},[t._v(t._s(t.monthName)+" "+t._s(t.newYear))]),t._v(" "),i("div",{staticClass:"vdatetime-calendar__navigation--next",on:{click:t.nextMonth}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 61.3 102.8"}},[i("path",{attrs:{fill:"none",stroke:"#444","stroke-width":"14","stroke-miterlimit":"10",d:"M56.3 97.8L9.9 51.4 56.3 5"}})])])]),t._v(" "),i("div",{staticClass:"vdatetime-calendar__month"},[t._l(t.weekdays,function(e){return i("div",{staticClass:"vdatetime-calendar__month__weekday"},[t._v(t._s(e))])}),t._v(" "),t._l(t.days,function(e){return i("div",{staticClass:"vdatetime-calendar__month__day",class:{"vdatetime-calendar__month__day--selected":e.selected,"vdatetime-calendar__month__day--disabled":e.disabled},on:{click:function(i){t.selectDay(e)}}},[i("span",[i("span",[t._v(t._s(e.number))])])])})],2)])},staticRenderFns:[],props:{year:{type:Number,required:!0},month:{type:Number,required:!0},day:{type:Number,default:null},disabled:{type:Array},minDate:{type:e.DateTime,default:null},maxDate:{type:e.DateTime,default:null},weekStart:{type:Number,default:1}},data:function(){return{newDate:e.DateTime.fromObject({year:this.year,month:this.month,zone:"UTC"}),weekdays:function(t){--t<0&&(t=6);var n=e.Info.weekdays("short").map(function(t){return i(t)});return n=n.concat(n.splice(0,t))}(this.weekStart),months:s()}},computed:{newYear:function(){return this.newDate.year},newMonth:function(){return this.newDate.month},monthName:function(){return this.months[this.newMonth-1]},days:function(){var t=this;return function(t,i,n){var a=e.DateTime.local(t,i,1),s=a.weekday-n;s<0&&(s+=7);var r=(n-a.weekday-a.daysInMonth)%7;return r<0&&(r+=7),Array.apply(null,Array(a.daysInMonth+s+r)).map(function(t,e){return e+1<=s||e>=s+a.daysInMonth?null:e+1-s})}(this.newYear,this.newMonth,this.weekStart).map(function(i){return{number:i,selected:i&&t.year===t.newYear&&t.month===t.newMonth&&t.day===i,disabled:!i||function(t,i,n,a,s){var r=e.DateTime.fromObject({year:n,month:a,day:s,zone:"UTC"});return t=t?o(t.setZone("UTC",{keepLocalTime:!0})):null,i=i?o(i.setZone("UTC",{keepLocalTime:!0})):null,t&&ri}(t.minDate,t.maxDate,t.newYear,t.newMonth,i)}})}},methods:{selectDay:function(t){t.disabled||this.$emit("change",this.newYear,this.newMonth,t.number)},previousMonth:function(){this.newDate=this.newDate.minus({months:1})},nextMonth:function(){this.newDate=this.newDate.plus({months:1})}}},DatetimeTimePicker:{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:{"vdatetime-time-picker":!0,"vdatetime-time-picker__with-suffix":t.use12Hour}},[i("div",{ref:"hourList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--hours"},t._l(t.hours,function(e){return i("div",{staticClass:"vdatetime-time-picker__item",class:{"vdatetime-time-picker__item--selected":e.selected,"vdatetime-time-picker__item--disabled":e.disabled},on:{click:function(i){t.selectHour(e)}}},[t._v(t._s(t.formatHour(e.number)))])})),t._v(" "),i("div",{ref:"minuteList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--minutes"},t._l(t.minutes,function(e){return i("div",{staticClass:"vdatetime-time-picker__item",class:{"vdatetime-time-picker__item--selected":e.selected,"vdatetime-time-picker__item--disabled":e.disabled},on:{click:function(i){t.selectMinute(e)}}},[t._v(t._s(e.number))])})),t._v(" "),t.use12Hour?i("div",{ref:"suffixList",staticClass:"vdatetime-time-picker__list vdatetime-time-picker__list--suffix"},[i("div",{staticClass:"vdatetime-time-picker__item",class:{"vdatetime-time-picker__item--selected":t.hour<12},on:{click:function(e){t.selectSuffix("am")}}},[t._v("am")]),t._v(" "),i("div",{staticClass:"vdatetime-time-picker__item",class:{"vdatetime-time-picker__item--selected":t.hour>=12},on:{click:function(e){t.selectSuffix("pm")}}},[t._v("pm")])]):t._e()])},staticRenderFns:[],props:{hour:{type:Number,required:!0},minute:{type:Number,required:!0},use12Hour:{type:Boolean,default:!1},hourStep:{type:Number,default:1},minuteStep:{type:Number,default:1},minTime:{type:String,default:null},maxTime:{type:String,default:null}},computed:{hours:function(){var t=this;return function(t){return Array.apply(null,Array(Math.ceil(24/t))).map(function(e,i){return i*t})}(this.hourStep).filter(function(e){return!t.use12Hour||(t.hour<12?e<12:e>=12)}).map(function(e){return{number:r(e),selected:e===t.hour,disabled:a(t.minHour,t.maxHour,e)}})},minutes:function(){var t=this;return function(t){return Array.apply(null,Array(Math.ceil(60/t))).map(function(e,i){return i*t})}(this.minuteStep).map(function(e){return{number:r(e),selected:e===t.minute,disabled:a(t.minMinute,t.maxMinute,e)}})},minHour:function(){return this.minTime?parseInt(this.minTime.split(":")[0]):null},minMinute:function(){return this.minTime&&this.minHour===this.hour?parseInt(this.minTime.split(":")[1]):null},maxHour:function(){return this.maxTime?parseInt(this.maxTime.split(":")[0]):null},maxMinute:function(){return this.maxTime&&this.maxHour===this.hour?parseInt(this.maxTime.split(":")[1]):null}},methods:{selectHour:function(t){t.disabled||this.$emit("change",{hour:parseInt(t.number)})},selectMinute:function(t){t.disabled||this.$emit("change",{minute:parseInt(t.number)})},selectSuffix:function(t){"am"===t&&this.hour>=12&&this.$emit("change",{hour:parseInt(this.hour-12),suffixTouched:!0}),"pm"===t&&this.hour<12&&this.$emit("change",{hour:parseInt(this.hour+12),suffixTouched:!0})},formatHour:function(t){var e=Number(t);return this.use12Hour?0===e?12:e>12?e-12:e:t}},mounted:function(){var t=this.$refs.hourList.querySelector(".vdatetime-time-picker__item--selected"),e=this.$refs.minuteList.querySelector(".vdatetime-time-picker__item--selected");this.$refs.hourList.scrollTop=t?t.offsetTop-250:0,this.$refs.minuteList.scrollTop=e?e.offsetTop-250:0}},DatetimeYearPicker:{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"vdatetime-year-picker"},[i("div",{ref:"yearList",staticClass:"vdatetime-year-picker__list vdatetime-year-picker__list"},t._l(t.years,function(e){return i("div",{staticClass:"vdatetime-year-picker__item",class:{"vdatetime-year-picker__item--selected":e.selected,"vdatetime-year-picker__item--disabled":e.disabled},on:{click:function(i){t.select(e)}}},[t._v(t._s(e.number)+" ")])}))])},staticRenderFns:[],props:{year:{type:Number,required:!0},minDate:{type:e.DateTime,default:null},maxDate:{type:e.DateTime,default:null}},computed:{years:function(){var t=this;return function(t){return Array.apply(null,Array(201)).map(function(e,i){return t-100+i})}(this.year).map(function(e){return{number:e,selected:e===t.year,disabled:!e||function(t,e,i){var n=t?t.year:null,a=e?e.year:null;return n&&ia}(t.minDate,t.maxDate,e)}})}},methods:{select:function(t){t.disabled||this.$emit("change",parseInt(t.number))},scrollToCurrent:function(){if(this.$refs.yearList){var t=this.$refs.yearList.querySelector(".vdatetime-year-picker__item--selected");this.$refs.yearList.scrollTop=t?t.offsetTop-250:0}}},mounted:function(){this.scrollToCurrent()},updated:function(){this.scrollToCurrent()}},DatetimeMonthPicker:{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"vdatetime-month-picker"},[i("div",{ref:"monthList",staticClass:"vdatetime-month-picker__list vdatetime-month-picker__list"},t._l(t.months,function(e){return i("div",{staticClass:"vdatetime-month-picker__item",class:{"vdatetime-month-picker__item--selected":e.selected,"vdatetime-month-picker__item--disabled":e.disabled},on:{click:function(i){t.select(e)}}},[t._v(t._s(e.label)+" ")])}))])},staticRenderFns:[],props:{year:{type:Number,required:!0},month:{type:Number,required:!0},minDate:{type:e.DateTime,default:null},maxDate:{type:e.DateTime,default:null}},computed:{months:function(){var t=this;return s(this.month).map(function(i,n){return{number:++n,label:i,selected:n===t.month,disabled:!n||function(t,i,n,a){return t&&t>e.DateTime.utc(n,a,e.DateTime.utc(n,a).daysInMonth)||i&&ithis.popupMaxDatetime&&(t=this.popupMaxDatetime.set({seconds:0,milliseconds:0})),1===this.minuteStep)return t;var i=Math.round(t.minute/this.minuteStep)*this.minuteStep;return 60===i?t.plus({hours:1}).set({minute:0}):t.set({minute:i})},setValue:function(t){this.datetime=n(t.target.value),this.emitInput()}}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(u);t.default=u,t.Datetime=h,t.DatetimePopup=c,t.version="1.0.0-beta.13",Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/src/Datetime.vue b/src/Datetime.vue index a8d9e99..4b57f49 100644 --- a/src/Datetime.vue +++ b/src/Datetime.vue @@ -26,6 +26,8 @@ :minute-step="minuteStep" :min-datetime="popupMinDatetime" :max-datetime="popupMaxDatetime" + :min-time="minTime" + :max-time="maxTime" @confirm="confirm" @cancel="cancel" :auto="auto" @@ -119,6 +121,14 @@ export default { type: String, default: null }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, auto: { type: Boolean, default: false diff --git a/src/DatetimePopup.vue b/src/DatetimePopup.vue index 5f62913..2efa9ad 100644 --- a/src/DatetimePopup.vue +++ b/src/DatetimePopup.vue @@ -37,8 +37,8 @@ :use12-hour="use12Hour" :hour-step="hourStep" :minute-step="minuteStep" - :min-time="minTime" - :max-time="maxTime"> + :min-time="handleMinTime()" + :max-time="handleMaxTime()">
@@ -109,6 +109,14 @@ export default { type: DateTime, default: null }, + minTime: { + type: String, + default: null + }, + maxTime: { + type: String, + default: null + }, auto: { type: Boolean, default: false @@ -167,26 +175,26 @@ export default { month: 'long', day: 'numeric' }) - }, - minTime () { - return ( + } + }, + + methods: { + handleMinTime () { + return this.minTime ? this.minTime : ( this.minDatetime && this.minDatetime.year === this.year && this.minDatetime.month === this.month && this.minDatetime.day === this.day ) ? this.minDatetime.toFormat('HH:mm') : null }, - maxTime () { - return ( + handleMaxTime () { + return this.maxTime ? this.maxTime : ( this.maxDatetime && this.maxDatetime.year === this.year && this.maxDatetime.month === this.month && this.maxDatetime.day === this.day ) ? this.maxDatetime.toFormat('HH:mm') : null - } - }, - - methods: { + }, nextStep () { this.step = this.flowManager.next(this.step) this.timePartsTouched = [] diff --git a/test/dist/vuePluginTemplateDeps.dll.js b/test/dist/vuePluginTemplateDeps.dll.js new file mode 100644 index 0000000..a47056e --- /dev/null +++ b/test/dist/vuePluginTemplateDeps.dll.js @@ -0,0 +1,52013 @@ +var vuePluginTemplateDeps = +/** ****/ (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 +/** ****/ +/** ****/ // identity function for calling harmony imports with the correct context + /** ****/ __webpack_require__.i = function (value) { return value } +/** ****/ +/** ****/ // define getter function for harmony exports + /** ****/ __webpack_require__.d = function (exports, name, getter) { + /** ****/ if (!__webpack_require__.o(exports, name)) { + /** ****/ Object.defineProperty(exports, name, { + /** ****/ configurable: false, + /** ****/ enumerable: true, + /** ****/ get: getter + /** ****/ }) + /** ****/ } + /** ****/ } +/** ****/ +/** ****/ // 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 = 464) +/** ****/ })([ +/* 0 */ + /** */ function (module, exports, __webpack_require__) { + var global = __webpack_require__(2) + var core = __webpack_require__(15) + var ctx = __webpack_require__(20) + var hide = __webpack_require__(22) + var PROTOTYPE = 'prototype' + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F + var IS_GLOBAL = type & $export.G + var IS_STATIC = type & $export.S + var IS_PROTO = type & $export.P + var IS_BIND = type & $export.B + var IS_WRAP = type & $export.W + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + var expProto = exports[PROTOTYPE] + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + var key, own, out + if (IS_GLOBAL) source = name + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined + if (own && key in exports) continue + // export native or passed + out = own ? target[key] : source[key] + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] !== 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C() + case 1: return new C(a) + case 2: return new C(a, b) + } return new C(a, b, c) + } return C.apply(this, arguments) + } + F[PROTOTYPE] = C[PROTOTYPE] + return F + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out === 'function' ? ctx(Function.call, out) : out + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out) + } + } + } +// type bitmap + $export.F = 1 // forced + $export.G = 2 // global + $export.S = 4 // static + $export.P = 8 // proto + $export.B = 16 // bind + $export.W = 32 // wrap + $export.U = 64 // safe + $export.R = 128 // real proto method for `library` + module.exports = $export + /** */ }, +/* 1 */ + /** */ function (module, exports, __webpack_require__) { + var isObject = __webpack_require__(4) + module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!') + return it + } + /** */ }, +/* 2 */ + /** */ function (module, exports) { +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window !== 'undefined' && window.Math == Math + ? window : typeof self !== 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')() + if (typeof __g === 'number') __g = global // eslint-disable-line no-undef + /** */ }, +/* 3 */ + /** */ function (module, exports) { + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits (ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + } else { + // old school shim for old browsers + module.exports = function inherits (ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } + /** */ }, +/* 4 */ + /** */ function (module, exports) { + module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function' + } + /** */ }, +/* 5 */ + /** */ function (module, exports) { + module.exports = function (exec) { + try { + return !!exec() + } catch (e) { + return true + } + } + /** */ }, +/* 6 */ + /** */ 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 || Function('return this')() || (1, eval)('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 + /** */ }, +/* 7 */ + /** */ 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 } + /** */ }, +/* 8 */ + /** */ function (module, exports, __webpack_require__) { +// 7.1.15 ToLength + var toInteger = __webpack_require__(29) + var min = Math.min + module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0 // pow(2, 53) - 1 == 9007199254740991 + } + /** */ }, +/* 9 */ + /** */ function (module, exports, __webpack_require__) { + var store = __webpack_require__(73)('wks') + var uid = __webpack_require__(52) + var Symbol = __webpack_require__(2).Symbol + var USE_SYMBOL = typeof Symbol === 'function' + + var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)) + } + + $exports.store = store + /** */ }, +/* 10 */ + /** */ function (module, exports, __webpack_require__) { + /* WEBPACK VAR INJECTION */(function (process) { /** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + exports = module.exports = __webpack_require__(418) + exports.log = log + exports.formatArgs = formatArgs + exports.save = save + exports.load = load + exports.useColors = useColors + exports.storage = typeof chrome !== 'undefined' && + typeof chrome.storage !== 'undefined' + ? chrome.storage.local + : localstorage() + +/** + * Colors. + */ + + exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' + ] + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + function useColors () { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)) + } + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + exports.formatters.j = function (v) { + try { + return JSON.stringify(v) + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message + } + } + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs (args) { + var useColors = this.useColors + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff) + + if (!useColors) return + + var c = 'color: ' + this.color + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0 + var lastC = 0 + args[0].replace(/%[a-zA-Z%]/g, function (match) { + if (match === '%%') return + index++ + if (match === '%c') { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index + } + }) + + args.splice(lastC, 0, c) + } + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + function log () { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return typeof console === 'object' && + console.log && + Function.prototype.apply.call(console.log, console, arguments) + } + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + function save (namespaces) { + try { + if (namespaces == null) { + exports.storage.removeItem('debug') + } else { + exports.storage.debug = namespaces + } + } catch (e) {} + } + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load () { + var r + try { + r = exports.storage.debug + } catch (e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG + } + + return r + } + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + exports.enable(load()) + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage () { + try { + return window.localStorage + } catch (e) {} + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7))) + /** */ }, +/* 11 */ + /** */ function (module, exports, __webpack_require__) { + var anObject = __webpack_require__(1) + var IE8_DOM_DEFINE = __webpack_require__(130) + var toPrimitive = __webpack_require__(40) + var dP = Object.defineProperty + + exports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty (O, P, Attributes) { + anObject(O) + P = toPrimitive(P, true) + anObject(Attributes) + if (IE8_DOM_DEFINE) { + try { + return dP(O, P, Attributes) + } catch (e) { /* empty */ } + } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!') + if ('value' in Attributes) O[P] = Attributes.value + return O + } + /** */ }, +/* 12 */ + /** */ function (module, exports, __webpack_require__) { +// Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(5)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7 } }).a != 7 + }) + /** */ }, +/* 13 */ + /** */ function (module, exports, __webpack_require__) { +// 7.1.13 ToObject(argument) + var defined = __webpack_require__(30) + module.exports = function (it) { + return Object(defined(it)) + } + /** */ }, +/* 14 */ + /** */ function (module, exports) { + module.exports = function (it) { + if (typeof it !== 'function') throw TypeError(it + ' is not a function!') + return it + } + /** */ }, +/* 15 */ + /** */ function (module, exports) { + var core = module.exports = { version: '2.5.1' } + if (typeof __e === 'number') __e = core // eslint-disable-line no-undef + /** */ }, +/* 16 */ + /** */ function (module, exports, __webpack_require__) { +// to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(56) + var defined = __webpack_require__(30) + module.exports = function (it) { + return IObject(defined(it)) + } + /** */ }, +/* 17 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var inherits = __webpack_require__(3), + EventTarget = __webpack_require__(157) + + function EventEmitter () { + EventTarget.call(this) + } + + inherits(EventEmitter, EventTarget) + + EventEmitter.prototype.removeAllListeners = function (type) { + if (type) { + delete this._listeners[type] + } else { + this._listeners = {} + } + } + + EventEmitter.prototype.once = function (type, listener) { + var self = this, + fired = false + + function g () { + self.removeListener(type, g) + + if (!fired) { + fired = true + listener.apply(this, arguments) + } + } + + this.on(type, g) + } + + EventEmitter.prototype.emit = function () { + var type = arguments[0] + var listeners = this._listeners[type] + if (!listeners) { + return + } + // equivalent of Array.prototype.slice.call(arguments, 1); + var l = arguments.length + var args = new Array(l - 1) + for (var ai = 1; ai < l; ai++) { + args[ai - 1] = arguments[ai] + } + for (var i = 0; i < listeners.length; i++) { + listeners[i].apply(this, args) + } + } + + EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener + EventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener + + module.exports.EventEmitter = EventEmitter + /** */ }, +/* 18 */ + /** */ function (module, exports, __webpack_require__) { +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + var has = __webpack_require__(21) + var toObject = __webpack_require__(13) + var IE_PROTO = __webpack_require__(98)('IE_PROTO') + var ObjectProto = Object.prototype + + module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O) + if (has(O, IE_PROTO)) return O[IE_PROTO] + if (typeof O.constructor === 'function' && O instanceof O.constructor) { + return O.constructor.prototype + } return O instanceof Object ? ObjectProto : null + } + /** */ }, +/* 19 */ + /** */ function (module, exports, __webpack_require__) { + var $export = __webpack_require__(0) + var fails = __webpack_require__(5) + var defined = __webpack_require__(30) + var quot = /"/g +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) + var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)) + var p1 = '<' + tag + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"' + return p1 + '>' + S + '' + } + module.exports = function (NAME, exec) { + var O = {} + O[NAME] = exec(createHTML) + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"') + return test !== test.toLowerCase() || test.split('"').length > 3 + }), 'String', O) + } + /** */ }, +/* 20 */ + /** */ function (module, exports, __webpack_require__) { +// optional / simple context binding + var aFunction = __webpack_require__(14) + module.exports = function (fn, that, length) { + aFunction(fn) + if (that === undefined) return fn + switch (length) { + case 1: return function (a) { + return fn.call(that, a) + } + case 2: return function (a, b) { + return fn.call(that, a, b) + } + case 3: return function (a, b, c) { + return fn.call(that, a, b, c) + } + } + return function (/* ...args */) { + return fn.apply(that, arguments) + } + } + /** */ }, +/* 21 */ + /** */ function (module, exports) { + var hasOwnProperty = {}.hasOwnProperty + module.exports = function (it, key) { + return hasOwnProperty.call(it, key) + } + /** */ }, +/* 22 */ + /** */ function (module, exports, __webpack_require__) { + var dP = __webpack_require__(11) + var createDesc = __webpack_require__(39) + module.exports = __webpack_require__(12) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)) + } : function (object, key, value) { + object[key] = value + return object + } + /** */ }, +/* 23 */ + /** */ function (module, exports, __webpack_require__) { + var pIE = __webpack_require__(58) + var createDesc = __webpack_require__(39) + var toIObject = __webpack_require__(16) + var toPrimitive = __webpack_require__(40) + var has = __webpack_require__(21) + var IE8_DOM_DEFINE = __webpack_require__(130) + var gOPD = Object.getOwnPropertyDescriptor + + exports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor (O, P) { + O = toIObject(O) + P = toPrimitive(P, true) + if (IE8_DOM_DEFINE) { + try { + return gOPD(O, P) + } catch (e) { /* empty */ } + } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]) + } + /** */ }, +/* 24 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (process) { + var URL = __webpack_require__(171) + + var debug = function () {} + if (process.env.NODE_ENV !== 'production') { + debug = __webpack_require__(10)('sockjs-client:utils:url') + } + + module.exports = { + getOrigin: function (url) { + if (!url) { + return null + } + + var p = new URL(url) + if (p.protocol === 'file:') { + return null + } + + var port = p.port + if (!port) { + port = (p.protocol === 'https:') ? '443' : '80' + } + + return p.protocol + '//' + p.hostname + ':' + port + }, + + isOriginEqual: function (a, b) { + var res = this.getOrigin(a) === this.getOrigin(b) + debug('same', a, b, res) + return res + }, + + isSchemeEqual: function (a, b) { + return (a.split(':')[0] === b.split(':')[0]) + }, + + addPath: function (url, path) { + var qs = url.split('?') + return qs[0] + path + (qs[1] ? '?' + qs[1] : '') + }, + + addQuery: function (url, q) { + return url + (url.indexOf('?') === -1 ? ('?' + q) : ('&' + q)) + } + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7))) + /** */ }, +/* 25 */ + /** */ 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__(20) + var IObject = __webpack_require__(56) + var toObject = __webpack_require__(13) + var toLength = __webpack_require__(8) + var asc = __webpack_require__(80) + 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 + } + } + /** */ }, +/* 26 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var fails = __webpack_require__(5) + + module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null) + }) + } + /** */ }, +/* 27 */ + /** */ function (module, exports) { + var toString = {}.toString + + module.exports = function (it) { + return toString.call(it).slice(8, -1) + } + /** */ }, +/* 28 */ + /** */ function (module, exports, __webpack_require__) { +// most Object methods by ES6 should accept primitives + var $export = __webpack_require__(0) + var core = __webpack_require__(15) + var fails = __webpack_require__(5) + module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY] + var exp = {} + exp[KEY] = exec(fn) + $export($export.S + $export.F * fails(function () { fn(1) }), 'Object', exp) + } + /** */ }, +/* 29 */ + /** */ function (module, exports) { +// 7.1.4 ToInteger + var ceil = Math.ceil + var floor = Math.floor + module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it) + } + /** */ }, +/* 30 */ + /** */ 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 + } + /** */ }, +/* 31 */ + /** */ function (module, exports, __webpack_require__) { + var Map = __webpack_require__(153) + var $export = __webpack_require__(0) + var shared = __webpack_require__(73)('metadata') + var store = shared.store || (shared.store = new (__webpack_require__(155))()) + + var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target) + if (!targetMetadata) { + if (!create) return undefined + store.set(target, targetMetadata = new Map()) + } + var keyMetadata = targetMetadata.get(targetKey) + if (!keyMetadata) { + if (!create) return undefined + targetMetadata.set(targetKey, keyMetadata = new Map()) + } return keyMetadata + } + var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false) + return metadataMap === undefined ? false : metadataMap.has(MetadataKey) + } + var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false) + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey) + } + var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue) + } + var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + var keys = [] + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key) }) + return keys + } + var toMetaKey = function (it) { + return it === undefined || typeof it === 'symbol' ? it : String(it) + } + var exp = function (O) { + $export($export.S, 'Reflect', O) + } + + module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp + } + /** */ }, +/* 32 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + if (__webpack_require__(12)) { + var LIBRARY = __webpack_require__(46) + var global = __webpack_require__(2) + var fails = __webpack_require__(5) + var $export = __webpack_require__(0) + var $typed = __webpack_require__(75) + var $buffer = __webpack_require__(104) + var ctx = __webpack_require__(20) + var anInstance = __webpack_require__(43) + var propertyDesc = __webpack_require__(39) + var hide = __webpack_require__(22) + var redefineAll = __webpack_require__(47) + var toInteger = __webpack_require__(29) + var toLength = __webpack_require__(8) + var toIndex = __webpack_require__(150) + var toAbsoluteIndex = __webpack_require__(49) + var toPrimitive = __webpack_require__(40) + var has = __webpack_require__(21) + var classof = __webpack_require__(44) + var isObject = __webpack_require__(4) + var toObject = __webpack_require__(13) + var isArrayIter = __webpack_require__(87) + var create = __webpack_require__(37) + var getPrototypeOf = __webpack_require__(18) + var gOPN = __webpack_require__(57).f + var getIterFn = __webpack_require__(60) + var uid = __webpack_require__(52) + var wks = __webpack_require__(9) + var createArrayMethod = __webpack_require__(25) + var createArrayIncludes = __webpack_require__(64) + var speciesConstructor = __webpack_require__(74) + var ArrayIterators = __webpack_require__(106) + var Iterators = __webpack_require__(45) + var $iterDetect = __webpack_require__(88) + var setSpecies = __webpack_require__(48) + var arrayFill = __webpack_require__(79) + var arrayCopyWithin = __webpack_require__(121) + var $DP = __webpack_require__(11) + var $GOPD = __webpack_require__(23) + var dP = $DP.f + var gOPD = $GOPD.f + var RangeError = global.RangeError + var TypeError = global.TypeError + var Uint8Array = global.Uint8Array + var ARRAY_BUFFER = 'ArrayBuffer' + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + var PROTOTYPE = 'prototype' + var ArrayProto = Array[PROTOTYPE] + var $ArrayBuffer = $buffer.ArrayBuffer + var $DataView = $buffer.DataView + var arrayForEach = createArrayMethod(0) + var arrayFilter = createArrayMethod(2) + var arraySome = createArrayMethod(3) + var arrayEvery = createArrayMethod(4) + var arrayFind = createArrayMethod(5) + var arrayFindIndex = createArrayMethod(6) + var arrayIncludes = createArrayIncludes(true) + var arrayIndexOf = createArrayIncludes(false) + var arrayValues = ArrayIterators.values + var arrayKeys = ArrayIterators.keys + var arrayEntries = ArrayIterators.entries + var arrayLastIndexOf = ArrayProto.lastIndexOf + var arrayReduce = ArrayProto.reduce + var arrayReduceRight = ArrayProto.reduceRight + var arrayJoin = ArrayProto.join + var arraySort = ArrayProto.sort + var arraySlice = ArrayProto.slice + var arrayToString = ArrayProto.toString + var arrayToLocaleString = ArrayProto.toLocaleString + var ITERATOR = wks('iterator') + var TAG = wks('toStringTag') + var TYPED_CONSTRUCTOR = uid('typed_constructor') + var DEF_CONSTRUCTOR = uid('def_constructor') + var ALL_CONSTRUCTORS = $typed.CONSTR + var TYPED_ARRAY = $typed.TYPED + var VIEW = $typed.VIEW + var WRONG_LENGTH = 'Wrong length!' + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length) + }) + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1 + }) + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}) + }) + + var toOffset = function (it, BYTES) { + var offset = toInteger(it) + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!') + return offset + } + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it + throw TypeError(it + ' is not a typed array!') + } + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!') + } return new C(length) + } + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list) + } + + var fromList = function (C, list) { + var index = 0 + var length = list.length + var result = allocate(C, length) + while (length > index) result[index] = list[index++] + return result + } + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal] } }) + } + + var $from = function from (source /* , mapfn, thisArg */) { + var O = toObject(source) + var aLen = arguments.length + var mapfn = aLen > 1 ? arguments[1] : undefined + var mapping = mapfn !== undefined + var iterFn = getIterFn(O) + var i, length, values, result, step, iterator + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value) + } O = values + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2) + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i] + } + return result + } + + var $of = function of (/* ...items */) { + var index = 0 + var length = arguments.length + var result = allocate(this, length) + while (length > index) result[index] = arguments[index++] + return result + } + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)) }) + + var $toLocaleString = function toLocaleString () { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments) + } + + var proto = { + copyWithin: function copyWithin (target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined) + }, + every: function every (callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) + }, + fill: function fill (value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments) + }, + filter: function filter (callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)) + }, + find: function find (predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined) + }, + findIndex: function findIndex (predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined) + }, + forEach: function forEach (callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) + }, + indexOf: function indexOf (searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined) + }, + includes: function includes (searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined) + }, + join: function join (separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments) + }, + lastIndexOf: function lastIndexOf (searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments) + }, + map: function map (mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined) + }, + reduce: function reduce (callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments) + }, + reduceRight: function reduceRight (callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments) + }, + reverse: function reverse () { + var that = this + var length = validate(that).length + var middle = Math.floor(length / 2) + var index = 0 + var value + while (index < middle) { + value = that[index] + that[index++] = that[--length] + that[length] = value + } return that + }, + some: function some (callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) + }, + sort: function sort (comparefn) { + return arraySort.call(validate(this), comparefn) + }, + subarray: function subarray (begin, end) { + var O = validate(this) + var length = O.length + var $begin = toAbsoluteIndex(begin, length) + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ) + } + } + + var $slice = function slice (start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)) + } + + var $set = function set (arrayLike /* , offset */) { + validate(this) + var offset = toOffset(arguments[1], 1) + var length = this.length + var src = toObject(arrayLike) + var len = toLength(src.length) + var index = 0 + if (len + offset > length) throw RangeError(WRONG_LENGTH) + while (index < len) this[offset + index] = src[index++] + } + + var $iterators = { + entries: function entries () { + return arrayEntries.call(validate(this)) + }, + keys: function keys () { + return arrayKeys.call(validate(this)) + }, + values: function values () { + return arrayValues.call(validate(this)) + } + } + + var isTAIndex = function (target, key) { + return isObject(target) && + target[TYPED_ARRAY] && + typeof key !== 'symbol' && + key in target && + String(+key) == String(key) + } + var $getDesc = function getOwnPropertyDescriptor (target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key) + } + var $setDesc = function defineProperty (target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) && + isObject(desc) && + has(desc, 'value') && + !has(desc, 'get') && + !has(desc, 'set') && + // TODO: add validation descriptor w/o calling accessors + !desc.configurable && + (!has(desc, 'writable') || desc.writable) && + (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value + return target + } return dP(target, key, desc) + } + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc + $DP.f = $setDesc + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }) + + if (fails(function () { arrayToString.call({}) })) { + arrayToString = arrayToLocaleString = function toString () { + return arrayJoin.call(this) + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto) + redefineAll($TypedArrayPrototype$, $iterators) + hide($TypedArrayPrototype$, ITERATOR, $iterators.values) + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }) + addGetter($TypedArrayPrototype$, 'buffer', 'b') + addGetter($TypedArrayPrototype$, 'byteOffset', 'o') + addGetter($TypedArrayPrototype$, 'byteLength', 'l') + addGetter($TypedArrayPrototype$, 'length', 'e') + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY] } + }) + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + var GETTER = 'get' + KEY + var SETTER = 'set' + KEY + var TypedArray = global[NAME] + var Base = TypedArray || {} + var TAC = TypedArray && getPrototypeOf(TypedArray) + var FORCED = !TypedArray || !$typed.ABV + var O = {} + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE] + var getter = function (that, index) { + var data = that._d + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN) + } + var setter = function (that, index, value) { + var data = that._d + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN) + } + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index) + }, + set: function (value) { + return setter(this, index, value) + }, + enumerable: true + }) + } + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d') + var index = 0 + var offset = 0 + var buffer, byteLength, length, klass + if (!isObject(data)) { + length = toIndex(data) + byteLength = length * BYTES + buffer = new $ArrayBuffer(byteLength) + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data + offset = toOffset($offset, BYTES) + var $len = data.byteLength + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH) + byteLength = $len - offset + if (byteLength < 0) throw RangeError(WRONG_LENGTH) + } else { + byteLength = toLength($length) * BYTES + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH) + } + length = byteLength / BYTES + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data) + } else { + return $from.call(TypedArray, data) + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }) + while (index < length) addElement(that, index++) + }) + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$) + hide(TypedArrayPrototype, 'constructor', TypedArray) + } else if (!fails(function () { + TypedArray(1) + }) || !fails(function () { + new TypedArray(-1) // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray() // eslint-disable-line no-new + new TypedArray(null) // eslint-disable-line no-new + new TypedArray(1.5) // eslint-disable-line no-new + new TypedArray(iter) // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME) + var klass + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)) + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data) + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data) + return $from.call(TypedArray, data) + }) + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]) + }) + TypedArray[PROTOTYPE] = TypedArrayPrototype + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + var CORRECT_ITER_NAME = !!$nativeIterator && + ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + var $iterator = $iterators.values + hide(TypedArray, TYPED_CONSTRUCTOR, true) + hide(TypedArrayPrototype, TYPED_ARRAY, NAME) + hide(TypedArrayPrototype, VIEW, true) + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray) + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME } + }) + } + + O[NAME] = TypedArray + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O) + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }) + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1) }), NAME, { + from: $from, + of: $of + }) + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES) + + $export($export.P, NAME, proto) + + setSpecies(NAME) + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }) + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators) + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice() + }), NAME, { slice: $slice }) + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]) + })), NAME, { toLocaleString: $toLocaleString }) + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator) + } + } else module.exports = function () { /* empty */ } + /** */ }, +/* 33 */ + /** */ function (module, exports, __webpack_require__) { + /* WEBPACK VAR INJECTION */(function (module, global) { + var __WEBPACK_AMD_DEFINE_RESULT__/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */ +;(function () { + // Detect the `define` function exposed by asynchronous module loaders. The + // strict `define` check is necessary for compatibility with `r.js`. + var isLoader = 'function' === 'function' && __webpack_require__(463) + + // A set of types used to distinguish objects from primitives. + var objectTypes = { + 'function': true, + 'object': true + } + + // Detect the `exports` object exposed by CommonJS implementations. + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports + + // Use the `global` object exposed by Node (including Browserify via + // `insert-module-globals`), Narwhal, and Ringo as the default context, + // and the `window` object in browsers. Rhino exports a `global` function + // instead. + var root = objectTypes[typeof window] && window || this, + freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global === 'object' && global + + if (freeGlobal && (freeGlobal['global'] === freeGlobal || freeGlobal['window'] === freeGlobal || freeGlobal['self'] === freeGlobal)) { + root = freeGlobal + } + + // Public: Initializes JSON 3 using the given `context` object, attaching the + // `stringify` and `parse` functions to the specified `exports` object. + function runInContext (context, exports) { + context || (context = root['Object']()) + exports || (exports = root['Object']()) + + // Native constructor aliases. + var Number = context['Number'] || root['Number'], + String = context['String'] || root['String'], + Object = context['Object'] || root['Object'], + Date = context['Date'] || root['Date'], + SyntaxError = context['SyntaxError'] || root['SyntaxError'], + TypeError = context['TypeError'] || root['TypeError'], + Math = context['Math'] || root['Math'], + nativeJSON = context['JSON'] || root['JSON'] + + // Delegate to the native `stringify` and `parse` implementations. + if (typeof nativeJSON === 'object' && nativeJSON) { + exports.stringify = nativeJSON.stringify + exports.parse = nativeJSON.parse + } + + // Convenience aliases. + var objectProto = Object.prototype, + getClass = objectProto.toString, + isProperty, forEach, undef + + // Test the `Date#getUTC*` methods. Based on work by @Yaffle. + var isExtended = new Date(-3509827334573292) + try { + // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical + // results for certain dates in Opera >= 10.53. + isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 && + // Safari < 2.0.2 stores the internal millisecond time value correctly, + // but clips the values returned by the date methods to the range of + // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]). + isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708 + } catch (exception) {} + + // Internal: Determines whether the native `JSON.stringify` and `parse` + // implementations are spec-compliant. Based on work by Ken Snyder. + function has (name) { + if (has[name] !== undef) { + // Return cached feature test result. + return has[name] + } + var isSupported + if (name == 'bug-string-char-index') { + // IE <= 7 doesn't support accessing string characters using square + // bracket notation. IE 8 only supports this for primitives. + isSupported = 'a'[0] != 'a' + } else if (name == 'json') { + // Indicates whether both `JSON.stringify` and `JSON.parse` are + // supported. + isSupported = has('json-stringify') && has('json-parse') + } else { + var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}' + // Test `JSON.stringify`. + if (name == 'json-stringify') { + var stringify = exports.stringify, stringifySupported = typeof stringify === 'function' && isExtended + if (stringifySupported) { + // A test function object with a custom `toJSON` method. + (value = function () { + return 1 + }).toJSON = value + try { + stringifySupported = + // Firefox 3.1b1 and b2 serialize string, number, and boolean + // primitives as object literals. + stringify(0) === '0' && + // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object + // literals. + stringify(new Number()) === '0' && + stringify(new String()) == '""' && + // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or + // does not define a canonical JSON representation (this applies to + // objects with `toJSON` properties as well, *unless* they are nested + // within an object or array). + stringify(getClass) === undef && + // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and + // FF 3.1b3 pass this test. + stringify(undef) === undef && + // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s, + // respectively, if the value is omitted entirely. + stringify() === undef && + // FF 3.1b1, 2 throw an error if the given value is not a number, + // string, array, object, Boolean, or `null` literal. This applies to + // objects with custom `toJSON` methods as well, unless they are nested + // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON` + // methods entirely. + stringify(value) === '1' && + stringify([value]) == '[1]' && + // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of + // `"[null]"`. + stringify([undef]) == '[null]' && + // YUI 3.0.0b1 fails to serialize `null` literals. + stringify(null) == 'null' && + // FF 3.1b1, 2 halts serialization if an array contains a function: + // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3 + // elides non-JSON values from objects and arrays, unless they + // define custom `toJSON` methods. + stringify([undef, getClass, null]) == '[null,null,null]' && + // Simple serialization test. FF 3.1b1 uses Unicode escape sequences + // where character escape codes are expected (e.g., `\b` => `\u0008`). + stringify({ 'a': [value, true, false, null, '\x00\b\n\f\r\t'] }) == serialized && + // FF 3.1b1 and b2 ignore the `filter` and `width` arguments. + stringify(null, value) === '1' && + stringify([1, 2], null, 1) == '[\n 1,\n 2\n]' && + // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly + // serialize extended years. + stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' && + // The milliseconds are optional in ES 5, but required in 5.1. + stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' && + // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative + // four-digit years instead of six-digit years. Credits: @Yaffle. + stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' && + // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond + // values less than 1000. Credits: @Yaffle. + stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"' + } catch (exception) { + stringifySupported = false + } + } + isSupported = stringifySupported + } + // Test `JSON.parse`. + if (name == 'json-parse') { + var parse = exports.parse + if (typeof parse === 'function') { + try { + // FF 3.1b1, b2 will throw an exception if a bare literal is provided. + // Conforming implementations should also coerce the initial argument to + // a string prior to parsing. + if (parse('0') === 0 && !parse(false)) { + // Simple parsing test. + value = parse(serialized) + var parseSupported = value['a'].length == 5 && value['a'][0] === 1 + if (parseSupported) { + try { + // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings. + parseSupported = !parse('"\t"') + } catch (exception) {} + if (parseSupported) { + try { + // FF 4.0 and 4.0.1 allow leading `+` signs and leading + // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow + // certain octal literals. + parseSupported = parse('01') !== 1 + } catch (exception) {} + } + if (parseSupported) { + try { + // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal + // points. These environments, along with FF 3.1b1 and 2, + // also allow trailing commas in JSON objects and arrays. + parseSupported = parse('1.') !== 1 + } catch (exception) {} + } + } + } + } catch (exception) { + parseSupported = false + } + } + isSupported = parseSupported + } + } + return has[name] = !!isSupported + } + + if (!has('json')) { + // Common `[[Class]]` name aliases. + var functionClass = '[object Function]', + dateClass = '[object Date]', + numberClass = '[object Number]', + stringClass = '[object String]', + arrayClass = '[object Array]', + booleanClass = '[object Boolean]' + + // Detect incomplete support for accessing string characters by index. + var charIndexBuggy = has('bug-string-char-index') + + // Define additional utility methods if the `Date` methods are buggy. + if (!isExtended) { + var floor = Math.floor + // A mapping between the months of the year and the number of days between + // January 1st and the first of the respective month. + var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334] + // Internal: Calculates the number of days between the Unix epoch and the + // first day of the given month. + var getDay = function (year, month) { + return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400) + } + } + + // Internal: Determines if a property is a direct property of the given + // object. Delegates to the native `Object#hasOwnProperty` method. + if (!(isProperty = objectProto.hasOwnProperty)) { + isProperty = function (property) { + var members = {}, constructor + if ((members.__proto__ = null, members.__proto__ = { + // The *proto* property cannot be set multiple times in recent + // versions of Firefox and SeaMonkey. + 'toString': 1 + }, members).toString != getClass) { + // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but + // supports the mutable *proto* property. + isProperty = function (property) { + // Capture and break the object's prototype chain (see section 8.6.2 + // of the ES 5.1 spec). The parenthesized expression prevents an + // unsafe transformation by the Closure Compiler. + var original = this.__proto__, result = property in (this.__proto__ = null, this) + // Restore the original prototype chain. + this.__proto__ = original + return result + } + } else { + // Capture a reference to the top-level `Object` constructor. + constructor = members.constructor + // Use the `constructor` property to simulate `Object#hasOwnProperty` in + // other environments. + isProperty = function (property) { + var parent = (this.constructor || constructor).prototype + return property in this && !(property in parent && this[property] === parent[property]) + } + } + members = null + return isProperty.call(this, property) + } + } + + // Internal: Normalizes the `for...in` iteration algorithm across + // environments. Each enumerated key is yielded to a `callback` function. + forEach = function (object, callback) { + var size = 0, Properties, members, property; + + // Tests for bugs in the current environment's `for...in` algorithm. The + // `valueOf` property inherits the non-enumerable flag from + // `Object.prototype` in older versions of IE, Netscape, and Mozilla. + (Properties = function () { + this.valueOf = 0 + }).prototype.valueOf = 0 + + // Iterate over a new instance of the `Properties` class. + members = new Properties() + for (property in members) { + // Ignore all properties inherited from `Object.prototype`. + if (isProperty.call(members, property)) { + size++ + } + } + Properties = members = null + + // Normalize the iteration algorithm. + if (!size) { + // A list of non-enumerable properties inherited from `Object.prototype`. + members = ['valueOf', 'toString', 'toLocaleString', 'propertyIsEnumerable', 'isPrototypeOf', 'hasOwnProperty', 'constructor'] + // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable + // properties. + forEach = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, length + var hasProperty = !isFunction && typeof object.constructor !== 'function' && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty + for (property in object) { + // Gecko <= 1.0 enumerates the `prototype` property of functions under + // certain conditions; IE does not. + if (!(isFunction && property == 'prototype') && hasProperty.call(object, property)) { + callback(property) + } + } + // Manually invoke the callback for each non-enumerable property. + for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property)); + } + } else if (size == 2) { + // Safari <= 2.0.4 enumerates shadowed properties twice. + forEach = function (object, callback) { + // Create a set of iterated properties. + var members = {}, isFunction = getClass.call(object) == functionClass, property + for (property in object) { + // Store each property name to prevent double enumeration. The + // `prototype` property of functions is not enumerated due to cross- + // environment inconsistencies. + if (!(isFunction && property == 'prototype') && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) { + callback(property) + } + } + } + } else { + // No bugs detected; use the standard `for...in` algorithm. + forEach = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, isConstructor + for (property in object) { + if (!(isFunction && property == 'prototype') && isProperty.call(object, property) && !(isConstructor = property === 'constructor')) { + callback(property) + } + } + // Manually invoke the callback for the `constructor` property due to + // cross-environment inconsistencies. + if (isConstructor || isProperty.call(object, (property = 'constructor'))) { + callback(property) + } + } + } + return forEach(object, callback) + } + + // Public: Serializes a JavaScript `value` as a JSON string. The optional + // `filter` argument may specify either a function that alters how object and + // array members are serialized, or an array of strings and numbers that + // indicates which properties should be serialized. The optional `width` + // argument may be either a string or number that specifies the indentation + // level of the output. + if (!has('json-stringify')) { + // Internal: A map of control characters and their escaped equivalents. + var Escapes = { + 92: '\\\\', + 34: '\\"', + 8: '\\b', + 12: '\\f', + 10: '\\n', + 13: '\\r', + 9: '\\t' + } + + // Internal: Converts `value` into a zero-padded string such that its + // length is at least equal to `width`. The `width` must be <= 6. + var leadingZeroes = '000000' + var toPaddedString = function (width, value) { + // The `|| 0` expression is necessary to work around a bug in + // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`. + return (leadingZeroes + (value || 0)).slice(-width) + } + + // Internal: Double-quotes a string `value`, replacing all ASCII control + // characters (characters with code unit values between 0 and 31) with + // their escaped equivalents. This is an implementation of the + // `Quote(value)` operation defined in ES 5.1 section 15.12.3. + var unicodePrefix = '\\u00' + var quote = function (value) { + var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10 + var symbols = useCharIndex && (charIndexBuggy ? value.split('') : value) + for (; index < length; index++) { + var charCode = value.charCodeAt(index) + // If the character is a control character, append its Unicode or + // shorthand escape sequence; otherwise, append the character as-is. + switch (charCode) { + case 8: case 9: case 10: case 12: case 13: case 34: case 92: + result += Escapes[charCode] + break + default: + if (charCode < 32) { + result += unicodePrefix + toPaddedString(2, charCode.toString(16)) + break + } + result += useCharIndex ? symbols[index] : value.charAt(index) + } + } + return result + '"' + } + + // Internal: Recursively serializes an object. Implements the + // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations. + var serialize = function (property, object, callback, properties, whitespace, indentation, stack) { + var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result + try { + // Necessary for host object support. + value = object[property] + } catch (exception) {} + if (typeof value === 'object' && value) { + className = getClass.call(value) + if (className == dateClass && !isProperty.call(value, 'toJSON')) { + if (value > -1 / 0 && value < 1 / 0) { + // Dates are serialized according to the `Date#toJSON` method + // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15 + // for the ISO 8601 date time string format. + if (getDay) { + // Manually compute the year, month, date, hours, minutes, + // seconds, and milliseconds if the `getUTC*` methods are + // buggy. Adapted from @Yaffle's `date-shim` project. + date = floor(value / 864e5) + for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++); + for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++); + date = 1 + date - getDay(year, month) + // The `time` value specifies the time within the day (see ES + // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used + // to compute `A modulo B`, as the `%` operator does not + // correspond to the `modulo` operation for negative numbers. + time = (value % 864e5 + 864e5) % 864e5 + // The hours, minutes, seconds, and milliseconds are obtained by + // decomposing the time within the day. See section 15.9.1.10. + hours = floor(time / 36e5) % 24 + minutes = floor(time / 6e4) % 60 + seconds = floor(time / 1e3) % 60 + milliseconds = time % 1e3 + } else { + year = value.getUTCFullYear() + month = value.getUTCMonth() + date = value.getUTCDate() + hours = value.getUTCHours() + minutes = value.getUTCMinutes() + seconds = value.getUTCSeconds() + milliseconds = value.getUTCMilliseconds() + } + // Serialize extended years correctly. + value = (year <= 0 || year >= 1e4 ? (year < 0 ? '-' : '+') + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) + + '-' + toPaddedString(2, month + 1) + '-' + toPaddedString(2, date) + + // Months, dates, hours, minutes, and seconds should have two + // digits; milliseconds should have three. + 'T' + toPaddedString(2, hours) + ':' + toPaddedString(2, minutes) + ':' + toPaddedString(2, seconds) + + // Milliseconds are optional in ES 5.0, but required in 5.1. + '.' + toPaddedString(3, milliseconds) + 'Z' + } else { + value = null + } + } else if (typeof value.toJSON === 'function' && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, 'toJSON'))) { + // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the + // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3 + // ignores all `toJSON` methods on these objects unless they are + // defined directly on an instance. + value = value.toJSON(property) + } + } + if (callback) { + // If a replacement function was provided, call it to obtain the value + // for serialization. + value = callback.call(object, property, value) + } + if (value === null) { + return 'null' + } + className = getClass.call(value) + if (className == booleanClass) { + // Booleans are represented literally. + return '' + value + } else if (className == numberClass) { + // JSON numbers must be finite. `Infinity` and `NaN` are serialized as + // `"null"`. + return value > -1 / 0 && value < 1 / 0 ? '' + value : 'null' + } else if (className == stringClass) { + // Strings are double-quoted and escaped. + return quote('' + value) + } + // Recursively serialize objects and arrays. + if (typeof value === 'object') { + // Check for cyclic structures. This is a linear search; performance + // is inversely proportional to the number of unique nested objects. + for (length = stack.length; length--;) { + if (stack[length] === value) { + // Cyclic structures cannot be serialized by `JSON.stringify`. + throw TypeError() + } + } + // Add the object to the stack of traversed objects. + stack.push(value) + results = [] + // Save the current indentation level and indent one additional level. + prefix = indentation + indentation += whitespace + if (className == arrayClass) { + // Recursively serialize array elements. + for (index = 0, length = value.length; index < length; index++) { + element = serialize(index, value, callback, properties, whitespace, indentation, stack) + results.push(element === undef ? 'null' : element) + } + result = results.length ? (whitespace ? '[\n' + indentation + results.join(',\n' + indentation) + '\n' + prefix + ']' : ('[' + results.join(',') + ']')) : '[]' + } else { + // Recursively serialize object members. Members are selected from + // either a user-specified list of property names, or the object + // itself. + forEach(properties || value, function (property) { + var element = serialize(property, value, callback, properties, whitespace, indentation, stack) + if (element !== undef) { + // According to ES 5.1 section 15.12.3: "If `gap` {whitespace} + // is not the empty string, let `member` {quote(property) + ":"} + // be the concatenation of `member` and the `space` character." + // The "`space` character" refers to the literal space + // character, not the `space` {width} argument provided to + // `JSON.stringify`. + results.push(quote(property) + ':' + (whitespace ? ' ' : '') + element) + } + }) + result = results.length ? (whitespace ? '{\n' + indentation + results.join(',\n' + indentation) + '\n' + prefix + '}' : ('{' + results.join(',') + '}')) : '{}' + } + // Remove the object from the traversed object stack. + stack.pop() + return result + } + } + + // Public: `JSON.stringify`. See ES 5.1 section 15.12.3. + exports.stringify = function (source, filter, width) { + var whitespace, callback, properties, className + if (objectTypes[typeof filter] && filter) { + if ((className = getClass.call(filter)) == functionClass) { + callback = filter + } else if (className == arrayClass) { + // Convert the property names array into a makeshift set. + properties = {} + for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1)); + } + } + if (width) { + if ((className = getClass.call(width)) == numberClass) { + // Convert the `width` to an integer and create a string containing + // `width` number of space characters. + if ((width -= width % 1) > 0) { + for (whitespace = '', width > 10 && (width = 10); whitespace.length < width; whitespace += ' '); + } + } else if (className == stringClass) { + whitespace = width.length <= 10 ? width : width.slice(0, 10) + } + } + // Opera <= 7.54u2 discards the values associated with empty string keys + // (`""`) only if they are used directly within an object member list + // (e.g., `!("" in { "": 1})`). + return serialize('', (value = {}, value[''] = source, value), callback, properties, whitespace, '', []) + } + } + + // Public: Parses a JSON source string. + if (!has('json-parse')) { + var fromCharCode = String.fromCharCode + + // Internal: A map of escaped control characters and their unescaped + // equivalents. + var Unescapes = { + 92: '\\', + 34: '"', + 47: '/', + 98: '\b', + 116: '\t', + 110: '\n', + 102: '\f', + 114: '\r' + } + + // Internal: Stores the parser state. + var Index, Source + + // Internal: Resets the parser state and throws a `SyntaxError`. + var abort = function () { + Index = Source = null + throw SyntaxError() + } + + // Internal: Returns the next token, or `"$"` if the parser has reached + // the end of the source string. A token may be a string, number, `null` + // literal, or Boolean literal. + var lex = function () { + var source = Source, length = source.length, value, begin, position, isSigned, charCode + while (Index < length) { + charCode = source.charCodeAt(Index) + switch (charCode) { + case 9: case 10: case 13: case 32: + // Skip whitespace tokens, including tabs, carriage returns, line + // feeds, and space characters. + Index++ + break + case 123: case 125: case 91: case 93: case 58: case 44: + // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at + // the current position. + value = charIndexBuggy ? source.charAt(Index) : source[Index] + Index++ + return value + case 34: + // `"` delimits a JSON string; advance to the next character and + // begin parsing the string. String tokens are prefixed with the + // sentinel `@` character to distinguish them from punctuators and + // end-of-string tokens. + for (value = '@', Index++; Index < length;) { + charCode = source.charCodeAt(Index) + if (charCode < 32) { + // Unescaped ASCII control characters (those with a code unit + // less than the space character) are not permitted. + abort() + } else if (charCode == 92) { + // A reverse solidus (`\`) marks the beginning of an escaped + // control character (including `"`, `\`, and `/`) or Unicode + // escape sequence. + charCode = source.charCodeAt(++Index) + switch (charCode) { + case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114: + // Revive escaped control characters. + value += Unescapes[charCode] + Index++ + break + case 117: + // `\u` marks the beginning of a Unicode escape sequence. + // Advance to the first character and validate the + // four-digit code point. + begin = ++Index + for (position = Index + 4; Index < position; Index++) { + charCode = source.charCodeAt(Index) + // A valid sequence comprises four hexdigits (case- + // insensitive) that form a single hexadecimal value. + if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) { + // Invalid Unicode escape sequence. + abort() + } + } + // Revive the escaped character. + value += fromCharCode('0x' + source.slice(begin, Index)) + break + default: + // Invalid escape sequence. + abort() + } + } else { + if (charCode == 34) { + // An unescaped double-quote character marks the end of the + // string. + break + } + charCode = source.charCodeAt(Index) + begin = Index + // Optimize for the common case where a string is valid. + while (charCode >= 32 && charCode != 92 && charCode != 34) { + charCode = source.charCodeAt(++Index) + } + // Append the string as-is. + value += source.slice(begin, Index) + } + } + if (source.charCodeAt(Index) == 34) { + // Advance to the next character and return the revived string. + Index++ + return value + } + // Unterminated string. + abort() + default: + // Parse numbers and literals. + begin = Index + // Advance past the negative sign, if one is specified. + if (charCode == 45) { + isSigned = true + charCode = source.charCodeAt(++Index) + } + // Parse an integer or floating-point value. + if (charCode >= 48 && charCode <= 57) { + // Leading zeroes are interpreted as octal literals. + if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) { + // Illegal octal literal. + abort() + } + isSigned = false + // Parse the integer component. + for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++); + // Floats cannot contain a leading decimal point; however, this + // case is already accounted for by the parser. + if (source.charCodeAt(Index) == 46) { + position = ++Index + // Parse the decimal component. + for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); + if (position == Index) { + // Illegal trailing decimal. + abort() + } + Index = position + } + // Parse exponents. The `e` denoting the exponent is + // case-insensitive. + charCode = source.charCodeAt(Index) + if (charCode == 101 || charCode == 69) { + charCode = source.charCodeAt(++Index) + // Skip past the sign following the exponent, if one is + // specified. + if (charCode == 43 || charCode == 45) { + Index++ + } + // Parse the exponential component. + for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); + if (position == Index) { + // Illegal empty exponent. + abort() + } + Index = position + } + // Coerce the parsed value to a JavaScript number. + return +source.slice(begin, Index) + } + // A negative sign may only precede numbers. + if (isSigned) { + abort() + } + // `true`, `false`, and `null` literals. + if (source.slice(Index, Index + 4) == 'true') { + Index += 4 + return true + } else if (source.slice(Index, Index + 5) == 'false') { + Index += 5 + return false + } else if (source.slice(Index, Index + 4) == 'null') { + Index += 4 + return null + } + // Unrecognized token. + abort() + } + } + // Return the sentinel `$` character if the parser has reached the end + // of the source string. + return '$' + } + + // Internal: Parses a JSON `value` token. + var get = function (value) { + var results, hasMembers + if (value == '$') { + // Unexpected end of input. + abort() + } + if (typeof value === 'string') { + if ((charIndexBuggy ? value.charAt(0) : value[0]) == '@') { + // Remove the sentinel `@` character. + return value.slice(1) + } + // Parse object and array literals. + if (value == '[') { + // Parses a JSON array, returning a new JavaScript array. + results = [] + for (;; hasMembers || (hasMembers = true)) { + value = lex() + // A closing square bracket marks the end of the array literal. + if (value == ']') { + break + } + // If the array literal contains elements, the current token + // should be a comma separating the previous element from the + // next. + if (hasMembers) { + if (value == ',') { + value = lex() + if (value == ']') { + // Unexpected trailing `,` in array literal. + abort() + } + } else { + // A `,` must separate each array element. + abort() + } + } + // Elisions and leading commas are not permitted. + if (value == ',') { + abort() + } + results.push(get(value)) + } + return results + } else if (value == '{') { + // Parses a JSON object, returning a new JavaScript object. + results = {} + for (;; hasMembers || (hasMembers = true)) { + value = lex() + // A closing curly brace marks the end of the object literal. + if (value == '}') { + break + } + // If the object literal contains members, the current token + // should be a comma separator. + if (hasMembers) { + if (value == ',') { + value = lex() + if (value == '}') { + // Unexpected trailing `,` in object literal. + abort() + } + } else { + // A `,` must separate each object member. + abort() + } + } + // Leading commas are not permitted, object property names must be + // double-quoted strings, and a `:` must separate each property + // name and value. + if (value == ',' || typeof value !== 'string' || (charIndexBuggy ? value.charAt(0) : value[0]) != '@' || lex() != ':') { + abort() + } + results[value.slice(1)] = get(lex()) + } + return results + } + // Unexpected token encountered. + abort() + } + return value + } + + // Internal: Updates a traversed object member. + var update = function (source, property, callback) { + var element = walk(source, property, callback) + if (element === undef) { + delete source[property] + } else { + source[property] = element + } + } + + // Internal: Recursively traverses a parsed JSON object, invoking the + // `callback` function for each value. This is an implementation of the + // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2. + var walk = function (source, property, callback) { + var value = source[property], length + if (typeof value === 'object' && value) { + // `forEach` can't be used to traverse an array in Opera <= 8.54 + // because its `Object#hasOwnProperty` implementation returns `false` + // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`). + if (getClass.call(value) == arrayClass) { + for (length = value.length; length--;) { + update(value, length, callback) + } + } else { + forEach(value, function (property) { + update(value, property, callback) + }) + } + } + return callback.call(source, property, value) + } + + // Public: `JSON.parse`. See ES 5.1 section 15.12.2. + exports.parse = function (source, callback) { + var result, value + Index = 0 + Source = '' + source + result = get(lex()) + // If a JSON string contains multiple tokens, it is invalid. + if (lex() != '$') { + abort() + } + // Reset the parser state. + Index = Source = null + return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[''] = result, value), '', callback) : result + } + } + } + + exports['runInContext'] = runInContext + return exports + } + + if (freeExports && !isLoader) { + // Export for CommonJS environments. + runInContext(root, freeExports) + } else { + // Export for web browsers and JavaScript engines. + var nativeJSON = root.JSON, + previousJSON = root['JSON3'], + isRestored = false + + var JSON3 = runInContext(root, (root['JSON3'] = { + // Public: Restores the original value of the global `JSON` object and + // returns a reference to the `JSON3` object. + 'noConflict': function () { + if (!isRestored) { + isRestored = true + root.JSON = nativeJSON + root['JSON3'] = previousJSON + nativeJSON = previousJSON = null + } + return JSON3 + } + })) + + root.JSON = { + 'parse': JSON3.parse, + 'stringify': JSON3.stringify + } + } + + // Export for asynchronous module loaders. + if (isLoader) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return JSON3 + }.call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) + } +}).call(this) + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(172)(module), __webpack_require__(6))) + /** */ }, +/* 34 */ + /** */ function (module, exports) { + module.exports = function () { /* empty */ } + /** */ }, +/* 35 */ + /** */ function (module, exports, __webpack_require__) { + var ctx = __webpack_require__(20) + var call = __webpack_require__(133) + var isArrayIter = __webpack_require__(87) + var anObject = __webpack_require__(1) + var toLength = __webpack_require__(8) + var getIterFn = __webpack_require__(60) + var BREAK = {} + var RETURN = {} + var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable } : getIterFn(iterable) + var f = ctx(fn, that, entries ? 2 : 1) + var index = 0 + var length, step, iterator, result + if (typeof iterFn !== 'function') throw TypeError(iterable + ' is not iterable!') + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) { + for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]) + if (result === BREAK || result === RETURN) return result + } + } else { + for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries) + if (result === BREAK || result === RETURN) return result + } + } + } + exports.BREAK = BREAK + exports.RETURN = RETURN + /** */ }, +/* 36 */ + /** */ function (module, exports, __webpack_require__) { + var META = __webpack_require__(52)('meta') + var isObject = __webpack_require__(4) + var has = __webpack_require__(21) + var setDesc = __webpack_require__(11).f + var id = 0 + var isExtensible = Object.isExtensible || function () { + return true + } + var FREEZE = !__webpack_require__(5)(function () { + return isExtensible(Object.preventExtensions({})) + }) + var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}) + } + var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it === 'symbol' ? it : (typeof it === 'string' ? 'S' : 'P') + it + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F' + // not necessary to add metadata + if (!create) return 'E' + // add missing metadata + setMeta(it) + // return object ID + } return it[META].i + } + var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true + // not necessary to add metadata + if (!create) return false + // add missing metadata + setMeta(it) + // return hash weak collections IDs + } return it[META].w + } +// add metadata on freeze-family methods calling + var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it) + return it + } + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + } + /** */ }, +/* 37 */ + /** */ function (module, exports, __webpack_require__) { +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + var anObject = __webpack_require__(1) + var dPs = __webpack_require__(138) + var enumBugKeys = __webpack_require__(83) + var IE_PROTO = __webpack_require__(98)('IE_PROTO') + var Empty = function () { /* empty */ } + var PROTOTYPE = 'prototype' + +// Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(82)('iframe') + var i = enumBugKeys.length + var lt = '<' + var gt = '>' + var iframeDocument + iframe.style.display = 'none' + __webpack_require__(85).appendChild(iframe) + iframe.src = 'javascript:' // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document + iframeDocument.open() + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt) + iframeDocument.close() + createDict = iframeDocument.F + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]] + return createDict() + } + + module.exports = Object.create || function create (O, Properties) { + var result + if (O !== null) { + Empty[PROTOTYPE] = anObject(O) + result = new Empty() + Empty[PROTOTYPE] = null + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O + } else result = createDict() + return Properties === undefined ? result : dPs(result, Properties) + } + /** */ }, +/* 38 */ + /** */ function (module, exports, __webpack_require__) { +// 19.1.2.14 / 15.2.3.14 Object.keys(O) + var $keys = __webpack_require__(140) + var enumBugKeys = __webpack_require__(83) + + module.exports = Object.keys || function keys (O) { + return $keys(O, enumBugKeys) + } + /** */ }, +/* 39 */ + /** */ function (module, exports) { + module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + } + } + /** */ }, +/* 40 */ + /** */ function (module, exports, __webpack_require__) { +// 7.1.1 ToPrimitive(input [, PreferredType]) + var isObject = __webpack_require__(4) +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string + module.exports = function (it, S) { + if (!isObject(it)) return it + var fn, val + if (S && typeof (fn = it.toString) === 'function' && !isObject(val = fn.call(it))) return val + if (typeof (fn = it.valueOf) === 'function' && !isObject(val = fn.call(it))) return val + if (!S && typeof (fn = it.toString) === 'function' && !isObject(val = fn.call(it))) return val + throw TypeError("Can't convert object to primitive value") + } + /** */ }, +/* 41 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (global) { + var random = __webpack_require__(55) + + var onUnload = {}, + afterUnload = false, + // detect google chrome packaged apps because they don't allow the 'unload' event + isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime + + module.exports = { + attachEvent: function (event, listener) { + if (typeof global.addEventListener !== 'undefined') { + global.addEventListener(event, listener, false) + } else if (global.document && global.attachEvent) { + // IE quirks. + // According to: http://stevesouders.com/misc/test-postmessage.php + // the message gets delivered only to 'document', not 'window'. + global.document.attachEvent('on' + event, listener) + // I get 'window' for ie8. + global.attachEvent('on' + event, listener) + } + }, + + detachEvent: function (event, listener) { + if (typeof global.addEventListener !== 'undefined') { + global.removeEventListener(event, listener, false) + } else if (global.document && global.detachEvent) { + global.document.detachEvent('on' + event, listener) + global.detachEvent('on' + event, listener) + } + }, + + unloadAdd: function (listener) { + if (isChromePackagedApp) { + return null + } + + var ref = random.string(8) + onUnload[ref] = listener + if (afterUnload) { + setTimeout(this.triggerUnloadCallbacks, 0) + } + return ref + }, + + unloadDel: function (ref) { + if (ref in onUnload) { + delete onUnload[ref] + } + }, + + triggerUnloadCallbacks: function () { + for (var ref in onUnload) { + onUnload[ref]() + delete onUnload[ref] + } + } + } + + var unloadTriggered = function () { + if (afterUnload) { + return + } + afterUnload = true + module.exports.triggerUnloadCallbacks() + } + +// 'unload' alone is not reliable in opera within an iframe, but we +// can't use `beforeunload` as IE fires it on javascript: links. + if (!isChromePackagedApp) { + module.exports.attachEvent('unload', unloadTriggered) + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(6))) + /** */ }, +/* 42 */ + /** */ function (module, exports) { +/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ + +/** + * ### flag(object, key, [value]) + * + * Get or set a flag value on an object. If a + * value is provided it will be set, else it will + * return the currently set value or `undefined` if + * the value is not set. + * + * utils.flag(this, 'foo', 'bar'); // setter + * utils.flag(this, 'foo'); // getter, returns `bar` + * + * @param {Object} object constructed Assertion + * @param {String} key + * @param {Mixed} value (optional) + * @namespace Utils + * @name flag + * @api private + */ + + module.exports = function (obj, key, value) { + var flags = obj.__flags || (obj.__flags = Object.create(null)) + if (arguments.length === 3) { + flags[key] = value + } else { + return flags[key] + } + } + /** */ }, +/* 43 */ + /** */ function (module, exports) { + module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!') + } return it + } + /** */ }, +/* 44 */ + /** */ function (module, exports, __webpack_require__) { +// getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(27) + var TAG = __webpack_require__(9)('toStringTag') +// ES3 wrong here + var ARG = cof(function () { return arguments }()) == 'Arguments' + +// fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key] + } catch (e) { /* empty */ } + } + + module.exports = function (it) { + var O, T, B + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) === 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee === 'function' ? 'Arguments' : B + } + /** */ }, +/* 45 */ + /** */ function (module, exports) { + module.exports = {} + /** */ }, +/* 46 */ + /** */ function (module, exports) { + module.exports = true + /** */ }, +/* 47 */ + /** */ function (module, exports, __webpack_require__) { + var hide = __webpack_require__(22) + module.exports = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key] + else hide(target, key, src[key]) + } return target + } + /** */ }, +/* 48 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var global = __webpack_require__(2) + var core = __webpack_require__(15) + var dP = __webpack_require__(11) + var DESCRIPTORS = __webpack_require__(12) + var SPECIES = __webpack_require__(9)('species') + + module.exports = function (KEY) { + var C = typeof core[KEY] === 'function' ? core[KEY] : global[KEY] + if (DESCRIPTORS && C && !C[SPECIES]) { + dP.f(C, SPECIES, { + configurable: true, + get: function () { return this } + }) + } + } + /** */ }, +/* 49 */ + /** */ function (module, exports, __webpack_require__) { + var toInteger = __webpack_require__(29) + var max = Math.max + var min = Math.min + module.exports = function (index, length) { + index = toInteger(index) + return index < 0 ? max(index + length, 0) : min(index, length) + } + /** */ }, +/* 50 */ + /** */ function (module, exports) { + module.exports = { + + /** + * ### config.includeStack + * + * User configurable property, influences whether stack trace + * is included in Assertion error message. Default of false + * suppresses stack trace in the error message. + * + * chai.config.includeStack = true; // enable stack on error + * + * @param {Boolean} + * @api public + */ + + includeStack: false, + + /** + * ### config.showDiff + * + * User configurable property, influences whether or not + * the `showDiff` flag should be included in the thrown + * AssertionErrors. `false` will always be `false`; `true` + * will be true when the assertion has requested a diff + * be shown. + * + * @param {Boolean} + * @api public + */ + + showDiff: true, + + /** + * ### config.truncateThreshold + * + * User configurable property, sets length threshold for actual and + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. + * + * Set it to zero if you want to disable truncating altogether. + * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * + * chai.config.truncateThreshold = 0; // disable truncating + * + * @param {Number} + * @api public + */ + + truncateThreshold: 40 + + } + /** */ }, +/* 51 */ + /** */ function (module, exports, __webpack_require__) { + var def = __webpack_require__(11).f + var has = __webpack_require__(21) + var TAG = __webpack_require__(9)('toStringTag') + + module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }) + } + /** */ }, +/* 52 */ + /** */ function (module, exports) { + var id = 0 + var px = Math.random() + module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)) + } + /** */ }, +/* 53 */ + /** */ function (module, exports, __webpack_require__) { + var isObject = __webpack_require__(4) + module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!') + return it + } + /** */ }, +/* 54 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (process) { + var inherits = __webpack_require__(3), + urlUtils = __webpack_require__(24), + SenderReceiver = __webpack_require__(166) + + var debug = function () {} + if (process.env.NODE_ENV !== 'production') { + debug = __webpack_require__(10)('sockjs-client:ajax-based') + } + + function createAjaxSender (AjaxObject) { + return function (url, payload, callback) { + debug('create ajax sender', url, payload) + var opt = {} + if (typeof payload === 'string') { + opt.headers = { 'Content-type': 'text/plain' } + } + var ajaxUrl = urlUtils.addPath(url, '/xhr_send') + var xo = new AjaxObject('POST', ajaxUrl, payload, opt) + xo.once('finish', function (status) { + debug('finish', status) + xo = null + + if (status !== 200 && status !== 204) { + return callback(new Error('http status ' + status)) + } + callback() + }) + return function () { + debug('abort') + xo.close() + xo = null + + var err = new Error('Aborted') + err.code = 1000 + callback(err) + } + } + } + + function AjaxBasedTransport (transUrl, urlSuffix, Receiver, AjaxObject) { + SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject) + } + + inherits(AjaxBasedTransport, SenderReceiver) + + module.exports = AjaxBasedTransport + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7))) + /** */ }, +/* 55 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +/* global crypto:true */ + var crypto = __webpack_require__(455) + +// This string has length 32, a power of 2, so the modulus doesn't introduce a +// bias. + var _randomStringChars = 'abcdefghijklmnopqrstuvwxyz012345' + module.exports = { + string: function (length) { + var max = _randomStringChars.length + var bytes = crypto.randomBytes(length) + var ret = [] + for (var i = 0; i < length; i++) { + ret.push(_randomStringChars.substr(bytes[i] % max, 1)) + } + return ret.join('') + }, + + number: function (max) { + return Math.floor(Math.random() * max) + }, + + numberString: function (max) { + var t = ('' + (max - 1)).length + var p = new Array(t + 1).join('0') + return (p + this.number(max)).slice(-t) + } + } + /** */ }, +/* 56 */ + /** */ function (module, exports, __webpack_require__) { +// fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(27) +// eslint-disable-next-line no-prototype-builtins + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it) + } + /** */ }, +/* 57 */ + /** */ function (module, exports, __webpack_require__) { +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + var $keys = __webpack_require__(140) + var hiddenKeys = __webpack_require__(83).concat('length', 'prototype') + + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames (O) { + return $keys(O, hiddenKeys) + } + /** */ }, +/* 58 */ + /** */ function (module, exports) { + exports.f = {}.propertyIsEnumerable + /** */ }, +/* 59 */ + /** */ function (module, exports, __webpack_require__) { + var $export = __webpack_require__(0) + var defined = __webpack_require__(30) + var fails = __webpack_require__(5) + var spaces = __webpack_require__(102) + var space = '[' + spaces + ']' + var non = '\u200b\u0085' + var ltrim = RegExp('^' + space + space + '*') + var rtrim = RegExp(space + space + '*$') + + var exporter = function (KEY, exec, ALIAS) { + var exp = {} + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non + }) + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY] + if (ALIAS) exp[ALIAS] = fn + $export($export.P + $export.F * FORCE, 'String', exp) + } + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim + var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)) + if (TYPE & 1) string = string.replace(ltrim, '') + if (TYPE & 2) string = string.replace(rtrim, '') + return string + } + + module.exports = exporter + /** */ }, +/* 60 */ + /** */ function (module, exports, __webpack_require__) { + var classof = __webpack_require__(44) + var ITERATOR = __webpack_require__(9)('iterator') + var Iterators = __webpack_require__(45) + module.exports = __webpack_require__(15).getIteratorMethod = function (it) { + if (it != undefined) { + return it[ITERATOR] || + it['@@iterator'] || + Iterators[classof(it)] + } + } + /** */ }, +/* 61 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var inherits = __webpack_require__(3), + XhrDriver = __webpack_require__(161) + + function XHRLocalObject (method, url, payload /*, opts */) { + XhrDriver.call(this, method, url, payload, { + noCredentials: true + }) + } + + inherits(XHRLocalObject, XhrDriver) + + XHRLocalObject.enabled = XhrDriver.enabled + + module.exports = XHRLocalObject + /** */ }, +/* 62 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (global) { + module.exports = { + isOpera: function () { + return global.navigator && + /opera/i.test(global.navigator.userAgent) + }, + + isKonqueror: function () { + return global.navigator && + /konqueror/i.test(global.navigator.userAgent) + }, + + // #187 wrap document.domain in try/catch because of WP8 from file:/// + hasDomain: function () { + // non-browser client always has a domain + if (!global.document) { + return true + } + + try { + return !!global.document.domain + } catch (e) { + return false + } + } + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(6))) + /** */ }, +/* 63 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (process, global) { + var eventUtils = __webpack_require__(41), + JSON3 = __webpack_require__(33), + browser = __webpack_require__(62) + + var debug = function () {} + if (process.env.NODE_ENV !== 'production') { + debug = __webpack_require__(10)('sockjs-client:utils:iframe') + } + + module.exports = { + WPrefix: '_jp', + currentWindowId: null, + + polluteGlobalNamespace: function () { + if (!(module.exports.WPrefix in global)) { + global[module.exports.WPrefix] = {} + } + }, + + postMessage: function (type, data) { + if (global.parent !== global) { + global.parent.postMessage(JSON3.stringify({ + windowId: module.exports.currentWindowId, + type: type, + data: data || '' + }), '*') + } else { + debug('Cannot postMessage, no parent window.', type, data) + } + }, + + createIframe: function (iframeUrl, errorCallback) { + var iframe = global.document.createElement('iframe') + var tref, unloadRef + var unattach = function () { + debug('unattach') + clearTimeout(tref) + // Explorer had problems with that. + try { + iframe.onload = null + } catch (x) { + // intentionally empty + } + iframe.onerror = null + } + var cleanup = function () { + debug('cleanup') + if (iframe) { + unattach() + // This timeout makes chrome fire onbeforeunload event + // within iframe. Without the timeout it goes straight to + // onunload. + setTimeout(function () { + if (iframe) { + iframe.parentNode.removeChild(iframe) + } + iframe = null + }, 0) + eventUtils.unloadDel(unloadRef) + } + } + var onerror = function (err) { + debug('onerror', err) + if (iframe) { + cleanup() + errorCallback(err) + } + } + var post = function (msg, origin) { + debug('post', msg, origin) + setTimeout(function () { + try { + // When the iframe is not loaded, IE raises an exception + // on 'contentWindow'. + if (iframe && iframe.contentWindow) { + iframe.contentWindow.postMessage(msg, origin) + } + } catch (x) { + // intentionally empty + } + }, 0) + } + + iframe.src = iframeUrl + iframe.style.display = 'none' + iframe.style.position = 'absolute' + iframe.onerror = function () { + onerror('onerror') + } + iframe.onload = function () { + debug('onload') + // `onload` is triggered before scripts on the iframe are + // executed. Give it few seconds to actually load stuff. + clearTimeout(tref) + tref = setTimeout(function () { + onerror('onload timeout') + }, 2000) + } + global.document.body.appendChild(iframe) + tref = setTimeout(function () { + onerror('timeout') + }, 15000) + unloadRef = eventUtils.unloadAdd(cleanup) + return { + post: post, + cleanup: cleanup, + loaded: unattach + } + }, + +/* eslint no-undef: "off", new-cap: "off" */ + createHtmlfile: function (iframeUrl, errorCallback) { + var axo = ['Active'].concat('Object').join('X') + var doc = new global[axo]('htmlfile') + var tref, unloadRef + var iframe + var unattach = function () { + clearTimeout(tref) + iframe.onerror = null + } + var cleanup = function () { + if (doc) { + unattach() + eventUtils.unloadDel(unloadRef) + iframe.parentNode.removeChild(iframe) + iframe = doc = null + CollectGarbage() + } + } + var onerror = function (r) { + debug('onerror', r) + if (doc) { + cleanup() + errorCallback(r) + } + } + var post = function (msg, origin) { + try { + // When the iframe is not loaded, IE raises an exception + // on 'contentWindow'. + setTimeout(function () { + if (iframe && iframe.contentWindow) { + iframe.contentWindow.postMessage(msg, origin) + } + }, 0) + } catch (x) { + // intentionally empty + } + } + + doc.open() + doc.write('' + + 'document.domain="' + global.document.domain + '";' + + '') + doc.close() + doc.parentWindow[module.exports.WPrefix] = global[module.exports.WPrefix] + var c = doc.createElement('div') + doc.body.appendChild(c) + iframe = doc.createElement('iframe') + c.appendChild(iframe) + iframe.src = iframeUrl + iframe.onerror = function () { + onerror('onerror') + } + tref = setTimeout(function () { + onerror('timeout') + }, 15000) + unloadRef = eventUtils.unloadAdd(cleanup) + return { + post: post, + cleanup: cleanup, + loaded: unattach + } + } + } + + module.exports.iframeEnabled = false + if (global.document) { + // postMessage misbehaves in konqueror 4.6.5 - the messages are delivered with + // huge delay, or not at all. + module.exports.iframeEnabled = (typeof global.postMessage === 'function' || + typeof global.postMessage === 'object') && (!browser.isKonqueror()) + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7), __webpack_require__(6))) + /** */ }, +/* 64 */ + /** */ function (module, exports, __webpack_require__) { +// false -> Array#indexOf +// true -> Array#includes + var toIObject = __webpack_require__(16) + var toLength = __webpack_require__(8) + var toAbsoluteIndex = __webpack_require__(49) + 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 + } + } + /** */ }, +/* 65 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var global = __webpack_require__(2) + var $export = __webpack_require__(0) + var meta = __webpack_require__(36) + var fails = __webpack_require__(5) + var hide = __webpack_require__(22) + var redefineAll = __webpack_require__(47) + var forOf = __webpack_require__(35) + var anInstance = __webpack_require__(43) + var isObject = __webpack_require__(4) + var setToStringTag = __webpack_require__(51) + var dP = __webpack_require__(11).f + var each = __webpack_require__(25)(0) + var DESCRIPTORS = __webpack_require__(12) + + module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME] + var C = Base + var ADDER = IS_MAP ? 'set' : 'add' + var proto = C && C.prototype + var O = {} + if (!DESCRIPTORS || typeof C !== 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next() + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER) + redefineAll(C.prototype, methods) + meta.NEED = true + } else { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME, '_c') + target._c = new Base() + if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target) + }) + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set' + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) { + hide(C.prototype, KEY, function (a, b) { + anInstance(this, C, KEY) + if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false + var result = this._c[KEY](a === 0 ? 0 : a, b) + return IS_ADDER ? this : result + }) + } + }) + IS_WEAK || dP(C.prototype, 'size', { + get: function () { + return this._c.size + } + }) + } + + setToStringTag(C, NAME) + + O[NAME] = C + $export($export.G + $export.W + $export.F, O) + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP) + + return C + } + /** */ }, +/* 66 */ + /** */ function (module, exports, __webpack_require__) { +// 7.2.2 IsArray(argument) + var cof = __webpack_require__(27) + module.exports = Array.isArray || function isArray (arg) { + return cof(arg) == 'Array' + } + /** */ }, +/* 67 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var create = __webpack_require__(37) + var descriptor = __webpack_require__(39) + var setToStringTag = __webpack_require__(51) + var IteratorPrototype = {} + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(22)(IteratorPrototype, __webpack_require__(9)('iterator'), function () { return this }) + + module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }) + setToStringTag(Constructor, NAME + ' Iterator') + } + /** */ }, +/* 68 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var LIBRARY = __webpack_require__(46) + var $export = __webpack_require__(0) + var redefine = __webpack_require__(96) + var hide = __webpack_require__(22) + var has = __webpack_require__(21) + var Iterators = __webpack_require__(45) + var $iterCreate = __webpack_require__(67) + var setToStringTag = __webpack_require__(51) + var getPrototypeOf = __webpack_require__(18) + var ITERATOR = __webpack_require__(9)('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 && !has(IteratorPrototype, ITERATOR)) 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 + } + /** */ }, +/* 69 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +// Forced replacement prototype accessors methods + module.exports = __webpack_require__(46) || !__webpack_require__(5)(function () { + var K = Math.random() + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }) + delete __webpack_require__(2)[K] + }) + /** */ }, +/* 70 */ + /** */ function (module, exports) { + exports.f = Object.getOwnPropertySymbols + /** */ }, +/* 71 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +// https://tc39.github.io/proposal-setmap-offrom/ + var $export = __webpack_require__(0) + var aFunction = __webpack_require__(14) + var ctx = __webpack_require__(20) + var forOf = __webpack_require__(35) + + module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { from: function from (source /* , mapFn, thisArg */) { + var mapFn = arguments[1] + var mapping, A, n, cb + aFunction(this) + mapping = mapFn !== undefined + if (mapping) aFunction(mapFn) + if (source == undefined) return new this() + A = [] + if (mapping) { + n = 0 + cb = ctx(mapFn, arguments[2], 2) + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)) + }) + } else { + forOf(source, false, A.push, A) + } + return new this(A) + } }) + } + /** */ }, +/* 72 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +// https://tc39.github.io/proposal-setmap-offrom/ + var $export = __webpack_require__(0) + + module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { of: function of () { + var length = arguments.length + var A = Array(length) + while (length--) A[length] = arguments[length] + return new this(A) + } }) + } + /** */ }, +/* 73 */ + /** */ function (module, exports, __webpack_require__) { + var global = __webpack_require__(2) + var SHARED = '__core-js_shared__' + var store = global[SHARED] || (global[SHARED] = {}) + module.exports = function (key) { + return store[key] || (store[key] = {}) + } + /** */ }, +/* 74 */ + /** */ function (module, exports, __webpack_require__) { +// 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(1) + var aFunction = __webpack_require__(14) + var SPECIES = __webpack_require__(9)('species') + module.exports = function (O, D) { + var C = anObject(O).constructor + var S + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S) + } + /** */ }, +/* 75 */ + /** */ function (module, exports, __webpack_require__) { + var global = __webpack_require__(2) + var hide = __webpack_require__(22) + var uid = __webpack_require__(52) + var TYPED = uid('typed_array') + var VIEW = uid('view') + var ABV = !!(global.ArrayBuffer && global.DataView) + var CONSTR = ABV + var i = 0 + var l = 9 + var Typed + + var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(',') + + while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true) + hide(Typed.prototype, VIEW, true) + } else CONSTR = false + } + + module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW + } + /** */ }, +/* 76 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (process) { + var inherits = __webpack_require__(3), + EventEmitter = __webpack_require__(17).EventEmitter + + var debug = function () {} + if (process.env.NODE_ENV !== 'production') { + debug = __webpack_require__(10)('sockjs-client:receiver:xhr') + } + + function XhrReceiver (url, AjaxObject) { + debug(url) + EventEmitter.call(this) + var self = this + + this.bufferPosition = 0 + + this.xo = new AjaxObject('POST', url, null) + this.xo.on('chunk', this._chunkHandler.bind(this)) + this.xo.once('finish', function (status, text) { + debug('finish', status, text) + self._chunkHandler(status, text) + self.xo = null + var reason = status === 200 ? 'network' : 'permanent' + debug('close', reason) + self.emit('close', null, reason) + self._cleanup() + }) + } + + inherits(XhrReceiver, EventEmitter) + + XhrReceiver.prototype._chunkHandler = function (status, text) { + debug('_chunkHandler', status) + if (status !== 200 || !text) { + return + } + + for (var idx = -1; ; this.bufferPosition += idx + 1) { + var buf = text.slice(this.bufferPosition) + idx = buf.indexOf('\n') + if (idx === -1) { + break + } + var msg = buf.slice(0, idx) + if (msg) { + debug('message', msg) + this.emit('message', msg) + } + } + } + + XhrReceiver.prototype._cleanup = function () { + debug('_cleanup') + this.removeAllListeners() + } + + XhrReceiver.prototype.abort = function () { + debug('abort') + if (this.xo) { + this.xo.close() + debug('close') + this.emit('close', null, 'user') + this.xo = null + } + this._cleanup() + } + + module.exports = XhrReceiver + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7))) + /** */ }, +/* 77 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var inherits = __webpack_require__(3), + XhrDriver = __webpack_require__(161) + + function XHRCorsObject (method, url, payload, opts) { + XhrDriver.call(this, method, url, payload, opts) + } + + inherits(XHRCorsObject, XhrDriver) + + XHRCorsObject.enabled = XhrDriver.enabled && XhrDriver.supportsCORS + + module.exports = XHRCorsObject + /** */ }, +/* 78 */ + /** */ function (module, exports, __webpack_require__) { +// This is (almost) directly from Node.js utils +// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js + + var getName = __webpack_require__(115) + var getProperties = __webpack_require__(200) + var getEnumerableProperties = __webpack_require__(197) + + module.exports = inspect + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Boolean} showHidden Flag that shows hidden (not enumerable) + * properties of objects. + * @param {Number} depth Depth in which to descend in object. Default is 2. + * @param {Boolean} colors Flag to turn on ANSI escape codes to color the + * output. Default is false (no coloring). + * @namespace Utils + * @name inspect + */ + function inspect (obj, showHidden, depth, colors) { + var ctx = { + showHidden: showHidden, + seen: [], + stylize: function (str) { return str } + } + return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth)) + } + +// Returns true if object is a DOM element. + var isDOMElement = function (object) { + if (typeof HTMLElement === 'object') { + return object instanceof HTMLElement + } else { + return object && + typeof object === 'object' && + object.nodeType === 1 && + typeof object.nodeName === 'string' + } + } + + function formatValue (ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (value && typeof value.inspect === 'function' && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes) + if (typeof ret !== 'string') { + ret = formatValue(ctx, ret, recurseTimes) + } + return ret + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value) + if (primitive) { + return primitive + } + + // If this is a DOM element, try to get the outer HTML. + if (isDOMElement(value)) { + if ('outerHTML' in value) { + return value.outerHTML + // This value does not have an outerHTML attribute, + // it could still be an XML element + } else { + // Attempt to serialize it + try { + if (document.xmlVersion) { + var xmlSerializer = new XMLSerializer() + return xmlSerializer.serializeToString(value) + } else { + // Firefox 11- do not support outerHTML + // It does, however, support innerHTML + // Use the following to render the element + var ns = 'http://www.w3.org/1999/xhtml' + var container = document.createElementNS(ns, '_') + + container.appendChild(value.cloneNode(false)) + html = container.innerHTML + .replace('><', '>' + value.innerHTML + '<') + container.innerHTML = '' + return html + } + } catch (err) { + // This could be a non-native DOM implementation, + // continue with the normal flow: + // printing the element as if it is an object. + } + } + } + + // Look up the keys of the object. + var visibleKeys = getEnumerableProperties(value) + var keys = ctx.showHidden ? getProperties(value) : visibleKeys + + // Some type of object without properties can be shortcutted. + // In IE, errors have a single `stack` property, or if they are vanilla `Error`, + // a `stack` plus `description` property; ignore those for consistency. + if (keys.length === 0 || (isError(value) && ( + (keys.length === 1 && keys[0] === 'stack') || + (keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack') + ))) { + if (typeof value === 'function') { + var name = getName(value) + var nameSuffix = name ? ': ' + name : '' + return ctx.stylize('[Function' + nameSuffix + ']', 'special') + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp') + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toUTCString.call(value), 'date') + } + if (isError(value)) { + return formatError(value) + } + } + + var base = '', array = false, braces = ['{', '}'] + + // Make Array say that they are Array + if (isArray(value)) { + array = true + braces = ['[', ']'] + } + + // Make functions say that they are functions + if (typeof value === 'function') { + var name = getName(value) + var nameSuffix = name ? ': ' + name : '' + base = ' [Function' + nameSuffix + ']' + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value) + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value) + } + + // Make error with message first say the error + if (isError(value)) { + return formatError(value) + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1] + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp') + } else { + return ctx.stylize('[Object]', 'special') + } + } + + ctx.seen.push(value) + + var output + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys) + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) + }) + } + + ctx.seen.pop() + + return reduceToSingleString(output, base, braces) + } + + function formatPrimitive (ctx, value) { + switch (typeof value) { + case 'undefined': + return ctx.stylize('undefined', 'undefined') + + case 'string': + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\'' + return ctx.stylize(simple, 'string') + + case 'number': + if (value === 0 && (1 / value) === -Infinity) { + return ctx.stylize('-0', 'number') + } + return ctx.stylize('' + value, 'number') + + case 'boolean': + return ctx.stylize('' + value, 'boolean') + } + // For some reason typeof null is "object", so special case here. + if (value === null) { + return ctx.stylize('null', 'null') + } + } + + function formatError (value) { + return '[' + Error.prototype.toString.call(value) + ']' + } + + function formatArray (ctx, value, recurseTimes, visibleKeys, keys) { + var output = [] + for (var i = 0, l = value.length; i < l; ++i) { + if (Object.prototype.hasOwnProperty.call(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)) + } else { + output.push('') + } + } + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)) + } + }) + return output + } + + function formatProperty (ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str + if (value.__lookupGetter__) { + if (value.__lookupGetter__(key)) { + if (value.__lookupSetter__(key)) { + str = ctx.stylize('[Getter/Setter]', 'special') + } else { + str = ctx.stylize('[Getter]', 'special') + } + } else { + if (value.__lookupSetter__(key)) { + str = ctx.stylize('[Setter]', 'special') + } + } + } + if (visibleKeys.indexOf(key) < 0) { + name = '[' + key + ']' + } + if (!str) { + if (ctx.seen.indexOf(value[key]) < 0) { + if (recurseTimes === null) { + str = formatValue(ctx, value[key], null) + } else { + str = formatValue(ctx, value[key], recurseTimes - 1) + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line + }).join('\n').substr(2) + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line + }).join('\n') + } + } + } else { + str = ctx.stylize('[Circular]', 'special') + } + } + if (typeof name === 'undefined') { + if (array && key.match(/^\d+$/)) { + return str + } + name = JSON.stringify('' + key) + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2) + name = ctx.stylize(name, 'name') + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'") + name = ctx.stylize(name, 'string') + } + } + + return name + ': ' + str + } + + function reduceToSingleString (output, base, braces) { + var numLinesEst = 0 + var length = output.reduce(function (prev, cur) { + numLinesEst++ + if (cur.indexOf('\n') >= 0) numLinesEst++ + return prev + cur.length + 1 + }, 0) + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1] + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1] + } + + function isArray (ar) { + return Array.isArray(ar) || + (typeof ar === 'object' && objectToString(ar) === '[object Array]') + } + + function isRegExp (re) { + return typeof re === 'object' && objectToString(re) === '[object RegExp]' + } + + function isDate (d) { + return typeof d === 'object' && objectToString(d) === '[object Date]' + } + + function isError (e) { + return typeof e === 'object' && objectToString(e) === '[object Error]' + } + + function objectToString (o) { + return Object.prototype.toString.call(o) + } + /** */ }, +/* 79 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + + var toObject = __webpack_require__(13) + var toAbsoluteIndex = __webpack_require__(49) + var toLength = __webpack_require__(8) + module.exports = function fill (value /* , start = 0, end = @length */) { + var O = toObject(this) + var length = toLength(O.length) + var aLen = arguments.length + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length) + var end = aLen > 2 ? arguments[2] : undefined + var endPos = end === undefined ? length : toAbsoluteIndex(end, length) + while (endPos > index) O[index++] = value + return O + } + /** */ }, +/* 80 */ + /** */ function (module, exports, __webpack_require__) { +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) + var speciesConstructor = __webpack_require__(206) + + module.exports = function (original, length) { + return new (speciesConstructor(original))(length) + } + /** */ }, +/* 81 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var $defineProperty = __webpack_require__(11) + var createDesc = __webpack_require__(39) + + module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)) + else object[index] = value + } + /** */ }, +/* 82 */ + /** */ function (module, exports, __webpack_require__) { + var isObject = __webpack_require__(4) + var document = __webpack_require__(2).document +// typeof document.createElement is 'object' in old IE + var is = isObject(document) && isObject(document.createElement) + module.exports = function (it) { + return is ? document.createElement(it) : {} + } + /** */ }, +/* 83 */ + /** */ function (module, exports) { +// IE 8- don't enum bug keys + module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(',') + /** */ }, +/* 84 */ + /** */ function (module, exports, __webpack_require__) { + var MATCH = __webpack_require__(9)('match') + module.exports = function (KEY) { + var re = /./ + try { + '/./'[KEY](re) + } catch (e) { + try { + re[MATCH] = false + return !'/./'[KEY](re) + } catch (f) { /* empty */ } + } return true + } + /** */ }, +/* 85 */ + /** */ function (module, exports, __webpack_require__) { + var document = __webpack_require__(2).document + module.exports = document && document.documentElement + /** */ }, +/* 86 */ + /** */ function (module, exports) { +// fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function (fn, args, that) { + var un = that === undefined + switch (args.length) { + case 0: return un ? fn() + : fn.call(that) + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]) + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]) + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]) + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]) + } return fn.apply(that, args) + } + /** */ }, +/* 87 */ + /** */ function (module, exports, __webpack_require__) { +// check on default Array iterator + var Iterators = __webpack_require__(45) + var ITERATOR = __webpack_require__(9)('iterator') + var ArrayProto = Array.prototype + + module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it) + } + /** */ }, +/* 88 */ + /** */ function (module, exports, __webpack_require__) { + var ITERATOR = __webpack_require__(9)('iterator') + var SAFE_CLOSING = false + + try { + var riter = [7][ITERATOR]() + riter['return'] = function () { SAFE_CLOSING = true } + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2 }) + } catch (e) { /* empty */ } + + module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false + var safe = false + try { + var arr = [7] + var iter = arr[ITERATOR]() + iter.next = function () { return { done: safe = true } } + arr[ITERATOR] = function () { return iter } + exec(arr) + } catch (e) { /* empty */ } + return safe + } + /** */ }, +/* 89 */ + /** */ function (module, exports) { + module.exports = function (done, value) { + return { value: value, done: !!done } + } + /** */ }, +/* 90 */ + /** */ function (module, exports) { +// 20.2.2.14 Math.expm1(x) + var $expm1 = Math.expm1 + module.exports = (!$expm1 || + // Old FF bug + $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 || + // Tor Browser bug + $expm1(-2e-17) != -2e-17 +) ? function expm1 (x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1 +} : $expm1 + /** */ }, +/* 91 */ + /** */ function (module, exports) { +// 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign (x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1 + } + /** */ }, +/* 92 */ + /** */ function (module, exports, __webpack_require__) { + var global = __webpack_require__(2) + var macrotask = __webpack_require__(103).set + var Observer = global.MutationObserver || global.WebKitMutationObserver + var process = global.process + var Promise = global.Promise + var isNode = __webpack_require__(27)(process) == 'process' + + module.exports = function () { + var head, last, notify + + var flush = function () { + var parent, fn + if (isNode && (parent = process.domain)) parent.exit() + while (head) { + fn = head.fn + head = head.next + try { + fn() + } catch (e) { + if (head) notify() + else last = undefined + throw e + } + } last = undefined + if (parent) parent.enter() + } + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush) + } + // browsers with MutationObserver + } else if (Observer) { + var toggle = true + var node = document.createTextNode('') + new Observer(flush).observe(node, { characterData: true }) // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle + } + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + var promise = Promise.resolve() + notify = function () { + promise.then(flush) + } + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush) + } + } + + return function (fn) { + var task = { fn: fn, next: undefined } + if (last) last.next = task + if (!head) { + head = task + notify() + } last = task + } + } + /** */ }, +/* 93 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +// 25.4.1.5 NewPromiseCapability(C) + var aFunction = __webpack_require__(14) + + function PromiseCapability (C) { + var resolve, reject + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor') + resolve = $$resolve + reject = $$reject + }) + this.resolve = aFunction(resolve) + this.reject = aFunction(reject) + } + + module.exports.f = function (C) { + return new PromiseCapability(C) + } + /** */ }, +/* 94 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + +// 19.1.2.1 Object.assign(target, source, ...) + var getKeys = __webpack_require__(38) + var gOPS = __webpack_require__(70) + var pIE = __webpack_require__(58) + var toObject = __webpack_require__(13) + var IObject = __webpack_require__(56) + var $assign = Object.assign + +// should work with symbols and should have deterministic property order (V8 bug) + module.exports = !$assign || __webpack_require__(5)(function () { + var A = {} + var B = {} + // eslint-disable-next-line no-undef + var S = Symbol() + var K = 'abcdefghijklmnopqrst' + A[S] = 7 + K.split('').forEach(function (k) { B[k] = k }) + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K + }) ? function assign (target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target) + var aLen = arguments.length + var index = 1 + var getSymbols = gOPS.f + var isEnum = pIE.f + while (aLen > index) { + var S = IObject(arguments[index++]) + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + var length = keys.length + var j = 0 + var key + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key] + } return T + } : $assign + /** */ }, +/* 95 */ + /** */ function (module, exports, __webpack_require__) { +// all object keys, includes non-enumerable and symbols + var gOPN = __webpack_require__(57) + var gOPS = __webpack_require__(70) + var anObject = __webpack_require__(1) + var Reflect = __webpack_require__(2).Reflect + module.exports = Reflect && Reflect.ownKeys || function ownKeys (it) { + var keys = gOPN.f(anObject(it)) + var getSymbols = gOPS.f + return getSymbols ? keys.concat(getSymbols(it)) : keys + } + /** */ }, +/* 96 */ + /** */ function (module, exports, __webpack_require__) { + module.exports = __webpack_require__(22) + /** */ }, +/* 97 */ + /** */ function (module, exports) { + module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part] + } : replace + return function (it) { + return String(it).replace(regExp, replacer) + } + } + /** */ }, +/* 98 */ + /** */ function (module, exports, __webpack_require__) { + var shared = __webpack_require__(73)('keys') + var uid = __webpack_require__(52) + module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)) + } + /** */ }, +/* 99 */ + /** */ function (module, exports, __webpack_require__) { + var toInteger = __webpack_require__(29) + var defined = __webpack_require__(30) +// 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 + } + } + /** */ }, +/* 100 */ + /** */ function (module, exports, __webpack_require__) { +// helper for String#{startsWith, endsWith, includes} + var isRegExp = __webpack_require__(132) + var defined = __webpack_require__(30) + + module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!") + return String(defined(that)) + } + /** */ }, +/* 101 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var toInteger = __webpack_require__(29) + var defined = __webpack_require__(30) + + module.exports = function repeat (count) { + var str = String(defined(this)) + var res = '' + var n = toInteger(count) + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative") + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str + return res + } + /** */ }, +/* 102 */ + /** */ function (module, exports) { + module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' + /** */ }, +/* 103 */ + /** */ function (module, exports, __webpack_require__) { + var ctx = __webpack_require__(20) + var invoke = __webpack_require__(86) + var html = __webpack_require__(85) + var cel = __webpack_require__(82) + var global = __webpack_require__(2) + var process = global.process + var setTask = global.setImmediate + var clearTask = global.clearImmediate + var MessageChannel = global.MessageChannel + var Dispatch = global.Dispatch + var counter = 0 + var queue = {} + var ONREADYSTATECHANGE = 'onreadystatechange' + var defer, channel, port + var run = function () { + var id = +this + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id] + delete queue[id] + fn() + } + } + var listener = function (event) { + run.call(event.data) + } +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!setTask || !clearTask) { + setTask = function setImmediate (fn) { + var args = [] + var i = 1 + while (arguments.length > i) args.push(arguments[i++]) + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn === 'function' ? fn : Function(fn), args) + } + defer(counter) + return counter + } + clearTask = function clearImmediate (id) { + delete queue[id] + } + // Node.js 0.8- + if (__webpack_require__(27)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)) + } + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)) + } + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel() + port = channel.port2 + channel.port1.onmessage = listener + defer = ctx(port.postMessage, port, 1) + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage === 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*') + } + global.addEventListener('message', listener, false) + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this) + run.call(id) + } + } + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0) + } + } + } + module.exports = { + set: setTask, + clear: clearTask + } + /** */ }, +/* 104 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var global = __webpack_require__(2) + var DESCRIPTORS = __webpack_require__(12) + var LIBRARY = __webpack_require__(46) + var $typed = __webpack_require__(75) + var hide = __webpack_require__(22) + var redefineAll = __webpack_require__(47) + var fails = __webpack_require__(5) + var anInstance = __webpack_require__(43) + var toInteger = __webpack_require__(29) + var toLength = __webpack_require__(8) + var toIndex = __webpack_require__(150) + var gOPN = __webpack_require__(57).f + var dP = __webpack_require__(11).f + var arrayFill = __webpack_require__(79) + var setToStringTag = __webpack_require__(51) + var ARRAY_BUFFER = 'ArrayBuffer' + var DATA_VIEW = 'DataView' + var PROTOTYPE = 'prototype' + var WRONG_LENGTH = 'Wrong length!' + var WRONG_INDEX = 'Wrong index!' + var $ArrayBuffer = global[ARRAY_BUFFER] + var $DataView = global[DATA_VIEW] + var Math = global.Math + var RangeError = global.RangeError +// eslint-disable-next-line no-shadow-restricted-names + var Infinity = global.Infinity + var BaseBuffer = $ArrayBuffer + var abs = Math.abs + var pow = Math.pow + var floor = Math.floor + var log = Math.log + var LN2 = Math.LN2 + var BUFFER = 'buffer' + var BYTE_LENGTH = 'byteLength' + var BYTE_OFFSET = 'byteOffset' + var $BUFFER = DESCRIPTORS ? '_b' : BUFFER + var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET + +// IEEE754 conversions based on https://github.com/feross/ieee754 + function packIEEE754 (value, mLen, nBytes) { + var buffer = Array(nBytes) + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + var i = 0 + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + var e, m, c + value = abs(value) + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0 + e = eMax + } else { + e = floor(log(value) / LN2) + if (value * (c = pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen) + e = e + eBias + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen) + e = 0 + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m + eLen += mLen + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128 + return buffer + } + function unpackIEEE754 (buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = eLen - 7 + var i = nBytes - 1 + var s = buffer[i--] + var e = s & 127 + var m + s >>= 7 + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1 + e >>= -nBits + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity + } else { + m = m + pow(2, mLen) + e = e - eBias + } return (s ? -1 : 1) * m * pow(2, e - mLen) + } + + function unpackI32 (bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0] + } + function packI8 (it) { + return [it & 0xff] + } + function packI16 (it) { + return [it & 0xff, it >> 8 & 0xff] + } + function packI32 (it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff] + } + function packF64 (it) { + return packIEEE754(it, 52, 8) + } + function packF32 (it) { + return packIEEE754(it, 23, 4) + } + + function addGetter (C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal] } }) + } + + function get (view, bytes, index, isLittleEndian) { + var numIndex = +index + var intIndex = toIndex(numIndex) + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX) + var store = view[$BUFFER]._b + var start = intIndex + view[$OFFSET] + var pack = store.slice(start, start + bytes) + return isLittleEndian ? pack : pack.reverse() + } + function set (view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index + var intIndex = toIndex(numIndex) + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX) + var store = view[$BUFFER]._b + var start = intIndex + view[$OFFSET] + var pack = conversion(+value) + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1] + } + + if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer (length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER) + var byteLength = toIndex(length) + this._b = arrayFill.call(Array(byteLength), 0) + this[$LENGTH] = byteLength + } + + $DataView = function DataView (buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW) + anInstance(buffer, $ArrayBuffer, DATA_VIEW) + var bufferLength = buffer[$LENGTH] + var offset = toInteger(byteOffset) + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!') + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength) + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH) + this[$BUFFER] = buffer + this[$OFFSET] = offset + this[$LENGTH] = byteLength + } + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l') + addGetter($DataView, BUFFER, '_b') + addGetter($DataView, BYTE_LENGTH, '_l') + addGetter($DataView, BYTE_OFFSET, '_o') + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8 (byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24 + }, + getUint8: function getUint8 (byteOffset) { + return get(this, 1, byteOffset)[0] + }, + getInt16: function getInt16 (byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]) + return (bytes[1] << 8 | bytes[0]) << 16 >> 16 + }, + getUint16: function getUint16 (byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]) + return bytes[1] << 8 | bytes[0] + }, + getInt32: function getInt32 (byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) + }, + getUint32: function getUint32 (byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0 + }, + getFloat32: function getFloat32 (byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4) + }, + getFloat64: function getFloat64 (byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8) + }, + setInt8: function setInt8 (byteOffset, value) { + set(this, 1, byteOffset, packI8, value) + }, + setUint8: function setUint8 (byteOffset, value) { + set(this, 1, byteOffset, packI8, value) + }, + setInt16: function setInt16 (byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]) + }, + setUint16: function setUint16 (byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]) + }, + setInt32: function setInt32 (byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]) + }, + setUint32: function setUint32 (byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]) + }, + setFloat32: function setFloat32 (byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]) + }, + setFloat64: function setFloat64 (byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]) + } + }) + } else { + if (!fails(function () { + $ArrayBuffer(1) + }) || !fails(function () { + new $ArrayBuffer(-1) // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer() // eslint-disable-line no-new + new $ArrayBuffer(1.5) // eslint-disable-line no-new + new $ArrayBuffer(NaN) // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER + })) { + $ArrayBuffer = function ArrayBuffer (length) { + anInstance(this, $ArrayBuffer) + return new BaseBuffer(toIndex(length)) + } + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE] + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]) + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + var $setInt8 = $DataView[PROTOTYPE].setInt8 + view.setInt8(0, 2147483648) + view.setInt8(1, 2147483649) + if (view.getInt8(0) || !view.getInt8(1)) { + redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8 (byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24) + }, + setUint8: function setUint8 (byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24) + } + }, true) + } + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER) + setToStringTag($DataView, DATA_VIEW) + hide($DataView[PROTOTYPE], $typed.VIEW, true) + exports[ARRAY_BUFFER] = $ArrayBuffer + exports[DATA_VIEW] = $DataView + /** */ }, +/* 105 */ + /** */ function (module, exports, __webpack_require__) { + var global = __webpack_require__(2) + var core = __webpack_require__(15) + var LIBRARY = __webpack_require__(46) + var wksExt = __webpack_require__(151) + var defineProperty = __webpack_require__(11).f + module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}) + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }) + } + /** */ }, +/* 106 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + var addToUnscopables = __webpack_require__(34) + var step = __webpack_require__(89) + var Iterators = __webpack_require__(45) + var toIObject = __webpack_require__(16) + +// 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__(68)(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') + /** */ }, +/* 107 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + function Event (eventType) { + this.type = eventType + } + + Event.prototype.initEvent = function (eventType, canBubble, cancelable) { + this.type = eventType + this.bubbles = canBubble + this.cancelable = cancelable + this.timeStamp = +new Date() + return this + } + + Event.prototype.stopPropagation = function () {} + Event.prototype.preventDefault = function () {} + + Event.CAPTURING_PHASE = 1 + Event.AT_TARGET = 2 + Event.BUBBLING_PHASE = 3 + + module.exports = Event + /** */ }, +/* 108 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (global) { + var inherits = __webpack_require__(3), + IframeTransport = __webpack_require__(165), + objectUtils = __webpack_require__(110) + + module.exports = function (transport) { + function IframeWrapTransport (transUrl, baseUrl) { + IframeTransport.call(this, transport.transportName, transUrl, baseUrl) + } + + inherits(IframeWrapTransport, IframeTransport) + + IframeWrapTransport.enabled = function (url, info) { + if (!global.document) { + return false + } + + var iframeInfo = objectUtils.extend({}, info) + iframeInfo.sameOrigin = true + return transport.enabled(iframeInfo) && IframeTransport.enabled() + } + + IframeWrapTransport.transportName = 'iframe-' + transport.transportName + IframeWrapTransport.needBody = true + IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1 // html, javascript (2) + transport - no CORS (1) + + IframeWrapTransport.facadeTransport = transport + + return IframeWrapTransport + } + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(6))) + /** */ }, +/* 109 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict'; + /* WEBPACK VAR INJECTION */(function (process, global) { + var EventEmitter = __webpack_require__(17).EventEmitter, + inherits = __webpack_require__(3), + eventUtils = __webpack_require__(41), + browser = __webpack_require__(62), + urlUtils = __webpack_require__(24) + + var debug = function () {} + if (process.env.NODE_ENV !== 'production') { + debug = __webpack_require__(10)('sockjs-client:sender:xdr') + } + +// References: +// http://ajaxian.com/archives/100-line-ajax-wrapper +// http://msdn.microsoft.com/en-us/library/cc288060(v=VS.85).aspx + + function XDRObject (method, url, payload) { + debug(method, url) + var self = this + EventEmitter.call(this) + + setTimeout(function () { + self._start(method, url, payload) + }, 0) + } + + inherits(XDRObject, EventEmitter) + + XDRObject.prototype._start = function (method, url, payload) { + debug('_start') + var self = this + var xdr = new global.XDomainRequest() + // IE caches even POSTs + url = urlUtils.addQuery(url, 't=' + (+new Date())) + + xdr.onerror = function () { + debug('onerror') + self._error() + } + xdr.ontimeout = function () { + debug('ontimeout') + self._error() + } + xdr.onprogress = function () { + debug('progress', xdr.responseText) + self.emit('chunk', 200, xdr.responseText) + } + xdr.onload = function () { + debug('load') + self.emit('finish', 200, xdr.responseText) + self._cleanup(false) + } + this.xdr = xdr + this.unloadRef = eventUtils.unloadAdd(function () { + self._cleanup(true) + }) + try { + // Fails with AccessDenied if port number is bogus + this.xdr.open(method, url) + if (this.timeout) { + this.xdr.timeout = this.timeout + } + this.xdr.send(payload) + } catch (x) { + this._error() + } + } + + XDRObject.prototype._error = function () { + this.emit('finish', 0, '') + this._cleanup(false) + } + + XDRObject.prototype._cleanup = function (abort) { + debug('cleanup', abort) + if (!this.xdr) { + return + } + this.removeAllListeners() + eventUtils.unloadDel(this.unloadRef) + + this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr.onload = null + if (abort) { + try { + this.xdr.abort() + } catch (x) { + // intentionally empty + } + } + this.unloadRef = this.xdr = null + } + + XDRObject.prototype.close = function () { + debug('close') + this._cleanup(true) + } + +// IE 8/9 if the request target uses the same scheme - #79 + XDRObject.enabled = !!(global.XDomainRequest && browser.hasDomain()) + + module.exports = XDRObject + /* WEBPACK VAR INJECTION */ }.call(exports, __webpack_require__(7), __webpack_require__(6))) + /** */ }, +/* 110 */ + /** */ function (module, exports, __webpack_require__) { + 'use strict' + + module.exports = { + isObject: function (obj) { + var type = typeof obj + return type === 'function' || type === 'object' && !!obj + }, + + extend: function (obj) { + if (!this.isObject(obj)) { + return obj + } + var source, prop + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i] + for (prop in source) { + if (Object.prototype.hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop] + } + } + } + return obj + } + } + /** */ }, +/* 111 */ + /** */ function (module, exports, __webpack_require__) { + module.exports = __webpack_require__(460) + /** */ }, +/* 112 */ + /** */ function (module, exports, __webpack_require__) { +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + var stylesInDom = {}, + memoize = function (fn) { + var memo + return function () { + if (typeof memo === 'undefined') memo = fn.apply(this, arguments) + return memo + } + }, + isOldIE = memoize(function () { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob + }), + getElement = (function (fn) { + var memo = {} + return function (selector) { + if (typeof memo[selector] === 'undefined') { + memo[selector] = fn.call(this, selector) + } + return memo[selector] + } + })(function (styleTarget) { + return document.querySelector(styleTarget) + }), + singletonElement = null, + singletonCounter = 0, + styleElementsInsertedAtTop = [], + fixUrls = __webpack_require__(459) + + module.exports = function (list, options) { + if (typeof DEBUG !== 'undefined' && DEBUG) { + if (typeof document !== 'object') throw new Error('The style-loader cannot be used in a non-browser environment') + } + + options = options || {} + options.attrs = typeof options.attrs === 'object' ? options.attrs : {} + + // Force single-tag solution on IE6-9, which has a hard limit on the # of