\n * ```\n */\nexports.default = {\n bind: function bind(el, binding, vnode) {\n nodeList.push(el);\n var id = seed++;\n el[ctx] = {\n id: id,\n documentHandler: createDocumentHandler(el, binding, vnode),\n methodName: binding.expression,\n bindingFn: binding.value\n };\n },\n update: function update(el, binding, vnode) {\n el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);\n el[ctx].methodName = binding.expression;\n el[ctx].bindingFn = binding.value;\n },\n unbind: function unbind(el) {\n var len = nodeList.length;\n\n for (var i = 0; i < len; i++) {\n if (nodeList[i][ctx].id === el[ctx].id) {\n nodeList.splice(i, 1);\n break;\n }\n }\n delete el[ctx];\n }\n};","'use strict';\n\nexports.__esModule = true;\nexports.validateRangeInOneMonth = exports.extractTimeFormat = exports.extractDateFormat = exports.nextYear = exports.prevYear = exports.nextMonth = exports.prevMonth = exports.changeYearMonthAndClampDate = exports.timeWithinRange = exports.limitTimeRange = exports.clearMilliseconds = exports.clearTime = exports.modifyWithTimeString = exports.modifyTime = exports.modifyDate = exports.range = exports.getRangeMinutes = exports.getMonthDays = exports.getPrevMonthLastDays = exports.getRangeHours = exports.getWeekNumber = exports.getStartDateOfMonth = exports.nextDate = exports.prevDate = exports.getFirstDayOfMonth = exports.getDayCountOfYear = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isDateObject = exports.isDate = exports.toDate = exports.getI18nSettings = undefined;\n\nvar _date = require('element-ui/lib/utils/date');\n\nvar _date2 = _interopRequireDefault(_date);\n\nvar _locale = require('element-ui/lib/locale');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\nvar months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];\n\nvar newArray = function newArray(start, end) {\n var result = [];\n for (var i = start; i <= end; i++) {\n result.push(i);\n }\n return result;\n};\n\nvar getI18nSettings = exports.getI18nSettings = function getI18nSettings() {\n return {\n dayNamesShort: weeks.map(function (week) {\n return (0, _locale.t)('el.datepicker.weeks.' + week);\n }),\n dayNames: weeks.map(function (week) {\n return (0, _locale.t)('el.datepicker.weeks.' + week);\n }),\n monthNamesShort: months.map(function (month) {\n return (0, _locale.t)('el.datepicker.months.' + month);\n }),\n monthNames: months.map(function (month, index) {\n return (0, _locale.t)('el.datepicker.month' + (index + 1));\n }),\n amPm: ['am', 'pm']\n };\n};\n\nvar toDate = exports.toDate = function toDate(date) {\n return isDate(date) ? new Date(date) : null;\n};\n\nvar isDate = exports.isDate = function isDate(date) {\n if (date === null || date === undefined) return false;\n if (isNaN(new Date(date).getTime())) return false;\n if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`\n return true;\n};\n\nvar isDateObject = exports.isDateObject = function isDateObject(val) {\n return val instanceof Date;\n};\n\nvar formatDate = exports.formatDate = function formatDate(date, format) {\n date = toDate(date);\n if (!date) return '';\n return _date2.default.format(date, format || 'yyyy-MM-dd', getI18nSettings());\n};\n\nvar parseDate = exports.parseDate = function parseDate(string, format) {\n return _date2.default.parse(string, format || 'yyyy-MM-dd', getI18nSettings());\n};\n\nvar getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {\n if (isNaN(+month)) return 31;\n\n return new Date(year, +month + 1, 0).getDate();\n};\n\nvar getDayCountOfYear = exports.getDayCountOfYear = function getDayCountOfYear(year) {\n var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;\n return isLeapYear ? 366 : 365;\n};\n\nvar getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {\n var temp = new Date(date.getTime());\n temp.setDate(1);\n return temp.getDay();\n};\n\n// see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript\n// {prev, next} Date should work for Daylight Saving Time\n// Adding 24 * 60 * 60 * 1000 does not work in the above scenario\nvar prevDate = exports.prevDate = function prevDate(date) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);\n};\n\nvar nextDate = exports.nextDate = function nextDate(date) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);\n};\n\nvar getStartDateOfMonth = exports.getStartDateOfMonth = function getStartDateOfMonth(year, month) {\n var result = new Date(year, month, 1);\n var day = result.getDay();\n\n if (day === 0) {\n return prevDate(result, 7);\n } else {\n return prevDate(result, day);\n }\n};\n\nvar getWeekNumber = exports.getWeekNumber = function getWeekNumber(src) {\n if (!isDate(src)) return null;\n var date = new Date(src.getTime());\n date.setHours(0, 0, 0, 0);\n // Thursday in current week decides the year.\n date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);\n // January 4 is always in week 1.\n var week1 = new Date(date.getFullYear(), 0, 4);\n // Adjust to Thursday in week 1 and count number of weeks from date to week 1.\n // Rounding should be fine for Daylight Saving Time. Its shift should never be more than 12 hours.\n return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n};\n\nvar getRangeHours = exports.getRangeHours = function getRangeHours(ranges) {\n var hours = [];\n var disabledHours = [];\n\n (ranges || []).forEach(function (range) {\n var value = range.map(function (date) {\n return date.getHours();\n });\n\n disabledHours = disabledHours.concat(newArray(value[0], value[1]));\n });\n\n if (disabledHours.length) {\n for (var i = 0; i < 24; i++) {\n hours[i] = disabledHours.indexOf(i) === -1;\n }\n } else {\n for (var _i = 0; _i < 24; _i++) {\n hours[_i] = false;\n }\n }\n\n return hours;\n};\n\nvar getPrevMonthLastDays = exports.getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {\n if (amount <= 0) return [];\n var temp = new Date(date.getTime());\n temp.setDate(0);\n var lastDay = temp.getDate();\n return range(amount).map(function (_, index) {\n return lastDay - (amount - index - 1);\n });\n};\n\nvar getMonthDays = exports.getMonthDays = function getMonthDays(date) {\n var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);\n var days = temp.getDate();\n return range(days).map(function (_, index) {\n return index + 1;\n });\n};\n\nfunction setRangeData(arr, start, end, value) {\n for (var i = start; i < end; i++) {\n arr[i] = value;\n }\n}\n\nvar getRangeMinutes = exports.getRangeMinutes = function getRangeMinutes(ranges, hour) {\n var minutes = new Array(60);\n\n if (ranges.length > 0) {\n ranges.forEach(function (range) {\n var start = range[0];\n var end = range[1];\n var startHour = start.getHours();\n var startMinute = start.getMinutes();\n var endHour = end.getHours();\n var endMinute = end.getMinutes();\n if (startHour === hour && endHour !== hour) {\n setRangeData(minutes, startMinute, 60, true);\n } else if (startHour === hour && endHour === hour) {\n setRangeData(minutes, startMinute, endMinute + 1, true);\n } else if (startHour !== hour && endHour === hour) {\n setRangeData(minutes, 0, endMinute + 1, true);\n } else if (startHour < hour && endHour > hour) {\n setRangeData(minutes, 0, 60, true);\n }\n });\n } else {\n setRangeData(minutes, 0, 60, true);\n }\n return minutes;\n};\n\nvar range = exports.range = function range(n) {\n // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n\n return Array.apply(null, { length: n }).map(function (_, n) {\n return n;\n });\n};\n\nvar modifyDate = exports.modifyDate = function modifyDate(date, y, m, d) {\n return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n};\n\nvar modifyTime = exports.modifyTime = function modifyTime(date, h, m, s) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());\n};\n\nvar modifyWithTimeString = exports.modifyWithTimeString = function modifyWithTimeString(date, time) {\n if (date == null || !time) {\n return date;\n }\n time = parseDate(time, 'HH:mm:ss');\n return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());\n};\n\nvar clearTime = exports.clearTime = function clearTime(date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n};\n\nvar clearMilliseconds = exports.clearMilliseconds = function clearMilliseconds(date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);\n};\n\nvar limitTimeRange = exports.limitTimeRange = function limitTimeRange(date, ranges) {\n var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';\n\n // TODO: refactory a more elegant solution\n if (ranges.length === 0) return date;\n var normalizeDate = function normalizeDate(date) {\n return _date2.default.parse(_date2.default.format(date, format), format);\n };\n var ndate = normalizeDate(date);\n var nranges = ranges.map(function (range) {\n return range.map(normalizeDate);\n });\n if (nranges.some(function (nrange) {\n return ndate >= nrange[0] && ndate <= nrange[1];\n })) return date;\n\n var minDate = nranges[0][0];\n var maxDate = nranges[0][0];\n\n nranges.forEach(function (nrange) {\n minDate = new Date(Math.min(nrange[0], minDate));\n maxDate = new Date(Math.max(nrange[1], minDate));\n });\n\n var ret = ndate < minDate ? minDate : maxDate;\n // preserve Year/Month/Date\n return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());\n};\n\nvar timeWithinRange = exports.timeWithinRange = function timeWithinRange(date, selectableRange, format) {\n var limitedDate = limitTimeRange(date, selectableRange, format);\n return limitedDate.getTime() === date.getTime();\n};\n\nvar changeYearMonthAndClampDate = exports.changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {\n // clamp date to the number of days in `year`, `month`\n // eg: (2010-1-31, 2010, 2) => 2010-2-28\n var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));\n return modifyDate(date, year, month, monthDate);\n};\n\nvar prevMonth = exports.prevMonth = function prevMonth(date) {\n var year = date.getFullYear();\n var month = date.getMonth();\n return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);\n};\n\nvar nextMonth = exports.nextMonth = function nextMonth(date) {\n var year = date.getFullYear();\n var month = date.getMonth();\n return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);\n};\n\nvar prevYear = exports.prevYear = function prevYear(date) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var year = date.getFullYear();\n var month = date.getMonth();\n return changeYearMonthAndClampDate(date, year - amount, month);\n};\n\nvar nextYear = exports.nextYear = function nextYear(date) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var year = date.getFullYear();\n var month = date.getMonth();\n return changeYearMonthAndClampDate(date, year + amount, month);\n};\n\nvar extractDateFormat = exports.extractDateFormat = function extractDateFormat(format) {\n return format.replace(/\\W?m{1,2}|\\W?ZZ/g, '').replace(/\\W?h{1,2}|\\W?s{1,3}|\\W?a/gi, '').trim();\n};\n\nvar extractTimeFormat = exports.extractTimeFormat = function extractTimeFormat(format) {\n return format.replace(/\\W?D{1,2}|\\W?Do|\\W?d{1,4}|\\W?M{1,4}|\\W?y{2,4}/g, '').trim();\n};\n\nvar validateRangeInOneMonth = exports.validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {\n return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();\n};","'use strict';\n\n/* Modified from https://github.com/taylorhakes/fecha\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 Taylor Hakes\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/*eslint-disable*/\n// 把 YYYY-MM-DD 改成了 yyyy-MM-dd\n(function (main) {\n 'use strict';\n\n /**\n * Parse or format dates\n * @class fecha\n */\n\n var fecha = {};\n var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\\1?|[aA]|\"[^\"]*\"|'[^']*'/g;\n var twoDigits = '\\\\d\\\\d?';\n var threeDigits = '\\\\d{3}';\n var fourDigits = '\\\\d{4}';\n var word = '[^\\\\s]+';\n var literal = /\\[([^]*?)\\]/gm;\n var noop = function noop() {};\n\n function regexEscape(str) {\n return str.replace(/[|\\\\{()[^$+*?.-]/g, '\\\\$&');\n }\n\n function shorten(arr, sLen) {\n var newArr = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n newArr.push(arr[i].substr(0, sLen));\n }\n return newArr;\n }\n\n function monthUpdate(arrName) {\n return function (d, v, i18n) {\n var index = i18n[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());\n if (~index) {\n d.month = index;\n }\n };\n }\n\n function pad(val, len) {\n val = String(val);\n len = len || 2;\n while (val.length < len) {\n val = '0' + val;\n }\n return val;\n }\n\n var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var monthNamesShort = shorten(monthNames, 3);\n var dayNamesShort = shorten(dayNames, 3);\n fecha.i18n = {\n dayNamesShort: dayNamesShort,\n dayNames: dayNames,\n monthNamesShort: monthNamesShort,\n monthNames: monthNames,\n amPm: ['am', 'pm'],\n DoFn: function DoFn(D) {\n return D + ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];\n }\n };\n\n var formatFlags = {\n D: function D(dateObj) {\n return dateObj.getDay();\n },\n DD: function DD(dateObj) {\n return pad(dateObj.getDay());\n },\n Do: function Do(dateObj, i18n) {\n return i18n.DoFn(dateObj.getDate());\n },\n d: function d(dateObj) {\n return dateObj.getDate();\n },\n dd: function dd(dateObj) {\n return pad(dateObj.getDate());\n },\n ddd: function ddd(dateObj, i18n) {\n return i18n.dayNamesShort[dateObj.getDay()];\n },\n dddd: function dddd(dateObj, i18n) {\n return i18n.dayNames[dateObj.getDay()];\n },\n M: function M(dateObj) {\n return dateObj.getMonth() + 1;\n },\n MM: function MM(dateObj) {\n return pad(dateObj.getMonth() + 1);\n },\n MMM: function MMM(dateObj, i18n) {\n return i18n.monthNamesShort[dateObj.getMonth()];\n },\n MMMM: function MMMM(dateObj, i18n) {\n return i18n.monthNames[dateObj.getMonth()];\n },\n yy: function yy(dateObj) {\n return pad(String(dateObj.getFullYear()), 4).substr(2);\n },\n yyyy: function yyyy(dateObj) {\n return pad(dateObj.getFullYear(), 4);\n },\n h: function h(dateObj) {\n return dateObj.getHours() % 12 || 12;\n },\n hh: function hh(dateObj) {\n return pad(dateObj.getHours() % 12 || 12);\n },\n H: function H(dateObj) {\n return dateObj.getHours();\n },\n HH: function HH(dateObj) {\n return pad(dateObj.getHours());\n },\n m: function m(dateObj) {\n return dateObj.getMinutes();\n },\n mm: function mm(dateObj) {\n return pad(dateObj.getMinutes());\n },\n s: function s(dateObj) {\n return dateObj.getSeconds();\n },\n ss: function ss(dateObj) {\n return pad(dateObj.getSeconds());\n },\n S: function S(dateObj) {\n return Math.round(dateObj.getMilliseconds() / 100);\n },\n SS: function SS(dateObj) {\n return pad(Math.round(dateObj.getMilliseconds() / 10), 2);\n },\n SSS: function SSS(dateObj) {\n return pad(dateObj.getMilliseconds(), 3);\n },\n a: function a(dateObj, i18n) {\n return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];\n },\n A: function A(dateObj, i18n) {\n return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();\n },\n ZZ: function ZZ(dateObj) {\n var o = dateObj.getTimezoneOffset();\n return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);\n }\n };\n\n var parseFlags = {\n d: [twoDigits, function (d, v) {\n d.day = v;\n }],\n Do: [twoDigits + word, function (d, v) {\n d.day = parseInt(v, 10);\n }],\n M: [twoDigits, function (d, v) {\n d.month = v - 1;\n }],\n yy: [twoDigits, function (d, v) {\n var da = new Date(),\n cent = +('' + da.getFullYear()).substr(0, 2);\n d.year = '' + (v > 68 ? cent - 1 : cent) + v;\n }],\n h: [twoDigits, function (d, v) {\n d.hour = v;\n }],\n m: [twoDigits, function (d, v) {\n d.minute = v;\n }],\n s: [twoDigits, function (d, v) {\n d.second = v;\n }],\n yyyy: [fourDigits, function (d, v) {\n d.year = v;\n }],\n S: ['\\\\d', function (d, v) {\n d.millisecond = v * 100;\n }],\n SS: ['\\\\d{2}', function (d, v) {\n d.millisecond = v * 10;\n }],\n SSS: [threeDigits, function (d, v) {\n d.millisecond = v;\n }],\n D: [twoDigits, noop],\n ddd: [word, noop],\n MMM: [word, monthUpdate('monthNamesShort')],\n MMMM: [word, monthUpdate('monthNames')],\n a: [word, function (d, v, i18n) {\n var val = v.toLowerCase();\n if (val === i18n.amPm[0]) {\n d.isPm = false;\n } else if (val === i18n.amPm[1]) {\n d.isPm = true;\n }\n }],\n ZZ: ['[^\\\\s]*?[\\\\+\\\\-]\\\\d\\\\d:?\\\\d\\\\d|[^\\\\s]*?Z', function (d, v) {\n var parts = (v + '').match(/([+-]|\\d\\d)/gi),\n minutes;\n\n if (parts) {\n minutes = +(parts[1] * 60) + parseInt(parts[2], 10);\n d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;\n }\n }]\n };\n parseFlags.dd = parseFlags.d;\n parseFlags.dddd = parseFlags.ddd;\n parseFlags.DD = parseFlags.D;\n parseFlags.mm = parseFlags.m;\n parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;\n parseFlags.MM = parseFlags.M;\n parseFlags.ss = parseFlags.s;\n parseFlags.A = parseFlags.a;\n\n // Some common format strings\n fecha.masks = {\n default: 'ddd MMM dd yyyy HH:mm:ss',\n shortDate: 'M/D/yy',\n mediumDate: 'MMM d, yyyy',\n longDate: 'MMMM d, yyyy',\n fullDate: 'dddd, MMMM d, yyyy',\n shortTime: 'HH:mm',\n mediumTime: 'HH:mm:ss',\n longTime: 'HH:mm:ss.SSS'\n };\n\n /***\n * Format a date\n * @method format\n * @param {Date|number} dateObj\n * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'\n */\n fecha.format = function (dateObj, mask, i18nSettings) {\n var i18n = i18nSettings || fecha.i18n;\n\n if (typeof dateObj === 'number') {\n dateObj = new Date(dateObj);\n }\n\n if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {\n throw new Error('Invalid Date in fecha.format');\n }\n\n mask = fecha.masks[mask] || mask || fecha.masks['default'];\n\n var literals = [];\n\n // Make literals inactive by replacing them with ??\n mask = mask.replace(literal, function ($0, $1) {\n literals.push($1);\n return '@@@';\n });\n // Apply formatting rules\n mask = mask.replace(token, function ($0) {\n return $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1);\n });\n // Inline literal values back into the formatted value\n return mask.replace(/@@@/g, function () {\n return literals.shift();\n });\n };\n\n /**\n * Parse a date string into an object, changes - into /\n * @method parse\n * @param {string} dateStr Date string\n * @param {string} format Date parse format\n * @returns {Date|boolean}\n */\n fecha.parse = function (dateStr, format, i18nSettings) {\n var i18n = i18nSettings || fecha.i18n;\n\n if (typeof format !== 'string') {\n throw new Error('Invalid format in fecha.parse');\n }\n\n format = fecha.masks[format] || format;\n\n // Avoid regular expression denial of service, fail early for really long strings\n // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS\n if (dateStr.length > 1000) {\n return null;\n }\n\n var dateInfo = {};\n var parseInfo = [];\n var literals = [];\n format = format.replace(literal, function ($0, $1) {\n literals.push($1);\n return '@@@';\n });\n var newFormat = regexEscape(format).replace(token, function ($0) {\n if (parseFlags[$0]) {\n var info = parseFlags[$0];\n parseInfo.push(info[1]);\n return '(' + info[0] + ')';\n }\n\n return $0;\n });\n newFormat = newFormat.replace(/@@@/g, function () {\n return literals.shift();\n });\n var matches = dateStr.match(new RegExp(newFormat, 'i'));\n if (!matches) {\n return null;\n }\n\n for (var i = 1; i < matches.length; i++) {\n parseInfo[i - 1](dateInfo, matches[i], i18n);\n }\n\n var today = new Date();\n if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {\n dateInfo.hour = +dateInfo.hour + 12;\n } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {\n dateInfo.hour = 0;\n }\n\n var date;\n if (dateInfo.timezoneOffset != null) {\n dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;\n date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));\n } else {\n date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);\n }\n return date;\n };\n\n /* istanbul ignore next */\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = fecha;\n } else if (typeof define === 'function' && define.amd) {\n define(function () {\n return fecha;\n });\n } else {\n main.fecha = fecha;\n }\n})(undefined);","'use strict';\n\nexports.__esModule = true;\nexports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.getStyle = exports.once = exports.off = exports.on = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; /* istanbul ignore next */\n\nexports.hasClass = hasClass;\nexports.addClass = addClass;\nexports.removeClass = removeClass;\nexports.setStyle = setStyle;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar isServer = _vue2.default.prototype.$isServer;\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\nvar ieVersion = isServer ? 0 : Number(document.documentMode);\n\n/* istanbul ignore next */\nvar trim = function trim(string) {\n return (string || '').replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, '');\n};\n/* istanbul ignore next */\nvar camelCase = function camelCase(name) {\n return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n }).replace(MOZ_HACK_REGEXP, 'Moz$1');\n};\n\n/* istanbul ignore next */\nvar on = exports.on = function () {\n if (!isServer && document.addEventListener) {\n return function (element, event, handler) {\n if (element && event && handler) {\n element.addEventListener(event, handler, false);\n }\n };\n } else {\n return function (element, event, handler) {\n if (element && event && handler) {\n element.attachEvent('on' + event, handler);\n }\n };\n }\n}();\n\n/* istanbul ignore next */\nvar off = exports.off = function () {\n if (!isServer && document.removeEventListener) {\n return function (element, event, handler) {\n if (element && event) {\n element.removeEventListener(event, handler, false);\n }\n };\n } else {\n return function (element, event, handler) {\n if (element && event) {\n element.detachEvent('on' + event, handler);\n }\n };\n }\n}();\n\n/* istanbul ignore next */\nvar once = exports.once = function once(el, event, fn) {\n var listener = function listener() {\n if (fn) {\n fn.apply(this, arguments);\n }\n off(el, event, listener);\n };\n on(el, event, listener);\n};\n\n/* istanbul ignore next */\nfunction hasClass(el, cls) {\n if (!el || !cls) return false;\n if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');\n if (el.classList) {\n return el.classList.contains(cls);\n } else {\n return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }\n};\n\n/* istanbul ignore next */\nfunction addClass(el, cls) {\n if (!el) return;\n var curClass = el.className;\n var classes = (cls || '').split(' ');\n\n for (var i = 0, j = classes.length; i < j; i++) {\n var clsName = classes[i];\n if (!clsName) continue;\n\n if (el.classList) {\n el.classList.add(clsName);\n } else if (!hasClass(el, clsName)) {\n curClass += ' ' + clsName;\n }\n }\n if (!el.classList) {\n el.setAttribute('class', curClass);\n }\n};\n\n/* istanbul ignore next */\nfunction removeClass(el, cls) {\n if (!el || !cls) return;\n var classes = cls.split(' ');\n var curClass = ' ' + el.className + ' ';\n\n for (var i = 0, j = classes.length; i < j; i++) {\n var clsName = classes[i];\n if (!clsName) continue;\n\n if (el.classList) {\n el.classList.remove(clsName);\n } else if (hasClass(el, clsName)) {\n curClass = curClass.replace(' ' + clsName + ' ', ' ');\n }\n }\n if (!el.classList) {\n el.setAttribute('class', trim(curClass));\n }\n};\n\n/* istanbul ignore next */\nvar getStyle = exports.getStyle = ieVersion < 9 ? function (element, styleName) {\n if (isServer) return;\n if (!element || !styleName) return null;\n styleName = camelCase(styleName);\n if (styleName === 'float') {\n styleName = 'styleFloat';\n }\n try {\n switch (styleName) {\n case 'opacity':\n try {\n return element.filters.item('alpha').opacity / 100;\n } catch (e) {\n return 1.0;\n }\n default:\n return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;\n }\n } catch (e) {\n return element.style[styleName];\n }\n} : function (element, styleName) {\n if (isServer) return;\n if (!element || !styleName) return null;\n styleName = camelCase(styleName);\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n try {\n var computed = document.defaultView.getComputedStyle(element, '');\n return element.style[styleName] || computed ? computed[styleName] : null;\n } catch (e) {\n return element.style[styleName];\n }\n};\n\n/* istanbul ignore next */\nfunction setStyle(element, styleName, value) {\n if (!element || !styleName) return;\n\n if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {\n for (var prop in styleName) {\n if (styleName.hasOwnProperty(prop)) {\n setStyle(element, prop, styleName[prop]);\n }\n }\n } else {\n styleName = camelCase(styleName);\n if (styleName === 'opacity' && ieVersion < 9) {\n element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';\n } else {\n element.style[styleName] = value;\n }\n }\n};\n\nvar isScroll = exports.isScroll = function isScroll(el, vertical) {\n if (isServer) return;\n\n var determinedDirection = vertical !== null && vertical !== undefined;\n var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');\n\n return overflow.match(/(scroll|auto|overlay)/);\n};\n\nvar getScrollContainer = exports.getScrollContainer = function getScrollContainer(el, vertical) {\n if (isServer) return;\n\n var parent = el;\n while (parent) {\n if ([window, document, document.documentElement].includes(parent)) {\n return window;\n }\n if (isScroll(parent, vertical)) {\n return parent;\n }\n parent = parent.parentNode;\n }\n\n return parent;\n};\n\nvar isInContainer = exports.isInContainer = function isInContainer(el, container) {\n if (isServer || !el || !container) return false;\n\n var elRect = el.getBoundingClientRect();\n var containerRect = void 0;\n\n if ([window, document, document.documentElement, null, undefined].includes(container)) {\n containerRect = {\n top: 0,\n right: window.innerWidth,\n bottom: window.innerHeight,\n left: 0\n };\n } else {\n containerRect = container.getBoundingClientRect();\n }\n\n return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (target) {\n for (var i = 1, j = arguments.length; i < j; i++) {\n var source = arguments[i] || {};\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n var value = source[prop];\n if (value !== undefined) {\n target[prop] = value;\n }\n }\n }\n }\n\n return target;\n};\n\n;","'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version {{version}}\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n//\n// Cross module loader\n// Supported: Node, AMD, Browser globals\n//\n;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.Popper = factory();\n }\n})(undefined, function () {\n\n 'use strict';\n\n var root = window;\n\n // default options\n var DEFAULTS = {\n // placement of the popper\n placement: 'bottom',\n\n gpuAcceleration: true,\n\n // shift popper from its origin by the given amount of pixels (can be negative)\n offset: 0,\n\n // the element which will act as boundary of the popper\n boundariesElement: 'viewport',\n\n // amount of pixel used to define a minimum distance between the boundaries and the popper\n boundariesPadding: 5,\n\n // popper will try to prevent overflow following this order,\n // by default, then, it could overflow on the left and on top of the boundariesElement\n preventOverflowOrder: ['left', 'right', 'top', 'bottom'],\n\n // the behavior used by flip to change the placement of the popper\n flipBehavior: 'flip',\n\n arrowElement: '[x-arrow]',\n\n arrowOffset: 0,\n\n // list of functions used to modify the offsets before they are applied to the popper\n modifiers: ['shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle'],\n\n modifiersIgnored: [],\n\n forceAbsolute: false\n };\n\n /**\n * Create a new Popper.js instance\n * @constructor Popper\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement|Object} popper\n * The HTML element used as popper, or a configuration used to generate the popper.\n * @param {String} [popper.tagName='div'] The tag name of the generated popper.\n * @param {Array} [popper.classNames=['popper']] Array of classes to apply to the generated popper.\n * @param {Array} [popper.attributes] Array of attributes to apply, specify `attr:value` to assign a value to it.\n * @param {HTMLElement|String} [popper.parent=window.document.body] The parent element, given as HTMLElement or as query string.\n * @param {String} [popper.content=''] The content of the popper, it can be text, html, or node; if it is not text, set `contentType` to `html` or `node`.\n * @param {String} [popper.contentType='text'] If `html`, the `content` will be parsed as HTML. If `node`, it will be appended as-is.\n * @param {String} [popper.arrowTagName='div'] Same as `popper.tagName` but for the arrow element.\n * @param {Array} [popper.arrowClassNames='popper__arrow'] Same as `popper.classNames` but for the arrow element.\n * @param {String} [popper.arrowAttributes=['x-arrow']] Same as `popper.attributes` but for the arrow element.\n * @param {Object} options\n * @param {String} [options.placement=bottom]\n * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -right),\n * left(-start, -end)`\n *\n * @param {HTMLElement|String} [options.arrowElement='[x-arrow]']\n * The DOM Node used as arrow for the popper, or a CSS selector used to get the DOM node. It must be child of\n * its parent Popper. Popper.js will apply to the given element the style required to align the arrow with its\n * reference element.\n * By default, it will look for a child node of the popper with the `x-arrow` attribute.\n *\n * @param {Boolean} [options.gpuAcceleration=true]\n * When this property is set to true, the popper position will be applied using CSS3 translate3d, allowing the\n * browser to use the GPU to accelerate the rendering.\n * If set to false, the popper will be placed using `top` and `left` properties, not using the GPU.\n *\n * @param {Number} [options.offset=0]\n * Amount of pixels the popper will be shifted (can be negative).\n *\n * @param {String|Element} [options.boundariesElement='viewport']\n * The element which will define the boundaries of the popper position, the popper will never be placed outside\n * of the defined boundaries (except if `keepTogether` is enabled)\n *\n * @param {Number} [options.boundariesPadding=5]\n * Additional padding for the boundaries\n *\n * @param {Array} [options.preventOverflowOrder=['left', 'right', 'top', 'bottom']]\n * Order used when Popper.js tries to avoid overflows from the boundaries, they will be checked in order,\n * this means that the last ones will never overflow\n *\n * @param {String|Array} [options.flipBehavior='flip']\n * The behavior used by the `flip` modifier to change the placement of the popper when the latter is trying to\n * overlap its reference element. Defining `flip` as value, the placement will be flipped on\n * its axis (`right - left`, `top - bottom`).\n * You can even pass an array of placements (eg: `['right', 'left', 'top']` ) to manually specify\n * how alter the placement when a flip is needed. (eg. in the above example, it would first flip from right to left,\n * then, if even in its new placement, the popper is overlapping its reference element, it will be moved to top)\n *\n * @param {Array} [options.modifiers=[ 'shift', 'offset', 'preventOverflow', 'keepTogether', 'arrow', 'flip', 'applyStyle']]\n * List of functions used to modify the data before they are applied to the popper, add your custom functions\n * to this array to edit the offsets and placement.\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Array} [options.modifiersIgnored=[]]\n * Put here any built-in modifier name you want to exclude from the modifiers list\n * The function should reflect the @params and @returns of preventOverflow\n *\n * @param {Boolean} [options.removeOnDestroy=false]\n * Set to true if you want to automatically remove the popper when you call the `destroy` method.\n */\n function Popper(reference, popper, options) {\n this._reference = reference.jquery ? reference[0] : reference;\n this.state = {};\n\n // if the popper variable is a configuration object, parse it to generate an HTMLElement\n // generate a default popper if is not defined\n var isNotDefined = typeof popper === 'undefined' || popper === null;\n var isConfig = popper && Object.prototype.toString.call(popper) === '[object Object]';\n if (isNotDefined || isConfig) {\n this._popper = this.parse(isConfig ? popper : {});\n }\n // otherwise, use the given HTMLElement as popper\n else {\n this._popper = popper.jquery ? popper[0] : popper;\n }\n\n // with {} we create a new object with the options inside it\n this._options = Object.assign({}, DEFAULTS, options);\n\n // refactoring modifiers' list\n this._options.modifiers = this._options.modifiers.map(function (modifier) {\n // remove ignored modifiers\n if (this._options.modifiersIgnored.indexOf(modifier) !== -1) return;\n\n // set the x-placement attribute before everything else because it could be used to add margins to the popper\n // margins needs to be calculated to get the correct popper offsets\n if (modifier === 'applyStyle') {\n this._popper.setAttribute('x-placement', this._options.placement);\n }\n\n // return predefined modifier identified by string or keep the custom one\n return this.modifiers[modifier] || modifier;\n }.bind(this));\n\n // make sure to apply the popper position before any computation\n this.state.position = this._getPosition(this._popper, this._reference);\n setStyle(this._popper, { position: this.state.position, top: 0 });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n // setup event listeners, they will take care of update the position in specific situations\n this._setupEventListeners();\n return this;\n }\n\n //\n // Methods\n //\n /**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\n Popper.prototype.destroy = function () {\n this._popper.removeAttribute('x-placement');\n this._popper.style.left = '';\n this._popper.style.position = '';\n this._popper.style.top = '';\n this._popper.style[getSupportedPropertyName('transform')] = '';\n this._removeEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n if (this._options.removeOnDestroy) {\n this._popper.remove();\n }\n return this;\n };\n\n /**\n * Updates the position of the popper, computing the new offsets and applying the new style\n * @method\n * @memberof Popper\n */\n Popper.prototype.update = function () {\n var data = { instance: this, styles: {} };\n\n // store placement inside the data object, modifiers will be able to edit `placement` if needed\n // and refer to _originalPlacement to know the original value\n data.placement = this._options.placement;\n data._originalPlacement = this._options.placement;\n\n // compute the popper and reference offsets and put them inside data.offsets\n data.offsets = this._getOffsets(this._popper, this._reference, data.placement);\n\n // get boundaries\n data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);\n\n data = this.runModifiers(data, this._options.modifiers);\n\n if (typeof this.state.updateCallback === 'function') {\n this.state.updateCallback(data);\n }\n };\n\n /**\n * If a function is passed, it will be executed after the initialization of popper with as first argument the Popper instance.\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onCreate = function (callback) {\n // the createCallbacks return as first argument the popper instance\n callback(this);\n return this;\n };\n\n /**\n * If a function is passed, it will be executed after each update of popper with as first argument the set of coordinates and informations\n * used to style popper and its arrow.\n * NOTE: it doesn't get fired on the first call of the `Popper.update()` method inside the `Popper` constructor!\n * @method\n * @memberof Popper\n * @param {Function} callback\n */\n Popper.prototype.onUpdate = function (callback) {\n this.state.updateCallback = callback;\n return this;\n };\n\n /**\n * Helper used to generate poppers from a configuration file\n * @method\n * @memberof Popper\n * @param config {Object} configuration\n * @returns {HTMLElement} popper\n */\n Popper.prototype.parse = function (config) {\n var defaultConfig = {\n tagName: 'div',\n classNames: ['popper'],\n attributes: [],\n parent: root.document.body,\n content: '',\n contentType: 'text',\n arrowTagName: 'div',\n arrowClassNames: ['popper__arrow'],\n arrowAttributes: ['x-arrow']\n };\n config = Object.assign({}, defaultConfig, config);\n\n var d = root.document;\n\n var popper = d.createElement(config.tagName);\n addClassNames(popper, config.classNames);\n addAttributes(popper, config.attributes);\n if (config.contentType === 'node') {\n popper.appendChild(config.content.jquery ? config.content[0] : config.content);\n } else if (config.contentType === 'html') {\n popper.innerHTML = config.content;\n } else {\n popper.textContent = config.content;\n }\n\n if (config.arrowTagName) {\n var arrow = d.createElement(config.arrowTagName);\n addClassNames(arrow, config.arrowClassNames);\n addAttributes(arrow, config.arrowAttributes);\n popper.appendChild(arrow);\n }\n\n var parent = config.parent.jquery ? config.parent[0] : config.parent;\n\n // if the given parent is a string, use it to match an element\n // if more than one element is matched, the first one will be used as parent\n // if no elements are matched, the script will throw an error\n if (typeof parent === 'string') {\n parent = d.querySelectorAll(config.parent);\n if (parent.length > 1) {\n console.warn('WARNING: the given `parent` query(' + config.parent + ') matched more than one element, the first one will be used');\n }\n if (parent.length === 0) {\n throw 'ERROR: the given `parent` doesn\\'t exists!';\n }\n parent = parent[0];\n }\n // if the given parent is a DOM nodes list or an array of nodes with more than one element,\n // the first one will be used as parent\n if (parent.length > 1 && parent instanceof Element === false) {\n console.warn('WARNING: you have passed as parent a list of elements, the first one will be used');\n parent = parent[0];\n }\n\n // append the generated popper to its parent\n parent.appendChild(popper);\n\n return popper;\n\n /**\n * Adds class names to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} classes\n */\n function addClassNames(element, classNames) {\n classNames.forEach(function (className) {\n element.classList.add(className);\n });\n }\n\n /**\n * Adds attributes to the given element\n * @function\n * @ignore\n * @param {HTMLElement} target\n * @param {Array} attributes\n * @example\n * addAttributes(element, [ 'data-info:foobar' ]);\n */\n function addAttributes(element, attributes) {\n attributes.forEach(function (attribute) {\n element.setAttribute(attribute.split(':')[0], attribute.split(':')[1] || '');\n });\n }\n };\n\n /**\n * Helper used to get the position which will be applied to the popper\n * @method\n * @memberof Popper\n * @param config {HTMLElement} popper element\n * @param reference {HTMLElement} reference element\n * @returns {String} position\n */\n Popper.prototype._getPosition = function (popper, reference) {\n var container = getOffsetParent(reference);\n\n if (this._options.forceAbsolute) {\n return 'absolute';\n }\n\n // Decide if the popper will be fixed\n // If the reference element is inside a fixed context, the popper will be fixed as well to allow them to scroll together\n var isParentFixed = isFixed(reference, container);\n return isParentFixed ? 'fixed' : 'absolute';\n };\n\n /**\n * Get offsets to the popper\n * @method\n * @memberof Popper\n * @access private\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\n Popper.prototype._getOffsets = function (popper, reference, placement) {\n placement = placement.split('-')[0];\n var popperOffsets = {};\n\n popperOffsets.position = this.state.position;\n var isParentFixed = popperOffsets.position === 'fixed';\n\n //\n // Get reference element position\n //\n var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);\n\n //\n // Get popper sizes\n //\n var popperRect = getOuterSizes(popper);\n\n //\n // Compute offsets of popper\n //\n\n // depending by the popper placement we have to compute its offsets slightly differently\n if (['right', 'left'].indexOf(placement) !== -1) {\n popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;\n if (placement === 'left') {\n popperOffsets.left = referenceOffsets.left - popperRect.width;\n } else {\n popperOffsets.left = referenceOffsets.right;\n }\n } else {\n popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;\n if (placement === 'top') {\n popperOffsets.top = referenceOffsets.top - popperRect.height;\n } else {\n popperOffsets.top = referenceOffsets.bottom;\n }\n }\n\n // Add width and height to our offsets object\n popperOffsets.width = popperRect.width;\n popperOffsets.height = popperRect.height;\n\n return {\n popper: popperOffsets,\n reference: referenceOffsets\n };\n };\n\n /**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._setupEventListeners = function () {\n // NOTE: 1 DOM access here\n this.state.updateBound = this.update.bind(this);\n root.addEventListener('resize', this.state.updateBound);\n // if the boundariesElement is window we don't need to listen for the scroll event\n if (this._options.boundariesElement !== 'window') {\n var target = getScrollParent(this._reference);\n // here it could be both `body` or `documentElement` thanks to Firefox, we then check both\n if (target === root.document.body || target === root.document.documentElement) {\n target = root;\n }\n target.addEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = target;\n }\n };\n\n /**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper\n * @access private\n */\n Popper.prototype._removeEventListeners = function () {\n // NOTE: 1 DOM access here\n root.removeEventListener('resize', this.state.updateBound);\n if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {\n this.state.scrollTarget.removeEventListener('scroll', this.state.updateBound);\n this.state.scrollTarget = null;\n }\n this.state.updateBound = null;\n };\n\n /**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper\n * @access private\n * @param {Object} data - Object containing the property \"offsets\" generated by `_getOffsets`\n * @param {Number} padding - Boundaries padding\n * @param {Element} boundariesElement - Element used to define the boundaries\n * @returns {Object} Coordinates of the boundaries\n */\n Popper.prototype._getBoundaries = function (data, padding, boundariesElement) {\n // NOTE: 1 DOM access here\n var boundaries = {};\n var width, height;\n if (boundariesElement === 'window') {\n var body = root.document.body,\n html = root.document.documentElement;\n\n height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);\n\n boundaries = {\n top: 0,\n right: width,\n bottom: height,\n left: 0\n };\n } else if (boundariesElement === 'viewport') {\n var offsetParent = getOffsetParent(this._popper);\n var scrollParent = getScrollParent(this._popper);\n var offsetParentRect = getOffsetRect(offsetParent);\n\n // Thanks the fucking native API, `document.body.scrollTop` & `document.documentElement.scrollTop`\n var getScrollTopValue = function getScrollTopValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;\n };\n var getScrollLeftValue = function getScrollLeftValue(element) {\n return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;\n };\n\n // if the popper is fixed we don't have to substract scrolling from the boundaries\n var scrollTop = data.offsets.popper.position === 'fixed' ? 0 : getScrollTopValue(scrollParent);\n var scrollLeft = data.offsets.popper.position === 'fixed' ? 0 : getScrollLeftValue(scrollParent);\n\n boundaries = {\n top: 0 - (offsetParentRect.top - scrollTop),\n right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),\n bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),\n left: 0 - (offsetParentRect.left - scrollLeft)\n };\n } else {\n if (getOffsetParent(this._popper) === boundariesElement) {\n boundaries = {\n top: 0,\n left: 0,\n right: boundariesElement.clientWidth,\n bottom: boundariesElement.clientHeight\n };\n } else {\n boundaries = getOffsetRect(boundariesElement);\n }\n }\n boundaries.left += padding;\n boundaries.right -= padding;\n boundaries.top = boundaries.top + padding;\n boundaries.bottom = boundaries.bottom - padding;\n return boundaries;\n };\n\n /**\n * Loop trough the list of modifiers and run them in order, each of them will then edit the data object\n * @method\n * @memberof Popper\n * @access public\n * @param {Object} data\n * @param {Array} modifiers\n * @param {Function} ends\n */\n Popper.prototype.runModifiers = function (data, modifiers, ends) {\n var modifiersToRun = modifiers.slice();\n if (ends !== undefined) {\n modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));\n }\n\n modifiersToRun.forEach(function (modifier) {\n if (isFunction(modifier)) {\n data = modifier.call(this, data);\n }\n }.bind(this));\n\n return data;\n };\n\n /**\n * Helper used to know if the given modifier depends from another one.\n * @method\n * @memberof Popper\n * @param {String} requesting - name of requesting modifier\n * @param {String} requested - name of requested modifier\n * @returns {Boolean}\n */\n Popper.prototype.isModifierRequired = function (requesting, requested) {\n var index = getArrayKeyIndex(this._options.modifiers, requesting);\n return !!this._options.modifiers.slice(0, index).filter(function (modifier) {\n return modifier === requested;\n }).length;\n };\n\n //\n // Modifiers\n //\n\n /**\n * Modifiers list\n * @namespace Popper.modifiers\n * @memberof Popper\n * @type {Object}\n */\n Popper.prototype.modifiers = {};\n\n /**\n * Apply the computed styles to the popper element\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The same data object\n */\n Popper.prototype.modifiers.applyStyle = function (data) {\n // apply the final offsets to the popper\n // NOTE: 1 DOM access here\n var styles = {\n position: data.offsets.popper.position\n };\n\n // round top and left to avoid blurry text\n var left = Math.round(data.offsets.popper.left);\n var top = Math.round(data.offsets.popper.top);\n\n // if gpuAcceleration is set to true and transform is supported, we use `translate3d` to apply the position to the popper\n // we automatically use the supported prefixed version if needed\n var prefixedProperty;\n if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName('transform'))) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles.top = 0;\n styles.left = 0;\n }\n // othwerise, we use the standard `left` and `top` properties\n else {\n styles.left = left;\n styles.top = top;\n }\n\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n Object.assign(styles, data.styles);\n\n setStyle(this._popper, styles);\n\n // set an attribute which will be useful to style the tooltip (use it to properly position its arrow)\n // NOTE: 1 DOM access here\n this._popper.setAttribute('x-placement', data.placement);\n\n // if the arrow modifier is required and the arrow style has been computed, apply the arrow style\n if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {\n setStyle(data.arrowElement, data.offsets.arrow);\n }\n\n return data;\n };\n\n /**\n * Modifier used to shift the popper on the start or end of its reference element side\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.shift = function (data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftVariation = placement.split('-')[1];\n\n // if shift shiftVariation is specified, run the modifier\n if (shiftVariation) {\n var reference = data.offsets.reference;\n var popper = getPopperClientRect(data.offsets.popper);\n\n var shiftOffsets = {\n y: {\n start: { top: reference.top },\n end: { top: reference.top + reference.height - popper.height }\n },\n x: {\n start: { left: reference.left },\n end: { left: reference.left + reference.width - popper.width }\n }\n };\n\n var axis = ['bottom', 'top'].indexOf(basePlacement) !== -1 ? 'x' : 'y';\n\n data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);\n }\n\n return data;\n };\n\n /**\n * Modifier used to make sure the popper does not overflows from it's boundaries\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.preventOverflow = function (data) {\n var order = this._options.preventOverflowOrder;\n var popper = getPopperClientRect(data.offsets.popper);\n\n var check = {\n left: function left() {\n var left = popper.left;\n if (popper.left < data.boundaries.left) {\n left = Math.max(popper.left, data.boundaries.left);\n }\n return { left: left };\n },\n right: function right() {\n var left = popper.left;\n if (popper.right > data.boundaries.right) {\n left = Math.min(popper.left, data.boundaries.right - popper.width);\n }\n return { left: left };\n },\n top: function top() {\n var top = popper.top;\n if (popper.top < data.boundaries.top) {\n top = Math.max(popper.top, data.boundaries.top);\n }\n return { top: top };\n },\n bottom: function bottom() {\n var top = popper.top;\n if (popper.bottom > data.boundaries.bottom) {\n top = Math.min(popper.top, data.boundaries.bottom - popper.height);\n }\n return { top: top };\n }\n };\n\n order.forEach(function (direction) {\n data.offsets.popper = Object.assign(popper, check[direction]());\n });\n\n return data;\n };\n\n /**\n * Modifier used to make sure the popper is always near its reference\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.keepTogether = function (data) {\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var f = Math.floor;\n\n if (popper.right < f(reference.left)) {\n data.offsets.popper.left = f(reference.left) - popper.width;\n }\n if (popper.left > f(reference.right)) {\n data.offsets.popper.left = f(reference.right);\n }\n if (popper.bottom < f(reference.top)) {\n data.offsets.popper.top = f(reference.top) - popper.height;\n }\n if (popper.top > f(reference.bottom)) {\n data.offsets.popper.top = f(reference.bottom);\n }\n\n return data;\n };\n\n /**\n * Modifier used to flip the placement of the popper when the latter is starting overlapping its reference element.\n * Requires the `preventOverflow` modifier before it in order to work.\n * **NOTE:** This modifier will run all its previous modifiers everytime it tries to flip the popper!\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.flip = function (data) {\n // check if preventOverflow is in the list of modifiers before the flip modifier.\n // otherwise flip would not work as expected.\n if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {\n console.warn('WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!');\n return data;\n }\n\n if (data.flipped && data.placement === data._originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n if (this._options.flipBehavior === 'flip') {\n flipOrder = [placement, placementOpposite];\n } else {\n flipOrder = this._options.flipBehavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = getPopperClientRect(data.offsets.popper);\n\n // this boolean is used to distinguish right and bottom from top and left\n // they need different computations to get flipped\n var a = ['right', 'bottom'].indexOf(placement) !== -1;\n\n // using Math.floor because the reference offsets may contain decimals we are not going to consider here\n if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {\n // we'll use this boolean to detect any flip loop\n data.flipped = true;\n data.placement = flipOrder[index + 1];\n if (variation) {\n data.placement += '-' + variation;\n }\n data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;\n\n data = this.runModifiers(data, this._options.modifiers, this._flip);\n }\n }.bind(this));\n return data;\n };\n\n /**\n * Modifier used to add an offset to the popper, useful if you more granularity positioning your popper.\n * The offsets will shift the popper on the side of its reference element.\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.offset = function (data) {\n var offset = this._options.offset;\n var popper = data.offsets.popper;\n\n if (data.placement.indexOf('left') !== -1) {\n popper.top -= offset;\n } else if (data.placement.indexOf('right') !== -1) {\n popper.top += offset;\n } else if (data.placement.indexOf('top') !== -1) {\n popper.left -= offset;\n } else if (data.placement.indexOf('bottom') !== -1) {\n popper.left += offset;\n }\n return data;\n };\n\n /**\n * Modifier used to move the arrows on the edge of the popper to make sure them are always between the popper and the reference element\n * It will use the CSS outer size of the arrow element to know how many pixels of conjuction are needed\n * @method\n * @memberof Popper.modifiers\n * @argument {Object} data - The data object generated by _update method\n * @returns {Object} The data object, properly modified\n */\n Popper.prototype.modifiers.arrow = function (data) {\n var arrow = this._options.arrowElement;\n var arrowOffset = this._options.arrowOffset;\n\n // if the arrowElement is a string, suppose it's a CSS selector\n if (typeof arrow === 'string') {\n arrow = this._popper.querySelector(arrow);\n }\n\n // if arrow element is not found, don't run the modifier\n if (!arrow) {\n return data;\n }\n\n // the arrow element must be child of its popper\n if (!this._popper.contains(arrow)) {\n console.warn('WARNING: `arrowElement` must be child of its popper element!');\n return data;\n }\n\n // arrow depends on keepTogether in order to work\n if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {\n console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!');\n return data;\n }\n\n var arrowStyle = {};\n var placement = data.placement.split('-')[0];\n var popper = getPopperClientRect(data.offsets.popper);\n var reference = data.offsets.reference;\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var side = isVertical ? 'top' : 'left';\n var translate = isVertical ? 'translateY' : 'translateX';\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowSize = getOuterSizes(arrow)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);\n }\n // bottom/right side\n if (reference[side] + arrowSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];\n }\n\n // compute center of the popper\n var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);\n\n var sideValue = center - popper[side];\n\n // prevent arrow from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);\n arrowStyle[side] = sideValue;\n arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow\n\n data.offsets.arrow = arrowStyle;\n data.arrowElement = arrow;\n\n return data;\n };\n\n //\n // Helpers\n //\n\n /**\n * Get the outer sizes of the given element (offset size + margins)\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\n function getOuterSizes(element) {\n // NOTE: 1 DOM access here\n var _display = element.style.display,\n _visibility = element.style.visibility;\n element.style.display = 'block';element.style.visibility = 'hidden';\n var calcWidthToForceRepaint = element.offsetWidth;\n\n // original method\n var styles = root.getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = { width: element.offsetWidth + y, height: element.offsetHeight + x };\n\n // reset element styles\n element.style.display = _display;element.style.visibility = _visibility;\n return result;\n }\n\n /**\n * Get the opposite placement of the given one/\n * @function\n * @ignore\n * @argument {String} placement\n * @returns {String} flipped placement\n */\n function getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n }\n\n /**\n * Given the popper offsets, generate an output similar to getBoundingClientRect\n * @function\n * @ignore\n * @argument {Object} popperOffsets\n * @returns {Object} ClientRect like output\n */\n function getPopperClientRect(popperOffsets) {\n var offsets = Object.assign({}, popperOffsets);\n offsets.right = offsets.left + offsets.width;\n offsets.bottom = offsets.top + offsets.height;\n return offsets;\n }\n\n /**\n * Given an array and the key to find, returns its index\n * @function\n * @ignore\n * @argument {Array} arr\n * @argument keyToFind\n * @returns index or null\n */\n function getArrayKeyIndex(arr, keyToFind) {\n var i = 0,\n key;\n for (key in arr) {\n if (arr[key] === keyToFind) {\n return i;\n }\n i++;\n }\n return null;\n }\n\n /**\n * Get CSS computed property of the given element\n * @function\n * @ignore\n * @argument {Eement} element\n * @argument {String} property\n */\n function getStyleComputedProperty(element, property) {\n // NOTE: 1 DOM access here\n var css = root.getComputedStyle(element, null);\n return css[property];\n }\n\n /**\n * Returns the offset parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getOffsetParent(element) {\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent;\n return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;\n }\n\n /**\n * Returns the scrolling parent of the given element\n * @function\n * @ignore\n * @argument {Element} element\n * @returns {Element} offset parent\n */\n function getScrollParent(element) {\n var parent = element.parentNode;\n\n if (!parent) {\n return element;\n }\n\n if (parent === root.document) {\n // Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is\n // greater than 0 and return the proper element\n if (root.document.body.scrollTop || root.document.body.scrollLeft) {\n return root.document.body;\n } else {\n return root.document.documentElement;\n }\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n if (['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 || ['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1) {\n // If the detected scrollParent is body, we perform an additional check on its parentNode\n // in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise\n // fixes issue #65\n return parent;\n }\n return getScrollParent(element.parentNode);\n }\n\n /**\n * Check if the given element is fixed or is inside a fixed parent\n * @function\n * @ignore\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\n function isFixed(element) {\n if (element === root.document.body) {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return element.parentNode ? isFixed(element.parentNode) : element;\n }\n\n /**\n * Set the style to the given popper\n * @function\n * @ignore\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles - Object with a list of properties and values which will be applied to the element\n */\n function setStyle(element, styles) {\n function is_numeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n }\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && is_numeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n }\n\n /**\n * Check if the given variable is a function\n * @function\n * @ignore\n * @argument {*} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\n function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }\n\n /**\n * Get the position of the given element, relative to its offset parent\n * @function\n * @ignore\n * @param {Element} element\n * @return {Object} position - Coordinates of the element and its `scrollTop`\n */\n function getOffsetRect(element) {\n var elementRect = {\n width: element.offsetWidth,\n height: element.offsetHeight,\n left: element.offsetLeft,\n top: element.offsetTop\n };\n\n elementRect.right = elementRect.left + elementRect.width;\n elementRect.bottom = elementRect.top + elementRect.height;\n\n // position\n return elementRect;\n }\n\n /**\n * Get bounding client rect of given element\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\n function getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n\n // whether the IE version is lower than 11\n var isIE = navigator.userAgent.indexOf(\"MSIE\") != -1;\n\n // fix ie document bounding top always 0 bug\n var rectTop = isIE && element.tagName === 'HTML' ? -element.scrollTop : rect.top;\n\n return {\n left: rect.left,\n top: rectTop,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.right - rect.left,\n height: rect.bottom - rectTop\n };\n }\n\n /**\n * Given an element and one of its parents, return the offset\n * @function\n * @ignore\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @return {Object} rect\n */\n function getOffsetRectRelativeToCustomParent(element, parent, fixed) {\n var elementRect = getBoundingClientRect(element);\n var parentRect = getBoundingClientRect(parent);\n\n if (fixed) {\n var scrollParent = getScrollParent(parent);\n parentRect.top += scrollParent.scrollTop;\n parentRect.bottom += scrollParent.scrollTop;\n parentRect.left += scrollParent.scrollLeft;\n parentRect.right += scrollParent.scrollLeft;\n }\n\n var rect = {\n top: elementRect.top - parentRect.top,\n left: elementRect.left - parentRect.left,\n bottom: elementRect.top - parentRect.top + elementRect.height,\n right: elementRect.left - parentRect.left + elementRect.width,\n width: elementRect.width,\n height: elementRect.height\n };\n return rect;\n }\n\n /**\n * Get the prefixed supported property name\n * @function\n * @ignore\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase)\n */\n function getSupportedPropertyName(property) {\n var prefixes = ['', 'ms', 'webkit', 'moz', 'o'];\n\n for (var i = 0; i < prefixes.length; i++) {\n var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;\n if (typeof root.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n }\n\n /**\n * The Object.assign() method is used to copy the values of all enumerable own properties from one or more source\n * objects to a target object. It will return the target object.\n * This polyfill doesn't support symbol properties, since ES5 doesn't have symbols anyway\n * Source: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @function\n * @ignore\n */\n if (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: function value(target) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n nextSource = Object(nextSource);\n\n var keysArray = Object.keys(nextSource);\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n }\n });\n }\n\n return Popper;\n});","'use strict';\n\nexports.__esModule = true;\nexports.PopupManager = undefined;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _merge = require('element-ui/lib/utils/merge');\n\nvar _merge2 = _interopRequireDefault(_merge);\n\nvar _popupManager = require('element-ui/lib/utils/popup/popup-manager');\n\nvar _popupManager2 = _interopRequireDefault(_popupManager);\n\nvar _scrollbarWidth = require('../scrollbar-width');\n\nvar _scrollbarWidth2 = _interopRequireDefault(_scrollbarWidth);\n\nvar _dom = require('../dom');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar idSeed = 1;\n\nvar scrollBarWidth = void 0;\n\nexports.default = {\n props: {\n visible: {\n type: Boolean,\n default: false\n },\n openDelay: {},\n closeDelay: {},\n zIndex: {},\n modal: {\n type: Boolean,\n default: false\n },\n modalFade: {\n type: Boolean,\n default: true\n },\n modalClass: {},\n modalAppendToBody: {\n type: Boolean,\n default: false\n },\n lockScroll: {\n type: Boolean,\n default: true\n },\n closeOnPressEscape: {\n type: Boolean,\n default: false\n },\n closeOnClickModal: {\n type: Boolean,\n default: false\n }\n },\n\n beforeMount: function beforeMount() {\n this._popupId = 'popup-' + idSeed++;\n _popupManager2.default.register(this._popupId, this);\n },\n beforeDestroy: function beforeDestroy() {\n _popupManager2.default.deregister(this._popupId);\n _popupManager2.default.closeModal(this._popupId);\n\n this.restoreBodyStyle();\n },\n data: function data() {\n return {\n opened: false,\n bodyPaddingRight: null,\n computedBodyPaddingRight: 0,\n withoutHiddenClass: true,\n rendered: false\n };\n },\n\n\n watch: {\n visible: function visible(val) {\n var _this = this;\n\n if (val) {\n if (this._opening) return;\n if (!this.rendered) {\n this.rendered = true;\n _vue2.default.nextTick(function () {\n _this.open();\n });\n } else {\n this.open();\n }\n } else {\n this.close();\n }\n }\n },\n\n methods: {\n open: function open(options) {\n var _this2 = this;\n\n if (!this.rendered) {\n this.rendered = true;\n }\n\n var props = (0, _merge2.default)({}, this.$props || this, options);\n\n if (this._closeTimer) {\n clearTimeout(this._closeTimer);\n this._closeTimer = null;\n }\n clearTimeout(this._openTimer);\n\n var openDelay = Number(props.openDelay);\n if (openDelay > 0) {\n this._openTimer = setTimeout(function () {\n _this2._openTimer = null;\n _this2.doOpen(props);\n }, openDelay);\n } else {\n this.doOpen(props);\n }\n },\n doOpen: function doOpen(props) {\n if (this.$isServer) return;\n if (this.willOpen && !this.willOpen()) return;\n if (this.opened) return;\n\n this._opening = true;\n\n var dom = this.$el;\n\n var modal = props.modal;\n\n var zIndex = props.zIndex;\n if (zIndex) {\n _popupManager2.default.zIndex = zIndex;\n }\n\n if (modal) {\n if (this._closing) {\n _popupManager2.default.closeModal(this._popupId);\n this._closing = false;\n }\n _popupManager2.default.openModal(this._popupId, _popupManager2.default.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);\n if (props.lockScroll) {\n this.withoutHiddenClass = !(0, _dom.hasClass)(document.body, 'el-popup-parent--hidden');\n if (this.withoutHiddenClass) {\n this.bodyPaddingRight = document.body.style.paddingRight;\n this.computedBodyPaddingRight = parseInt((0, _dom.getStyle)(document.body, 'paddingRight'), 10);\n }\n scrollBarWidth = (0, _scrollbarWidth2.default)();\n var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;\n var bodyOverflowY = (0, _dom.getStyle)(document.body, 'overflowY');\n if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {\n document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';\n }\n (0, _dom.addClass)(document.body, 'el-popup-parent--hidden');\n }\n }\n\n if (getComputedStyle(dom).position === 'static') {\n dom.style.position = 'absolute';\n }\n\n dom.style.zIndex = _popupManager2.default.nextZIndex();\n this.opened = true;\n\n this.onOpen && this.onOpen();\n\n this.doAfterOpen();\n },\n doAfterOpen: function doAfterOpen() {\n this._opening = false;\n },\n close: function close() {\n var _this3 = this;\n\n if (this.willClose && !this.willClose()) return;\n\n if (this._openTimer !== null) {\n clearTimeout(this._openTimer);\n this._openTimer = null;\n }\n clearTimeout(this._closeTimer);\n\n var closeDelay = Number(this.closeDelay);\n\n if (closeDelay > 0) {\n this._closeTimer = setTimeout(function () {\n _this3._closeTimer = null;\n _this3.doClose();\n }, closeDelay);\n } else {\n this.doClose();\n }\n },\n doClose: function doClose() {\n this._closing = true;\n\n this.onClose && this.onClose();\n\n if (this.lockScroll) {\n setTimeout(this.restoreBodyStyle, 200);\n }\n\n this.opened = false;\n\n this.doAfterClose();\n },\n doAfterClose: function doAfterClose() {\n _popupManager2.default.closeModal(this._popupId);\n this._closing = false;\n },\n restoreBodyStyle: function restoreBodyStyle() {\n if (this.modal && this.withoutHiddenClass) {\n document.body.style.paddingRight = this.bodyPaddingRight;\n (0, _dom.removeClass)(document.body, 'el-popup-parent--hidden');\n }\n this.withoutHiddenClass = true;\n }\n }\n};\nexports.PopupManager = _popupManager2.default;","'use strict';\n\nexports.__esModule = true;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _dom = require('element-ui/lib/utils/dom');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasModal = false;\nvar hasInitZIndex = false;\nvar zIndex = void 0;\n\nvar getModal = function getModal() {\n if (_vue2.default.prototype.$isServer) return;\n var modalDom = PopupManager.modalDom;\n if (modalDom) {\n hasModal = true;\n } else {\n hasModal = false;\n modalDom = document.createElement('div');\n PopupManager.modalDom = modalDom;\n\n modalDom.addEventListener('touchmove', function (event) {\n event.preventDefault();\n event.stopPropagation();\n });\n\n modalDom.addEventListener('click', function () {\n PopupManager.doOnModalClick && PopupManager.doOnModalClick();\n });\n }\n\n return modalDom;\n};\n\nvar instances = {};\n\nvar PopupManager = {\n modalFade: true,\n\n getInstance: function getInstance(id) {\n return instances[id];\n },\n\n register: function register(id, instance) {\n if (id && instance) {\n instances[id] = instance;\n }\n },\n\n deregister: function deregister(id) {\n if (id) {\n instances[id] = null;\n delete instances[id];\n }\n },\n\n nextZIndex: function nextZIndex() {\n return PopupManager.zIndex++;\n },\n\n modalStack: [],\n\n doOnModalClick: function doOnModalClick() {\n var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];\n if (!topItem) return;\n\n var instance = PopupManager.getInstance(topItem.id);\n if (instance && instance.closeOnClickModal) {\n instance.close();\n }\n },\n\n openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {\n if (_vue2.default.prototype.$isServer) return;\n if (!id || zIndex === undefined) return;\n this.modalFade = modalFade;\n\n var modalStack = this.modalStack;\n\n for (var i = 0, j = modalStack.length; i < j; i++) {\n var item = modalStack[i];\n if (item.id === id) {\n return;\n }\n }\n\n var modalDom = getModal();\n\n (0, _dom.addClass)(modalDom, 'v-modal');\n if (this.modalFade && !hasModal) {\n (0, _dom.addClass)(modalDom, 'v-modal-enter');\n }\n if (modalClass) {\n var classArr = modalClass.trim().split(/\\s+/);\n classArr.forEach(function (item) {\n return (0, _dom.addClass)(modalDom, item);\n });\n }\n setTimeout(function () {\n (0, _dom.removeClass)(modalDom, 'v-modal-enter');\n }, 200);\n\n if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {\n dom.parentNode.appendChild(modalDom);\n } else {\n document.body.appendChild(modalDom);\n }\n\n if (zIndex) {\n modalDom.style.zIndex = zIndex;\n }\n modalDom.tabIndex = 0;\n modalDom.style.display = '';\n\n this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });\n },\n\n closeModal: function closeModal(id) {\n var modalStack = this.modalStack;\n var modalDom = getModal();\n\n if (modalStack.length > 0) {\n var topItem = modalStack[modalStack.length - 1];\n if (topItem.id === id) {\n if (topItem.modalClass) {\n var classArr = topItem.modalClass.trim().split(/\\s+/);\n classArr.forEach(function (item) {\n return (0, _dom.removeClass)(modalDom, item);\n });\n }\n\n modalStack.pop();\n if (modalStack.length > 0) {\n modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;\n }\n } else {\n for (var i = modalStack.length - 1; i >= 0; i--) {\n if (modalStack[i].id === id) {\n modalStack.splice(i, 1);\n break;\n }\n }\n }\n }\n\n if (modalStack.length === 0) {\n if (this.modalFade) {\n (0, _dom.addClass)(modalDom, 'v-modal-leave');\n }\n setTimeout(function () {\n if (modalStack.length === 0) {\n if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);\n modalDom.style.display = 'none';\n PopupManager.modalDom = undefined;\n }\n (0, _dom.removeClass)(modalDom, 'v-modal-leave');\n }, 200);\n }\n }\n};\n\nObject.defineProperty(PopupManager, 'zIndex', {\n configurable: true,\n get: function get() {\n if (!hasInitZIndex) {\n zIndex = zIndex || (_vue2.default.prototype.$ELEMENT || {}).zIndex || 2000;\n hasInitZIndex = true;\n }\n return zIndex;\n },\n set: function set(value) {\n zIndex = value;\n }\n});\n\nvar getTopPopup = function getTopPopup() {\n if (_vue2.default.prototype.$isServer) return;\n if (PopupManager.modalStack.length > 0) {\n var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];\n if (!topPopup) return;\n var instance = PopupManager.getInstance(topPopup.id);\n\n return instance;\n }\n};\n\nif (!_vue2.default.prototype.$isServer) {\n // handle `esc` key when the popup is shown\n window.addEventListener('keydown', function (event) {\n if (event.keyCode === 27) {\n var topPopup = getTopPopup();\n\n if (topPopup && topPopup.closeOnPressEscape) {\n topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();\n }\n }\n });\n}\n\nexports.default = PopupManager;","'use strict';\n\nexports.__esModule = true;\nexports.removeResizeListener = exports.addResizeListener = undefined;\n\nvar _resizeObserverPolyfill = require('resize-observer-polyfill');\n\nvar _resizeObserverPolyfill2 = _interopRequireDefault(_resizeObserverPolyfill);\n\nvar _throttleDebounce = require('throttle-debounce');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar isServer = typeof window === 'undefined';\n\n/* istanbul ignore next */\nvar resizeHandler = function resizeHandler(entries) {\n for (var _iterator = entries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var entry = _ref;\n\n var listeners = entry.target.__resizeListeners__ || [];\n if (listeners.length) {\n listeners.forEach(function (fn) {\n fn();\n });\n }\n }\n};\n\n/* istanbul ignore next */\nvar addResizeListener = exports.addResizeListener = function addResizeListener(element, fn) {\n if (isServer) return;\n if (!element.__resizeListeners__) {\n element.__resizeListeners__ = [];\n element.__ro__ = new _resizeObserverPolyfill2.default((0, _throttleDebounce.debounce)(16, resizeHandler));\n element.__ro__.observe(element);\n }\n element.__resizeListeners__.push(fn);\n};\n\n/* istanbul ignore next */\nvar removeResizeListener = exports.removeResizeListener = function removeResizeListener(element, fn) {\n if (!element || !element.__resizeListeners__) return;\n element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n if (!element.__resizeListeners__.length) {\n element.__ro__.disconnect();\n }\n};","'use strict';\n\nexports.__esModule = true;\nexports.default = scrollIntoView;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scrollIntoView(container, selected) {\n if (_vue2.default.prototype.$isServer) return;\n\n if (!selected) {\n container.scrollTop = 0;\n return;\n }\n\n var offsetParents = [];\n var pointer = selected.offsetParent;\n while (pointer && container !== pointer && container.contains(pointer)) {\n offsetParents.push(pointer);\n pointer = pointer.offsetParent;\n }\n var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {\n return prev + curr.offsetTop;\n }, 0);\n var bottom = top + selected.offsetHeight;\n var viewRectTop = container.scrollTop;\n var viewRectBottom = viewRectTop + container.clientHeight;\n\n if (top < viewRectTop) {\n container.scrollTop = top;\n } else if (bottom > viewRectBottom) {\n container.scrollTop = bottom - container.clientHeight;\n }\n}","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n if (_vue2.default.prototype.$isServer) return 0;\n if (scrollBarWidth !== undefined) return scrollBarWidth;\n\n var outer = document.createElement('div');\n outer.className = 'el-scrollbar__wrap';\n outer.style.visibility = 'hidden';\n outer.style.width = '100px';\n outer.style.position = 'absolute';\n outer.style.top = '-9999px';\n document.body.appendChild(outer);\n\n var widthNoScroll = outer.offsetWidth;\n outer.style.overflow = 'scroll';\n\n var inner = document.createElement('div');\n inner.style.width = '100%';\n outer.appendChild(inner);\n\n var widthWithScroll = inner.offsetWidth;\n outer.parentNode.removeChild(outer);\n scrollBarWidth = widthNoScroll - widthWithScroll;\n\n return scrollBarWidth;\n};\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar scrollBarWidth = void 0;\n\n;","\"use strict\";\n\nexports.__esModule = true;\nexports.isDef = isDef;\nexports.isKorean = isKorean;\nfunction isDef(val) {\n return val !== undefined && val !== null;\n}\nfunction isKorean(text) {\n var reg = /([(\\uAC00-\\uD7AF)|(\\u3130-\\u318F)])+/gi;\n return reg.test(text);\n}","'use strict';\n\nexports.__esModule = true;\nexports.isDefined = exports.isUndefined = exports.isFunction = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isString = isString;\nexports.isObject = isObject;\nexports.isHtmlElement = isHtmlElement;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}\n\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nfunction isHtmlElement(node) {\n return node && node.nodeType === Node.ELEMENT_NODE;\n}\n\n/**\n * - Inspired:\n * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js\n */\nvar isFunction = function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n};\n\nif (typeof /./ !== 'function' && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) !== 'object' && (_vue2.default.prototype.$isServer || typeof document.childNodes !== 'function')) {\n exports.isFunction = isFunction = function isFunction(obj) {\n return typeof obj === 'function' || false;\n };\n}\n\nexports.isFunction = isFunction;\nvar isUndefined = exports.isUndefined = function isUndefined(val) {\n return val === void 0;\n};\n\nvar isDefined = exports.isDefined = function isDefined(val) {\n return val !== undefined && val !== null;\n};","'use strict';\n\nexports.__esModule = true;\nexports.isEmpty = exports.isEqual = exports.arrayEquals = exports.looseEqual = exports.capitalize = exports.kebabCase = exports.autoprefixer = exports.isFirefox = exports.isEdge = exports.isIE = exports.coerceTruthyValueToArray = exports.arrayFind = exports.arrayFindIndex = exports.escapeRegexpString = exports.valueEquals = exports.generateId = exports.getValueByPath = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.noop = noop;\nexports.hasOwn = hasOwn;\nexports.toObject = toObject;\nexports.getPropByPath = getPropByPath;\nexports.rafThrottle = rafThrottle;\nexports.objToArray = objToArray;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _types = require('element-ui/lib/utils/types');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction noop() {};\n\nfunction hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n};\n\nfunction extend(to, _from) {\n for (var key in _from) {\n to[key] = _from[key];\n }\n return to;\n};\n\nfunction toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n};\n\nvar getValueByPath = exports.getValueByPath = function getValueByPath(object, prop) {\n prop = prop || '';\n var paths = prop.split('.');\n var current = object;\n var result = null;\n for (var i = 0, j = paths.length; i < j; i++) {\n var path = paths[i];\n if (!current) break;\n\n if (i === j - 1) {\n result = current[path];\n break;\n }\n current = current[path];\n }\n return result;\n};\n\nfunction getPropByPath(obj, path, strict) {\n var tempObj = obj;\n path = path.replace(/\\[(\\w+)\\]/g, '.$1');\n path = path.replace(/^\\./, '');\n\n var keyArr = path.split('.');\n var i = 0;\n for (var len = keyArr.length; i < len - 1; ++i) {\n if (!tempObj && !strict) break;\n var key = keyArr[i];\n if (key in tempObj) {\n tempObj = tempObj[key];\n } else {\n if (strict) {\n throw new Error('please transfer a valid prop path to form item!');\n }\n break;\n }\n }\n return {\n o: tempObj,\n k: keyArr[i],\n v: tempObj ? tempObj[keyArr[i]] : null\n };\n};\n\nvar generateId = exports.generateId = function generateId() {\n return Math.floor(Math.random() * 10000);\n};\n\nvar valueEquals = exports.valueEquals = function valueEquals(a, b) {\n // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript\n if (a === b) return true;\n if (!(a instanceof Array)) return false;\n if (!(b instanceof Array)) return false;\n if (a.length !== b.length) return false;\n for (var i = 0; i !== a.length; ++i) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n};\n\nvar escapeRegexpString = exports.escapeRegexpString = function escapeRegexpString() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n return String(value).replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n};\n\n// TODO: use native Array.find, Array.findIndex when IE support is dropped\nvar arrayFindIndex = exports.arrayFindIndex = function arrayFindIndex(arr, pred) {\n for (var i = 0; i !== arr.length; ++i) {\n if (pred(arr[i])) {\n return i;\n }\n }\n return -1;\n};\n\nvar arrayFind = exports.arrayFind = function arrayFind(arr, pred) {\n var idx = arrayFindIndex(arr, pred);\n return idx !== -1 ? arr[idx] : undefined;\n};\n\n// coerce truthy value to array\nvar coerceTruthyValueToArray = exports.coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {\n if (Array.isArray(val)) {\n return val;\n } else if (val) {\n return [val];\n } else {\n return [];\n }\n};\n\nvar isIE = exports.isIE = function isIE() {\n return !_vue2.default.prototype.$isServer && !isNaN(Number(document.documentMode));\n};\n\nvar isEdge = exports.isEdge = function isEdge() {\n return !_vue2.default.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;\n};\n\nvar isFirefox = exports.isFirefox = function isFirefox() {\n return !_vue2.default.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);\n};\n\nvar autoprefixer = exports.autoprefixer = function autoprefixer(style) {\n if ((typeof style === 'undefined' ? 'undefined' : _typeof(style)) !== 'object') return style;\n var rules = ['transform', 'transition', 'animation'];\n var prefixes = ['ms-', 'webkit-'];\n rules.forEach(function (rule) {\n var value = style[rule];\n if (rule && value) {\n prefixes.forEach(function (prefix) {\n style[prefix + rule] = value;\n });\n }\n });\n return style;\n};\n\nvar kebabCase = exports.kebabCase = function kebabCase(str) {\n var hyphenateRE = /([^-])([A-Z])/g;\n return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();\n};\n\nvar capitalize = exports.capitalize = function capitalize(str) {\n if (!(0, _types.isString)(str)) return str;\n return str.charAt(0).toUpperCase() + str.slice(1);\n};\n\nvar looseEqual = exports.looseEqual = function looseEqual(a, b) {\n var isObjectA = (0, _types.isObject)(a);\n var isObjectB = (0, _types.isObject)(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b);\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b);\n } else {\n return false;\n }\n};\n\nvar arrayEquals = exports.arrayEquals = function arrayEquals(arrayA, arrayB) {\n arrayA = arrayA || [];\n arrayB = arrayB || [];\n\n if (arrayA.length !== arrayB.length) {\n return false;\n }\n\n for (var i = 0; i < arrayA.length; i++) {\n if (!looseEqual(arrayA[i], arrayB[i])) {\n return false;\n }\n }\n\n return true;\n};\n\nvar isEqual = exports.isEqual = function isEqual(value1, value2) {\n if (Array.isArray(value1) && Array.isArray(value2)) {\n return arrayEquals(value1, value2);\n }\n return looseEqual(value1, value2);\n};\n\nvar isEmpty = exports.isEmpty = function isEmpty(val) {\n // null or undefined\n if (val == null) return true;\n\n if (typeof val === 'boolean') return false;\n\n if (typeof val === 'number') return !val;\n\n if (val instanceof Error) return val.message === '';\n\n switch (Object.prototype.toString.call(val)) {\n // String or Array\n case '[object String]':\n case '[object Array]':\n return !val.length;\n\n // Map or Set or File\n case '[object File]':\n case '[object Map]':\n case '[object Set]':\n {\n return !val.size;\n }\n // Plain Object\n case '[object Object]':\n {\n return !Object.keys(val).length;\n }\n }\n\n return false;\n};\n\nfunction rafThrottle(fn) {\n var locked = false;\n return function () {\n var _this = this;\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (locked) return;\n locked = true;\n window.requestAnimationFrame(function (_) {\n fn.apply(_this, args);\n locked = false;\n });\n };\n}\n\nfunction objToArray(obj) {\n if (Array.isArray(obj)) {\n return obj;\n }\n return isEmpty(obj) ? [] : [obj];\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.isVNode = isVNode;\n\nvar _util = require('element-ui/lib/utils/util');\n\nfunction isVNode(node) {\n return node !== null && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && (0, _util.hasOwn)(node, 'componentOptions');\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _vue = require('vue');\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _popup = require('element-ui/lib/utils/popup');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PopperJS = _vue2.default.prototype.$isServer ? function () {} : require('./popper');\nvar stop = function stop(e) {\n return e.stopPropagation();\n};\n\n/**\n * @param {HTMLElement} [reference=$refs.reference] - The reference element used to position the popper.\n * @param {HTMLElement} [popper=$refs.popper] - The HTML element used as popper, or a configuration used to generate the popper.\n * @param {String} [placement=button] - Placement of the popper accepted values: top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)\n * @param {Number} [offset=0] - Amount of pixels the popper will be shifted (can be negative).\n * @param {Boolean} [visible=false] Visibility of the popup element.\n * @param {Boolean} [visible-arrow=false] Visibility of the arrow, no style.\n */\nexports.default = {\n props: {\n transformOrigin: {\n type: [Boolean, String],\n default: true\n },\n placement: {\n type: String,\n default: 'bottom'\n },\n boundariesPadding: {\n type: Number,\n default: 5\n },\n reference: {},\n popper: {},\n offset: {\n default: 0\n },\n value: Boolean,\n visibleArrow: Boolean,\n arrowOffset: {\n type: Number,\n default: 35\n },\n appendToBody: {\n type: Boolean,\n default: true\n },\n popperOptions: {\n type: Object,\n default: function _default() {\n return {\n gpuAcceleration: false\n };\n }\n }\n },\n\n data: function data() {\n return {\n showPopper: false,\n currentPlacement: ''\n };\n },\n\n\n watch: {\n value: {\n immediate: true,\n handler: function handler(val) {\n this.showPopper = val;\n this.$emit('input', val);\n }\n },\n\n showPopper: function showPopper(val) {\n if (this.disabled) return;\n val ? this.updatePopper() : this.destroyPopper();\n this.$emit('input', val);\n }\n },\n\n methods: {\n createPopper: function createPopper() {\n var _this = this;\n\n if (this.$isServer) return;\n this.currentPlacement = this.currentPlacement || this.placement;\n if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {\n return;\n }\n\n var options = this.popperOptions;\n var popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;\n var reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;\n\n if (!reference && this.$slots.reference && this.$slots.reference[0]) {\n reference = this.referenceElm = this.$slots.reference[0].elm;\n }\n\n if (!popper || !reference) return;\n if (this.visibleArrow) this.appendArrow(popper);\n if (this.appendToBody) document.body.appendChild(this.popperElm);\n if (this.popperJS && this.popperJS.destroy) {\n this.popperJS.destroy();\n }\n\n options.placement = this.currentPlacement;\n options.offset = this.offset;\n options.arrowOffset = this.arrowOffset;\n this.popperJS = new PopperJS(reference, popper, options);\n this.popperJS.onCreate(function (_) {\n _this.$emit('created', _this);\n _this.resetTransformOrigin();\n _this.$nextTick(_this.updatePopper);\n });\n if (typeof options.onUpdate === 'function') {\n this.popperJS.onUpdate(options.onUpdate);\n }\n this.popperJS._popper.style.zIndex = _popup.PopupManager.nextZIndex();\n this.popperElm.addEventListener('click', stop);\n },\n updatePopper: function updatePopper() {\n var popperJS = this.popperJS;\n if (popperJS) {\n popperJS.update();\n if (popperJS._popper) {\n popperJS._popper.style.zIndex = _popup.PopupManager.nextZIndex();\n }\n } else {\n this.createPopper();\n }\n },\n doDestroy: function doDestroy(forceDestroy) {\n /* istanbul ignore if */\n if (!this.popperJS || this.showPopper && !forceDestroy) return;\n this.popperJS.destroy();\n this.popperJS = null;\n },\n destroyPopper: function destroyPopper() {\n if (this.popperJS) {\n this.resetTransformOrigin();\n }\n },\n resetTransformOrigin: function resetTransformOrigin() {\n if (!this.transformOrigin) return;\n var placementMap = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n };\n var placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];\n var origin = placementMap[placement];\n this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === 'string' ? this.transformOrigin : ['top', 'bottom'].indexOf(placement) > -1 ? 'center ' + origin : origin + ' center';\n },\n appendArrow: function appendArrow(element) {\n var hash = void 0;\n if (this.appended) {\n return;\n }\n\n this.appended = true;\n\n for (var item in element.attributes) {\n if (/^_v-/.test(element.attributes[item].name)) {\n hash = element.attributes[item].name;\n break;\n }\n }\n\n var arrow = document.createElement('div');\n\n if (hash) {\n arrow.setAttribute(hash, '');\n }\n arrow.setAttribute('x-arrow', '');\n arrow.className = 'popper__arrow';\n element.appendChild(arrow);\n }\n },\n\n beforeDestroy: function beforeDestroy() {\n this.doDestroy(true);\n if (this.popperElm && this.popperElm.parentNode === document.body) {\n this.popperElm.removeEventListener('click', stop);\n document.body.removeChild(this.popperElm);\n }\n },\n\n\n // call destroy in keep-alive mode\n deactivated: function deactivated() {\n this.$options.beforeDestroy[0].call(this);\n }\n};","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh
\n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n","module.exports = require('./src/normalizeWheel.js');\n","/**\n * Copyright (c) 2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ExecutionEnvironment\n */\n\n/*jslint evil: true */\n\n'use strict';\n\nvar canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n canUseDOM: canUseDOM,\n\n canUseWorkers: typeof Worker !== 'undefined',\n\n canUseEventListeners:\n canUseDOM && !!(window.addEventListener || window.attachEvent),\n\n canUseViewport: canUseDOM && !!window.screen,\n\n isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nmodule.exports = ExecutionEnvironment;\n","/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @providesModule UserAgent_DEPRECATED\n */\n\n/**\n * Provides entirely client-side User Agent and OS detection. You should prefer\n * the non-deprecated UserAgent module when possible, which exposes our\n * authoritative server-side PHP-based detection to the client.\n *\n * Usage is straightforward:\n *\n * if (UserAgent_DEPRECATED.ie()) {\n * // IE\n * }\n *\n * You can also do version checks:\n *\n * if (UserAgent_DEPRECATED.ie() >= 7) {\n * // IE7 or better\n * }\n *\n * The browser functions will return NaN if the browser does not match, so\n * you can also do version compares the other way:\n *\n * if (UserAgent_DEPRECATED.ie() < 7) {\n * // IE6 or worse\n * }\n *\n * Note that the version is a float and may include a minor version number,\n * so you should always use range operators to perform comparisons, not\n * strict equality.\n *\n * **Note:** You should **strongly** prefer capability detection to browser\n * version detection where it's reasonable:\n *\n * http://www.quirksmode.org/js/support.html\n *\n * Further, we have a large number of mature wrapper functions and classes\n * which abstract away many browser irregularities. Check the documentation,\n * grep for things, or ask on javascript@lists.facebook.com before writing yet\n * another copy of \"event || window.event\".\n *\n */\n\nvar _populated = false;\n\n// Browsers\nvar _ie, _firefox, _opera, _webkit, _chrome;\n\n// Actual IE browser for compatibility mode\nvar _ie_real_version;\n\n// Platforms\nvar _osx, _windows, _linux, _android;\n\n// Architectures\nvar _win64;\n\n// Devices\nvar _iphone, _ipad, _native;\n\nvar _mobile;\n\nfunction _populate() {\n if (_populated) {\n return;\n }\n\n _populated = true;\n\n // To work around buggy JS libraries that can't handle multi-digit\n // version numbers, Opera 10's user agent string claims it's Opera\n // 9, then later includes a Version/X.Y field:\n //\n // Opera/9.80 (foo) Presto/2.2.15 Version/10.10\n var uas = navigator.userAgent;\n var agent = /(?:MSIE.(\\d+\\.\\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\\d+\\.\\d+))|(?:Opera(?:.+Version.|.)(\\d+\\.\\d+))|(?:AppleWebKit.(\\d+(?:\\.\\d+)?))|(?:Trident\\/\\d+\\.\\d+.*rv:(\\d+\\.\\d+))/.exec(uas);\n var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);\n\n _iphone = /\\b(iPhone|iP[ao]d)/.exec(uas);\n _ipad = /\\b(iP[ao]d)/.exec(uas);\n _android = /Android/i.exec(uas);\n _native = /FBAN\\/\\w+;/i.exec(uas);\n _mobile = /Mobile/i.exec(uas);\n\n // Note that the IE team blog would have you believe you should be checking\n // for 'Win64; x64'. But MSDN then reveals that you can actually be coming\n // from either x64 or ia64; so ultimately, you should just check for Win64\n // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit\n // Windows will send 'WOW64' instead.\n _win64 = !!(/Win64/.exec(uas));\n\n if (agent) {\n _ie = agent[1] ? parseFloat(agent[1]) : (\n agent[5] ? parseFloat(agent[5]) : NaN);\n // IE compatibility mode\n if (_ie && document && document.documentMode) {\n _ie = document.documentMode;\n }\n // grab the \"true\" ie version from the trident token if available\n var trident = /(?:Trident\\/(\\d+.\\d+))/.exec(uas);\n _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;\n\n _firefox = agent[2] ? parseFloat(agent[2]) : NaN;\n _opera = agent[3] ? parseFloat(agent[3]) : NaN;\n _webkit = agent[4] ? parseFloat(agent[4]) : NaN;\n if (_webkit) {\n // We do not add the regexp to the above test, because it will always\n // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in\n // the userAgent string.\n agent = /(?:Chrome\\/(\\d+\\.\\d+))/.exec(uas);\n _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;\n } else {\n _chrome = NaN;\n }\n } else {\n _ie = _firefox = _opera = _chrome = _webkit = NaN;\n }\n\n if (os) {\n if (os[1]) {\n // Detect OS X version. If no version number matches, set _osx to true.\n // Version examples: 10, 10_6_1, 10.7\n // Parses version number as a float, taking only first two sets of\n // digits. If only one set of digits is found, returns just the major\n // version number.\n var ver = /(?:Mac OS X (\\d+(?:[._]\\d+)?))/.exec(uas);\n\n _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;\n } else {\n _osx = false;\n }\n _windows = !!os[2];\n _linux = !!os[3];\n } else {\n _osx = _windows = _linux = false;\n }\n}\n\nvar UserAgent_DEPRECATED = {\n\n /**\n * Check if the UA is Internet Explorer.\n *\n *\n * @return float|NaN Version number (if match) or NaN.\n */\n ie: function() {\n return _populate() || _ie;\n },\n\n /**\n * Check if we're in Internet Explorer compatibility mode.\n *\n * @return bool true if in compatibility mode, false if\n * not compatibility mode or not ie\n */\n ieCompatibilityMode: function() {\n return _populate() || (_ie_real_version > _ie);\n },\n\n\n /**\n * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we\n * only need this because Skype can't handle 64-bit IE yet. We need to remove\n * this when we don't need it -- tracked by #601957.\n */\n ie64: function() {\n return UserAgent_DEPRECATED.ie() && _win64;\n },\n\n /**\n * Check if the UA is Firefox.\n *\n *\n * @return float|NaN Version number (if match) or NaN.\n */\n firefox: function() {\n return _populate() || _firefox;\n },\n\n\n /**\n * Check if the UA is Opera.\n *\n *\n * @return float|NaN Version number (if match) or NaN.\n */\n opera: function() {\n return _populate() || _opera;\n },\n\n\n /**\n * Check if the UA is WebKit.\n *\n *\n * @return float|NaN Version number (if match) or NaN.\n */\n webkit: function() {\n return _populate() || _webkit;\n },\n\n /**\n * For Push\n * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit\n */\n safari: function() {\n return UserAgent_DEPRECATED.webkit();\n },\n\n /**\n * Check if the UA is a Chrome browser.\n *\n *\n * @return float|NaN Version number (if match) or NaN.\n */\n chrome : function() {\n return _populate() || _chrome;\n },\n\n\n /**\n * Check if the user is running Windows.\n *\n * @return bool `true' if the user's OS is Windows.\n */\n windows: function() {\n return _populate() || _windows;\n },\n\n\n /**\n * Check if the user is running Mac OS X.\n *\n * @return float|bool Returns a float if a version number is detected,\n * otherwise true/false.\n */\n osx: function() {\n return _populate() || _osx;\n },\n\n /**\n * Check if the user is running Linux.\n *\n * @return bool `true' if the user's OS is some flavor of Linux.\n */\n linux: function() {\n return _populate() || _linux;\n },\n\n /**\n * Check if the user is running on an iPhone or iPod platform.\n *\n * @return bool `true' if the user is running some flavor of the\n * iPhone OS.\n */\n iphone: function() {\n return _populate() || _iphone;\n },\n\n mobile: function() {\n return _populate() || (_iphone || _ipad || _android || _mobile);\n },\n\n nativeApp: function() {\n // webviews inside of the native apps\n return _populate() || _native;\n },\n\n android: function() {\n return _populate() || _android;\n },\n\n ipad: function() {\n return _populate() || _ipad;\n }\n};\n\nmodule.exports = UserAgent_DEPRECATED;\n","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isEventSupported\n */\n\n'use strict';\n\nvar ExecutionEnvironment = require('./ExecutionEnvironment');\n\nvar useHasFeature;\nif (ExecutionEnvironment.canUseDOM) {\n useHasFeature =\n document.implementation &&\n document.implementation.hasFeature &&\n // always returns true in newer browsers as per the standard.\n // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n document.implementation.hasFeature('', '') !== true;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @param {?boolean} capture Check if the capture phase is supported.\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix, capture) {\n if (!ExecutionEnvironment.canUseDOM ||\n capture && !('addEventListener' in document)) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = eventName in document;\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {\n // This is the only way to test support for the `wheel` event in IE9+.\n isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n }\n\n return isSupported;\n}\n\nmodule.exports = isEventSupported;\n","/**\n * Copyright (c) 2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule normalizeWheel\n * @typechecks\n */\n\n'use strict';\n\nvar UserAgent_DEPRECATED = require('./UserAgent_DEPRECATED');\n\nvar isEventSupported = require('./isEventSupported');\n\n\n// Reasonable defaults\nvar PIXEL_STEP = 10;\nvar LINE_HEIGHT = 40;\nvar PAGE_HEIGHT = 800;\n\n/**\n * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is\n * complicated, thus this doc is long and (hopefully) detailed enough to answer\n * your questions.\n *\n * If you need to react to the mouse wheel in a predictable way, this code is\n * like your bestest friend. * hugs *\n *\n * As of today, there are 4 DOM event types you can listen to:\n *\n * 'wheel' -- Chrome(31+), FF(17+), IE(9+)\n * 'mousewheel' -- Chrome, IE(6+), Opera, Safari\n * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!\n * 'DOMMouseScroll' -- FF(0.9.7+) since 2003\n *\n * So what to do? The is the best:\n *\n * normalizeWheel.getEventType();\n *\n * In your event callback, use this code to get sane interpretation of the\n * deltas. This code will return an object with properties:\n *\n * spinX -- normalized spin speed (use for zoom) - x plane\n * spinY -- \" - y plane\n * pixelX -- normalized distance (to pixels) - x plane\n * pixelY -- \" - y plane\n *\n * Wheel values are provided by the browser assuming you are using the wheel to\n * scroll a web page by a number of lines or pixels (or pages). Values can vary\n * significantly on different platforms and browsers, forgetting that you can\n * scroll at different speeds. Some devices (like trackpads) emit more events\n * at smaller increments with fine granularity, and some emit massive jumps with\n * linear speed or acceleration.\n *\n * This code does its best to normalize the deltas for you:\n *\n * - spin is trying to normalize how far the wheel was spun (or trackpad\n * dragged). This is super useful for zoom support where you want to\n * throw away the chunky scroll steps on the PC and make those equal to\n * the slow and smooth tiny steps on the Mac. Key data: This code tries to\n * resolve a single slow step on a wheel to 1.\n *\n * - pixel is normalizing the desired scroll delta in pixel units. You'll\n * get the crazy differences between browsers, but at least it'll be in\n * pixels!\n *\n * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This\n * should translate to positive value zooming IN, negative zooming OUT.\n * This matches the newer 'wheel' event.\n *\n * Why are there spinX, spinY (or pixels)?\n *\n * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn\n * with a mouse. It results in side-scrolling in the browser by default.\n *\n * - spinY is what you expect -- it's the classic axis of a mouse wheel.\n *\n * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and\n * probably is by browsers in conjunction with fancy 3D controllers .. but\n * you know.\n *\n * Implementation info:\n *\n * Examples of 'wheel' event if you scroll slowly (down) by one step with an\n * average mouse:\n *\n * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)\n * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)\n * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)\n * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)\n * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)\n *\n * On the trackpad:\n *\n * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)\n * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)\n *\n * On other/older browsers.. it's more complicated as there can be multiple and\n * also missing delta values.\n *\n * The 'wheel' event is more standard:\n *\n * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n *\n * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and\n * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain\n * backward compatibility with older events. Those other values help us\n * better normalize spin speed. Example of what the browsers provide:\n *\n * | event.wheelDelta | event.detail\n * ------------------+------------------+--------------\n * Safari v5/OS X | -120 | 0\n * Safari v5/Win7 | -120 | 0\n * Chrome v17/OS X | -120 | 0\n * Chrome v17/Win7 | -120 | 0\n * IE9/Win7 | -120 | undefined\n * Firefox v4/OS X | undefined | 1\n * Firefox v4/Win7 | undefined | 3\n *\n */\nfunction normalizeWheel(/*object*/ event) /*object*/ {\n var sX = 0, sY = 0, // spinX, spinY\n pX = 0, pY = 0; // pixelX, pixelY\n\n // Legacy\n if ('detail' in event) { sY = event.detail; }\n if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; }\n if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; }\n if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; }\n\n // side scrolling on FF with DOMMouseScroll\n if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {\n sX = sY;\n sY = 0;\n }\n\n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n\n if ('deltaY' in event) { pY = event.deltaY; }\n if ('deltaX' in event) { pX = event.deltaX; }\n\n if ((pX || pY) && event.deltaMode) {\n if (event.deltaMode == 1) { // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else { // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n }\n\n // Fall-back if spin cannot be determined\n if (pX && !sX) { sX = (pX < 1) ? -1 : 1; }\n if (pY && !sY) { sY = (pY < 1) ? -1 : 1; }\n\n return { spinX : sX,\n spinY : sY,\n pixelX : pX,\n pixelY : pY };\n}\n\n\n/**\n * The best combination if you prefer spinX + spinY normalization. It favors\n * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with\n * 'wheel' event, making spin speed determination impossible.\n */\nnormalizeWheel.getEventType = function() /*string*/ {\n return (UserAgent_DEPRECATED.firefox())\n ? 'DOMMouseScroll'\n : (isEventSupported('wheel'))\n ? 'wheel'\n : 'mousewheel';\n};\n\nmodule.exports = normalizeWheel;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n","'use strict';\n\nvar postcss = require('postcss');\nvar objectAssign = require('object-assign');\nvar { createPropListMatcher } = require('./src/prop-list-matcher');\nvar { getUnitRegexp } = require('./src/pixel-unit-regexp');\n\nvar defaults = {\n unitToConvert: 'px',\n viewportWidth: 320,\n viewportHeight: 568, // not now used; TODO: need for different units and math for different properties\n unitPrecision: 5,\n viewportUnit: 'vw',\n fontViewportUnit: 'vw', // vmin is more suitable.\n selectorBlackList: [],\n propList: ['*'],\n minPixelValue: 1,\n mediaQuery: false,\n replace: true,\n landscape: false,\n landscapeUnit: 'vw',\n landscapeWidth: 568\n};\n\nmodule.exports = postcss.plugin('postcss-px-to-viewport', function (options) {\n \n var opts = objectAssign({}, defaults, options);\n\n var pxRegex = getUnitRegexp(opts.unitToConvert);\n var satisfyPropList = createPropListMatcher(opts.propList);\n var landscapeRules = [];\n \n return function (css) {\n css.walkRules(function (rule) {\n // Add exclude option to ignore some files like 'node_modules'\n var file = rule.source && rule.source.input.file;\n\n if (opts.exclude && file) {\n if (Object.prototype.toString.call(opts.exclude) === '[object RegExp]') {\n if (isExclude(opts.exclude, file)) return;\n } else if (Object.prototype.toString.call(opts.exclude) === '[object Array]') {\n for (let i = 0; i < opts.exclude.length; i++) {\n if (isExclude(opts.exclude[i], file)) return;\n }\n } else {\n throw new Error('options.exclude should be RegExp or Array.');\n }\n }\n \n if (blacklistedSelector(opts.selectorBlackList, rule.selector)) return;\n\n if (opts.landscape && !rule.parent.params) {\n var landscapeRule = rule.clone().removeAll();\n\n rule.walkDecls(function(decl) {\n if (decl.value.indexOf(opts.unitToConvert) === -1) return;\n if (!satisfyPropList(decl.prop)) return;\n \n landscapeRule.append(decl.clone({\n value: decl.value.replace(pxRegex, createPxReplace(opts, opts.landscapeUnit, opts.landscapeWidth))\n }));\n });\n \n if (landscapeRule.nodes.length > 0) {\n landscapeRules.push(landscapeRule); \n }\n }\n\n if (!validateParams(rule.parent.params, opts.mediaQuery)) return;\n \n rule.walkDecls(function(decl, i) {\n if (decl.value.indexOf(opts.unitToConvert) === -1) return;\n if (!satisfyPropList(decl.prop)) return;\n\n var unit;\n var size;\n var params = rule.parent.params;\n \n if (opts.landscape && params && params.indexOf('landscape') !== -1) {\n unit = opts.landscapeUnit;\n size = opts.landscapeWidth;\n } else {\n unit = getUnit(decl.prop, opts);\n size = opts.viewportWidth;\n }\n \n var value = decl.value.replace(pxRegex, createPxReplace(opts, unit, size));\n \n if (declarationExists(decl.parent, decl.prop, value)) return;\n \n if (opts.replace) {\n decl.value = value;\n } else {\n decl.parent.insertAfter(i, decl.clone({ value: value }));\n }\n });\n });\n \n if (landscapeRules.length > 0) {\n var landscapeRoot = new postcss.atRule({ params: '(orientation: landscape)', name: 'media' });\n \n landscapeRules.forEach(function(rule) {\n landscapeRoot.append(rule);\n });\n css.append(landscapeRoot);\n }\n };\n});\n\nfunction getUnit(prop, opts) {\n return prop.indexOf('font') === -1 ? opts.viewportUnit : opts.fontViewportUnit;\n}\n\nfunction createPxReplace(opts, viewportUnit, viewportSize) {\n return function (m, $1) {\n if (!$1) return m;\n var pixels = parseFloat($1);\n if (pixels <= opts.minPixelValue) return m;\n var parsedVal = toFixed((pixels / viewportSize * 100), opts.unitPrecision);\n return parsedVal === 0 ? '0' : parsedVal + viewportUnit;\n };\n}\n\nfunction toFixed(number, precision) {\n var multiplier = Math.pow(10, precision + 1),\n wholeNumber = Math.floor(number * multiplier);\n return Math.round(wholeNumber / 10) * 10 / multiplier;\n}\n\nfunction blacklistedSelector(blacklist, selector) {\n if (typeof selector !== 'string') return;\n return blacklist.some(function (regex) {\n if (typeof regex === 'string') return selector.indexOf(regex) !== -1;\n return selector.match(regex);\n });\n}\n\nfunction isExclude(reg, file) {\n if (Object.prototype.toString.call(reg) !== '[object RegExp]') {\n throw new Error('options.exclude should be RegExp.');\n }\n return file.match(reg) !== null;\n}\n\nfunction declarationExists(decls, prop, value) {\n return decls.some(function (decl) {\n return (decl.prop === prop && decl.value === value);\n });\n}\n\nfunction validateParams(params, mediaQuery) {\n return !params || (params && mediaQuery);\n}\n","// excluding regex trick: http://www.rexegg.com/regex-best-trick.html\n\n// Not anything inside double quotes\n// Not anything inside single quotes\n// Not anything inside url()\n// Any digit followed by px\n// !singlequotes|!doublequotes|!url()|pixelunit\nfunction getUnitRegexp(unit) {\n return new RegExp('\"[^\"]+\"|\\'[^\\']+\\'|url\\\\([^\\\\)]+\\\\)|(\\\\d*\\\\.?\\\\d+)' + unit, 'g');\n}\n\nmodule.exports = {\n getUnitRegexp\n};\n","var filterPropList = {\n exact: function (list) {\n return list.filter(function (m) {\n return m.match(/^[^\\*\\!]+$/);\n });\n },\n contain: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\*.+\\*$/);\n }).map(function (m) {\n return m.substr(1, m.length - 2);\n });\n },\n endWith: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\*[^\\*]+$/);\n }).map(function (m) {\n return m.substr(1);\n });\n },\n startWith: function (list) {\n return list.filter(function (m) {\n return m.match(/^[^\\*\\!]+\\*$/);\n }).map(function (m) {\n return m.substr(0, m.length - 1);\n });\n },\n notExact: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\![^\\*].*$/);\n }).map(function (m) {\n return m.substr(1);\n });\n },\n notContain: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\!\\*.+\\*$/);\n }).map(function (m) {\n return m.substr(2, m.length - 3);\n });\n },\n notEndWith: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\!\\*[^\\*]+$/);\n }).map(function (m) {\n return m.substr(2);\n });\n },\n notStartWith: function (list) {\n return list.filter(function (m) {\n return m.match(/^\\![^\\*]+\\*$/);\n }).map(function (m) {\n return m.substr(1, m.length - 2);\n });\n }\n};\n\nfunction createPropListMatcher(propList) {\n var hasWild = propList.indexOf('*') > -1;\n var matchAll = (hasWild && propList.length === 1);\n var lists = {\n exact: filterPropList.exact(propList),\n contain: filterPropList.contain(propList),\n startWith: filterPropList.startWith(propList),\n endWith: filterPropList.endWith(propList),\n notExact: filterPropList.notExact(propList),\n notContain: filterPropList.notContain(propList),\n notStartWith: filterPropList.notStartWith(propList),\n notEndWith: filterPropList.notEndWith(propList)\n };\n return function (prop) {\n if (matchAll) return true;\n return (\n (\n hasWild ||\n lists.exact.indexOf(prop) > -1 ||\n lists.contain.some(function (m) {\n return prop.indexOf(m) > -1;\n }) ||\n lists.startWith.some(function (m) {\n return prop.indexOf(m) === 0;\n }) ||\n lists.endWith.some(function (m) {\n return prop.indexOf(m) === prop.length - m.length;\n })\n ) &&\n !(\n lists.notExact.indexOf(prop) > -1 ||\n lists.notContain.some(function (m) {\n return prop.indexOf(m) > -1;\n }) ||\n lists.notStartWith.some(function (m) {\n return prop.indexOf(m) === 0;\n }) ||\n lists.notEndWith.some(function (m) {\n return prop.indexOf(m) === prop.length - m.length;\n })\n )\n );\n };\n}\n\nmodule.exports = {\n filterPropList,\n createPropListMatcher\n};\n","'use strict'\n\nlet Container = require('./container')\n\nclass AtRule extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'atrule'\n }\n\n append(...children) {\n if (!this.proxyOf.nodes) this.nodes = []\n return super.append(...children)\n }\n\n prepend(...children) {\n if (!this.proxyOf.nodes) this.nodes = []\n return super.prepend(...children)\n }\n}\n\nmodule.exports = AtRule\nAtRule.default = AtRule\n\nContainer.registerAtRule(AtRule)\n","'use strict'\n\nlet Node = require('./node')\n\nclass Comment extends Node {\n constructor(defaults) {\n super(defaults)\n this.type = 'comment'\n }\n}\n\nmodule.exports = Comment\nComment.default = Comment\n","'use strict'\n\nlet { isClean, my } = require('./symbols')\nlet Declaration = require('./declaration')\nlet Comment = require('./comment')\nlet Node = require('./node')\n\nlet parse, Rule, AtRule, Root\n\nfunction cleanSource(nodes) {\n return nodes.map(i => {\n if (i.nodes) i.nodes = cleanSource(i.nodes)\n delete i.source\n return i\n })\n}\n\nfunction markDirtyUp(node) {\n node[isClean] = false\n if (node.proxyOf.nodes) {\n for (let i of node.proxyOf.nodes) {\n markDirtyUp(i)\n }\n }\n}\n\nclass Container extends Node {\n push(child) {\n child.parent = this\n this.proxyOf.nodes.push(child)\n return this\n }\n\n each(callback) {\n if (!this.proxyOf.nodes) return undefined\n let iterator = this.getIterator()\n\n let index, result\n while (this.indexes[iterator] < this.proxyOf.nodes.length) {\n index = this.indexes[iterator]\n result = callback(this.proxyOf.nodes[index], index)\n if (result === false) break\n\n this.indexes[iterator] += 1\n }\n\n delete this.indexes[iterator]\n return result\n }\n\n walk(callback) {\n return this.each((child, i) => {\n let result\n try {\n result = callback(child, i)\n } catch (e) {\n throw child.addToError(e)\n }\n if (result !== false && child.walk) {\n result = child.walk(callback)\n }\n\n return result\n })\n }\n\n walkDecls(prop, callback) {\n if (!callback) {\n callback = prop\n return this.walk((child, i) => {\n if (child.type === 'decl') {\n return callback(child, i)\n }\n })\n }\n if (prop instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'decl' && prop.test(child.prop)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'decl' && child.prop === prop) {\n return callback(child, i)\n }\n })\n }\n\n walkRules(selector, callback) {\n if (!callback) {\n callback = selector\n\n return this.walk((child, i) => {\n if (child.type === 'rule') {\n return callback(child, i)\n }\n })\n }\n if (selector instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'rule' && selector.test(child.selector)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'rule' && child.selector === selector) {\n return callback(child, i)\n }\n })\n }\n\n walkAtRules(name, callback) {\n if (!callback) {\n callback = name\n return this.walk((child, i) => {\n if (child.type === 'atrule') {\n return callback(child, i)\n }\n })\n }\n if (name instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'atrule' && name.test(child.name)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'atrule' && child.name === name) {\n return callback(child, i)\n }\n })\n }\n\n walkComments(callback) {\n return this.walk((child, i) => {\n if (child.type === 'comment') {\n return callback(child, i)\n }\n })\n }\n\n append(...children) {\n for (let child of children) {\n let nodes = this.normalize(child, this.last)\n for (let node of nodes) this.proxyOf.nodes.push(node)\n }\n\n this.markDirty()\n\n return this\n }\n\n prepend(...children) {\n children = children.reverse()\n for (let child of children) {\n let nodes = this.normalize(child, this.first, 'prepend').reverse()\n for (let node of nodes) this.proxyOf.nodes.unshift(node)\n for (let id in this.indexes) {\n this.indexes[id] = this.indexes[id] + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n cleanRaws(keepBetween) {\n super.cleanRaws(keepBetween)\n if (this.nodes) {\n for (let node of this.nodes) node.cleanRaws(keepBetween)\n }\n }\n\n insertBefore(exist, add) {\n exist = this.index(exist)\n\n let type = exist === 0 ? 'prepend' : false\n let nodes = this.normalize(add, this.proxyOf.nodes[exist], type).reverse()\n for (let node of nodes) this.proxyOf.nodes.splice(exist, 0, node)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (exist <= index) {\n this.indexes[id] = index + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n insertAfter(exist, add) {\n exist = this.index(exist)\n\n let nodes = this.normalize(add, this.proxyOf.nodes[exist]).reverse()\n for (let node of nodes) this.proxyOf.nodes.splice(exist + 1, 0, node)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (exist < index) {\n this.indexes[id] = index + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n removeChild(child) {\n child = this.index(child)\n this.proxyOf.nodes[child].parent = undefined\n this.proxyOf.nodes.splice(child, 1)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (index >= child) {\n this.indexes[id] = index - 1\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n removeAll() {\n for (let node of this.proxyOf.nodes) node.parent = undefined\n this.proxyOf.nodes = []\n\n this.markDirty()\n\n return this\n }\n\n replaceValues(pattern, opts, callback) {\n if (!callback) {\n callback = opts\n opts = {}\n }\n\n this.walkDecls(decl => {\n if (opts.props && !opts.props.includes(decl.prop)) return\n if (opts.fast && !decl.value.includes(opts.fast)) return\n\n decl.value = decl.value.replace(pattern, callback)\n })\n\n this.markDirty()\n\n return this\n }\n\n every(condition) {\n return this.nodes.every(condition)\n }\n\n some(condition) {\n return this.nodes.some(condition)\n }\n\n index(child) {\n if (typeof child === 'number') return child\n if (child.proxyOf) child = child.proxyOf\n return this.proxyOf.nodes.indexOf(child)\n }\n\n get first() {\n if (!this.proxyOf.nodes) return undefined\n return this.proxyOf.nodes[0]\n }\n\n get last() {\n if (!this.proxyOf.nodes) return undefined\n return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]\n }\n\n normalize(nodes, sample) {\n if (typeof nodes === 'string') {\n nodes = cleanSource(parse(nodes).nodes)\n } else if (Array.isArray(nodes)) {\n nodes = nodes.slice(0)\n for (let i of nodes) {\n if (i.parent) i.parent.removeChild(i, 'ignore')\n }\n } else if (nodes.type === 'root' && this.type !== 'document') {\n nodes = nodes.nodes.slice(0)\n for (let i of nodes) {\n if (i.parent) i.parent.removeChild(i, 'ignore')\n }\n } else if (nodes.type) {\n nodes = [nodes]\n } else if (nodes.prop) {\n if (typeof nodes.value === 'undefined') {\n throw new Error('Value field is missed in node creation')\n } else if (typeof nodes.value !== 'string') {\n nodes.value = String(nodes.value)\n }\n nodes = [new Declaration(nodes)]\n } else if (nodes.selector) {\n nodes = [new Rule(nodes)]\n } else if (nodes.name) {\n nodes = [new AtRule(nodes)]\n } else if (nodes.text) {\n nodes = [new Comment(nodes)]\n } else {\n throw new Error('Unknown node type in node creation')\n }\n\n let processed = nodes.map(i => {\n /* c8 ignore next */\n if (!i[my]) Container.rebuild(i)\n i = i.proxyOf\n if (i.parent) i.parent.removeChild(i)\n if (i[isClean]) markDirtyUp(i)\n if (typeof i.raws.before === 'undefined') {\n if (sample && typeof sample.raws.before !== 'undefined') {\n i.raws.before = sample.raws.before.replace(/\\S/g, '')\n }\n }\n i.parent = this.proxyOf\n return i\n })\n\n return processed\n }\n\n getProxyProcessor() {\n return {\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (prop === 'name' || prop === 'params' || prop === 'selector') {\n node.markDirty()\n }\n return true\n },\n\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (!node[prop]) {\n return node[prop]\n } else if (\n prop === 'each' ||\n (typeof prop === 'string' && prop.startsWith('walk'))\n ) {\n return (...args) => {\n return node[prop](\n ...args.map(i => {\n if (typeof i === 'function') {\n return (child, index) => i(child.toProxy(), index)\n } else {\n return i\n }\n })\n )\n }\n } else if (prop === 'every' || prop === 'some') {\n return cb => {\n return node[prop]((child, ...other) =>\n cb(child.toProxy(), ...other)\n )\n }\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else if (prop === 'nodes') {\n return node.nodes.map(i => i.toProxy())\n } else if (prop === 'first' || prop === 'last') {\n return node[prop].toProxy()\n } else {\n return node[prop]\n }\n }\n }\n }\n\n getIterator() {\n if (!this.lastEach) this.lastEach = 0\n if (!this.indexes) this.indexes = {}\n\n this.lastEach += 1\n let iterator = this.lastEach\n this.indexes[iterator] = 0\n\n return iterator\n }\n}\n\nContainer.registerParse = dependant => {\n parse = dependant\n}\n\nContainer.registerRule = dependant => {\n Rule = dependant\n}\n\nContainer.registerAtRule = dependant => {\n AtRule = dependant\n}\n\nContainer.registerRoot = dependant => {\n Root = dependant\n}\n\nmodule.exports = Container\nContainer.default = Container\n\n/* c8 ignore start */\nContainer.rebuild = node => {\n if (node.type === 'atrule') {\n Object.setPrototypeOf(node, AtRule.prototype)\n } else if (node.type === 'rule') {\n Object.setPrototypeOf(node, Rule.prototype)\n } else if (node.type === 'decl') {\n Object.setPrototypeOf(node, Declaration.prototype)\n } else if (node.type === 'comment') {\n Object.setPrototypeOf(node, Comment.prototype)\n } else if (node.type === 'root') {\n Object.setPrototypeOf(node, Root.prototype)\n }\n\n node[my] = true\n\n if (node.nodes) {\n node.nodes.forEach(child => {\n Container.rebuild(child)\n })\n }\n}\n/* c8 ignore stop */\n","'use strict'\n\nlet pico = require('picocolors')\n\nlet terminalHighlight = require('./terminal-highlight')\n\nclass CssSyntaxError extends Error {\n constructor(message, line, column, source, file, plugin) {\n super(message)\n this.name = 'CssSyntaxError'\n this.reason = message\n\n if (file) {\n this.file = file\n }\n if (source) {\n this.source = source\n }\n if (plugin) {\n this.plugin = plugin\n }\n if (typeof line !== 'undefined' && typeof column !== 'undefined') {\n if (typeof line === 'number') {\n this.line = line\n this.column = column\n } else {\n this.line = line.line\n this.column = line.column\n this.endLine = column.line\n this.endColumn = column.column\n }\n }\n\n this.setMessage()\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CssSyntaxError)\n }\n }\n\n setMessage() {\n this.message = this.plugin ? this.plugin + ': ' : ''\n this.message += this.file ? this.file : ''\n if (typeof this.line !== 'undefined') {\n this.message += ':' + this.line + ':' + this.column\n }\n this.message += ': ' + this.reason\n }\n\n showSourceCode(color) {\n if (!this.source) return ''\n\n let css = this.source\n if (color == null) color = pico.isColorSupported\n if (terminalHighlight) {\n if (color) css = terminalHighlight(css)\n }\n\n let lines = css.split(/\\r?\\n/)\n let start = Math.max(this.line - 3, 0)\n let end = Math.min(this.line + 2, lines.length)\n\n let maxWidth = String(end).length\n\n let mark, aside\n if (color) {\n let { bold, red, gray } = pico.createColors(true)\n mark = text => bold(red(text))\n aside = text => gray(text)\n } else {\n mark = aside = str => str\n }\n\n return lines\n .slice(start, end)\n .map((line, index) => {\n let number = start + 1 + index\n let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '\n if (number === this.line) {\n let spacing =\n aside(gutter.replace(/\\d/g, ' ')) +\n line.slice(0, this.column - 1).replace(/[^\\t]/g, ' ')\n return mark('>') + aside(gutter) + line + '\\n ' + spacing + mark('^')\n }\n return ' ' + aside(gutter) + line\n })\n .join('\\n')\n }\n\n toString() {\n let code = this.showSourceCode()\n if (code) {\n code = '\\n\\n' + code + '\\n'\n }\n return this.name + ': ' + this.message + code\n }\n}\n\nmodule.exports = CssSyntaxError\nCssSyntaxError.default = CssSyntaxError\n","'use strict'\n\nlet Node = require('./node')\n\nclass Declaration extends Node {\n constructor(defaults) {\n if (\n defaults &&\n typeof defaults.value !== 'undefined' &&\n typeof defaults.value !== 'string'\n ) {\n defaults = { ...defaults, value: String(defaults.value) }\n }\n super(defaults)\n this.type = 'decl'\n }\n\n get variable() {\n return this.prop.startsWith('--') || this.prop[0] === '$'\n }\n}\n\nmodule.exports = Declaration\nDeclaration.default = Declaration\n","'use strict'\n\nlet Container = require('./container')\n\nlet LazyResult, Processor\n\nclass Document extends Container {\n constructor(defaults) {\n // type needs to be passed to super, otherwise child roots won't be normalized correctly\n super({ type: 'document', ...defaults })\n\n if (!this.nodes) {\n this.nodes = []\n }\n }\n\n toResult(opts = {}) {\n let lazy = new LazyResult(new Processor(), this, opts)\n\n return lazy.stringify()\n }\n}\n\nDocument.registerLazyResult = dependant => {\n LazyResult = dependant\n}\n\nDocument.registerProcessor = dependant => {\n Processor = dependant\n}\n\nmodule.exports = Document\nDocument.default = Document\n","'use strict'\n\nlet Declaration = require('./declaration')\nlet PreviousMap = require('./previous-map')\nlet Comment = require('./comment')\nlet AtRule = require('./at-rule')\nlet Input = require('./input')\nlet Root = require('./root')\nlet Rule = require('./rule')\n\nfunction fromJSON(json, inputs) {\n if (Array.isArray(json)) return json.map(n => fromJSON(n))\n\n let { inputs: ownInputs, ...defaults } = json\n if (ownInputs) {\n inputs = []\n for (let input of ownInputs) {\n let inputHydrated = { ...input, __proto__: Input.prototype }\n if (inputHydrated.map) {\n inputHydrated.map = {\n ...inputHydrated.map,\n __proto__: PreviousMap.prototype\n }\n }\n inputs.push(inputHydrated)\n }\n }\n if (defaults.nodes) {\n defaults.nodes = json.nodes.map(n => fromJSON(n, inputs))\n }\n if (defaults.source) {\n let { inputId, ...source } = defaults.source\n defaults.source = source\n if (inputId != null) {\n defaults.source.input = inputs[inputId]\n }\n }\n if (defaults.type === 'root') {\n return new Root(defaults)\n } else if (defaults.type === 'decl') {\n return new Declaration(defaults)\n } else if (defaults.type === 'rule') {\n return new Rule(defaults)\n } else if (defaults.type === 'comment') {\n return new Comment(defaults)\n } else if (defaults.type === 'atrule') {\n return new AtRule(defaults)\n } else {\n throw new Error('Unknown node type: ' + json.type)\n }\n}\n\nmodule.exports = fromJSON\nfromJSON.default = fromJSON\n","'use strict'\n\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { fileURLToPath, pathToFileURL } = require('url')\nlet { resolve, isAbsolute } = require('path')\nlet { nanoid } = require('nanoid/non-secure')\n\nlet terminalHighlight = require('./terminal-highlight')\nlet CssSyntaxError = require('./css-syntax-error')\nlet PreviousMap = require('./previous-map')\n\nlet fromOffsetCache = Symbol('fromOffsetCache')\n\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)\nlet pathAvailable = Boolean(resolve && isAbsolute)\n\nclass Input {\n constructor(css, opts = {}) {\n if (\n css === null ||\n typeof css === 'undefined' ||\n (typeof css === 'object' && !css.toString)\n ) {\n throw new Error(`PostCSS received ${css} instead of CSS string`)\n }\n\n this.css = css.toString()\n\n if (this.css[0] === '\\uFEFF' || this.css[0] === '\\uFFFE') {\n this.hasBOM = true\n this.css = this.css.slice(1)\n } else {\n this.hasBOM = false\n }\n\n if (opts.from) {\n if (\n !pathAvailable ||\n /^\\w+:\\/\\//.test(opts.from) ||\n isAbsolute(opts.from)\n ) {\n this.file = opts.from\n } else {\n this.file = resolve(opts.from)\n }\n }\n\n if (pathAvailable && sourceMapAvailable) {\n let map = new PreviousMap(this.css, opts)\n if (map.text) {\n this.map = map\n let file = map.consumer().file\n if (!this.file && file) this.file = this.mapResolve(file)\n }\n }\n\n if (!this.file) {\n this.id = ''\n }\n if (this.map) this.map.file = this.from\n }\n\n fromOffset(offset) {\n let lastLine, lineToIndex\n if (!this[fromOffsetCache]) {\n let lines = this.css.split('\\n')\n lineToIndex = new Array(lines.length)\n let prevIndex = 0\n\n for (let i = 0, l = lines.length; i < l; i++) {\n lineToIndex[i] = prevIndex\n prevIndex += lines[i].length + 1\n }\n\n this[fromOffsetCache] = lineToIndex\n } else {\n lineToIndex = this[fromOffsetCache]\n }\n lastLine = lineToIndex[lineToIndex.length - 1]\n\n let min = 0\n if (offset >= lastLine) {\n min = lineToIndex.length - 1\n } else {\n let max = lineToIndex.length - 2\n let mid\n while (min < max) {\n mid = min + ((max - min) >> 1)\n if (offset < lineToIndex[mid]) {\n max = mid - 1\n } else if (offset >= lineToIndex[mid + 1]) {\n min = mid + 1\n } else {\n min = mid\n break\n }\n }\n }\n return {\n line: min + 1,\n col: offset - lineToIndex[min] + 1\n }\n }\n\n error(message, line, column, opts = {}) {\n let result, endLine, endColumn\n\n if (line && typeof line === 'object') {\n let start = line\n let end = column\n if (typeof line.offset === 'number') {\n let pos = this.fromOffset(start.offset)\n line = pos.line\n column = pos.col\n } else {\n line = start.line\n column = start.column\n }\n if (typeof end.offset === 'number') {\n let pos = this.fromOffset(end.offset)\n endLine = pos.line\n endColumn = pos.col\n } else {\n endLine = end.line\n endColumn = end.column\n }\n } else if (!column) {\n let pos = this.fromOffset(line)\n line = pos.line\n column = pos.col\n }\n\n let origin = this.origin(line, column, endLine, endColumn)\n if (origin) {\n result = new CssSyntaxError(\n message,\n origin.endLine === undefined\n ? origin.line\n : { line: origin.line, column: origin.column },\n origin.endLine === undefined\n ? origin.column\n : { line: origin.endLine, column: origin.endColumn },\n origin.source,\n origin.file,\n opts.plugin\n )\n } else {\n result = new CssSyntaxError(\n message,\n endLine === undefined ? line : { line, column },\n endLine === undefined ? column : { line: endLine, column: endColumn },\n this.css,\n this.file,\n opts.plugin\n )\n }\n\n result.input = { line, column, endLine, endColumn, source: this.css }\n if (this.file) {\n if (pathToFileURL) {\n result.input.url = pathToFileURL(this.file).toString()\n }\n result.input.file = this.file\n }\n\n return result\n }\n\n origin(line, column, endLine, endColumn) {\n if (!this.map) return false\n let consumer = this.map.consumer()\n\n let from = consumer.originalPositionFor({ line, column })\n if (!from.source) return false\n\n let to\n if (typeof endLine === 'number') {\n to = consumer.originalPositionFor({ line: endLine, column: endColumn })\n }\n\n let fromUrl\n\n if (isAbsolute(from.source)) {\n fromUrl = pathToFileURL(from.source)\n } else {\n fromUrl = new URL(\n from.source,\n this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)\n )\n }\n\n let result = {\n url: fromUrl.toString(),\n line: from.line,\n column: from.column,\n endLine: to && to.line,\n endColumn: to && to.column\n }\n\n if (fromUrl.protocol === 'file:') {\n if (fileURLToPath) {\n result.file = fileURLToPath(fromUrl)\n } else {\n /* c8 ignore next 2 */\n throw new Error(`file: protocol is not available in this PostCSS build`)\n }\n }\n\n let source = consumer.sourceContentFor(from.source)\n if (source) result.source = source\n\n return result\n }\n\n mapResolve(file) {\n if (/^\\w+:\\/\\//.test(file)) {\n return file\n }\n return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)\n }\n\n get from() {\n return this.file || this.id\n }\n\n toJSON() {\n let json = {}\n for (let name of ['hasBOM', 'css', 'file', 'id']) {\n if (this[name] != null) {\n json[name] = this[name]\n }\n }\n if (this.map) {\n json.map = { ...this.map }\n if (json.map.consumerCache) {\n json.map.consumerCache = undefined\n }\n }\n return json\n }\n}\n\nmodule.exports = Input\nInput.default = Input\n\nif (terminalHighlight && terminalHighlight.registerInput) {\n terminalHighlight.registerInput(Input)\n}\n","'use strict'\n\nlet { isClean, my } = require('./symbols')\nlet MapGenerator = require('./map-generator')\nlet stringify = require('./stringify')\nlet Container = require('./container')\nlet Document = require('./document')\nlet warnOnce = require('./warn-once')\nlet Result = require('./result')\nlet parse = require('./parse')\nlet Root = require('./root')\n\nconst TYPE_TO_CLASS_NAME = {\n document: 'Document',\n root: 'Root',\n atrule: 'AtRule',\n rule: 'Rule',\n decl: 'Declaration',\n comment: 'Comment'\n}\n\nconst PLUGIN_PROPS = {\n postcssPlugin: true,\n prepare: true,\n Once: true,\n Document: true,\n Root: true,\n Declaration: true,\n Rule: true,\n AtRule: true,\n Comment: true,\n DeclarationExit: true,\n RuleExit: true,\n AtRuleExit: true,\n CommentExit: true,\n RootExit: true,\n DocumentExit: true,\n OnceExit: true\n}\n\nconst NOT_VISITORS = {\n postcssPlugin: true,\n prepare: true,\n Once: true\n}\n\nconst CHILDREN = 0\n\nfunction isPromise(obj) {\n return typeof obj === 'object' && typeof obj.then === 'function'\n}\n\nfunction getEvents(node) {\n let key = false\n let type = TYPE_TO_CLASS_NAME[node.type]\n if (node.type === 'decl') {\n key = node.prop.toLowerCase()\n } else if (node.type === 'atrule') {\n key = node.name.toLowerCase()\n }\n\n if (key && node.append) {\n return [\n type,\n type + '-' + key,\n CHILDREN,\n type + 'Exit',\n type + 'Exit-' + key\n ]\n } else if (key) {\n return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key]\n } else if (node.append) {\n return [type, CHILDREN, type + 'Exit']\n } else {\n return [type, type + 'Exit']\n }\n}\n\nfunction toStack(node) {\n let events\n if (node.type === 'document') {\n events = ['Document', CHILDREN, 'DocumentExit']\n } else if (node.type === 'root') {\n events = ['Root', CHILDREN, 'RootExit']\n } else {\n events = getEvents(node)\n }\n\n return {\n node,\n events,\n eventIndex: 0,\n visitors: [],\n visitorIndex: 0,\n iterator: 0\n }\n}\n\nfunction cleanMarks(node) {\n node[isClean] = false\n if (node.nodes) node.nodes.forEach(i => cleanMarks(i))\n return node\n}\n\nlet postcss = {}\n\nclass LazyResult {\n constructor(processor, css, opts) {\n this.stringified = false\n this.processed = false\n\n let root\n if (\n typeof css === 'object' &&\n css !== null &&\n (css.type === 'root' || css.type === 'document')\n ) {\n root = cleanMarks(css)\n } else if (css instanceof LazyResult || css instanceof Result) {\n root = cleanMarks(css.root)\n if (css.map) {\n if (typeof opts.map === 'undefined') opts.map = {}\n if (!opts.map.inline) opts.map.inline = false\n opts.map.prev = css.map\n }\n } else {\n let parser = parse\n if (opts.syntax) parser = opts.syntax.parse\n if (opts.parser) parser = opts.parser\n if (parser.parse) parser = parser.parse\n\n try {\n root = parser(css, opts)\n } catch (error) {\n this.processed = true\n this.error = error\n }\n\n if (root && !root[my]) {\n /* c8 ignore next 2 */\n Container.rebuild(root)\n }\n }\n\n this.result = new Result(processor, root, opts)\n this.helpers = { ...postcss, result: this.result, postcss }\n this.plugins = this.processor.plugins.map(plugin => {\n if (typeof plugin === 'object' && plugin.prepare) {\n return { ...plugin, ...plugin.prepare(this.result) }\n } else {\n return plugin\n }\n })\n }\n\n get [Symbol.toStringTag]() {\n return 'LazyResult'\n }\n\n get processor() {\n return this.result.processor\n }\n\n get opts() {\n return this.result.opts\n }\n\n get css() {\n return this.stringify().css\n }\n\n get content() {\n return this.stringify().content\n }\n\n get map() {\n return this.stringify().map\n }\n\n get root() {\n return this.sync().root\n }\n\n get messages() {\n return this.sync().messages\n }\n\n warnings() {\n return this.sync().warnings()\n }\n\n toString() {\n return this.css\n }\n\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== 'production') {\n if (!('from' in this.opts)) {\n warnOnce(\n 'Without `from` option PostCSS could generate wrong source map ' +\n 'and will not find Browserslist config. Set it to CSS file path ' +\n 'or to `undefined` to prevent this warning.'\n )\n }\n }\n return this.async().then(onFulfilled, onRejected)\n }\n\n catch(onRejected) {\n return this.async().catch(onRejected)\n }\n\n finally(onFinally) {\n return this.async().then(onFinally, onFinally)\n }\n\n async() {\n if (this.error) return Promise.reject(this.error)\n if (this.processed) return Promise.resolve(this.result)\n if (!this.processing) {\n this.processing = this.runAsync()\n }\n return this.processing\n }\n\n sync() {\n if (this.error) throw this.error\n if (this.processed) return this.result\n this.processed = true\n\n if (this.processing) {\n throw this.getAsyncError()\n }\n\n for (let plugin of this.plugins) {\n let promise = this.runOnRoot(plugin)\n if (isPromise(promise)) {\n throw this.getAsyncError()\n }\n }\n\n this.prepareVisitors()\n if (this.hasListener) {\n let root = this.result.root\n while (!root[isClean]) {\n root[isClean] = true\n this.walkSync(root)\n }\n if (this.listeners.OnceExit) {\n if (root.type === 'document') {\n for (let subRoot of root.nodes) {\n this.visitSync(this.listeners.OnceExit, subRoot)\n }\n } else {\n this.visitSync(this.listeners.OnceExit, root)\n }\n }\n }\n\n return this.result\n }\n\n stringify() {\n if (this.error) throw this.error\n if (this.stringified) return this.result\n this.stringified = true\n\n this.sync()\n\n let opts = this.result.opts\n let str = stringify\n if (opts.syntax) str = opts.syntax.stringify\n if (opts.stringifier) str = opts.stringifier\n if (str.stringify) str = str.stringify\n\n let map = new MapGenerator(str, this.result.root, this.result.opts)\n let data = map.generate()\n this.result.css = data[0]\n this.result.map = data[1]\n\n return this.result\n }\n\n walkSync(node) {\n node[isClean] = true\n let events = getEvents(node)\n for (let event of events) {\n if (event === CHILDREN) {\n if (node.nodes) {\n node.each(child => {\n if (!child[isClean]) this.walkSync(child)\n })\n }\n } else {\n let visitors = this.listeners[event]\n if (visitors) {\n if (this.visitSync(visitors, node.toProxy())) return\n }\n }\n }\n }\n\n visitSync(visitors, node) {\n for (let [plugin, visitor] of visitors) {\n this.result.lastPlugin = plugin\n let promise\n try {\n promise = visitor(node, this.helpers)\n } catch (e) {\n throw this.handleError(e, node.proxyOf)\n }\n if (node.type !== 'root' && node.type !== 'document' && !node.parent) {\n return true\n }\n if (isPromise(promise)) {\n throw this.getAsyncError()\n }\n }\n }\n\n runOnRoot(plugin) {\n this.result.lastPlugin = plugin\n try {\n if (typeof plugin === 'object' && plugin.Once) {\n if (this.result.root.type === 'document') {\n let roots = this.result.root.nodes.map(root =>\n plugin.Once(root, this.helpers)\n )\n\n if (isPromise(roots[0])) {\n return Promise.all(roots)\n }\n\n return roots\n }\n\n return plugin.Once(this.result.root, this.helpers)\n } else if (typeof plugin === 'function') {\n return plugin(this.result.root, this.result)\n }\n } catch (error) {\n throw this.handleError(error)\n }\n }\n\n getAsyncError() {\n throw new Error('Use process(css).then(cb) to work with async plugins')\n }\n\n handleError(error, node) {\n let plugin = this.result.lastPlugin\n try {\n if (node) node.addToError(error)\n this.error = error\n if (error.name === 'CssSyntaxError' && !error.plugin) {\n error.plugin = plugin.postcssPlugin\n error.setMessage()\n } else if (plugin.postcssVersion) {\n if (process.env.NODE_ENV !== 'production') {\n let pluginName = plugin.postcssPlugin\n let pluginVer = plugin.postcssVersion\n let runtimeVer = this.result.processor.version\n let a = pluginVer.split('.')\n let b = runtimeVer.split('.')\n\n if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {\n // eslint-disable-next-line no-console\n console.error(\n 'Unknown error from PostCSS plugin. Your current PostCSS ' +\n 'version is ' +\n runtimeVer +\n ', but ' +\n pluginName +\n ' uses ' +\n pluginVer +\n '. Perhaps this is the source of the error below.'\n )\n }\n }\n }\n } catch (err) {\n /* c8 ignore next 3 */\n // eslint-disable-next-line no-console\n if (console && console.error) console.error(err)\n }\n return error\n }\n\n async runAsync() {\n this.plugin = 0\n for (let i = 0; i < this.plugins.length; i++) {\n let plugin = this.plugins[i]\n let promise = this.runOnRoot(plugin)\n if (isPromise(promise)) {\n try {\n await promise\n } catch (error) {\n throw this.handleError(error)\n }\n }\n }\n\n this.prepareVisitors()\n if (this.hasListener) {\n let root = this.result.root\n while (!root[isClean]) {\n root[isClean] = true\n let stack = [toStack(root)]\n while (stack.length > 0) {\n let promise = this.visitTick(stack)\n if (isPromise(promise)) {\n try {\n await promise\n } catch (e) {\n let node = stack[stack.length - 1].node\n throw this.handleError(e, node)\n }\n }\n }\n }\n\n if (this.listeners.OnceExit) {\n for (let [plugin, visitor] of this.listeners.OnceExit) {\n this.result.lastPlugin = plugin\n try {\n if (root.type === 'document') {\n let roots = root.nodes.map(subRoot =>\n visitor(subRoot, this.helpers)\n )\n\n await Promise.all(roots)\n } else {\n await visitor(root, this.helpers)\n }\n } catch (e) {\n throw this.handleError(e)\n }\n }\n }\n }\n\n this.processed = true\n return this.stringify()\n }\n\n prepareVisitors() {\n this.listeners = {}\n let add = (plugin, type, cb) => {\n if (!this.listeners[type]) this.listeners[type] = []\n this.listeners[type].push([plugin, cb])\n }\n for (let plugin of this.plugins) {\n if (typeof plugin === 'object') {\n for (let event in plugin) {\n if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {\n throw new Error(\n `Unknown event ${event} in ${plugin.postcssPlugin}. ` +\n `Try to update PostCSS (${this.processor.version} now).`\n )\n }\n if (!NOT_VISITORS[event]) {\n if (typeof plugin[event] === 'object') {\n for (let filter in plugin[event]) {\n if (filter === '*') {\n add(plugin, event, plugin[event][filter])\n } else {\n add(\n plugin,\n event + '-' + filter.toLowerCase(),\n plugin[event][filter]\n )\n }\n }\n } else if (typeof plugin[event] === 'function') {\n add(plugin, event, plugin[event])\n }\n }\n }\n }\n }\n this.hasListener = Object.keys(this.listeners).length > 0\n }\n\n visitTick(stack) {\n let visit = stack[stack.length - 1]\n let { node, visitors } = visit\n\n if (node.type !== 'root' && node.type !== 'document' && !node.parent) {\n stack.pop()\n return\n }\n\n if (visitors.length > 0 && visit.visitorIndex < visitors.length) {\n let [plugin, visitor] = visitors[visit.visitorIndex]\n visit.visitorIndex += 1\n if (visit.visitorIndex === visitors.length) {\n visit.visitors = []\n visit.visitorIndex = 0\n }\n this.result.lastPlugin = plugin\n try {\n return visitor(node.toProxy(), this.helpers)\n } catch (e) {\n throw this.handleError(e, node)\n }\n }\n\n if (visit.iterator !== 0) {\n let iterator = visit.iterator\n let child\n while ((child = node.nodes[node.indexes[iterator]])) {\n node.indexes[iterator] += 1\n if (!child[isClean]) {\n child[isClean] = true\n stack.push(toStack(child))\n return\n }\n }\n visit.iterator = 0\n delete node.indexes[iterator]\n }\n\n let events = visit.events\n while (visit.eventIndex < events.length) {\n let event = events[visit.eventIndex]\n visit.eventIndex += 1\n if (event === CHILDREN) {\n if (node.nodes && node.nodes.length) {\n node[isClean] = true\n visit.iterator = node.getIterator()\n }\n return\n } else if (this.listeners[event]) {\n visit.visitors = this.listeners[event]\n return\n }\n }\n stack.pop()\n }\n}\n\nLazyResult.registerPostcss = dependant => {\n postcss = dependant\n}\n\nmodule.exports = LazyResult\nLazyResult.default = LazyResult\n\nRoot.registerLazyResult(LazyResult)\nDocument.registerLazyResult(LazyResult)\n","'use strict'\n\nlet list = {\n split(string, separators, last) {\n let array = []\n let current = ''\n let split = false\n\n let func = 0\n let inQuote = false\n let prevQuote = ''\n let escape = false\n\n for (let letter of string) {\n if (escape) {\n escape = false\n } else if (letter === '\\\\') {\n escape = true\n } else if (inQuote) {\n if (letter === prevQuote) {\n inQuote = false\n }\n } else if (letter === '\"' || letter === \"'\") {\n inQuote = true\n prevQuote = letter\n } else if (letter === '(') {\n func += 1\n } else if (letter === ')') {\n if (func > 0) func -= 1\n } else if (func === 0) {\n if (separators.includes(letter)) split = true\n }\n\n if (split) {\n if (current !== '') array.push(current.trim())\n current = ''\n split = false\n } else {\n current += letter\n }\n }\n\n if (last || current !== '') array.push(current.trim())\n return array\n },\n\n space(string) {\n let spaces = [' ', '\\n', '\\t']\n return list.split(string, spaces)\n },\n\n comma(string) {\n return list.split(string, [','], true)\n }\n}\n\nmodule.exports = list\nlist.default = list\n","'use strict'\n\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { dirname, resolve, relative, sep } = require('path')\nlet { pathToFileURL } = require('url')\n\nlet Input = require('./input')\n\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)\nlet pathAvailable = Boolean(dirname && resolve && relative && sep)\n\nclass MapGenerator {\n constructor(stringify, root, opts, cssString) {\n this.stringify = stringify\n this.mapOpts = opts.map || {}\n this.root = root\n this.opts = opts\n this.css = cssString\n }\n\n isMap() {\n if (typeof this.opts.map !== 'undefined') {\n return !!this.opts.map\n }\n return this.previous().length > 0\n }\n\n previous() {\n if (!this.previousMaps) {\n this.previousMaps = []\n if (this.root) {\n this.root.walk(node => {\n if (node.source && node.source.input.map) {\n let map = node.source.input.map\n if (!this.previousMaps.includes(map)) {\n this.previousMaps.push(map)\n }\n }\n })\n } else {\n let input = new Input(this.css, this.opts)\n if (input.map) this.previousMaps.push(input.map)\n }\n }\n\n return this.previousMaps\n }\n\n isInline() {\n if (typeof this.mapOpts.inline !== 'undefined') {\n return this.mapOpts.inline\n }\n\n let annotation = this.mapOpts.annotation\n if (typeof annotation !== 'undefined' && annotation !== true) {\n return false\n }\n\n if (this.previous().length) {\n return this.previous().some(i => i.inline)\n }\n return true\n }\n\n isSourcesContent() {\n if (typeof this.mapOpts.sourcesContent !== 'undefined') {\n return this.mapOpts.sourcesContent\n }\n if (this.previous().length) {\n return this.previous().some(i => i.withContent())\n }\n return true\n }\n\n clearAnnotation() {\n if (this.mapOpts.annotation === false) return\n\n if (this.root) {\n let node\n for (let i = this.root.nodes.length - 1; i >= 0; i--) {\n node = this.root.nodes[i]\n if (node.type !== 'comment') continue\n if (node.text.indexOf('# sourceMappingURL=') === 0) {\n this.root.removeChild(i)\n }\n }\n } else if (this.css) {\n this.css = this.css.replace(/(\\n)?\\/\\*#[\\S\\s]*?\\*\\/$/gm, '')\n }\n }\n\n setSourcesContent() {\n let already = {}\n if (this.root) {\n this.root.walk(node => {\n if (node.source) {\n let from = node.source.input.from\n if (from && !already[from]) {\n already[from] = true\n this.map.setSourceContent(\n this.toUrl(this.path(from)),\n node.source.input.css\n )\n }\n }\n })\n } else if (this.css) {\n let from = this.opts.from\n ? this.toUrl(this.path(this.opts.from))\n : ''\n this.map.setSourceContent(from, this.css)\n }\n }\n\n applyPrevMaps() {\n for (let prev of this.previous()) {\n let from = this.toUrl(this.path(prev.file))\n let root = prev.root || dirname(prev.file)\n let map\n\n if (this.mapOpts.sourcesContent === false) {\n map = new SourceMapConsumer(prev.text)\n if (map.sourcesContent) {\n map.sourcesContent = map.sourcesContent.map(() => null)\n }\n } else {\n map = prev.consumer()\n }\n\n this.map.applySourceMap(map, from, this.toUrl(this.path(root)))\n }\n }\n\n isAnnotation() {\n if (this.isInline()) {\n return true\n }\n if (typeof this.mapOpts.annotation !== 'undefined') {\n return this.mapOpts.annotation\n }\n if (this.previous().length) {\n return this.previous().some(i => i.annotation)\n }\n return true\n }\n\n toBase64(str) {\n if (Buffer) {\n return Buffer.from(str).toString('base64')\n } else {\n return window.btoa(unescape(encodeURIComponent(str)))\n }\n }\n\n addAnnotation() {\n let content\n\n if (this.isInline()) {\n content =\n 'data:application/json;base64,' + this.toBase64(this.map.toString())\n } else if (typeof this.mapOpts.annotation === 'string') {\n content = this.mapOpts.annotation\n } else if (typeof this.mapOpts.annotation === 'function') {\n content = this.mapOpts.annotation(this.opts.to, this.root)\n } else {\n content = this.outputFile() + '.map'\n }\n let eol = '\\n'\n if (this.css.includes('\\r\\n')) eol = '\\r\\n'\n\n this.css += eol + '/*# sourceMappingURL=' + content + ' */'\n }\n\n outputFile() {\n if (this.opts.to) {\n return this.path(this.opts.to)\n } else if (this.opts.from) {\n return this.path(this.opts.from)\n } else {\n return 'to.css'\n }\n }\n\n generateMap() {\n if (this.root) {\n this.generateString()\n } else if (this.previous().length === 1) {\n let prev = this.previous()[0].consumer()\n prev.file = this.outputFile()\n this.map = SourceMapGenerator.fromSourceMap(prev)\n } else {\n this.map = new SourceMapGenerator({ file: this.outputFile() })\n this.map.addMapping({\n source: this.opts.from\n ? this.toUrl(this.path(this.opts.from))\n : '',\n generated: { line: 1, column: 0 },\n original: { line: 1, column: 0 }\n })\n }\n\n if (this.isSourcesContent()) this.setSourcesContent()\n if (this.root && this.previous().length > 0) this.applyPrevMaps()\n if (this.isAnnotation()) this.addAnnotation()\n\n if (this.isInline()) {\n return [this.css]\n } else {\n return [this.css, this.map]\n }\n }\n\n path(file) {\n if (file.indexOf('<') === 0) return file\n if (/^\\w+:\\/\\//.test(file)) return file\n if (this.mapOpts.absolute) return file\n\n let from = this.opts.to ? dirname(this.opts.to) : '.'\n\n if (typeof this.mapOpts.annotation === 'string') {\n from = dirname(resolve(from, this.mapOpts.annotation))\n }\n\n file = relative(from, file)\n return file\n }\n\n toUrl(path) {\n if (sep === '\\\\') {\n path = path.replace(/\\\\/g, '/')\n }\n return encodeURI(path).replace(/[#?]/g, encodeURIComponent)\n }\n\n sourcePath(node) {\n if (this.mapOpts.from) {\n return this.toUrl(this.mapOpts.from)\n } else if (this.mapOpts.absolute) {\n if (pathToFileURL) {\n return pathToFileURL(node.source.input.from).toString()\n } else {\n throw new Error(\n '`map.absolute` option is not available in this PostCSS build'\n )\n }\n } else {\n return this.toUrl(this.path(node.source.input.from))\n }\n }\n\n generateString() {\n this.css = ''\n this.map = new SourceMapGenerator({ file: this.outputFile() })\n\n let line = 1\n let column = 1\n\n let noSource = ''\n let mapping = {\n source: '',\n generated: { line: 0, column: 0 },\n original: { line: 0, column: 0 }\n }\n\n let lines, last\n this.stringify(this.root, (str, node, type) => {\n this.css += str\n\n if (node && type !== 'end') {\n mapping.generated.line = line\n mapping.generated.column = column - 1\n if (node.source && node.source.start) {\n mapping.source = this.sourcePath(node)\n mapping.original.line = node.source.start.line\n mapping.original.column = node.source.start.column - 1\n this.map.addMapping(mapping)\n } else {\n mapping.source = noSource\n mapping.original.line = 1\n mapping.original.column = 0\n this.map.addMapping(mapping)\n }\n }\n\n lines = str.match(/\\n/g)\n if (lines) {\n line += lines.length\n last = str.lastIndexOf('\\n')\n column = str.length - last\n } else {\n column += str.length\n }\n\n if (node && type !== 'start') {\n let p = node.parent || { raws: {} }\n if (node.type !== 'decl' || node !== p.last || p.raws.semicolon) {\n if (node.source && node.source.end) {\n mapping.source = this.sourcePath(node)\n mapping.original.line = node.source.end.line\n mapping.original.column = node.source.end.column - 1\n mapping.generated.line = line\n mapping.generated.column = column - 2\n this.map.addMapping(mapping)\n } else {\n mapping.source = noSource\n mapping.original.line = 1\n mapping.original.column = 0\n mapping.generated.line = line\n mapping.generated.column = column - 1\n this.map.addMapping(mapping)\n }\n }\n }\n })\n }\n\n generate() {\n this.clearAnnotation()\n if (pathAvailable && sourceMapAvailable && this.isMap()) {\n return this.generateMap()\n } else {\n let result = ''\n this.stringify(this.root, i => {\n result += i\n })\n return [result]\n }\n }\n}\n\nmodule.exports = MapGenerator\n","'use strict'\n\nlet MapGenerator = require('./map-generator')\nlet stringify = require('./stringify')\nlet warnOnce = require('./warn-once')\nlet parse = require('./parse')\nconst Result = require('./result')\n\nclass NoWorkResult {\n constructor(processor, css, opts) {\n css = css.toString()\n this.stringified = false\n\n this._processor = processor\n this._css = css\n this._opts = opts\n this._map = undefined\n let root\n\n let str = stringify\n this.result = new Result(this._processor, root, this._opts)\n this.result.css = css\n\n let self = this\n Object.defineProperty(this.result, 'root', {\n get() {\n return self.root\n }\n })\n\n let map = new MapGenerator(str, root, this._opts, css)\n if (map.isMap()) {\n let [generatedCSS, generatedMap] = map.generate()\n if (generatedCSS) {\n this.result.css = generatedCSS\n }\n if (generatedMap) {\n this.result.map = generatedMap\n }\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'NoWorkResult'\n }\n\n get processor() {\n return this.result.processor\n }\n\n get opts() {\n return this.result.opts\n }\n\n get css() {\n return this.result.css\n }\n\n get content() {\n return this.result.css\n }\n\n get map() {\n return this.result.map\n }\n\n get root() {\n if (this._root) {\n return this._root\n }\n\n let root\n let parser = parse\n\n try {\n root = parser(this._css, this._opts)\n } catch (error) {\n this.error = error\n }\n\n if (this.error) {\n throw this.error\n } else {\n this._root = root\n return root\n }\n }\n\n get messages() {\n return []\n }\n\n warnings() {\n return []\n }\n\n toString() {\n return this._css\n }\n\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== 'production') {\n if (!('from' in this._opts)) {\n warnOnce(\n 'Without `from` option PostCSS could generate wrong source map ' +\n 'and will not find Browserslist config. Set it to CSS file path ' +\n 'or to `undefined` to prevent this warning.'\n )\n }\n }\n\n return this.async().then(onFulfilled, onRejected)\n }\n\n catch(onRejected) {\n return this.async().catch(onRejected)\n }\n\n finally(onFinally) {\n return this.async().then(onFinally, onFinally)\n }\n\n async() {\n if (this.error) return Promise.reject(this.error)\n return Promise.resolve(this.result)\n }\n\n sync() {\n if (this.error) throw this.error\n return this.result\n }\n}\n\nmodule.exports = NoWorkResult\nNoWorkResult.default = NoWorkResult\n","'use strict'\n\nlet { isClean, my } = require('./symbols')\nlet CssSyntaxError = require('./css-syntax-error')\nlet Stringifier = require('./stringifier')\nlet stringify = require('./stringify')\n\nfunction cloneNode(obj, parent) {\n let cloned = new obj.constructor()\n\n for (let i in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i)) {\n /* c8 ignore next 2 */\n continue\n }\n if (i === 'proxyCache') continue\n let value = obj[i]\n let type = typeof value\n\n if (i === 'parent' && type === 'object') {\n if (parent) cloned[i] = parent\n } else if (i === 'source') {\n cloned[i] = value\n } else if (Array.isArray(value)) {\n cloned[i] = value.map(j => cloneNode(j, cloned))\n } else {\n if (type === 'object' && value !== null) value = cloneNode(value)\n cloned[i] = value\n }\n }\n\n return cloned\n}\n\nclass Node {\n constructor(defaults = {}) {\n this.raws = {}\n this[isClean] = false\n this[my] = true\n\n for (let name in defaults) {\n if (name === 'nodes') {\n this.nodes = []\n for (let node of defaults[name]) {\n if (typeof node.clone === 'function') {\n this.append(node.clone())\n } else {\n this.append(node)\n }\n }\n } else {\n this[name] = defaults[name]\n }\n }\n }\n\n error(message, opts = {}) {\n if (this.source) {\n let { start, end } = this.rangeBy(opts)\n return this.source.input.error(\n message,\n { line: start.line, column: start.column },\n { line: end.line, column: end.column },\n opts\n )\n }\n return new CssSyntaxError(message)\n }\n\n warn(result, text, opts) {\n let data = { node: this }\n for (let i in opts) data[i] = opts[i]\n return result.warn(text, data)\n }\n\n remove() {\n if (this.parent) {\n this.parent.removeChild(this)\n }\n this.parent = undefined\n return this\n }\n\n toString(stringifier = stringify) {\n if (stringifier.stringify) stringifier = stringifier.stringify\n let result = ''\n stringifier(this, i => {\n result += i\n })\n return result\n }\n\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name]\n }\n return this\n }\n\n clone(overrides = {}) {\n let cloned = cloneNode(this)\n for (let name in overrides) {\n cloned[name] = overrides[name]\n }\n return cloned\n }\n\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertBefore(this, cloned)\n return cloned\n }\n\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertAfter(this, cloned)\n return cloned\n }\n\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this\n let foundSelf = false\n for (let node of nodes) {\n if (node === this) {\n foundSelf = true\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node)\n bookmark = node\n } else {\n this.parent.insertBefore(bookmark, node)\n }\n }\n\n if (!foundSelf) {\n this.remove()\n }\n }\n\n return this\n }\n\n next() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index + 1]\n }\n\n prev() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index - 1]\n }\n\n before(add) {\n this.parent.insertBefore(this, add)\n return this\n }\n\n after(add) {\n this.parent.insertAfter(this, add)\n return this\n }\n\n root() {\n let result = this\n while (result.parent && result.parent.type !== 'document') {\n result = result.parent\n }\n return result\n }\n\n raw(prop, defaultType) {\n let str = new Stringifier()\n return str.raw(this, prop, defaultType)\n }\n\n cleanRaws(keepBetween) {\n delete this.raws.before\n delete this.raws.after\n if (!keepBetween) delete this.raws.between\n }\n\n toJSON(_, inputs) {\n let fixed = {}\n let emitInputs = inputs == null\n inputs = inputs || new Map()\n let inputsNextIndex = 0\n\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n /* c8 ignore next 2 */\n continue\n }\n if (name === 'parent' || name === 'proxyCache') continue\n let value = this[name]\n\n if (Array.isArray(value)) {\n fixed[name] = value.map(i => {\n if (typeof i === 'object' && i.toJSON) {\n return i.toJSON(null, inputs)\n } else {\n return i\n }\n })\n } else if (typeof value === 'object' && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs)\n } else if (name === 'source') {\n let inputId = inputs.get(value.input)\n if (inputId == null) {\n inputId = inputsNextIndex\n inputs.set(value.input, inputsNextIndex)\n inputsNextIndex++\n }\n fixed[name] = {\n inputId,\n start: value.start,\n end: value.end\n }\n } else {\n fixed[name] = value\n }\n }\n\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map(input => input.toJSON())\n }\n\n return fixed\n }\n\n positionInside(index) {\n let string = this.toString()\n let column = this.source.start.column\n let line = this.source.start.line\n\n for (let i = 0; i < index; i++) {\n if (string[i] === '\\n') {\n column = 1\n line += 1\n } else {\n column += 1\n }\n }\n\n return { line, column }\n }\n\n positionBy(opts) {\n let pos = this.source.start\n if (opts.index) {\n pos = this.positionInside(opts.index)\n } else if (opts.word) {\n let index = this.toString().indexOf(opts.word)\n if (index !== -1) pos = this.positionInside(index)\n }\n return pos\n }\n\n rangeBy(opts) {\n let start = {\n line: this.source.start.line,\n column: this.source.start.column\n }\n let end = this.source.end\n ? {\n line: this.source.end.line,\n column: this.source.end.column + 1\n }\n : {\n line: start.line,\n column: start.column + 1\n }\n\n if (opts.word) {\n let index = this.toString().indexOf(opts.word)\n if (index !== -1) {\n start = this.positionInside(index)\n end = this.positionInside(index + opts.word.length)\n }\n } else {\n if (opts.start) {\n start = {\n line: opts.start.line,\n column: opts.start.column\n }\n } else if (opts.index) {\n start = this.positionInside(opts.index)\n }\n\n if (opts.end) {\n end = {\n line: opts.end.line,\n column: opts.end.column\n }\n } else if (opts.endIndex) {\n end = this.positionInside(opts.endIndex)\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1)\n }\n }\n\n if (\n end.line < start.line ||\n (end.line === start.line && end.column <= start.column)\n ) {\n end = { line: start.line, column: start.column + 1 }\n }\n\n return { start, end }\n }\n\n getProxyProcessor() {\n return {\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (\n prop === 'prop' ||\n prop === 'value' ||\n prop === 'name' ||\n prop === 'params' ||\n prop === 'important' ||\n /* c8 ignore next */\n prop === 'text'\n ) {\n node.markDirty()\n }\n return true\n },\n\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else {\n return node[prop]\n }\n }\n }\n }\n\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor())\n }\n return this.proxyCache\n }\n\n addToError(error) {\n error.postcssNode = this\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s = this.source\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s.input.from}:${s.start.line}:${s.start.column}$&`\n )\n }\n return error\n }\n\n markDirty() {\n if (this[isClean]) {\n this[isClean] = false\n let next = this\n while ((next = next.parent)) {\n next[isClean] = false\n }\n }\n }\n\n get proxyOf() {\n return this\n }\n}\n\nmodule.exports = Node\nNode.default = Node\n","'use strict'\n\nlet Container = require('./container')\nlet Parser = require('./parser')\nlet Input = require('./input')\n\nfunction parse(css, opts) {\n let input = new Input(css, opts)\n let parser = new Parser(input)\n try {\n parser.parse()\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n if (e.name === 'CssSyntaxError' && opts && opts.from) {\n if (/\\.scss$/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse SCSS with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-scss parser'\n } else if (/\\.sass/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse Sass with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-sass parser'\n } else if (/\\.less$/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse Less with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-less parser'\n }\n }\n }\n throw e\n }\n\n return parser.root\n}\n\nmodule.exports = parse\nparse.default = parse\n\nContainer.registerParse(parse)\n","'use strict'\n\nlet Declaration = require('./declaration')\nlet tokenizer = require('./tokenize')\nlet Comment = require('./comment')\nlet AtRule = require('./at-rule')\nlet Root = require('./root')\nlet Rule = require('./rule')\n\nconst SAFE_COMMENT_NEIGHBOR = {\n empty: true,\n space: true\n}\n\nfunction findLastWithPosition(tokens) {\n for (let i = tokens.length - 1; i >= 0; i--) {\n let token = tokens[i]\n let pos = token[3] || token[2]\n if (pos) return pos\n }\n}\n\nclass Parser {\n constructor(input) {\n this.input = input\n\n this.root = new Root()\n this.current = this.root\n this.spaces = ''\n this.semicolon = false\n this.customProperty = false\n\n this.createTokenizer()\n this.root.source = { input, start: { offset: 0, line: 1, column: 1 } }\n }\n\n createTokenizer() {\n this.tokenizer = tokenizer(this.input)\n }\n\n parse() {\n let token\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken()\n\n switch (token[0]) {\n case 'space':\n this.spaces += token[1]\n break\n\n case ';':\n this.freeSemicolon(token)\n break\n\n case '}':\n this.end(token)\n break\n\n case 'comment':\n this.comment(token)\n break\n\n case 'at-word':\n this.atrule(token)\n break\n\n case '{':\n this.emptyRule(token)\n break\n\n default:\n this.other(token)\n break\n }\n }\n this.endFile()\n }\n\n comment(token) {\n let node = new Comment()\n this.init(node, token[2])\n node.source.end = this.getPosition(token[3] || token[2])\n\n let text = token[1].slice(2, -2)\n if (/^\\s*$/.test(text)) {\n node.text = ''\n node.raws.left = text\n node.raws.right = ''\n } else {\n let match = text.match(/^(\\s*)([^]*\\S)(\\s*)$/)\n node.text = match[2]\n node.raws.left = match[1]\n node.raws.right = match[3]\n }\n }\n\n emptyRule(token) {\n let node = new Rule()\n this.init(node, token[2])\n node.selector = ''\n node.raws.between = ''\n this.current = node\n }\n\n other(start) {\n let end = false\n let type = null\n let colon = false\n let bracket = null\n let brackets = []\n let customProperty = start[1].startsWith('--')\n\n let tokens = []\n let token = start\n while (token) {\n type = token[0]\n tokens.push(token)\n\n if (type === '(' || type === '[') {\n if (!bracket) bracket = token\n brackets.push(type === '(' ? ')' : ']')\n } else if (customProperty && colon && type === '{') {\n if (!bracket) bracket = token\n brackets.push('}')\n } else if (brackets.length === 0) {\n if (type === ';') {\n if (colon) {\n this.decl(tokens, customProperty)\n return\n } else {\n break\n }\n } else if (type === '{') {\n this.rule(tokens)\n return\n } else if (type === '}') {\n this.tokenizer.back(tokens.pop())\n end = true\n break\n } else if (type === ':') {\n colon = true\n }\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop()\n if (brackets.length === 0) bracket = null\n }\n\n token = this.tokenizer.nextToken()\n }\n\n if (this.tokenizer.endOfFile()) end = true\n if (brackets.length > 0) this.unclosedBracket(bracket)\n\n if (end && colon) {\n if (!customProperty) {\n while (tokens.length) {\n token = tokens[tokens.length - 1][0]\n if (token !== 'space' && token !== 'comment') break\n this.tokenizer.back(tokens.pop())\n }\n }\n this.decl(tokens, customProperty)\n } else {\n this.unknownWord(tokens)\n }\n }\n\n rule(tokens) {\n tokens.pop()\n\n let node = new Rule()\n this.init(node, tokens[0][2])\n\n node.raws.between = this.spacesAndCommentsFromEnd(tokens)\n this.raw(node, 'selector', tokens)\n this.current = node\n }\n\n decl(tokens, customProperty) {\n let node = new Declaration()\n this.init(node, tokens[0][2])\n\n let last = tokens[tokens.length - 1]\n if (last[0] === ';') {\n this.semicolon = true\n tokens.pop()\n }\n\n node.source.end = this.getPosition(\n last[3] || last[2] || findLastWithPosition(tokens)\n )\n\n while (tokens[0][0] !== 'word') {\n if (tokens.length === 1) this.unknownWord(tokens)\n node.raws.before += tokens.shift()[1]\n }\n node.source.start = this.getPosition(tokens[0][2])\n\n node.prop = ''\n while (tokens.length) {\n let type = tokens[0][0]\n if (type === ':' || type === 'space' || type === 'comment') {\n break\n }\n node.prop += tokens.shift()[1]\n }\n\n node.raws.between = ''\n\n let token\n while (tokens.length) {\n token = tokens.shift()\n\n if (token[0] === ':') {\n node.raws.between += token[1]\n break\n } else {\n if (token[0] === 'word' && /\\w/.test(token[1])) {\n this.unknownWord([token])\n }\n node.raws.between += token[1]\n }\n }\n\n if (node.prop[0] === '_' || node.prop[0] === '*') {\n node.raws.before += node.prop[0]\n node.prop = node.prop.slice(1)\n }\n\n let firstSpaces = []\n let next\n while (tokens.length) {\n next = tokens[0][0]\n if (next !== 'space' && next !== 'comment') break\n firstSpaces.push(tokens.shift())\n }\n\n this.precheckMissedSemicolon(tokens)\n\n for (let i = tokens.length - 1; i >= 0; i--) {\n token = tokens[i]\n if (token[1].toLowerCase() === '!important') {\n node.important = true\n let string = this.stringFrom(tokens, i)\n string = this.spacesFromEnd(tokens) + string\n if (string !== ' !important') node.raws.important = string\n break\n } else if (token[1].toLowerCase() === 'important') {\n let cache = tokens.slice(0)\n let str = ''\n for (let j = i; j > 0; j--) {\n let type = cache[j][0]\n if (str.trim().indexOf('!') === 0 && type !== 'space') {\n break\n }\n str = cache.pop()[1] + str\n }\n if (str.trim().indexOf('!') === 0) {\n node.important = true\n node.raws.important = str\n tokens = cache\n }\n }\n\n if (token[0] !== 'space' && token[0] !== 'comment') {\n break\n }\n }\n\n let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment')\n\n if (hasWord) {\n node.raws.between += firstSpaces.map(i => i[1]).join('')\n firstSpaces = []\n }\n this.raw(node, 'value', firstSpaces.concat(tokens), customProperty)\n\n if (node.value.includes(':') && !customProperty) {\n this.checkMissedSemicolon(tokens)\n }\n }\n\n atrule(token) {\n let node = new AtRule()\n node.name = token[1].slice(1)\n if (node.name === '') {\n this.unnamedAtrule(node, token)\n }\n this.init(node, token[2])\n\n let type\n let prev\n let shift\n let last = false\n let open = false\n let params = []\n let brackets = []\n\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken()\n type = token[0]\n\n if (type === '(' || type === '[') {\n brackets.push(type === '(' ? ')' : ']')\n } else if (type === '{' && brackets.length > 0) {\n brackets.push('}')\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop()\n }\n\n if (brackets.length === 0) {\n if (type === ';') {\n node.source.end = this.getPosition(token[2])\n this.semicolon = true\n break\n } else if (type === '{') {\n open = true\n break\n } else if (type === '}') {\n if (params.length > 0) {\n shift = params.length - 1\n prev = params[shift]\n while (prev && prev[0] === 'space') {\n prev = params[--shift]\n }\n if (prev) {\n node.source.end = this.getPosition(prev[3] || prev[2])\n }\n }\n this.end(token)\n break\n } else {\n params.push(token)\n }\n } else {\n params.push(token)\n }\n\n if (this.tokenizer.endOfFile()) {\n last = true\n break\n }\n }\n\n node.raws.between = this.spacesAndCommentsFromEnd(params)\n if (params.length) {\n node.raws.afterName = this.spacesAndCommentsFromStart(params)\n this.raw(node, 'params', params)\n if (last) {\n token = params[params.length - 1]\n node.source.end = this.getPosition(token[3] || token[2])\n this.spaces = node.raws.between\n node.raws.between = ''\n }\n } else {\n node.raws.afterName = ''\n node.params = ''\n }\n\n if (open) {\n node.nodes = []\n this.current = node\n }\n }\n\n end(token) {\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon\n }\n this.semicolon = false\n\n this.current.raws.after = (this.current.raws.after || '') + this.spaces\n this.spaces = ''\n\n if (this.current.parent) {\n this.current.source.end = this.getPosition(token[2])\n this.current = this.current.parent\n } else {\n this.unexpectedClose(token)\n }\n }\n\n endFile() {\n if (this.current.parent) this.unclosedBlock()\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon\n }\n this.current.raws.after = (this.current.raws.after || '') + this.spaces\n }\n\n freeSemicolon(token) {\n this.spaces += token[1]\n if (this.current.nodes) {\n let prev = this.current.nodes[this.current.nodes.length - 1]\n if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {\n prev.raws.ownSemicolon = this.spaces\n this.spaces = ''\n }\n }\n }\n\n // Helpers\n\n getPosition(offset) {\n let pos = this.input.fromOffset(offset)\n return {\n offset,\n line: pos.line,\n column: pos.col\n }\n }\n\n init(node, offset) {\n this.current.push(node)\n node.source = {\n start: this.getPosition(offset),\n input: this.input\n }\n node.raws.before = this.spaces\n this.spaces = ''\n if (node.type !== 'comment') this.semicolon = false\n }\n\n raw(node, prop, tokens, customProperty) {\n let token, type\n let length = tokens.length\n let value = ''\n let clean = true\n let next, prev\n\n for (let i = 0; i < length; i += 1) {\n token = tokens[i]\n type = token[0]\n if (type === 'space' && i === length - 1 && !customProperty) {\n clean = false\n } else if (type === 'comment') {\n prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'\n next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'\n if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {\n if (value.slice(-1) === ',') {\n clean = false\n } else {\n value += token[1]\n }\n } else {\n clean = false\n }\n } else {\n value += token[1]\n }\n }\n if (!clean) {\n let raw = tokens.reduce((all, i) => all + i[1], '')\n node.raws[prop] = { value, raw }\n }\n node[prop] = value\n }\n\n spacesAndCommentsFromEnd(tokens) {\n let lastTokenType\n let spaces = ''\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0]\n if (lastTokenType !== 'space' && lastTokenType !== 'comment') break\n spaces = tokens.pop()[1] + spaces\n }\n return spaces\n }\n\n spacesAndCommentsFromStart(tokens) {\n let next\n let spaces = ''\n while (tokens.length) {\n next = tokens[0][0]\n if (next !== 'space' && next !== 'comment') break\n spaces += tokens.shift()[1]\n }\n return spaces\n }\n\n spacesFromEnd(tokens) {\n let lastTokenType\n let spaces = ''\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0]\n if (lastTokenType !== 'space') break\n spaces = tokens.pop()[1] + spaces\n }\n return spaces\n }\n\n stringFrom(tokens, from) {\n let result = ''\n for (let i = from; i < tokens.length; i++) {\n result += tokens[i][1]\n }\n tokens.splice(from, tokens.length - from)\n return result\n }\n\n colon(tokens) {\n let brackets = 0\n let token, type, prev\n for (let [i, element] of tokens.entries()) {\n token = element\n type = token[0]\n\n if (type === '(') {\n brackets += 1\n }\n if (type === ')') {\n brackets -= 1\n }\n if (brackets === 0 && type === ':') {\n if (!prev) {\n this.doubleColon(token)\n } else if (prev[0] === 'word' && prev[1] === 'progid') {\n continue\n } else {\n return i\n }\n }\n\n prev = token\n }\n return false\n }\n\n // Errors\n\n unclosedBracket(bracket) {\n throw this.input.error(\n 'Unclosed bracket',\n { offset: bracket[2] },\n { offset: bracket[2] + 1 }\n )\n }\n\n unknownWord(tokens) {\n throw this.input.error(\n 'Unknown word',\n { offset: tokens[0][2] },\n { offset: tokens[0][2] + tokens[0][1].length }\n )\n }\n\n unexpectedClose(token) {\n throw this.input.error(\n 'Unexpected }',\n { offset: token[2] },\n { offset: token[2] + 1 }\n )\n }\n\n unclosedBlock() {\n let pos = this.current.source.start\n throw this.input.error('Unclosed block', pos.line, pos.column)\n }\n\n doubleColon(token) {\n throw this.input.error(\n 'Double colon',\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n )\n }\n\n unnamedAtrule(node, token) {\n throw this.input.error(\n 'At-rule without name',\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n )\n }\n\n precheckMissedSemicolon(/* tokens */) {\n // Hook for Safe Parser\n }\n\n checkMissedSemicolon(tokens) {\n let colon = this.colon(tokens)\n if (colon === false) return\n\n let founded = 0\n let token\n for (let j = colon - 1; j >= 0; j--) {\n token = tokens[j]\n if (token[0] !== 'space') {\n founded += 1\n if (founded === 2) break\n }\n }\n // If the token is a word, e.g. `!important`, `red` or any other valid property's value.\n // Then we need to return the colon after that word token. [3] is the \"end\" colon of that word.\n // And because we need it after that one we do +1 to get the next one.\n throw this.input.error(\n 'Missed semicolon',\n token[0] === 'word' ? token[3] + 1 : token[2]\n )\n }\n}\n\nmodule.exports = Parser\n","'use strict'\n\nlet CssSyntaxError = require('./css-syntax-error')\nlet Declaration = require('./declaration')\nlet LazyResult = require('./lazy-result')\nlet Container = require('./container')\nlet Processor = require('./processor')\nlet stringify = require('./stringify')\nlet fromJSON = require('./fromJSON')\nlet Document = require('./document')\nlet Warning = require('./warning')\nlet Comment = require('./comment')\nlet AtRule = require('./at-rule')\nlet Result = require('./result.js')\nlet Input = require('./input')\nlet parse = require('./parse')\nlet list = require('./list')\nlet Rule = require('./rule')\nlet Root = require('./root')\nlet Node = require('./node')\n\nfunction postcss(...plugins) {\n if (plugins.length === 1 && Array.isArray(plugins[0])) {\n plugins = plugins[0]\n }\n return new Processor(plugins)\n}\n\npostcss.plugin = function plugin(name, initializer) {\n let warningPrinted = false\n function creator(...args) {\n // eslint-disable-next-line no-console\n if (console && console.warn && !warningPrinted) {\n warningPrinted = true\n // eslint-disable-next-line no-console\n console.warn(\n name +\n ': postcss.plugin was deprecated. Migration guide:\\n' +\n 'https://evilmartians.com/chronicles/postcss-8-plugin-migration'\n )\n if (process.env.LANG && process.env.LANG.startsWith('cn')) {\n /* c8 ignore next 7 */\n // eslint-disable-next-line no-console\n console.warn(\n name +\n ': 里面 postcss.plugin 被弃用. 迁移指南:\\n' +\n 'https://www.w3ctech.com/topic/2226'\n )\n }\n }\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n }\n })\n\n creator.process = function (css, processOpts, pluginOpts) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n}\n\npostcss.stringify = stringify\npostcss.parse = parse\npostcss.fromJSON = fromJSON\npostcss.list = list\n\npostcss.comment = defaults => new Comment(defaults)\npostcss.atRule = defaults => new AtRule(defaults)\npostcss.decl = defaults => new Declaration(defaults)\npostcss.rule = defaults => new Rule(defaults)\npostcss.root = defaults => new Root(defaults)\npostcss.document = defaults => new Document(defaults)\n\npostcss.CssSyntaxError = CssSyntaxError\npostcss.Declaration = Declaration\npostcss.Container = Container\npostcss.Processor = Processor\npostcss.Document = Document\npostcss.Comment = Comment\npostcss.Warning = Warning\npostcss.AtRule = AtRule\npostcss.Result = Result\npostcss.Input = Input\npostcss.Rule = Rule\npostcss.Root = Root\npostcss.Node = Node\n\nLazyResult.registerPostcss(postcss)\n\nmodule.exports = postcss\npostcss.default = postcss\n","'use strict'\n\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { existsSync, readFileSync } = require('fs')\nlet { dirname, join } = require('path')\n\nfunction fromBase64(str) {\n if (Buffer) {\n return Buffer.from(str, 'base64').toString()\n } else {\n /* c8 ignore next 2 */\n return window.atob(str)\n }\n}\n\nclass PreviousMap {\n constructor(css, opts) {\n if (opts.map === false) return\n this.loadAnnotation(css)\n this.inline = this.startWith(this.annotation, 'data:')\n\n let prev = opts.map ? opts.map.prev : undefined\n let text = this.loadMap(opts.from, prev)\n if (!this.mapFile && opts.from) {\n this.mapFile = opts.from\n }\n if (this.mapFile) this.root = dirname(this.mapFile)\n if (text) this.text = text\n }\n\n consumer() {\n if (!this.consumerCache) {\n this.consumerCache = new SourceMapConsumer(this.text)\n }\n return this.consumerCache\n }\n\n withContent() {\n return !!(\n this.consumer().sourcesContent &&\n this.consumer().sourcesContent.length > 0\n )\n }\n\n startWith(string, start) {\n if (!string) return false\n return string.substr(0, start.length) === start\n }\n\n getAnnotationURL(sourceMapString) {\n return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, '').trim()\n }\n\n loadAnnotation(css) {\n let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/gm)\n if (!comments) return\n\n // sourceMappingURLs from comments, strings, etc.\n let start = css.lastIndexOf(comments.pop())\n let end = css.indexOf('*/', start)\n\n if (start > -1 && end > -1) {\n // Locate the last sourceMappingURL to avoid pickin\n this.annotation = this.getAnnotationURL(css.substring(start, end))\n }\n }\n\n decodeInline(text) {\n let baseCharsetUri = /^data:application\\/json;charset=utf-?8;base64,/\n let baseUri = /^data:application\\/json;base64,/\n let charsetUri = /^data:application\\/json;charset=utf-?8,/\n let uri = /^data:application\\/json,/\n\n if (charsetUri.test(text) || uri.test(text)) {\n return decodeURIComponent(text.substr(RegExp.lastMatch.length))\n }\n\n if (baseCharsetUri.test(text) || baseUri.test(text)) {\n return fromBase64(text.substr(RegExp.lastMatch.length))\n }\n\n let encoding = text.match(/data:application\\/json;([^,]+),/)[1]\n throw new Error('Unsupported source map encoding ' + encoding)\n }\n\n loadFile(path) {\n this.root = dirname(path)\n if (existsSync(path)) {\n this.mapFile = path\n return readFileSync(path, 'utf-8').toString().trim()\n }\n }\n\n loadMap(file, prev) {\n if (prev === false) return false\n\n if (prev) {\n if (typeof prev === 'string') {\n return prev\n } else if (typeof prev === 'function') {\n let prevPath = prev(file)\n if (prevPath) {\n let map = this.loadFile(prevPath)\n if (!map) {\n throw new Error(\n 'Unable to load previous source map: ' + prevPath.toString()\n )\n }\n return map\n }\n } else if (prev instanceof SourceMapConsumer) {\n return SourceMapGenerator.fromSourceMap(prev).toString()\n } else if (prev instanceof SourceMapGenerator) {\n return prev.toString()\n } else if (this.isMap(prev)) {\n return JSON.stringify(prev)\n } else {\n throw new Error(\n 'Unsupported previous source map format: ' + prev.toString()\n )\n }\n } else if (this.inline) {\n return this.decodeInline(this.annotation)\n } else if (this.annotation) {\n let map = this.annotation\n if (file) map = join(dirname(file), map)\n return this.loadFile(map)\n }\n }\n\n isMap(map) {\n if (typeof map !== 'object') return false\n return (\n typeof map.mappings === 'string' ||\n typeof map._mappings === 'string' ||\n Array.isArray(map.sections)\n )\n }\n}\n\nmodule.exports = PreviousMap\nPreviousMap.default = PreviousMap\n","'use strict'\n\nlet NoWorkResult = require('./no-work-result')\nlet LazyResult = require('./lazy-result')\nlet Document = require('./document')\nlet Root = require('./root')\n\nclass Processor {\n constructor(plugins = []) {\n this.version = '8.4.16'\n this.plugins = this.normalize(plugins)\n }\n\n use(plugin) {\n this.plugins = this.plugins.concat(this.normalize([plugin]))\n return this\n }\n\n process(css, opts = {}) {\n if (\n this.plugins.length === 0 &&\n typeof opts.parser === 'undefined' &&\n typeof opts.stringifier === 'undefined' &&\n typeof opts.syntax === 'undefined'\n ) {\n return new NoWorkResult(this, css, opts)\n } else {\n return new LazyResult(this, css, opts)\n }\n }\n\n normalize(plugins) {\n let normalized = []\n for (let i of plugins) {\n if (i.postcss === true) {\n i = i()\n } else if (i.postcss) {\n i = i.postcss\n }\n\n if (typeof i === 'object' && Array.isArray(i.plugins)) {\n normalized = normalized.concat(i.plugins)\n } else if (typeof i === 'object' && i.postcssPlugin) {\n normalized.push(i)\n } else if (typeof i === 'function') {\n normalized.push(i)\n } else if (typeof i === 'object' && (i.parse || i.stringify)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' +\n 'one of the syntax/parser/stringifier options as outlined ' +\n 'in your PostCSS runner documentation.'\n )\n }\n } else {\n throw new Error(i + ' is not a PostCSS plugin')\n }\n }\n return normalized\n }\n}\n\nmodule.exports = Processor\nProcessor.default = Processor\n\nRoot.registerProcessor(Processor)\nDocument.registerProcessor(Processor)\n","'use strict'\n\nlet Warning = require('./warning')\n\nclass Result {\n constructor(processor, root, opts) {\n this.processor = processor\n this.messages = []\n this.root = root\n this.opts = opts\n this.css = undefined\n this.map = undefined\n }\n\n toString() {\n return this.css\n }\n\n warn(text, opts = {}) {\n if (!opts.plugin) {\n if (this.lastPlugin && this.lastPlugin.postcssPlugin) {\n opts.plugin = this.lastPlugin.postcssPlugin\n }\n }\n\n let warning = new Warning(text, opts)\n this.messages.push(warning)\n\n return warning\n }\n\n warnings() {\n return this.messages.filter(i => i.type === 'warning')\n }\n\n get content() {\n return this.css\n }\n}\n\nmodule.exports = Result\nResult.default = Result\n","'use strict'\n\nlet Container = require('./container')\n\nlet LazyResult, Processor\n\nclass Root extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'root'\n if (!this.nodes) this.nodes = []\n }\n\n removeChild(child, ignore) {\n let index = this.index(child)\n\n if (!ignore && index === 0 && this.nodes.length > 1) {\n this.nodes[1].raws.before = this.nodes[index].raws.before\n }\n\n return super.removeChild(child)\n }\n\n normalize(child, sample, type) {\n let nodes = super.normalize(child)\n\n if (sample) {\n if (type === 'prepend') {\n if (this.nodes.length > 1) {\n sample.raws.before = this.nodes[1].raws.before\n } else {\n delete sample.raws.before\n }\n } else if (this.first !== sample) {\n for (let node of nodes) {\n node.raws.before = sample.raws.before\n }\n }\n }\n\n return nodes\n }\n\n toResult(opts = {}) {\n let lazy = new LazyResult(new Processor(), this, opts)\n return lazy.stringify()\n }\n}\n\nRoot.registerLazyResult = dependant => {\n LazyResult = dependant\n}\n\nRoot.registerProcessor = dependant => {\n Processor = dependant\n}\n\nmodule.exports = Root\nRoot.default = Root\n\nContainer.registerRoot(Root)\n","'use strict'\n\nlet Container = require('./container')\nlet list = require('./list')\n\nclass Rule extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'rule'\n if (!this.nodes) this.nodes = []\n }\n\n get selectors() {\n return list.comma(this.selector)\n }\n\n set selectors(values) {\n let match = this.selector ? this.selector.match(/,\\s*/) : null\n let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')\n this.selector = values.join(sep)\n }\n}\n\nmodule.exports = Rule\nRule.default = Rule\n\nContainer.registerRule(Rule)\n","'use strict'\n\nconst DEFAULT_RAW = {\n colon: ': ',\n indent: ' ',\n beforeDecl: '\\n',\n beforeRule: '\\n',\n beforeOpen: ' ',\n beforeClose: '\\n',\n beforeComment: '\\n',\n after: '\\n',\n emptyBody: '',\n commentLeft: ' ',\n commentRight: ' ',\n semicolon: false\n}\n\nfunction capitalize(str) {\n return str[0].toUpperCase() + str.slice(1)\n}\n\nclass Stringifier {\n constructor(builder) {\n this.builder = builder\n }\n\n stringify(node, semicolon) {\n /* c8 ignore start */\n if (!this[node.type]) {\n throw new Error(\n 'Unknown AST node type ' +\n node.type +\n '. ' +\n 'Maybe you need to change PostCSS stringifier.'\n )\n }\n /* c8 ignore stop */\n this[node.type](node, semicolon)\n }\n\n document(node) {\n this.body(node)\n }\n\n root(node) {\n this.body(node)\n if (node.raws.after) this.builder(node.raws.after)\n }\n\n comment(node) {\n let left = this.raw(node, 'left', 'commentLeft')\n let right = this.raw(node, 'right', 'commentRight')\n this.builder('/*' + left + node.text + right + '*/', node)\n }\n\n decl(node, semicolon) {\n let between = this.raw(node, 'between', 'colon')\n let string = node.prop + between + this.rawValue(node, 'value')\n\n if (node.important) {\n string += node.raws.important || ' !important'\n }\n\n if (semicolon) string += ';'\n this.builder(string, node)\n }\n\n rule(node) {\n this.block(node, this.rawValue(node, 'selector'))\n if (node.raws.ownSemicolon) {\n this.builder(node.raws.ownSemicolon, node, 'end')\n }\n }\n\n atrule(node, semicolon) {\n let name = '@' + node.name\n let params = node.params ? this.rawValue(node, 'params') : ''\n\n if (typeof node.raws.afterName !== 'undefined') {\n name += node.raws.afterName\n } else if (params) {\n name += ' '\n }\n\n if (node.nodes) {\n this.block(node, name + params)\n } else {\n let end = (node.raws.between || '') + (semicolon ? ';' : '')\n this.builder(name + params + end, node)\n }\n }\n\n body(node) {\n let last = node.nodes.length - 1\n while (last > 0) {\n if (node.nodes[last].type !== 'comment') break\n last -= 1\n }\n\n let semicolon = this.raw(node, 'semicolon')\n for (let i = 0; i < node.nodes.length; i++) {\n let child = node.nodes[i]\n let before = this.raw(child, 'before')\n if (before) this.builder(before)\n this.stringify(child, last !== i || semicolon)\n }\n }\n\n block(node, start) {\n let between = this.raw(node, 'between', 'beforeOpen')\n this.builder(start + between + '{', node, 'start')\n\n let after\n if (node.nodes && node.nodes.length) {\n this.body(node)\n after = this.raw(node, 'after')\n } else {\n after = this.raw(node, 'after', 'emptyBody')\n }\n\n if (after) this.builder(after)\n this.builder('}', node, 'end')\n }\n\n raw(node, own, detect) {\n let value\n if (!detect) detect = own\n\n // Already had\n if (own) {\n value = node.raws[own]\n if (typeof value !== 'undefined') return value\n }\n\n let parent = node.parent\n\n if (detect === 'before') {\n // Hack for first rule in CSS\n if (!parent || (parent.type === 'root' && parent.first === node)) {\n return ''\n }\n\n // `root` nodes in `document` should use only their own raws\n if (parent && parent.type === 'document') {\n return ''\n }\n }\n\n // Floating child without parent\n if (!parent) return DEFAULT_RAW[detect]\n\n // Detect style by other nodes\n let root = node.root()\n if (!root.rawCache) root.rawCache = {}\n if (typeof root.rawCache[detect] !== 'undefined') {\n return root.rawCache[detect]\n }\n\n if (detect === 'before' || detect === 'after') {\n return this.beforeAfter(node, detect)\n } else {\n let method = 'raw' + capitalize(detect)\n if (this[method]) {\n value = this[method](root, node)\n } else {\n root.walk(i => {\n value = i.raws[own]\n if (typeof value !== 'undefined') return false\n })\n }\n }\n\n if (typeof value === 'undefined') value = DEFAULT_RAW[detect]\n\n root.rawCache[detect] = value\n return value\n }\n\n rawSemicolon(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length && i.last.type === 'decl') {\n value = i.raws.semicolon\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawEmptyBody(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length === 0) {\n value = i.raws.after\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawIndent(root) {\n if (root.raws.indent) return root.raws.indent\n let value\n root.walk(i => {\n let p = i.parent\n if (p && p !== root && p.parent && p.parent === root) {\n if (typeof i.raws.before !== 'undefined') {\n let parts = i.raws.before.split('\\n')\n value = parts[parts.length - 1]\n value = value.replace(/\\S/g, '')\n return false\n }\n }\n })\n return value\n }\n\n rawBeforeComment(root, node) {\n let value\n root.walkComments(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeDecl(root, node) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeRule')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeRule(root) {\n let value\n root.walk(i => {\n if (i.nodes && (i.parent !== root || root.first !== i)) {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawBeforeClose(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length > 0) {\n if (typeof i.raws.after !== 'undefined') {\n value = i.raws.after\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawBeforeOpen(root) {\n let value\n root.walk(i => {\n if (i.type !== 'decl') {\n value = i.raws.between\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawColon(root) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.between !== 'undefined') {\n value = i.raws.between.replace(/[^\\s:]/g, '')\n return false\n }\n })\n return value\n }\n\n beforeAfter(node, detect) {\n let value\n if (node.type === 'decl') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (node.type === 'comment') {\n value = this.raw(node, null, 'beforeComment')\n } else if (detect === 'before') {\n value = this.raw(node, null, 'beforeRule')\n } else {\n value = this.raw(node, null, 'beforeClose')\n }\n\n let buf = node.parent\n let depth = 0\n while (buf && buf.type !== 'root') {\n depth += 1\n buf = buf.parent\n }\n\n if (value.includes('\\n')) {\n let indent = this.raw(node, null, 'indent')\n if (indent.length) {\n for (let step = 0; step < depth; step++) value += indent\n }\n }\n\n return value\n }\n\n rawValue(node, prop) {\n let value = node[prop]\n let raw = node.raws[prop]\n if (raw && raw.value === value) {\n return raw.raw\n }\n\n return value\n }\n}\n\nmodule.exports = Stringifier\nStringifier.default = Stringifier\n","'use strict'\n\nlet Stringifier = require('./stringifier')\n\nfunction stringify(node, builder) {\n let str = new Stringifier(builder)\n str.stringify(node)\n}\n\nmodule.exports = stringify\nstringify.default = stringify\n","'use strict'\n\nmodule.exports.isClean = Symbol('isClean')\n\nmodule.exports.my = Symbol('my')\n","'use strict'\n\nconst SINGLE_QUOTE = \"'\".charCodeAt(0)\nconst DOUBLE_QUOTE = '\"'.charCodeAt(0)\nconst BACKSLASH = '\\\\'.charCodeAt(0)\nconst SLASH = '/'.charCodeAt(0)\nconst NEWLINE = '\\n'.charCodeAt(0)\nconst SPACE = ' '.charCodeAt(0)\nconst FEED = '\\f'.charCodeAt(0)\nconst TAB = '\\t'.charCodeAt(0)\nconst CR = '\\r'.charCodeAt(0)\nconst OPEN_SQUARE = '['.charCodeAt(0)\nconst CLOSE_SQUARE = ']'.charCodeAt(0)\nconst OPEN_PARENTHESES = '('.charCodeAt(0)\nconst CLOSE_PARENTHESES = ')'.charCodeAt(0)\nconst OPEN_CURLY = '{'.charCodeAt(0)\nconst CLOSE_CURLY = '}'.charCodeAt(0)\nconst SEMICOLON = ';'.charCodeAt(0)\nconst ASTERISK = '*'.charCodeAt(0)\nconst COLON = ':'.charCodeAt(0)\nconst AT = '@'.charCodeAt(0)\n\nconst RE_AT_END = /[\\t\\n\\f\\r \"#'()/;[\\\\\\]{}]/g\nconst RE_WORD_END = /[\\t\\n\\f\\r !\"#'():;@[\\\\\\]{}]|\\/(?=\\*)/g\nconst RE_BAD_BRACKET = /.[\\n\"'(/\\\\]/\nconst RE_HEX_ESCAPE = /[\\da-f]/i\n\nmodule.exports = function tokenizer(input, options = {}) {\n let css = input.css.valueOf()\n let ignore = options.ignoreErrors\n\n let code, next, quote, content, escape\n let escaped, escapePos, prev, n, currentToken\n\n let length = css.length\n let pos = 0\n let buffer = []\n let returned = []\n\n function position() {\n return pos\n }\n\n function unclosed(what) {\n throw input.error('Unclosed ' + what, pos)\n }\n\n function endOfFile() {\n return returned.length === 0 && pos >= length\n }\n\n function nextToken(opts) {\n if (returned.length) return returned.pop()\n if (pos >= length) return\n\n let ignoreUnclosed = opts ? opts.ignoreUnclosed : false\n\n code = css.charCodeAt(pos)\n\n switch (code) {\n case NEWLINE:\n case SPACE:\n case TAB:\n case CR:\n case FEED: {\n next = pos\n do {\n next += 1\n code = css.charCodeAt(next)\n } while (\n code === SPACE ||\n code === NEWLINE ||\n code === TAB ||\n code === CR ||\n code === FEED\n )\n\n currentToken = ['space', css.slice(pos, next)]\n pos = next - 1\n break\n }\n\n case OPEN_SQUARE:\n case CLOSE_SQUARE:\n case OPEN_CURLY:\n case CLOSE_CURLY:\n case COLON:\n case SEMICOLON:\n case CLOSE_PARENTHESES: {\n let controlChar = String.fromCharCode(code)\n currentToken = [controlChar, controlChar, pos]\n break\n }\n\n case OPEN_PARENTHESES: {\n prev = buffer.length ? buffer.pop()[1] : ''\n n = css.charCodeAt(pos + 1)\n if (\n prev === 'url' &&\n n !== SINGLE_QUOTE &&\n n !== DOUBLE_QUOTE &&\n n !== SPACE &&\n n !== NEWLINE &&\n n !== TAB &&\n n !== FEED &&\n n !== CR\n ) {\n next = pos\n do {\n escaped = false\n next = css.indexOf(')', next + 1)\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos\n break\n } else {\n unclosed('bracket')\n }\n }\n escapePos = next\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1\n escaped = !escaped\n }\n } while (escaped)\n\n currentToken = ['brackets', css.slice(pos, next + 1), pos, next]\n\n pos = next\n } else {\n next = css.indexOf(')', pos + 1)\n content = css.slice(pos, next + 1)\n\n if (next === -1 || RE_BAD_BRACKET.test(content)) {\n currentToken = ['(', '(', pos]\n } else {\n currentToken = ['brackets', content, pos, next]\n pos = next\n }\n }\n\n break\n }\n\n case SINGLE_QUOTE:\n case DOUBLE_QUOTE: {\n quote = code === SINGLE_QUOTE ? \"'\" : '\"'\n next = pos\n do {\n escaped = false\n next = css.indexOf(quote, next + 1)\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos + 1\n break\n } else {\n unclosed('string')\n }\n }\n escapePos = next\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1\n escaped = !escaped\n }\n } while (escaped)\n\n currentToken = ['string', css.slice(pos, next + 1), pos, next]\n pos = next\n break\n }\n\n case AT: {\n RE_AT_END.lastIndex = pos + 1\n RE_AT_END.test(css)\n if (RE_AT_END.lastIndex === 0) {\n next = css.length - 1\n } else {\n next = RE_AT_END.lastIndex - 2\n }\n\n currentToken = ['at-word', css.slice(pos, next + 1), pos, next]\n\n pos = next\n break\n }\n\n case BACKSLASH: {\n next = pos\n escape = true\n while (css.charCodeAt(next + 1) === BACKSLASH) {\n next += 1\n escape = !escape\n }\n code = css.charCodeAt(next + 1)\n if (\n escape &&\n code !== SLASH &&\n code !== SPACE &&\n code !== NEWLINE &&\n code !== TAB &&\n code !== CR &&\n code !== FEED\n ) {\n next += 1\n if (RE_HEX_ESCAPE.test(css.charAt(next))) {\n while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {\n next += 1\n }\n if (css.charCodeAt(next + 1) === SPACE) {\n next += 1\n }\n }\n }\n\n currentToken = ['word', css.slice(pos, next + 1), pos, next]\n\n pos = next\n break\n }\n\n default: {\n if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {\n next = css.indexOf('*/', pos + 2) + 1\n if (next === 0) {\n if (ignore || ignoreUnclosed) {\n next = css.length\n } else {\n unclosed('comment')\n }\n }\n\n currentToken = ['comment', css.slice(pos, next + 1), pos, next]\n pos = next\n } else {\n RE_WORD_END.lastIndex = pos + 1\n RE_WORD_END.test(css)\n if (RE_WORD_END.lastIndex === 0) {\n next = css.length - 1\n } else {\n next = RE_WORD_END.lastIndex - 2\n }\n\n currentToken = ['word', css.slice(pos, next + 1), pos, next]\n buffer.push(currentToken)\n pos = next\n }\n\n break\n }\n }\n\n pos++\n return currentToken\n }\n\n function back(token) {\n returned.push(token)\n }\n\n return {\n back,\n nextToken,\n endOfFile,\n position\n }\n}\n","/* eslint-disable no-console */\n'use strict'\n\nlet printed = {}\n\nmodule.exports = function warnOnce(message) {\n if (printed[message]) return\n printed[message] = true\n\n if (typeof console !== 'undefined' && console.warn) {\n console.warn(message)\n }\n}\n","'use strict'\n\nclass Warning {\n constructor(text, opts = {}) {\n this.type = 'warning'\n this.text = text\n\n if (opts.node && opts.node.source) {\n let range = opts.node.rangeBy(opts)\n this.line = range.start.line\n this.column = range.start.column\n this.endLine = range.end.line\n this.endColumn = range.end.column\n }\n\n for (let opt in opts) this[opt] = opts[opt]\n }\n\n toString() {\n if (this.node) {\n return this.node.error(this.text, {\n plugin: this.plugin,\n index: this.index,\n word: this.word\n }).message\n }\n\n if (this.plugin) {\n return this.plugin + ': ' + this.text\n }\n\n return this.text\n }\n}\n\nmodule.exports = Warning\nWarning.default = Warning\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","/* eslint-disable no-undefined */\n\nvar throttle = require('./throttle');\n\n/**\n * Debounce execution of a function. Debouncing, unlike throttling,\n * guarantees that a function is only executed a single time, either at the\n * very beginning of a series of calls, or at the very end.\n *\n * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds\n * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.\n * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).\n * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the debounced-function is executed.\n *\n * @return {Function} A new, debounced function.\n */\nmodule.exports = function ( delay, atBegin, callback ) {\n\treturn callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);\n};\n","var throttle = require('./throttle');\nvar debounce = require('./debounce');\n\nmodule.exports = {\n\tthrottle: throttle,\n\tdebounce: debounce\n};\n","/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the\n * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time\n * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,\n * the internal counter is reset)\n * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the throttled-function is executed.\n * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),\n * schedule `callback` to execute after `delay` ms.\n *\n * @return {Function} A new, throttled, function.\n */\nmodule.exports = function ( delay, noTrailing, callback, debounceMode ) {\n\n\t// After wrapper has stopped being called, this timeout ensures that\n\t// `callback` is executed at the proper times in `throttle` and `end`\n\t// debounce modes.\n\tvar timeoutID;\n\n\t// Keep track of the last time `callback` was executed.\n\tvar lastExec = 0;\n\n\t// `noTrailing` defaults to falsy.\n\tif ( typeof noTrailing !== 'boolean' ) {\n\t\tdebounceMode = callback;\n\t\tcallback = noTrailing;\n\t\tnoTrailing = undefined;\n\t}\n\n\t// The `wrapper` function encapsulates all of the throttling / debouncing\n\t// functionality and when executed will limit the rate at which `callback`\n\t// is executed.\n\tfunction wrapper () {\n\n\t\tvar self = this;\n\t\tvar elapsed = Number(new Date()) - lastExec;\n\t\tvar args = arguments;\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec () {\n\t\t\tlastExec = Number(new Date());\n\t\t\tcallback.apply(self, args);\n\t\t}\n\n\t\t// If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t// to allow future `callback` executions.\n\t\tfunction clear () {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif ( debounceMode && !timeoutID ) {\n\t\t\t// Since `wrapper` is being called for the first time and\n\t\t\t// `debounceMode` is true (at begin), execute `callback`.\n\t\t\texec();\n\t\t}\n\n\t\t// Clear any existing timeout.\n\t\tif ( timeoutID ) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\n\t\tif ( debounceMode === undefined && elapsed > delay ) {\n\t\t\t// In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t// `callback`.\n\t\t\texec();\n\n\t\t} else if ( noTrailing !== true ) {\n\t\t\t// In trailing throttle mode, since `delay` time has not been\n\t\t\t// exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t// recent execution.\n\t\t\t//\n\t\t\t// If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t// after `delay` ms.\n\t\t\t//\n\t\t\t// If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t// execute after `delay` ms.\n\t\t\ttimeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n\t\t}\n\n\t}\n\n\t// Return the wrapper function.\n\treturn wrapper;\n\n};\n","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { inherit } from '../utils/functional'; // Components\n\nimport Info from '../info'; // Types\n\nvar _createNamespace = createNamespace('icon'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction isImage(name) {\n return name ? name.indexOf('/') !== -1 : false;\n} // compatible with legacy usage, should be removed in next major version\n\n\nvar LEGACY_MAP = {\n medel: 'medal',\n 'medel-o': 'medal-o',\n 'calender-o': 'calendar-o'\n};\n\nfunction correctName(name) {\n return name && LEGACY_MAP[name] || name;\n}\n\nfunction Icon(h, props, slots, ctx) {\n var _props$badge;\n\n var name = correctName(props.name);\n var imageIcon = isImage(name);\n\n if (process.env.NODE_ENV === 'development' && props.info) {\n console.warn('[Vant] Icon: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n return h(props.tag, _mergeJSXProps([{\n \"class\": [props.classPrefix, imageIcon ? '' : props.classPrefix + \"-\" + name],\n \"style\": {\n color: props.color,\n fontSize: addUnit(props.size)\n }\n }, inherit(ctx, true)]), [slots.default && slots.default(), imageIcon && h(\"img\", {\n \"class\": bem('image'),\n \"attrs\": {\n \"src\": name\n }\n }), h(Info, {\n \"attrs\": {\n \"dot\": props.dot,\n \"info\": (_props$badge = props.badge) != null ? _props$badge : props.info\n }\n })]);\n}\n\nIcon.props = {\n dot: Boolean,\n name: String,\n size: [Number, String],\n // @deprecated\n // should be removed in next major version\n info: [Number, String],\n badge: [Number, String],\n color: String,\n tag: {\n type: String,\n default: 'i'\n },\n classPrefix: {\n type: String,\n default: bem()\n }\n};\nexport default createComponent(Icon);","import { createNamespace, isDef } from '../utils';\nimport { PopupMixin } from '../mixins/popup';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('popup'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [PopupMixin()],\n props: {\n round: Boolean,\n duration: [Number, String],\n closeable: Boolean,\n transition: String,\n safeAreaInsetBottom: Boolean,\n closeIcon: {\n type: String,\n default: 'cross'\n },\n closeIconPosition: {\n type: String,\n default: 'top-right'\n },\n position: {\n type: String,\n default: 'center'\n },\n overlay: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n }\n },\n beforeCreate: function beforeCreate() {\n var _this = this;\n\n var createEmitter = function createEmitter(eventName) {\n return function (event) {\n return _this.$emit(eventName, event);\n };\n };\n\n this.onClick = createEmitter('click');\n this.onOpened = createEmitter('opened');\n this.onClosed = createEmitter('closed');\n },\n methods: {\n onClickCloseIcon: function onClickCloseIcon(event) {\n this.$emit('click-close-icon', event);\n this.close();\n }\n },\n render: function render() {\n var _bem;\n\n var h = arguments[0];\n\n if (!this.shouldRender) {\n return;\n }\n\n var round = this.round,\n position = this.position,\n duration = this.duration;\n var isCenter = position === 'center';\n var transitionName = this.transition || (isCenter ? 'van-fade' : \"van-popup-slide-\" + position);\n var style = {};\n\n if (isDef(duration)) {\n var key = isCenter ? 'animationDuration' : 'transitionDuration';\n style[key] = duration + \"s\";\n }\n\n return h(\"transition\", {\n \"attrs\": {\n \"appear\": this.transitionAppear,\n \"name\": transitionName\n },\n \"on\": {\n \"afterEnter\": this.onOpened,\n \"afterLeave\": this.onClosed\n }\n }, [h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.value\n }],\n \"style\": style,\n \"class\": bem((_bem = {\n round: round\n }, _bem[position] = position, _bem['safe-area-inset-bottom'] = this.safeAreaInsetBottom, _bem)),\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.slots(), this.closeable && h(Icon, {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": \"0\",\n \"name\": this.closeIcon\n },\n \"class\": bem('close-icon', this.closeIconPosition),\n \"on\": {\n \"click\": this.onClickCloseIcon\n }\n })])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport Vue from 'vue'; // Utils\n\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Mixins\n\nimport { popupMixinProps } from '../mixins/popup'; // Components\n\nimport Icon from '../icon';\nimport Popup from '../popup';\nimport Loading from '../loading'; // Types\n\nvar _createNamespace = createNamespace('action-sheet'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction ActionSheet(h, props, slots, ctx) {\n var title = props.title,\n cancelText = props.cancelText,\n closeable = props.closeable;\n\n function onCancel() {\n emit(ctx, 'input', false);\n emit(ctx, 'cancel');\n }\n\n function Header() {\n if (title) {\n return h(\"div\", {\n \"class\": bem('header')\n }, [title, closeable && h(Icon, {\n \"attrs\": {\n \"name\": props.closeIcon\n },\n \"class\": bem('close'),\n \"on\": {\n \"click\": onCancel\n }\n })]);\n }\n }\n\n function Option(item, index) {\n var disabled = item.disabled,\n loading = item.loading,\n callback = item.callback;\n\n function onClickOption(event) {\n event.stopPropagation();\n\n if (disabled || loading) {\n return;\n }\n\n if (callback) {\n callback(item);\n }\n\n if (props.closeOnClickAction) {\n emit(ctx, 'input', false);\n }\n\n Vue.nextTick(function () {\n emit(ctx, 'select', item, index);\n });\n }\n\n function OptionContent() {\n if (loading) {\n return h(Loading, {\n \"class\": bem('loading-icon')\n });\n }\n\n return [h(\"span\", {\n \"class\": bem('name')\n }, [item.name]), item.subname && h(\"div\", {\n \"class\": bem('subname')\n }, [item.subname])];\n }\n\n return h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": [bem('item', {\n disabled: disabled,\n loading: loading\n }), item.className],\n \"style\": {\n color: item.color\n },\n \"on\": {\n \"click\": onClickOption\n }\n }, [OptionContent()]);\n }\n\n function CancelText() {\n if (cancelText) {\n return [h(\"div\", {\n \"class\": bem('gap')\n }), h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": bem('cancel'),\n \"on\": {\n \"click\": onCancel\n }\n }, [cancelText])];\n }\n }\n\n function Description() {\n var description = (slots.description == null ? void 0 : slots.description()) || props.description;\n\n if (description) {\n return h(\"div\", {\n \"class\": bem('description')\n }, [description]);\n }\n }\n\n return h(Popup, _mergeJSXProps([{\n \"class\": bem(),\n \"attrs\": {\n \"position\": \"bottom\",\n \"round\": props.round,\n \"value\": props.value,\n \"overlay\": props.overlay,\n \"duration\": props.duration,\n \"lazyRender\": props.lazyRender,\n \"lockScroll\": props.lockScroll,\n \"getContainer\": props.getContainer,\n \"closeOnPopstate\": props.closeOnPopstate,\n \"closeOnClickOverlay\": props.closeOnClickOverlay,\n \"safeAreaInsetBottom\": props.safeAreaInsetBottom\n }\n }, inherit(ctx, true)]), [Header(), Description(), h(\"div\", {\n \"class\": bem('content')\n }, [props.actions && props.actions.map(Option), slots.default == null ? void 0 : slots.default()]), CancelText()]);\n}\n\nActionSheet.props = _extends({}, popupMixinProps, {\n title: String,\n actions: Array,\n duration: [Number, String],\n cancelText: String,\n description: String,\n getContainer: [String, Function],\n closeOnPopstate: Boolean,\n closeOnClickAction: Boolean,\n round: {\n type: Boolean,\n default: true\n },\n closeable: {\n type: Boolean,\n default: true\n },\n closeIcon: {\n type: String,\n default: 'cross'\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n },\n overlay: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n }\n});\nexport default createComponent(ActionSheet);","export function isMobile(value) {\n value = value.replace(/[^-|\\d]/g, '');\n return /^((\\+86)|(86))?(1)\\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);\n}","export var DEFAULT_ITEM_HEIGHT = 44;\nexport var pickerProps = {\n title: String,\n loading: Boolean,\n readonly: Boolean,\n itemHeight: [Number, String],\n showToolbar: Boolean,\n cancelButtonText: String,\n confirmButtonText: String,\n allowHtml: {\n type: Boolean,\n default: true\n },\n visibleItemCount: {\n type: [Number, String],\n default: 6\n },\n swipeDuration: {\n type: [Number, String],\n default: 1000\n }\n};","// color\nexport var RED = '#ee0a24'; // border\n\nexport var BORDER = 'van-hairline';\nexport var BORDER_TOP = BORDER + \"--top\";\nexport var BORDER_LEFT = BORDER + \"--left\";\nexport var BORDER_BOTTOM = BORDER + \"--bottom\";\nexport var BORDER_SURROUND = BORDER + \"--surround\";\nexport var BORDER_TOP_BOTTOM = BORDER + \"--top-bottom\";\nexport var BORDER_UNSET_TOP_BOTTOM = BORDER + \"-unset--top-bottom\";","import { isDef } from './index';\nexport function deepClone(obj) {\n if (!isDef(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(function (item) {\n return deepClone(item);\n });\n }\n\n if (typeof obj === 'object') {\n var to = {};\n Object.keys(obj).forEach(function (key) {\n to[key] = deepClone(obj[key]);\n });\n return to;\n }\n\n return obj;\n}","export function range(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}\n\nfunction trimExtraChar(value, _char, regExp) {\n var index = value.indexOf(_char);\n var prefix = '';\n\n if (index === -1) {\n return value;\n }\n\n if (_char === '-' && index !== 0) {\n return value.slice(0, index);\n }\n\n if (_char === '.' && value.match(/^(\\.|-\\.)/)) {\n prefix = index ? '-0' : '0';\n }\n\n return prefix + value.slice(0, index + 1) + value.slice(index).replace(regExp, '');\n}\n\nexport function formatNumber(value, allowDot, allowMinus) {\n if (allowDot === void 0) {\n allowDot = true;\n }\n\n if (allowMinus === void 0) {\n allowMinus = true;\n }\n\n if (allowDot) {\n value = trimExtraChar(value, '.', /\\./g);\n } else {\n value = value.split('.')[0];\n }\n\n if (allowMinus) {\n value = trimExtraChar(value, '-', /-/g);\n } else {\n value = value.replace(/-/, '');\n }\n\n var regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;\n return value.replace(regExp, '');\n} // add num and avoid float number\n\nexport function addNumber(num1, num2) {\n var cardinal = Math.pow(10, 10);\n return Math.round((num1 + num2) * cardinal) / cardinal;\n}","import _mergeJSXProps2 from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport { deepClone } from '../utils/deep-clone';\nimport { createNamespace, inBrowser, isObject } from '../utils';\nimport { range } from '../utils/format/number';\nimport { preventDefault, on, off } from '../utils/dom/event';\nimport { TouchMixin } from '../mixins/touch';\nvar DEFAULT_DURATION = 200; // 惯性滑动思路:\n// 在手指离开屏幕时,如果和上一次 move 时的间隔小于 `MOMENTUM_LIMIT_TIME` 且 move\n// 距离大于 `MOMENTUM_LIMIT_DISTANCE` 时,执行惯性滑动\n\nexport var MOMENTUM_LIMIT_TIME = 300;\nexport var MOMENTUM_LIMIT_DISTANCE = 15;\n\nvar _createNamespace = createNamespace('picker-column'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction getElementTranslateY(element) {\n var style = window.getComputedStyle(element);\n var transform = style.transform || style.webkitTransform;\n var translateY = transform.slice(7, transform.length - 1).split(', ')[5];\n return Number(translateY);\n}\n\nfunction isOptionDisabled(option) {\n return isObject(option) && option.disabled;\n} // use standard WheelEvent:\n// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent\n\n\nvar supportMousewheel = inBrowser && 'onwheel' in window;\nvar mousewheelTimer = null;\nexport default createComponent({\n mixins: [TouchMixin],\n props: {\n valueKey: String,\n readonly: Boolean,\n allowHtml: Boolean,\n className: String,\n itemHeight: Number,\n defaultIndex: Number,\n swipeDuration: [Number, String],\n visibleItemCount: [Number, String],\n initialOptions: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n offset: 0,\n duration: 0,\n options: deepClone(this.initialOptions),\n currentIndex: this.defaultIndex\n };\n },\n created: function created() {\n if (this.$parent.children) {\n this.$parent.children.push(this);\n }\n\n this.setIndex(this.currentIndex);\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$el);\n\n if (supportMousewheel) {\n on(this.$el, 'wheel', this.onMouseWheel, false);\n }\n },\n destroyed: function destroyed() {\n var children = this.$parent.children;\n\n if (children) {\n children.splice(children.indexOf(this), 1);\n }\n\n if (supportMousewheel) {\n off(this.$el, 'wheel');\n }\n },\n watch: {\n initialOptions: 'setOptions',\n defaultIndex: function defaultIndex(val) {\n this.setIndex(val);\n }\n },\n computed: {\n count: function count() {\n return this.options.length;\n },\n baseOffset: function baseOffset() {\n return this.itemHeight * (this.visibleItemCount - 1) / 2;\n }\n },\n methods: {\n setOptions: function setOptions(options) {\n if (JSON.stringify(options) !== JSON.stringify(this.options)) {\n this.options = deepClone(options);\n this.setIndex(this.defaultIndex);\n }\n },\n onTouchStart: function onTouchStart(event) {\n if (this.readonly) {\n return;\n }\n\n this.touchStart(event);\n\n if (this.moving) {\n var translateY = getElementTranslateY(this.$refs.wrapper);\n this.offset = Math.min(0, translateY - this.baseOffset);\n this.startOffset = this.offset;\n } else {\n this.startOffset = this.offset;\n }\n\n this.duration = 0;\n this.transitionEndTrigger = null;\n this.touchStartTime = Date.now();\n this.momentumOffset = this.startOffset;\n },\n onTouchMove: function onTouchMove(event) {\n if (this.readonly) {\n return;\n }\n\n this.touchMove(event);\n\n if (this.direction === 'vertical') {\n this.moving = true;\n preventDefault(event, true);\n }\n\n this.offset = range(this.startOffset + this.deltaY, -(this.count * this.itemHeight), this.itemHeight);\n var now = Date.now();\n\n if (now - this.touchStartTime > MOMENTUM_LIMIT_TIME) {\n this.touchStartTime = now;\n this.momentumOffset = this.offset;\n }\n },\n onTouchEnd: function onTouchEnd() {\n var _this = this;\n\n if (this.readonly) {\n return;\n }\n\n var distance = this.offset - this.momentumOffset;\n var duration = Date.now() - this.touchStartTime;\n var allowMomentum = duration < MOMENTUM_LIMIT_TIME && Math.abs(distance) > MOMENTUM_LIMIT_DISTANCE;\n\n if (allowMomentum) {\n this.momentum(distance, duration);\n return;\n }\n\n var index = this.getIndexByOffset(this.offset);\n this.duration = DEFAULT_DURATION;\n this.setIndex(index, true); // compatible with desktop scenario\n // use setTimeout to skip the click event Emitted after touchstart\n\n setTimeout(function () {\n _this.moving = false;\n }, 0);\n },\n onMouseWheel: function onMouseWheel(event) {\n var _this2 = this;\n\n if (this.readonly) {\n return;\n }\n\n preventDefault(event, true); // simply combine touchstart and touchmove\n\n var translateY = getElementTranslateY(this.$refs.wrapper);\n this.startOffset = Math.min(0, translateY - this.baseOffset);\n this.momentumOffset = this.startOffset;\n this.transitionEndTrigger = null; // directly use deltaY, see https://caniuse.com/?search=deltaY\n // use deltaY to detect direction for not special setting device\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event\n\n var deltaY = event.deltaY;\n\n if (this.startOffset === 0 && deltaY < 0) {\n return;\n } // get offset\n // if necessary, can adjust distance value to make scrolling smoother\n\n\n var distance = -deltaY;\n this.offset = range(this.startOffset + distance, -(this.count * this.itemHeight), this.itemHeight);\n\n if (mousewheelTimer) {\n clearTimeout(mousewheelTimer);\n }\n\n mousewheelTimer = setTimeout(function () {\n _this2.onTouchEnd();\n\n _this2.touchStartTime = 0;\n }, MOMENTUM_LIMIT_TIME);\n },\n onTransitionEnd: function onTransitionEnd() {\n this.stopMomentum();\n },\n onClickItem: function onClickItem(index) {\n if (this.moving || this.readonly) {\n return;\n }\n\n this.transitionEndTrigger = null;\n this.duration = DEFAULT_DURATION;\n this.setIndex(index, true);\n },\n adjustIndex: function adjustIndex(index) {\n index = range(index, 0, this.count);\n\n for (var i = index; i < this.count; i++) {\n if (!isOptionDisabled(this.options[i])) return i;\n }\n\n for (var _i = index - 1; _i >= 0; _i--) {\n if (!isOptionDisabled(this.options[_i])) return _i;\n }\n },\n getOptionText: function getOptionText(option) {\n if (isObject(option) && this.valueKey in option) {\n return option[this.valueKey];\n }\n\n return option;\n },\n setIndex: function setIndex(index, emitChange) {\n var _this3 = this;\n\n index = this.adjustIndex(index) || 0;\n var offset = -index * this.itemHeight;\n\n var trigger = function trigger() {\n if (index !== _this3.currentIndex) {\n _this3.currentIndex = index;\n\n if (emitChange) {\n _this3.$emit('change', index);\n }\n }\n }; // trigger the change event after transitionend when moving\n\n\n if (this.moving && offset !== this.offset) {\n this.transitionEndTrigger = trigger;\n } else {\n trigger();\n }\n\n this.offset = offset;\n },\n setValue: function setValue(value) {\n var options = this.options;\n\n for (var i = 0; i < options.length; i++) {\n if (this.getOptionText(options[i]) === value) {\n return this.setIndex(i);\n }\n }\n },\n getValue: function getValue() {\n return this.options[this.currentIndex];\n },\n getIndexByOffset: function getIndexByOffset(offset) {\n return range(Math.round(-offset / this.itemHeight), 0, this.count - 1);\n },\n momentum: function momentum(distance, duration) {\n var speed = Math.abs(distance / duration);\n distance = this.offset + speed / 0.003 * (distance < 0 ? -1 : 1);\n var index = this.getIndexByOffset(distance);\n this.duration = +this.swipeDuration;\n this.setIndex(index, true);\n },\n stopMomentum: function stopMomentum() {\n this.moving = false;\n this.duration = 0;\n\n if (this.transitionEndTrigger) {\n this.transitionEndTrigger();\n this.transitionEndTrigger = null;\n }\n },\n genOptions: function genOptions() {\n var _this4 = this;\n\n var h = this.$createElement;\n var optionStyle = {\n height: this.itemHeight + \"px\"\n };\n return this.options.map(function (option, index) {\n var _domProps;\n\n var text = _this4.getOptionText(option);\n\n var disabled = isOptionDisabled(option);\n var data = {\n style: optionStyle,\n attrs: {\n role: 'button',\n tabindex: disabled ? -1 : 0\n },\n class: [bem('item', {\n disabled: disabled,\n selected: index === _this4.currentIndex\n })],\n on: {\n click: function click() {\n _this4.onClickItem(index);\n }\n }\n };\n var childData = {\n class: 'van-ellipsis',\n domProps: (_domProps = {}, _domProps[_this4.allowHtml ? 'innerHTML' : 'textContent'] = text, _domProps)\n };\n return h(\"li\", _mergeJSXProps([{}, data]), [_this4.slots('option', option) || h(\"div\", _mergeJSXProps2([{}, childData]))]);\n });\n }\n },\n render: function render() {\n var h = arguments[0];\n var wrapperStyle = {\n transform: \"translate3d(0, \" + (this.offset + this.baseOffset) + \"px, 0)\",\n transitionDuration: this.duration + \"ms\",\n transitionProperty: this.duration ? 'all' : 'none'\n };\n return h(\"div\", {\n \"class\": [bem(), this.className]\n }, [h(\"ul\", {\n \"ref\": \"wrapper\",\n \"style\": wrapperStyle,\n \"class\": bem('wrapper'),\n \"on\": {\n \"transitionend\": this.onTransitionEnd\n }\n }, [this.genOptions()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { preventDefault } from '../utils/dom/event';\nimport { BORDER_UNSET_TOP_BOTTOM } from '../utils/constant';\nimport { pickerProps, DEFAULT_ITEM_HEIGHT } from './shared';\nimport { unitToPx } from '../utils/format/unit'; // Components\n\nimport Loading from '../loading';\nimport PickerColumn from './PickerColumn';\n\nvar _createNamespace = createNamespace('picker'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n props: _extends({}, pickerProps, {\n defaultIndex: {\n type: [Number, String],\n default: 0\n },\n columns: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n toolbarPosition: {\n type: String,\n default: 'top'\n },\n valueKey: {\n type: String,\n default: 'text'\n }\n }),\n data: function data() {\n return {\n children: [],\n formattedColumns: []\n };\n },\n computed: {\n itemPxHeight: function itemPxHeight() {\n return this.itemHeight ? unitToPx(this.itemHeight) : DEFAULT_ITEM_HEIGHT;\n },\n dataType: function dataType() {\n var columns = this.columns;\n var firstColumn = columns[0] || {};\n\n if (firstColumn.children) {\n return 'cascade';\n }\n\n if (firstColumn.values) {\n return 'object';\n }\n\n return 'text';\n }\n },\n watch: {\n columns: {\n handler: 'format',\n immediate: true\n }\n },\n methods: {\n format: function format() {\n var columns = this.columns,\n dataType = this.dataType;\n\n if (dataType === 'text') {\n this.formattedColumns = [{\n values: columns\n }];\n } else if (dataType === 'cascade') {\n this.formatCascade();\n } else {\n this.formattedColumns = columns;\n }\n },\n formatCascade: function formatCascade() {\n var formatted = [];\n var cursor = {\n children: this.columns\n };\n\n while (cursor && cursor.children) {\n var _cursor$defaultIndex;\n\n var _cursor = cursor,\n children = _cursor.children;\n var defaultIndex = (_cursor$defaultIndex = cursor.defaultIndex) != null ? _cursor$defaultIndex : +this.defaultIndex;\n\n while (children[defaultIndex] && children[defaultIndex].disabled) {\n if (defaultIndex < children.length - 1) {\n defaultIndex++;\n } else {\n defaultIndex = 0;\n break;\n }\n }\n\n formatted.push({\n values: cursor.children,\n className: cursor.className,\n defaultIndex: defaultIndex\n });\n cursor = children[defaultIndex];\n }\n\n this.formattedColumns = formatted;\n },\n emit: function emit(event) {\n var _this = this;\n\n if (this.dataType === 'text') {\n this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));\n } else {\n var values = this.getValues(); // compatible with old version of wrong parameters\n // should be removed in next major version\n // see: https://github.com/vant-ui/vant/issues/5905\n\n if (this.dataType === 'cascade') {\n values = values.map(function (item) {\n return item[_this.valueKey];\n });\n }\n\n this.$emit(event, values, this.getIndexes());\n }\n },\n onCascadeChange: function onCascadeChange(columnIndex) {\n var cursor = {\n children: this.columns\n };\n var indexes = this.getIndexes();\n\n for (var i = 0; i <= columnIndex; i++) {\n cursor = cursor.children[indexes[i]];\n }\n\n while (cursor && cursor.children) {\n columnIndex++;\n this.setColumnValues(columnIndex, cursor.children);\n cursor = cursor.children[cursor.defaultIndex || 0];\n }\n },\n onChange: function onChange(columnIndex) {\n var _this2 = this;\n\n if (this.dataType === 'cascade') {\n this.onCascadeChange(columnIndex);\n }\n\n if (this.dataType === 'text') {\n this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));\n } else {\n var values = this.getValues(); // compatible with old version of wrong parameters\n // should be removed in next major version\n // see: https://github.com/vant-ui/vant/issues/5905\n\n if (this.dataType === 'cascade') {\n values = values.map(function (item) {\n return item[_this2.valueKey];\n });\n }\n\n this.$emit('change', this, values, columnIndex);\n }\n },\n // get column instance by index\n getColumn: function getColumn(index) {\n return this.children[index];\n },\n // @exposed-api\n // get column value by index\n getColumnValue: function getColumnValue(index) {\n var column = this.getColumn(index);\n return column && column.getValue();\n },\n // @exposed-api\n // set column value by index\n setColumnValue: function setColumnValue(index, value) {\n var column = this.getColumn(index);\n\n if (column) {\n column.setValue(value);\n\n if (this.dataType === 'cascade') {\n this.onCascadeChange(index);\n }\n }\n },\n // @exposed-api\n // get column option index by column index\n getColumnIndex: function getColumnIndex(columnIndex) {\n return (this.getColumn(columnIndex) || {}).currentIndex;\n },\n // @exposed-api\n // set column option index by column index\n setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {\n var column = this.getColumn(columnIndex);\n\n if (column) {\n column.setIndex(optionIndex);\n\n if (this.dataType === 'cascade') {\n this.onCascadeChange(columnIndex);\n }\n }\n },\n // @exposed-api\n // get options of column by index\n getColumnValues: function getColumnValues(index) {\n return (this.children[index] || {}).options;\n },\n // @exposed-api\n // set options of column by index\n setColumnValues: function setColumnValues(index, options) {\n var column = this.children[index];\n\n if (column) {\n column.setOptions(options);\n }\n },\n // @exposed-api\n // get values of all columns\n getValues: function getValues() {\n return this.children.map(function (child) {\n return child.getValue();\n });\n },\n // @exposed-api\n // set values of all columns\n setValues: function setValues(values) {\n var _this3 = this;\n\n values.forEach(function (value, index) {\n _this3.setColumnValue(index, value);\n });\n },\n // @exposed-api\n // get indexes of all columns\n getIndexes: function getIndexes() {\n return this.children.map(function (child) {\n return child.currentIndex;\n });\n },\n // @exposed-api\n // set indexes of all columns\n setIndexes: function setIndexes(indexes) {\n var _this4 = this;\n\n indexes.forEach(function (optionIndex, columnIndex) {\n _this4.setColumnIndex(columnIndex, optionIndex);\n });\n },\n // @exposed-api\n confirm: function confirm() {\n this.children.forEach(function (child) {\n return child.stopMomentum();\n });\n this.emit('confirm');\n },\n cancel: function cancel() {\n this.emit('cancel');\n },\n genTitle: function genTitle() {\n var h = this.$createElement;\n var titleSlot = this.slots('title');\n\n if (titleSlot) {\n return titleSlot;\n }\n\n if (this.title) {\n return h(\"div\", {\n \"class\": ['van-ellipsis', bem('title')]\n }, [this.title]);\n }\n },\n genCancel: function genCancel() {\n var h = this.$createElement;\n return h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": bem('cancel'),\n \"on\": {\n \"click\": this.cancel\n }\n }, [this.slots('cancel') || this.cancelButtonText || t('cancel')]);\n },\n genConfirm: function genConfirm() {\n var h = this.$createElement;\n return h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": bem('confirm'),\n \"on\": {\n \"click\": this.confirm\n }\n }, [this.slots('confirm') || this.confirmButtonText || t('confirm')]);\n },\n genToolbar: function genToolbar() {\n var h = this.$createElement;\n\n if (this.showToolbar) {\n return h(\"div\", {\n \"class\": bem('toolbar')\n }, [this.slots() || [this.genCancel(), this.genTitle(), this.genConfirm()]]);\n }\n },\n genColumns: function genColumns() {\n var h = this.$createElement;\n var itemPxHeight = this.itemPxHeight;\n var wrapHeight = itemPxHeight * this.visibleItemCount;\n var frameStyle = {\n height: itemPxHeight + \"px\"\n };\n var columnsStyle = {\n height: wrapHeight + \"px\"\n };\n var maskStyle = {\n backgroundSize: \"100% \" + (wrapHeight - itemPxHeight) / 2 + \"px\"\n };\n return h(\"div\", {\n \"class\": bem('columns'),\n \"style\": columnsStyle,\n \"on\": {\n \"touchmove\": preventDefault\n }\n }, [this.genColumnItems(), h(\"div\", {\n \"class\": bem('mask'),\n \"style\": maskStyle\n }), h(\"div\", {\n \"class\": [BORDER_UNSET_TOP_BOTTOM, bem('frame')],\n \"style\": frameStyle\n })]);\n },\n genColumnItems: function genColumnItems() {\n var _this5 = this;\n\n var h = this.$createElement;\n return this.formattedColumns.map(function (item, columnIndex) {\n var _item$defaultIndex;\n\n return h(PickerColumn, {\n \"attrs\": {\n \"readonly\": _this5.readonly,\n \"valueKey\": _this5.valueKey,\n \"allowHtml\": _this5.allowHtml,\n \"className\": item.className,\n \"itemHeight\": _this5.itemPxHeight,\n \"defaultIndex\": (_item$defaultIndex = item.defaultIndex) != null ? _item$defaultIndex : +_this5.defaultIndex,\n \"swipeDuration\": _this5.swipeDuration,\n \"visibleItemCount\": _this5.visibleItemCount,\n \"initialOptions\": item.values\n },\n \"scopedSlots\": {\n option: _this5.$scopedSlots.option\n },\n \"on\": {\n \"change\": function change() {\n _this5.onChange(columnIndex);\n }\n }\n });\n });\n }\n },\n render: function render(h) {\n return h(\"div\", {\n \"class\": bem()\n }, [this.toolbarPosition === 'top' ? this.genToolbar() : h(), this.loading ? h(Loading, {\n \"class\": bem('loading')\n }) : h(), this.slots('columns-top'), this.genColumns(), this.slots('columns-bottom'), this.toolbarPosition === 'bottom' ? this.genToolbar() : h()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { pickerProps } from '../picker/shared';\nimport Picker from '../picker';\n\nvar _createNamespace = createNamespace('area'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar PLACEHOLDER_CODE = '000000';\n\nfunction isOverseaCode(code) {\n return code[0] === '9';\n}\n\nfunction pickSlots(instance, keys) {\n var $slots = instance.$slots,\n $scopedSlots = instance.$scopedSlots;\n var scopedSlots = {};\n keys.forEach(function (key) {\n if ($scopedSlots[key]) {\n scopedSlots[key] = $scopedSlots[key];\n } else if ($slots[key]) {\n scopedSlots[key] = function () {\n return $slots[key];\n };\n }\n });\n return scopedSlots;\n}\n\nexport default createComponent({\n props: _extends({}, pickerProps, {\n value: String,\n areaList: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n columnsNum: {\n type: [Number, String],\n default: 3\n },\n isOverseaCode: {\n type: Function,\n default: isOverseaCode\n },\n columnsPlaceholder: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n }),\n data: function data() {\n return {\n code: this.value,\n columns: [{\n values: []\n }, {\n values: []\n }, {\n values: []\n }]\n };\n },\n computed: {\n province: function province() {\n return this.areaList.province_list || {};\n },\n city: function city() {\n return this.areaList.city_list || {};\n },\n county: function county() {\n return this.areaList.county_list || {};\n },\n displayColumns: function displayColumns() {\n return this.columns.slice(0, +this.columnsNum);\n },\n placeholderMap: function placeholderMap() {\n return {\n province: this.columnsPlaceholder[0] || '',\n city: this.columnsPlaceholder[1] || '',\n county: this.columnsPlaceholder[2] || ''\n };\n }\n },\n watch: {\n value: function value(val) {\n this.code = val;\n this.setValues();\n },\n areaList: {\n deep: true,\n handler: 'setValues'\n },\n columnsNum: function columnsNum() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.setValues();\n });\n }\n },\n mounted: function mounted() {\n this.setValues();\n },\n methods: {\n // get list by code\n getList: function getList(type, code) {\n var result = [];\n\n if (type !== 'province' && !code) {\n return result;\n }\n\n var list = this[type];\n result = Object.keys(list).map(function (listCode) {\n return {\n code: listCode,\n name: list[listCode]\n };\n });\n\n if (code) {\n // oversea code\n if (this.isOverseaCode(code) && type === 'city') {\n code = '9';\n }\n\n result = result.filter(function (item) {\n return item.code.indexOf(code) === 0;\n });\n }\n\n if (this.placeholderMap[type] && result.length) {\n // set columns placeholder\n var codeFill = '';\n\n if (type === 'city') {\n codeFill = PLACEHOLDER_CODE.slice(2, 4);\n } else if (type === 'county') {\n codeFill = PLACEHOLDER_CODE.slice(4, 6);\n }\n\n result.unshift({\n code: \"\" + code + codeFill,\n name: this.placeholderMap[type]\n });\n }\n\n return result;\n },\n // get index by code\n getIndex: function getIndex(type, code) {\n var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;\n var list = this.getList(type, code.slice(0, compareNum - 2)); // oversea code\n\n if (this.isOverseaCode(code) && type === 'province') {\n compareNum = 1;\n }\n\n code = code.slice(0, compareNum);\n\n for (var i = 0; i < list.length; i++) {\n if (list[i].code.slice(0, compareNum) === code) {\n return i;\n }\n }\n\n return 0;\n },\n // parse output columns data\n parseOutputValues: function parseOutputValues(values) {\n var _this2 = this;\n\n return values.map(function (value, index) {\n // save undefined value\n if (!value) return value;\n value = JSON.parse(JSON.stringify(value));\n\n if (!value.code || value.name === _this2.columnsPlaceholder[index]) {\n value.code = '';\n value.name = '';\n }\n\n return value;\n });\n },\n onChange: function onChange(picker, values, index) {\n this.code = values[index].code;\n this.setValues();\n var parsedValues = this.parseOutputValues(picker.getValues());\n this.$emit('change', picker, parsedValues, index);\n },\n onConfirm: function onConfirm(values, index) {\n values = this.parseOutputValues(values);\n this.setValues();\n this.$emit('confirm', values, index);\n },\n getDefaultCode: function getDefaultCode() {\n if (this.columnsPlaceholder.length) {\n return PLACEHOLDER_CODE;\n }\n\n var countyCodes = Object.keys(this.county);\n\n if (countyCodes[0]) {\n return countyCodes[0];\n }\n\n var cityCodes = Object.keys(this.city);\n\n if (cityCodes[0]) {\n return cityCodes[0];\n }\n\n return '';\n },\n setValues: function setValues() {\n var code = this.code;\n\n if (!code) {\n code = this.getDefaultCode();\n }\n\n var picker = this.$refs.picker;\n var province = this.getList('province');\n var city = this.getList('city', code.slice(0, 2));\n\n if (!picker) {\n return;\n }\n\n picker.setColumnValues(0, province);\n picker.setColumnValues(1, city);\n\n if (city.length && code.slice(2, 4) === '00' && !this.isOverseaCode(code)) {\n code = city[0].code;\n }\n\n picker.setColumnValues(2, this.getList('county', code.slice(0, 4)));\n picker.setIndexes([this.getIndex('province', code), this.getIndex('city', code), this.getIndex('county', code)]);\n },\n getValues: function getValues() {\n var picker = this.$refs.picker;\n var getValues = picker ? picker.getValues().filter(function (value) {\n return !!value;\n }) : [];\n getValues = this.parseOutputValues(getValues);\n return getValues;\n },\n getArea: function getArea() {\n var values = this.getValues();\n var area = {\n code: '',\n country: '',\n province: '',\n city: '',\n county: ''\n };\n\n if (!values.length) {\n return area;\n }\n\n var names = values.map(function (item) {\n return item.name;\n });\n var validValues = values.filter(function (value) {\n return !!value.code;\n });\n area.code = validValues.length ? validValues[validValues.length - 1].code : '';\n\n if (this.isOverseaCode(area.code)) {\n area.country = names[1] || '';\n area.province = names[2] || '';\n } else {\n area.province = names[0] || '';\n area.city = names[1] || '';\n area.county = names[2] || '';\n }\n\n return area;\n },\n // @exposed-api\n reset: function reset(code) {\n this.code = code || '';\n this.setValues();\n }\n },\n render: function render() {\n var h = arguments[0];\n\n var on = _extends({}, this.$listeners, {\n change: this.onChange,\n confirm: this.onConfirm\n });\n\n return h(Picker, {\n \"ref\": \"picker\",\n \"class\": bem(),\n \"attrs\": {\n \"showToolbar\": true,\n \"valueKey\": \"name\",\n \"title\": this.title,\n \"columns\": this.displayColumns,\n \"loading\": this.loading,\n \"readonly\": this.readonly,\n \"itemHeight\": this.itemHeight,\n \"swipeDuration\": this.swipeDuration,\n \"visibleItemCount\": this.visibleItemCount,\n \"cancelButtonText\": this.cancelButtonText,\n \"confirmButtonText\": this.confirmButtonText\n },\n \"scopedSlots\": pickSlots(this, ['title', 'columns-top', 'columns-bottom']),\n \"on\": _extends({}, on)\n });\n }\n});","/**\n * Vue Router support\n */\nfunction isRedundantNavigation(err) {\n return err.name === 'NavigationDuplicated' || // compatible with vue-router@3.3\n err.message && err.message.indexOf('redundant navigation') !== -1;\n}\n\nexport function route(router, config) {\n var to = config.to,\n url = config.url,\n replace = config.replace;\n\n if (to && router) {\n var promise = router[replace ? 'replace' : 'push'](to);\n /* istanbul ignore else */\n\n if (promise && promise.catch) {\n promise.catch(function (err) {\n if (err && !isRedundantNavigation(err)) {\n throw err;\n }\n });\n }\n } else if (url) {\n replace ? location.replace(url) : location.href = url;\n }\n}\nexport function functionalRoute(context) {\n route(context.parent && context.parent.$router, context.props);\n}\nexport var routeProps = {\n url: String,\n replace: Boolean,\n to: [String, Object]\n};","export var cellProps = {\n icon: String,\n size: String,\n center: Boolean,\n isLink: Boolean,\n required: Boolean,\n iconPrefix: String,\n titleStyle: null,\n titleClass: null,\n valueClass: null,\n labelClass: null,\n title: [Number, String],\n value: [Number, String],\n label: [Number, String],\n arrowDirection: String,\n border: {\n type: Boolean,\n default: true\n },\n clickable: {\n type: Boolean,\n default: null\n }\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { emit, inherit } from '../utils/functional';\nimport { routeProps, functionalRoute } from '../utils/router';\nimport { cellProps } from './shared'; // Components\n\nimport Icon from '../icon'; // Types\n\nvar _createNamespace = createNamespace('cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Cell(h, props, slots, ctx) {\n var _props$clickable;\n\n var icon = props.icon,\n size = props.size,\n title = props.title,\n label = props.label,\n value = props.value,\n isLink = props.isLink;\n var showTitle = slots.title || isDef(title);\n\n function Label() {\n var showLabel = slots.label || isDef(label);\n\n if (showLabel) {\n return h(\"div\", {\n \"class\": [bem('label'), props.labelClass]\n }, [slots.label ? slots.label() : label]);\n }\n }\n\n function Title() {\n if (showTitle) {\n return h(\"div\", {\n \"class\": [bem('title'), props.titleClass],\n \"style\": props.titleStyle\n }, [slots.title ? slots.title() : h(\"span\", [title]), Label()]);\n }\n }\n\n function Value() {\n var showValue = slots.default || isDef(value);\n\n if (showValue) {\n return h(\"div\", {\n \"class\": [bem('value', {\n alone: !showTitle\n }), props.valueClass]\n }, [slots.default ? slots.default() : h(\"span\", [value])]);\n }\n }\n\n function LeftIcon() {\n if (slots.icon) {\n return slots.icon();\n }\n\n if (icon) {\n return h(Icon, {\n \"class\": bem('left-icon'),\n \"attrs\": {\n \"name\": icon,\n \"classPrefix\": props.iconPrefix\n }\n });\n }\n }\n\n function RightIcon() {\n var rightIconSlot = slots['right-icon'];\n\n if (rightIconSlot) {\n return rightIconSlot();\n }\n\n if (isLink) {\n var arrowDirection = props.arrowDirection;\n return h(Icon, {\n \"class\": bem('right-icon'),\n \"attrs\": {\n \"name\": arrowDirection ? \"arrow-\" + arrowDirection : 'arrow'\n }\n });\n }\n }\n\n function onClick(event) {\n emit(ctx, 'click', event);\n functionalRoute(ctx);\n }\n\n var clickable = (_props$clickable = props.clickable) != null ? _props$clickable : isLink;\n var classes = {\n clickable: clickable,\n center: props.center,\n required: props.required,\n borderless: !props.border\n };\n\n if (size) {\n classes[size] = size;\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem(classes),\n \"attrs\": {\n \"role\": clickable ? 'button' : null,\n \"tabindex\": clickable ? 0 : null\n },\n \"on\": {\n \"click\": onClick\n }\n }, inherit(ctx)]), [LeftIcon(), Title(), Value(), RightIcon(), slots.extra == null ? void 0 : slots.extra()]);\n}\n\nCell.props = _extends({}, cellProps, routeProps);\nexport default createComponent(Cell);","import { isServer } from '..';\nexport function isAndroid() {\n /* istanbul ignore next */\n return isServer ? false : /android/.test(navigator.userAgent.toLowerCase());\n}\nexport function isIOS() {\n /* istanbul ignore next */\n return isServer ? false : /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());\n}","/**\n * Hack for iOS12 page scroll\n * https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800\n */\nimport { isIOS as checkIsIOS } from '../validate/system';\nimport { getRootScrollTop, setRootScrollTop } from './scroll';\nvar isIOS = checkIsIOS();\n/* istanbul ignore next */\n\nexport function resetScroll() {\n if (isIOS) {\n setRootScrollTop(getRootScrollTop());\n }\n}","import _mergeJSXProps2 from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { resetScroll } from '../utils/dom/reset-scroll';\nimport { formatNumber } from '../utils/format/number';\nimport { preventDefault } from '../utils/dom/event';\nimport { getRootScrollTop, setRootScrollTop } from '../utils/dom/scroll';\nimport { isDef, addUnit, isObject, isPromise, isFunction, createNamespace } from '../utils'; // Components\n\nimport Icon from '../icon';\nimport Cell from '../cell';\nimport { cellProps } from '../cell/shared';\n\nvar _createNamespace = createNamespace('field'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n inheritAttrs: false,\n provide: function provide() {\n return {\n vanField: this\n };\n },\n inject: {\n vanForm: {\n default: null\n }\n },\n props: _extends({}, cellProps, {\n name: String,\n rules: Array,\n disabled: {\n type: Boolean,\n default: null\n },\n readonly: {\n type: Boolean,\n default: null\n },\n autosize: [Boolean, Object],\n leftIcon: String,\n rightIcon: String,\n clearable: Boolean,\n formatter: Function,\n maxlength: [Number, String],\n labelWidth: [Number, String],\n labelClass: null,\n labelAlign: String,\n inputAlign: String,\n placeholder: String,\n errorMessage: String,\n errorMessageAlign: String,\n showWordLimit: Boolean,\n value: {\n type: [Number, String],\n default: ''\n },\n type: {\n type: String,\n default: 'text'\n },\n error: {\n type: Boolean,\n default: null\n },\n colon: {\n type: Boolean,\n default: null\n },\n clearTrigger: {\n type: String,\n default: 'focus'\n },\n formatTrigger: {\n type: String,\n default: 'onChange'\n }\n }),\n data: function data() {\n return {\n focused: false,\n validateFailed: false,\n validateMessage: ''\n };\n },\n watch: {\n value: function value() {\n this.updateValue(this.value);\n this.resetValidation();\n this.validateWithTrigger('onChange');\n this.$nextTick(this.adjustSize);\n }\n },\n mounted: function mounted() {\n this.updateValue(this.value, this.formatTrigger);\n this.$nextTick(this.adjustSize);\n\n if (this.vanForm) {\n this.vanForm.addField(this);\n }\n },\n beforeDestroy: function beforeDestroy() {\n if (this.vanForm) {\n this.vanForm.removeField(this);\n }\n },\n computed: {\n showClear: function showClear() {\n var readonly = this.getProp('readonly');\n\n if (this.clearable && !readonly) {\n var hasValue = isDef(this.value) && this.value !== '';\n var trigger = this.clearTrigger === 'always' || this.clearTrigger === 'focus' && this.focused;\n return hasValue && trigger;\n }\n },\n showError: function showError() {\n if (this.error !== null) {\n return this.error;\n }\n\n if (this.vanForm && this.vanForm.showError && this.validateFailed) {\n return true;\n }\n },\n listeners: function listeners() {\n return _extends({}, this.$listeners, {\n blur: this.onBlur,\n focus: this.onFocus,\n input: this.onInput,\n click: this.onClickInput,\n keypress: this.onKeypress\n });\n },\n labelStyle: function labelStyle() {\n var labelWidth = this.getProp('labelWidth');\n\n if (labelWidth) {\n return {\n width: addUnit(labelWidth)\n };\n }\n },\n formValue: function formValue() {\n if (this.children && (this.$scopedSlots.input || this.$slots.input)) {\n return this.children.value;\n }\n\n return this.value;\n }\n },\n methods: {\n // @exposed-api\n focus: function focus() {\n if (this.$refs.input) {\n this.$refs.input.focus();\n }\n },\n // @exposed-api\n blur: function blur() {\n if (this.$refs.input) {\n this.$refs.input.blur();\n }\n },\n runValidator: function runValidator(value, rule) {\n return new Promise(function (resolve) {\n var returnVal = rule.validator(value, rule);\n\n if (isPromise(returnVal)) {\n return returnVal.then(resolve);\n }\n\n resolve(returnVal);\n });\n },\n isEmptyValue: function isEmptyValue(value) {\n if (Array.isArray(value)) {\n return !value.length;\n }\n\n if (value === 0) {\n return false;\n }\n\n return !value;\n },\n runSyncRule: function runSyncRule(value, rule) {\n if (rule.required && this.isEmptyValue(value)) {\n return false;\n }\n\n if (rule.pattern && !rule.pattern.test(value)) {\n return false;\n }\n\n return true;\n },\n getRuleMessage: function getRuleMessage(value, rule) {\n var message = rule.message;\n\n if (isFunction(message)) {\n return message(value, rule);\n }\n\n return message;\n },\n runRules: function runRules(rules) {\n var _this = this;\n\n return rules.reduce(function (promise, rule) {\n return promise.then(function () {\n if (_this.validateFailed) {\n return;\n }\n\n var value = _this.formValue;\n\n if (rule.formatter) {\n value = rule.formatter(value, rule);\n }\n\n if (!_this.runSyncRule(value, rule)) {\n _this.validateFailed = true;\n _this.validateMessage = _this.getRuleMessage(value, rule);\n return;\n }\n\n if (rule.validator) {\n return _this.runValidator(value, rule).then(function (result) {\n if (result === false) {\n _this.validateFailed = true;\n _this.validateMessage = _this.getRuleMessage(value, rule);\n }\n });\n }\n });\n }, Promise.resolve());\n },\n validate: function validate(rules) {\n var _this2 = this;\n\n if (rules === void 0) {\n rules = this.rules;\n }\n\n return new Promise(function (resolve) {\n if (!rules) {\n resolve();\n }\n\n _this2.resetValidation();\n\n _this2.runRules(rules).then(function () {\n if (_this2.validateFailed) {\n resolve({\n name: _this2.name,\n message: _this2.validateMessage\n });\n } else {\n resolve();\n }\n });\n });\n },\n validateWithTrigger: function validateWithTrigger(trigger) {\n if (this.vanForm && this.rules) {\n var defaultTrigger = this.vanForm.validateTrigger === trigger;\n var rules = this.rules.filter(function (rule) {\n if (rule.trigger) {\n return rule.trigger === trigger;\n }\n\n return defaultTrigger;\n });\n\n if (rules.length) {\n this.validate(rules);\n }\n }\n },\n resetValidation: function resetValidation() {\n if (this.validateFailed) {\n this.validateFailed = false;\n this.validateMessage = '';\n }\n },\n updateValue: function updateValue(value, trigger) {\n if (trigger === void 0) {\n trigger = 'onChange';\n }\n\n value = isDef(value) ? String(value) : ''; // native maxlength have incorrect line-break counting\n // see: https://github.com/vant-ui/vant/issues/5033\n\n var maxlength = this.maxlength;\n\n if (isDef(maxlength) && value.length > maxlength) {\n if (this.value && this.value.length === +maxlength) {\n value = this.value;\n } else {\n value = value.slice(0, maxlength);\n }\n }\n\n if (this.type === 'number' || this.type === 'digit') {\n var isNumber = this.type === 'number';\n value = formatNumber(value, isNumber, isNumber);\n }\n\n if (this.formatter && trigger === this.formatTrigger) {\n value = this.formatter(value);\n }\n\n var input = this.$refs.input;\n\n if (input && value !== input.value) {\n input.value = value;\n }\n\n if (value !== this.value) {\n this.$emit('input', value);\n }\n },\n onInput: function onInput(event) {\n // not update v-model when composing\n if (event.target.composing) {\n return;\n }\n\n this.updateValue(event.target.value);\n },\n onFocus: function onFocus(event) {\n this.focused = true;\n this.$emit('focus', event); // https://github.com/vant-ui/vant/issues/9715\n\n this.$nextTick(this.adjustSize); // readonly not work in legacy mobile safari\n\n /* istanbul ignore if */\n\n if (this.getProp('readonly')) {\n this.blur();\n }\n },\n onBlur: function onBlur(event) {\n if (this.getProp('readonly')) {\n return;\n }\n\n this.focused = false;\n this.updateValue(this.value, 'onBlur');\n this.$emit('blur', event);\n this.validateWithTrigger('onBlur');\n this.$nextTick(this.adjustSize);\n resetScroll();\n },\n onClick: function onClick(event) {\n this.$emit('click', event);\n },\n onClickInput: function onClickInput(event) {\n this.$emit('click-input', event);\n },\n onClickLeftIcon: function onClickLeftIcon(event) {\n this.$emit('click-left-icon', event);\n },\n onClickRightIcon: function onClickRightIcon(event) {\n this.$emit('click-right-icon', event);\n },\n onClear: function onClear(event) {\n preventDefault(event);\n this.$emit('input', '');\n this.$emit('clear', event);\n },\n onKeypress: function onKeypress(event) {\n var ENTER_CODE = 13;\n\n if (event.keyCode === ENTER_CODE) {\n var submitOnEnter = this.getProp('submitOnEnter');\n\n if (!submitOnEnter && this.type !== 'textarea') {\n preventDefault(event);\n } // trigger blur after click keyboard search button\n\n\n if (this.type === 'search') {\n this.blur();\n }\n }\n\n this.$emit('keypress', event);\n },\n adjustSize: function adjustSize() {\n var input = this.$refs.input;\n\n if (!(this.type === 'textarea' && this.autosize) || !input) {\n return;\n }\n\n var scrollTop = getRootScrollTop();\n input.style.height = 'auto';\n var height = input.scrollHeight;\n\n if (isObject(this.autosize)) {\n var _this$autosize = this.autosize,\n maxHeight = _this$autosize.maxHeight,\n minHeight = _this$autosize.minHeight;\n\n if (maxHeight) {\n height = Math.min(height, maxHeight);\n }\n\n if (minHeight) {\n height = Math.max(height, minHeight);\n }\n }\n\n if (height) {\n input.style.height = height + 'px'; // https://github.com/vant-ui/vant/issues/9178\n\n setRootScrollTop(scrollTop);\n }\n },\n genInput: function genInput() {\n var h = this.$createElement;\n var type = this.type;\n var disabled = this.getProp('disabled');\n var readonly = this.getProp('readonly');\n var inputSlot = this.slots('input');\n var inputAlign = this.getProp('inputAlign');\n\n if (inputSlot) {\n return h(\"div\", {\n \"class\": bem('control', [inputAlign, 'custom']),\n \"on\": {\n \"click\": this.onClickInput\n }\n }, [inputSlot]);\n }\n\n var inputProps = {\n ref: 'input',\n class: bem('control', inputAlign),\n domProps: {\n value: this.value\n },\n attrs: _extends({}, this.$attrs, {\n name: this.name,\n disabled: disabled,\n readonly: readonly,\n placeholder: this.placeholder\n }),\n on: this.listeners,\n // add model directive to skip IME composition\n directives: [{\n name: 'model',\n value: this.value\n }]\n };\n\n if (type === 'textarea') {\n return h(\"textarea\", _mergeJSXProps([{}, inputProps]));\n }\n\n var inputType = type;\n var inputMode; // type=\"number\" is weird in iOS, and can't prevent dot in Android\n // so use inputmode to set keyboard in modern browsers\n\n if (type === 'number') {\n inputType = 'text';\n inputMode = 'decimal';\n }\n\n if (type === 'digit') {\n inputType = 'tel';\n inputMode = 'numeric';\n }\n\n return h(\"input\", _mergeJSXProps2([{\n \"attrs\": {\n \"type\": inputType,\n \"inputmode\": inputMode\n }\n }, inputProps]));\n },\n genLeftIcon: function genLeftIcon() {\n var h = this.$createElement;\n var showLeftIcon = this.slots('left-icon') || this.leftIcon;\n\n if (showLeftIcon) {\n return h(\"div\", {\n \"class\": bem('left-icon'),\n \"on\": {\n \"click\": this.onClickLeftIcon\n }\n }, [this.slots('left-icon') || h(Icon, {\n \"attrs\": {\n \"name\": this.leftIcon,\n \"classPrefix\": this.iconPrefix\n }\n })]);\n }\n },\n genRightIcon: function genRightIcon() {\n var h = this.$createElement;\n var slots = this.slots;\n var showRightIcon = slots('right-icon') || this.rightIcon;\n\n if (showRightIcon) {\n return h(\"div\", {\n \"class\": bem('right-icon'),\n \"on\": {\n \"click\": this.onClickRightIcon\n }\n }, [slots('right-icon') || h(Icon, {\n \"attrs\": {\n \"name\": this.rightIcon,\n \"classPrefix\": this.iconPrefix\n }\n })]);\n }\n },\n genWordLimit: function genWordLimit() {\n var h = this.$createElement;\n\n if (this.showWordLimit && this.maxlength) {\n var count = (this.value || '').length;\n return h(\"div\", {\n \"class\": bem('word-limit')\n }, [h(\"span\", {\n \"class\": bem('word-num')\n }, [count]), \"/\", this.maxlength]);\n }\n },\n genMessage: function genMessage() {\n var h = this.$createElement;\n\n if (this.vanForm && this.vanForm.showErrorMessage === false) {\n return;\n }\n\n var message = this.errorMessage || this.validateMessage;\n\n if (message) {\n var errorMessageAlign = this.getProp('errorMessageAlign');\n return h(\"div\", {\n \"class\": bem('error-message', errorMessageAlign)\n }, [message]);\n }\n },\n getProp: function getProp(key) {\n if (isDef(this[key])) {\n return this[key];\n }\n\n if (this.vanForm && isDef(this.vanForm[key])) {\n return this.vanForm[key];\n }\n },\n genLabel: function genLabel() {\n var h = this.$createElement;\n var colon = this.getProp('colon') ? ':' : '';\n\n if (this.slots('label')) {\n return [this.slots('label'), colon];\n }\n\n if (this.label) {\n return h(\"span\", [this.label + colon]);\n }\n }\n },\n render: function render() {\n var _bem;\n\n var h = arguments[0];\n var slots = this.slots;\n var disabled = this.getProp('disabled');\n var labelAlign = this.getProp('labelAlign');\n var scopedSlots = {\n icon: this.genLeftIcon\n };\n var Label = this.genLabel();\n\n if (Label) {\n scopedSlots.title = function () {\n return Label;\n };\n }\n\n var extra = this.slots('extra');\n\n if (extra) {\n scopedSlots.extra = function () {\n return extra;\n };\n }\n\n return h(Cell, {\n \"attrs\": {\n \"icon\": this.leftIcon,\n \"size\": this.size,\n \"center\": this.center,\n \"border\": this.border,\n \"isLink\": this.isLink,\n \"required\": this.required,\n \"clickable\": this.clickable,\n \"titleStyle\": this.labelStyle,\n \"valueClass\": bem('value'),\n \"titleClass\": [bem('label', labelAlign), this.labelClass],\n \"arrowDirection\": this.arrowDirection\n },\n \"scopedSlots\": scopedSlots,\n \"class\": bem((_bem = {\n error: this.showError,\n disabled: disabled\n }, _bem[\"label-\" + labelAlign] = labelAlign, _bem['min-height'] = this.type === 'textarea' && !this.autosize, _bem)),\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(\"div\", {\n \"class\": bem('body')\n }, [this.genInput(), this.showClear && h(Icon, {\n \"attrs\": {\n \"name\": \"clear\"\n },\n \"class\": bem('clear'),\n \"on\": {\n \"touchstart\": this.onClear\n }\n }), this.genRightIcon(), slots('button') && h(\"div\", {\n \"class\": bem('button')\n }, [slots('button')])]), this.genWordLimit(), this.genMessage()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional';\nimport { BORDER_SURROUND } from '../utils/constant';\nimport { routeProps, functionalRoute } from '../utils/router'; // Components\n\nimport Icon from '../icon';\nimport Loading from '../loading'; // Types\n\nvar _createNamespace = createNamespace('button'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Button(h, props, slots, ctx) {\n var _ref;\n\n var tag = props.tag,\n icon = props.icon,\n type = props.type,\n color = props.color,\n plain = props.plain,\n disabled = props.disabled,\n loading = props.loading,\n hairline = props.hairline,\n loadingText = props.loadingText,\n iconPosition = props.iconPosition;\n var style = {};\n\n if (color) {\n style.color = plain ? color : 'white';\n\n if (!plain) {\n // Use background instead of backgroundColor to make linear-gradient work\n style.background = color;\n } // hide border when color is linear-gradient\n\n\n if (color.indexOf('gradient') !== -1) {\n style.border = 0;\n } else {\n style.borderColor = color;\n }\n }\n\n function onClick(event) {\n if (props.loading) {\n event.preventDefault();\n }\n\n if (!loading && !disabled) {\n emit(ctx, 'click', event);\n functionalRoute(ctx);\n }\n }\n\n function onTouchstart(event) {\n emit(ctx, 'touchstart', event);\n }\n\n var classes = [bem([type, props.size, {\n plain: plain,\n loading: loading,\n disabled: disabled,\n hairline: hairline,\n block: props.block,\n round: props.round,\n square: props.square\n }]), (_ref = {}, _ref[BORDER_SURROUND] = hairline, _ref)];\n\n function renderIcon() {\n if (loading) {\n return slots.loading ? slots.loading() : h(Loading, {\n \"class\": bem('loading'),\n \"attrs\": {\n \"size\": props.loadingSize,\n \"type\": props.loadingType,\n \"color\": \"currentColor\"\n }\n });\n }\n\n if (slots.icon) {\n return h(\"div\", {\n \"class\": bem('icon')\n }, [slots.icon()]);\n }\n\n if (icon) {\n return h(Icon, {\n \"attrs\": {\n \"name\": icon,\n \"classPrefix\": props.iconPrefix\n },\n \"class\": bem('icon')\n });\n }\n }\n\n function renderContent() {\n var content = [];\n\n if (iconPosition === 'left') {\n content.push(renderIcon());\n }\n\n var text;\n\n if (loading) {\n text = loadingText;\n } else {\n text = slots.default ? slots.default() : props.text;\n }\n\n if (text) {\n content.push(h(\"span\", {\n \"class\": bem('text')\n }, [text]));\n }\n\n if (iconPosition === 'right') {\n content.push(renderIcon());\n }\n\n return content;\n }\n\n return h(tag, _mergeJSXProps([{\n \"style\": style,\n \"class\": classes,\n \"attrs\": {\n \"type\": props.nativeType,\n \"disabled\": disabled\n },\n \"on\": {\n \"click\": onClick,\n \"touchstart\": onTouchstart\n }\n }, inherit(ctx)]), [h(\"div\", {\n \"class\": bem('content')\n }, [renderContent()])]);\n}\n\nButton.props = _extends({}, routeProps, {\n text: String,\n icon: String,\n color: String,\n block: Boolean,\n plain: Boolean,\n round: Boolean,\n square: Boolean,\n loading: Boolean,\n hairline: Boolean,\n disabled: Boolean,\n iconPrefix: String,\n nativeType: String,\n loadingText: String,\n loadingType: String,\n tag: {\n type: String,\n default: 'button'\n },\n type: {\n type: String,\n default: 'default'\n },\n size: {\n type: String,\n default: 'normal'\n },\n loadingSize: {\n type: String,\n default: '20px'\n },\n iconPosition: {\n type: String,\n default: 'left'\n }\n});\nexport default createComponent(Button);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nimport VanDialog from './Dialog';\nimport { isServer } from '../utils';\nvar instance;\n\nfunction isInDocument(element) {\n return document.body.contains(element);\n}\n\nfunction initInstance() {\n if (instance) {\n instance.$destroy();\n }\n\n instance = new (Vue.extend(VanDialog))({\n el: document.createElement('div'),\n // avoid missing animation when first rendered\n propsData: {\n lazyRender: false\n }\n });\n instance.$on('input', function (value) {\n instance.value = value;\n });\n}\n\nfunction Dialog(options) {\n /* istanbul ignore if */\n if (isServer) {\n return Promise.resolve();\n }\n\n return new Promise(function (resolve, reject) {\n if (!instance || !isInDocument(instance.$el)) {\n initInstance();\n }\n\n _extends(instance, Dialog.currentOptions, options, {\n resolve: resolve,\n reject: reject\n });\n });\n}\n\nDialog.defaultOptions = {\n value: true,\n title: '',\n width: '',\n theme: null,\n message: '',\n overlay: true,\n className: '',\n allowHtml: true,\n lockScroll: true,\n transition: 'van-dialog-bounce',\n beforeClose: null,\n overlayClass: '',\n overlayStyle: null,\n messageAlign: '',\n getContainer: 'body',\n cancelButtonText: '',\n cancelButtonColor: null,\n confirmButtonText: '',\n confirmButtonColor: null,\n showConfirmButton: true,\n showCancelButton: false,\n closeOnPopstate: true,\n closeOnClickOverlay: false,\n callback: function callback(action) {\n instance[action === 'confirm' ? 'resolve' : 'reject'](action);\n }\n};\nDialog.alert = Dialog;\n\nDialog.confirm = function (options) {\n return Dialog(_extends({\n showCancelButton: true\n }, options));\n};\n\nDialog.close = function () {\n if (instance) {\n instance.value = false;\n }\n};\n\nDialog.setDefaultOptions = function (options) {\n _extends(Dialog.currentOptions, options);\n};\n\nDialog.resetDefaultOptions = function () {\n Dialog.currentOptions = _extends({}, Dialog.defaultOptions);\n};\n\nDialog.resetDefaultOptions();\n\nDialog.install = function () {\n Vue.use(VanDialog);\n};\n\nDialog.Component = VanDialog;\nVue.prototype.$dialog = Dialog;\nexport default Dialog;","import { createNamespace } from '../utils';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('goods-action'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanGoodsAction')],\n props: {\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem({\n unfit: !this.safeAreaInsetBottom\n })\n }, [this.slots()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { route, routeProps } from '../utils/router';\nimport { ChildrenMixin } from '../mixins/relation';\nimport Button from '../button';\n\nvar _createNamespace = createNamespace('goods-action-button'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanGoodsAction')],\n props: _extends({}, routeProps, {\n type: String,\n text: String,\n icon: String,\n color: String,\n loading: Boolean,\n disabled: Boolean\n }),\n computed: {\n isFirst: function isFirst() {\n var prev = this.parent && this.parent.children[this.index - 1];\n return !prev || prev.$options.name !== this.$options.name;\n },\n isLast: function isLast() {\n var next = this.parent && this.parent.children[this.index + 1];\n return !next || next.$options.name !== this.$options.name;\n }\n },\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n route(this.$router, this);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(Button, {\n \"class\": bem([{\n first: this.isFirst,\n last: this.isLast\n }, this.type]),\n \"attrs\": {\n \"size\": \"large\",\n \"type\": this.type,\n \"icon\": this.icon,\n \"color\": this.color,\n \"loading\": this.loading,\n \"disabled\": this.disabled\n },\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.slots() || this.text]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport { createNamespace, addUnit, noop } from '../utils';\nimport { BORDER_TOP, BORDER_LEFT } from '../utils/constant';\nimport { PopupMixin } from '../mixins/popup';\nimport Button from '../button';\nimport GoodsAction from '../goods-action';\nimport GoodsActionButton from '../goods-action-button';\n\nvar _createNamespace = createNamespace('dialog'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n mixins: [PopupMixin()],\n props: {\n title: String,\n theme: String,\n width: [Number, String],\n message: String,\n className: null,\n callback: Function,\n beforeClose: Function,\n messageAlign: String,\n cancelButtonText: String,\n cancelButtonColor: String,\n confirmButtonText: String,\n confirmButtonColor: String,\n showCancelButton: Boolean,\n overlay: {\n type: Boolean,\n default: true\n },\n allowHtml: {\n type: Boolean,\n default: true\n },\n transition: {\n type: String,\n default: 'van-dialog-bounce'\n },\n showConfirmButton: {\n type: Boolean,\n default: true\n },\n closeOnPopstate: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n loading: {\n confirm: false,\n cancel: false\n }\n };\n },\n methods: {\n onClickOverlay: function onClickOverlay() {\n this.handleAction('overlay');\n },\n handleAction: function handleAction(action) {\n var _this = this;\n\n this.$emit(action); // show not trigger close event when hidden\n\n if (!this.value) {\n return;\n }\n\n if (this.beforeClose) {\n this.loading[action] = true;\n this.beforeClose(action, function (state) {\n if (state !== false && _this.loading[action]) {\n _this.onClose(action);\n }\n\n _this.loading.confirm = false;\n _this.loading.cancel = false;\n });\n } else {\n this.onClose(action);\n }\n },\n onClose: function onClose(action) {\n this.close();\n\n if (this.callback) {\n this.callback(action);\n }\n },\n onOpened: function onOpened() {\n var _this2 = this;\n\n this.$emit('opened');\n this.$nextTick(function () {\n var _this2$$refs$dialog;\n\n (_this2$$refs$dialog = _this2.$refs.dialog) == null ? void 0 : _this2$$refs$dialog.focus();\n });\n },\n onClosed: function onClosed() {\n this.$emit('closed');\n },\n onKeydown: function onKeydown(event) {\n var _this3 = this;\n\n if (event.key === 'Escape' || event.key === 'Enter') {\n // skip keyboard events of child elements\n if (event.target !== this.$refs.dialog) {\n return;\n }\n\n var onEventType = {\n Enter: this.showConfirmButton ? function () {\n return _this3.handleAction('confirm');\n } : noop,\n Escape: this.showCancelButton ? function () {\n return _this3.handleAction('cancel');\n } : noop\n };\n onEventType[event.key]();\n this.$emit('keydown', event);\n }\n },\n genRoundButtons: function genRoundButtons() {\n var _this4 = this;\n\n var h = this.$createElement;\n return h(GoodsAction, {\n \"class\": bem('footer')\n }, [this.showCancelButton && h(GoodsActionButton, {\n \"attrs\": {\n \"size\": \"large\",\n \"type\": \"warning\",\n \"text\": this.cancelButtonText || t('cancel'),\n \"color\": this.cancelButtonColor,\n \"loading\": this.loading.cancel\n },\n \"class\": bem('cancel'),\n \"on\": {\n \"click\": function click() {\n _this4.handleAction('cancel');\n }\n }\n }), this.showConfirmButton && h(GoodsActionButton, {\n \"attrs\": {\n \"size\": \"large\",\n \"type\": \"danger\",\n \"text\": this.confirmButtonText || t('confirm'),\n \"color\": this.confirmButtonColor,\n \"loading\": this.loading.confirm\n },\n \"class\": bem('confirm'),\n \"on\": {\n \"click\": function click() {\n _this4.handleAction('confirm');\n }\n }\n })]);\n },\n genButtons: function genButtons() {\n var _this5 = this,\n _ref;\n\n var h = this.$createElement;\n var multiple = this.showCancelButton && this.showConfirmButton;\n return h(\"div\", {\n \"class\": [BORDER_TOP, bem('footer')]\n }, [this.showCancelButton && h(Button, {\n \"attrs\": {\n \"size\": \"large\",\n \"loading\": this.loading.cancel,\n \"text\": this.cancelButtonText || t('cancel'),\n \"nativeType\": \"button\"\n },\n \"class\": bem('cancel'),\n \"style\": {\n color: this.cancelButtonColor\n },\n \"on\": {\n \"click\": function click() {\n _this5.handleAction('cancel');\n }\n }\n }), this.showConfirmButton && h(Button, {\n \"attrs\": {\n \"size\": \"large\",\n \"loading\": this.loading.confirm,\n \"text\": this.confirmButtonText || t('confirm'),\n \"nativeType\": \"button\"\n },\n \"class\": [bem('confirm'), (_ref = {}, _ref[BORDER_LEFT] = multiple, _ref)],\n \"style\": {\n color: this.confirmButtonColor\n },\n \"on\": {\n \"click\": function click() {\n _this5.handleAction('confirm');\n }\n }\n })]);\n },\n genContent: function genContent(hasTitle, messageSlot) {\n var h = this.$createElement;\n\n if (messageSlot) {\n return h(\"div\", {\n \"class\": bem('content')\n }, [messageSlot]);\n }\n\n var message = this.message,\n messageAlign = this.messageAlign;\n\n if (message) {\n var _bem, _domProps;\n\n var data = {\n class: bem('message', (_bem = {\n 'has-title': hasTitle\n }, _bem[messageAlign] = messageAlign, _bem)),\n domProps: (_domProps = {}, _domProps[this.allowHtml ? 'innerHTML' : 'textContent'] = message, _domProps)\n };\n return h(\"div\", {\n \"class\": bem('content', {\n isolated: !hasTitle\n })\n }, [h(\"div\", _mergeJSXProps([{}, data]))]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n\n if (!this.shouldRender) {\n return;\n }\n\n var message = this.message;\n var messageSlot = this.slots();\n var title = this.slots('title') || this.title;\n var Title = title && h(\"div\", {\n \"class\": bem('header', {\n isolated: !message && !messageSlot\n })\n }, [title]);\n return h(\"transition\", {\n \"attrs\": {\n \"name\": this.transition\n },\n \"on\": {\n \"afterEnter\": this.onOpened,\n \"afterLeave\": this.onClosed\n }\n }, [h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.value\n }],\n \"attrs\": {\n \"role\": \"dialog\",\n \"aria-labelledby\": this.title || message,\n \"tabIndex\": 0\n },\n \"class\": [bem([this.theme]), this.className],\n \"style\": {\n width: addUnit(this.width)\n },\n \"ref\": \"dialog\",\n \"on\": {\n \"keydown\": this.onKeydown\n }\n }, [Title, this.genContent(title, messageSlot), this.theme === 'round-button' ? this.genRoundButtons() : this.genButtons()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { isAndroid } from '../utils/validate/system'; // Components\n\nimport Cell from '../cell';\nimport Field from '../field';\n\nvar _createNamespace = createNamespace('address-edit-detail'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nvar android = isAndroid();\nexport default createComponent({\n props: {\n value: String,\n errorMessage: String,\n focused: Boolean,\n detailRows: [Number, String],\n searchResult: Array,\n detailMaxlength: [Number, String],\n showSearchResult: Boolean\n },\n computed: {\n shouldShowSearchResult: function shouldShowSearchResult() {\n return this.focused && this.searchResult && this.showSearchResult;\n }\n },\n methods: {\n onSelect: function onSelect(express) {\n this.$emit('select-search', express);\n this.$emit('input', ((express.address || '') + \" \" + (express.name || '')).trim());\n },\n onFinish: function onFinish() {\n this.$refs.field.blur();\n },\n genFinish: function genFinish() {\n var h = this.$createElement;\n var show = this.value && this.focused && android;\n\n if (show) {\n return h(\"div\", {\n \"class\": bem('finish'),\n \"on\": {\n \"click\": this.onFinish\n }\n }, [t('complete')]);\n }\n },\n genSearchResult: function genSearchResult() {\n var _this = this;\n\n var h = this.$createElement;\n var value = this.value,\n shouldShowSearchResult = this.shouldShowSearchResult,\n searchResult = this.searchResult;\n\n if (shouldShowSearchResult) {\n return searchResult.map(function (express) {\n return h(Cell, {\n \"key\": express.name + express.address,\n \"attrs\": {\n \"clickable\": true,\n \"border\": false,\n \"icon\": \"location-o\",\n \"label\": express.address\n },\n \"class\": bem('search-item'),\n \"on\": {\n \"click\": function click() {\n _this.onSelect(express);\n }\n },\n \"scopedSlots\": {\n title: function title() {\n if (express.name) {\n var text = express.name.replace(value, \"\" + value + \"\");\n return h(\"div\", {\n \"domProps\": {\n \"innerHTML\": text\n }\n });\n }\n }\n }\n });\n });\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(Cell, {\n \"class\": bem()\n }, [h(Field, {\n \"attrs\": {\n \"autosize\": true,\n \"rows\": this.detailRows,\n \"clearable\": !android,\n \"type\": \"textarea\",\n \"value\": this.value,\n \"errorMessage\": this.errorMessage,\n \"border\": !this.shouldShowSearchResult,\n \"label\": t('label'),\n \"maxlength\": this.detailMaxlength,\n \"placeholder\": t('placeholder')\n },\n \"ref\": \"field\",\n \"scopedSlots\": {\n icon: this.genFinish\n },\n \"on\": _extends({}, this.$listeners)\n }), this.genSearchResult()]);\n }\n});","/**\n * Common Switch Props\n */\nexport var switchProps = {\n size: [Number, String],\n value: null,\n loading: Boolean,\n disabled: Boolean,\n activeColor: String,\n inactiveColor: String,\n activeValue: {\n type: null,\n default: true\n },\n inactiveValue: {\n type: null,\n default: false\n }\n};","// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { switchProps } from './shared'; // Mixins\n\nimport { FieldMixin } from '../mixins/field'; // Components\n\nimport Loading from '../loading';\n\nvar _createNamespace = createNamespace('switch'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [FieldMixin],\n props: switchProps,\n computed: {\n checked: function checked() {\n return this.value === this.activeValue;\n },\n style: function style() {\n return {\n fontSize: addUnit(this.size),\n backgroundColor: this.checked ? this.activeColor : this.inactiveColor\n };\n }\n },\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n\n if (!this.disabled && !this.loading) {\n var newValue = this.checked ? this.inactiveValue : this.activeValue;\n this.$emit('input', newValue);\n this.$emit('change', newValue);\n }\n },\n genLoading: function genLoading() {\n var h = this.$createElement;\n\n if (this.loading) {\n var color = this.checked ? this.activeColor : this.inactiveColor;\n return h(Loading, {\n \"class\": bem('loading'),\n \"attrs\": {\n \"color\": color\n }\n });\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var checked = this.checked,\n loading = this.loading,\n disabled = this.disabled;\n return h(\"div\", {\n \"class\": bem({\n on: checked,\n loading: loading,\n disabled: disabled\n }),\n \"attrs\": {\n \"role\": \"switch\",\n \"aria-checked\": String(checked)\n },\n \"style\": this.style,\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(\"div\", {\n \"class\": bem('node')\n }, [this.genLoading()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace, isObject } from '../utils';\nimport { isMobile } from '../utils/validate/mobile'; // Components\n\nimport Area from '../area';\nimport Cell from '../cell';\nimport Field from '../field';\nimport Popup from '../popup';\nimport Toast from '../toast';\nimport Button from '../button';\nimport Dialog from '../dialog';\nimport Detail from './Detail';\nimport Switch from '../switch';\n\nvar _createNamespace = createNamespace('address-edit'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nvar defaultData = {\n name: '',\n tel: '',\n country: '',\n province: '',\n city: '',\n county: '',\n areaCode: '',\n postalCode: '',\n addressDetail: '',\n isDefault: false\n};\n\nfunction isPostal(value) {\n return /^\\d{6}$/.test(value);\n}\n\nexport default createComponent({\n props: {\n areaList: Object,\n isSaving: Boolean,\n isDeleting: Boolean,\n validator: Function,\n showDelete: Boolean,\n showPostal: Boolean,\n searchResult: Array,\n telMaxlength: [Number, String],\n showSetDefault: Boolean,\n saveButtonText: String,\n areaPlaceholder: String,\n deleteButtonText: String,\n showSearchResult: Boolean,\n showArea: {\n type: Boolean,\n default: true\n },\n showDetail: {\n type: Boolean,\n default: true\n },\n disableArea: Boolean,\n detailRows: {\n type: [Number, String],\n default: 1\n },\n detailMaxlength: {\n type: [Number, String],\n default: 200\n },\n addressInfo: {\n type: Object,\n default: function _default() {\n return _extends({}, defaultData);\n }\n },\n telValidator: {\n type: Function,\n default: isMobile\n },\n postalValidator: {\n type: Function,\n default: isPostal\n },\n areaColumnsPlaceholder: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n data: {},\n showAreaPopup: false,\n detailFocused: false,\n errorInfo: {\n tel: '',\n name: '',\n areaCode: '',\n postalCode: '',\n addressDetail: ''\n }\n };\n },\n computed: {\n areaListLoaded: function areaListLoaded() {\n return isObject(this.areaList) && Object.keys(this.areaList).length;\n },\n areaText: function areaText() {\n var _this$data = this.data,\n country = _this$data.country,\n province = _this$data.province,\n city = _this$data.city,\n county = _this$data.county,\n areaCode = _this$data.areaCode;\n\n if (areaCode) {\n var arr = [country, province, city, county];\n\n if (province && province === city) {\n arr.splice(1, 1);\n }\n\n return arr.filter(function (text) {\n return text;\n }).join('/');\n }\n\n return '';\n },\n // hide bottom field when use search && detail get focused\n hideBottomFields: function hideBottomFields() {\n var searchResult = this.searchResult;\n return searchResult && searchResult.length && this.detailFocused;\n }\n },\n watch: {\n addressInfo: {\n handler: function handler(val) {\n this.data = _extends({}, defaultData, val);\n this.setAreaCode(val.areaCode);\n },\n deep: true,\n immediate: true\n },\n areaList: function areaList() {\n this.setAreaCode(this.data.areaCode);\n }\n },\n methods: {\n onFocus: function onFocus(key) {\n this.errorInfo[key] = '';\n this.detailFocused = key === 'addressDetail';\n this.$emit('focus', key);\n },\n onChangeDetail: function onChangeDetail(val) {\n this.data.addressDetail = val;\n this.$emit('change-detail', val);\n },\n onAreaConfirm: function onAreaConfirm(values) {\n values = values.filter(function (value) {\n return !!value;\n });\n\n if (values.some(function (value) {\n return !value.code;\n })) {\n Toast(t('areaEmpty'));\n return;\n }\n\n this.showAreaPopup = false;\n this.assignAreaValues();\n this.$emit('change-area', values);\n },\n assignAreaValues: function assignAreaValues() {\n var area = this.$refs.area;\n\n if (area) {\n var detail = area.getArea();\n detail.areaCode = detail.code;\n delete detail.code;\n\n _extends(this.data, detail);\n }\n },\n onSave: function onSave() {\n var _this = this;\n\n var items = ['name', 'tel'];\n\n if (this.showArea) {\n items.push('areaCode');\n }\n\n if (this.showDetail) {\n items.push('addressDetail');\n }\n\n if (this.showPostal) {\n items.push('postalCode');\n }\n\n var isValid = items.every(function (item) {\n var msg = _this.getErrorMessage(item);\n\n if (msg) {\n _this.errorInfo[item] = msg;\n }\n\n return !msg;\n });\n\n if (isValid && !this.isSaving) {\n this.$emit('save', this.data);\n }\n },\n getErrorMessage: function getErrorMessage(key) {\n var value = String(this.data[key] || '').trim();\n\n if (this.validator) {\n var message = this.validator(key, value);\n\n if (message) {\n return message;\n }\n }\n\n switch (key) {\n case 'name':\n return value ? '' : t('nameEmpty');\n\n case 'tel':\n return this.telValidator(value) ? '' : t('telInvalid');\n\n case 'areaCode':\n return value ? '' : t('areaEmpty');\n\n case 'addressDetail':\n return value ? '' : t('addressEmpty');\n\n case 'postalCode':\n return value && !this.postalValidator(value) ? t('postalEmpty') : '';\n }\n },\n onDelete: function onDelete() {\n var _this2 = this;\n\n Dialog.confirm({\n title: t('confirmDelete')\n }).then(function () {\n _this2.$emit('delete', _this2.data);\n }).catch(function () {\n _this2.$emit('cancel-delete', _this2.data);\n });\n },\n // get values of area component\n getArea: function getArea() {\n return this.$refs.area ? this.$refs.area.getValues() : [];\n },\n // set area code to area component\n setAreaCode: function setAreaCode(code) {\n this.data.areaCode = code || '';\n\n if (code) {\n this.$nextTick(this.assignAreaValues);\n }\n },\n // @exposed-api\n setAddressDetail: function setAddressDetail(value) {\n this.data.addressDetail = value;\n },\n onDetailBlur: function onDetailBlur() {\n var _this3 = this;\n\n // await for click search event\n setTimeout(function () {\n _this3.detailFocused = false;\n });\n },\n genSetDefaultCell: function genSetDefaultCell(h) {\n var _this4 = this;\n\n if (this.showSetDefault) {\n var slots = {\n 'right-icon': function rightIcon() {\n return h(Switch, {\n \"attrs\": {\n \"size\": \"24\"\n },\n \"on\": {\n \"change\": function change(event) {\n _this4.$emit('change-default', event);\n }\n },\n \"model\": {\n value: _this4.data.isDefault,\n callback: function callback($$v) {\n _this4.$set(_this4.data, \"isDefault\", $$v);\n }\n }\n });\n }\n };\n return h(Cell, {\n \"directives\": [{\n name: \"show\",\n value: !this.hideBottomFields\n }],\n \"attrs\": {\n \"center\": true,\n \"title\": t('defaultAddress')\n },\n \"class\": bem('default'),\n \"scopedSlots\": slots\n });\n }\n\n return h();\n }\n },\n render: function render(h) {\n var _this5 = this;\n\n var data = this.data,\n errorInfo = this.errorInfo,\n disableArea = this.disableArea,\n hideBottomFields = this.hideBottomFields;\n\n var onFocus = function onFocus(name) {\n return function () {\n return _this5.onFocus(name);\n };\n };\n\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"class\": bem('fields')\n }, [h(Field, {\n \"attrs\": {\n \"clearable\": true,\n \"label\": t('name'),\n \"placeholder\": t('namePlaceholder'),\n \"errorMessage\": errorInfo.name\n },\n \"on\": {\n \"focus\": onFocus('name')\n },\n \"model\": {\n value: data.name,\n callback: function callback($$v) {\n _this5.$set(data, \"name\", $$v);\n }\n }\n }), h(Field, {\n \"attrs\": {\n \"clearable\": true,\n \"type\": \"tel\",\n \"label\": t('tel'),\n \"maxlength\": this.telMaxlength,\n \"placeholder\": t('telPlaceholder'),\n \"errorMessage\": errorInfo.tel\n },\n \"on\": {\n \"focus\": onFocus('tel')\n },\n \"model\": {\n value: data.tel,\n callback: function callback($$v) {\n _this5.$set(data, \"tel\", $$v);\n }\n }\n }), h(Field, {\n \"directives\": [{\n name: \"show\",\n value: this.showArea\n }],\n \"attrs\": {\n \"readonly\": true,\n \"clickable\": !disableArea,\n \"label\": t('area'),\n \"placeholder\": this.areaPlaceholder || t('areaPlaceholder'),\n \"errorMessage\": errorInfo.areaCode,\n \"rightIcon\": !disableArea ? 'arrow' : null,\n \"value\": this.areaText\n },\n \"on\": {\n \"focus\": onFocus('areaCode'),\n \"click\": function click() {\n _this5.$emit('click-area');\n\n _this5.showAreaPopup = !disableArea;\n }\n }\n }), h(Detail, {\n \"directives\": [{\n name: \"show\",\n value: this.showDetail\n }],\n \"attrs\": {\n \"focused\": this.detailFocused,\n \"value\": data.addressDetail,\n \"errorMessage\": errorInfo.addressDetail,\n \"detailRows\": this.detailRows,\n \"detailMaxlength\": this.detailMaxlength,\n \"searchResult\": this.searchResult,\n \"showSearchResult\": this.showSearchResult\n },\n \"on\": {\n \"focus\": onFocus('addressDetail'),\n \"blur\": this.onDetailBlur,\n \"input\": this.onChangeDetail,\n \"select-search\": function selectSearch(event) {\n _this5.$emit('select-search', event);\n }\n }\n }), this.showPostal && h(Field, {\n \"directives\": [{\n name: \"show\",\n value: !hideBottomFields\n }],\n \"attrs\": {\n \"type\": \"tel\",\n \"maxlength\": \"6\",\n \"label\": t('postal'),\n \"placeholder\": t('postal'),\n \"errorMessage\": errorInfo.postalCode\n },\n \"on\": {\n \"focus\": onFocus('postalCode')\n },\n \"model\": {\n value: data.postalCode,\n callback: function callback($$v) {\n _this5.$set(data, \"postalCode\", $$v);\n }\n }\n }), this.slots()]), this.genSetDefaultCell(h), h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: !hideBottomFields\n }],\n \"class\": bem('buttons')\n }, [h(Button, {\n \"attrs\": {\n \"block\": true,\n \"round\": true,\n \"loading\": this.isSaving,\n \"type\": \"danger\",\n \"text\": this.saveButtonText || t('save')\n },\n \"on\": {\n \"click\": this.onSave\n }\n }), this.showDelete && h(Button, {\n \"attrs\": {\n \"block\": true,\n \"round\": true,\n \"loading\": this.isDeleting,\n \"text\": this.deleteButtonText || t('delete')\n },\n \"on\": {\n \"click\": this.onDelete\n }\n })]), h(Popup, {\n \"attrs\": {\n \"round\": true,\n \"position\": \"bottom\",\n \"lazyRender\": false,\n \"getContainer\": \"body\"\n },\n \"model\": {\n value: _this5.showAreaPopup,\n callback: function callback($$v) {\n _this5.showAreaPopup = $$v;\n }\n }\n }, [h(Area, {\n \"ref\": \"area\",\n \"attrs\": {\n \"value\": data.areaCode,\n \"loading\": !this.areaListLoaded,\n \"areaList\": this.areaList,\n \"columnsPlaceholder\": this.areaColumnsPlaceholder\n },\n \"on\": {\n \"confirm\": this.onAreaConfirm,\n \"cancel\": function cancel() {\n _this5.showAreaPopup = false;\n }\n }\n })])]);\n }\n});","import { createNamespace } from '../utils';\nimport { FieldMixin } from '../mixins/field';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('radio-group'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanRadio'), FieldMixin],\n props: {\n value: null,\n disabled: Boolean,\n direction: String,\n checkedColor: String,\n iconSize: [Number, String]\n },\n watch: {\n value: function value(_value) {\n this.$emit('change', _value);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem([this.direction]),\n \"attrs\": {\n \"role\": \"radiogroup\"\n }\n }, [this.slots()]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit, emit } from '../utils/functional'; // Components\n\nimport Icon from '../icon'; // Types\n\nvar _createNamespace = createNamespace('tag'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Tag(h, props, slots, ctx) {\n var _style;\n\n var type = props.type,\n mark = props.mark,\n plain = props.plain,\n color = props.color,\n round = props.round,\n size = props.size,\n textColor = props.textColor;\n var key = plain ? 'color' : 'backgroundColor';\n var style = (_style = {}, _style[key] = color, _style);\n\n if (plain) {\n style.color = textColor || color;\n style.borderColor = color;\n } else {\n style.color = textColor;\n style.background = color;\n }\n\n var classes = {\n mark: mark,\n plain: plain,\n round: round\n };\n\n if (size) {\n classes[size] = size;\n }\n\n var CloseIcon = props.closeable && h(Icon, {\n \"attrs\": {\n \"name\": \"cross\"\n },\n \"class\": bem('close'),\n \"on\": {\n \"click\": function click(event) {\n event.stopPropagation();\n emit(ctx, 'close');\n }\n }\n });\n return h(\"transition\", {\n \"attrs\": {\n \"name\": props.closeable ? 'van-fade' : null\n }\n }, [h(\"span\", _mergeJSXProps([{\n \"key\": \"content\",\n \"style\": style,\n \"class\": bem([classes, type])\n }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default(), CloseIcon])]);\n}\n\nTag.props = {\n size: String,\n mark: Boolean,\n color: String,\n plain: Boolean,\n round: Boolean,\n textColor: String,\n closeable: Boolean,\n type: {\n type: String,\n default: 'default'\n }\n};\nexport default createComponent(Tag);","/**\n * Common part of Checkbox & Radio\n */\nimport Icon from '../icon';\nimport { FieldMixin } from './field';\nimport { ChildrenMixin } from './relation';\nimport { addUnit } from '../utils';\nexport var CheckboxMixin = function CheckboxMixin(_ref) {\n var parent = _ref.parent,\n bem = _ref.bem,\n role = _ref.role;\n return {\n mixins: [ChildrenMixin(parent), FieldMixin],\n props: {\n name: null,\n value: null,\n disabled: Boolean,\n iconSize: [Number, String],\n checkedColor: String,\n labelPosition: String,\n labelDisabled: Boolean,\n shape: {\n type: String,\n default: 'round'\n },\n bindGroup: {\n type: Boolean,\n default: true\n }\n },\n computed: {\n disableBindRelation: function disableBindRelation() {\n return !this.bindGroup;\n },\n isDisabled: function isDisabled() {\n return this.parent && this.parent.disabled || this.disabled;\n },\n direction: function direction() {\n return this.parent && this.parent.direction || null;\n },\n iconStyle: function iconStyle() {\n var checkedColor = this.checkedColor || this.parent && this.parent.checkedColor;\n\n if (checkedColor && this.checked && !this.isDisabled) {\n return {\n borderColor: checkedColor,\n backgroundColor: checkedColor\n };\n }\n },\n tabindex: function tabindex() {\n if (this.isDisabled || role === 'radio' && !this.checked) {\n return -1;\n }\n\n return 0;\n }\n },\n methods: {\n onClick: function onClick(event) {\n var _this = this;\n\n var target = event.target;\n var icon = this.$refs.icon;\n var iconClicked = icon === target || (icon == null ? void 0 : icon.contains(target));\n\n if (!this.isDisabled && (iconClicked || !this.labelDisabled)) {\n this.toggle(); // wait for toggle method to complete\n // so we can get the changed value in the click event listener\n\n setTimeout(function () {\n _this.$emit('click', event);\n });\n } else {\n this.$emit('click', event);\n }\n },\n genIcon: function genIcon() {\n var h = this.$createElement;\n var checked = this.checked;\n var iconSize = this.iconSize || this.parent && this.parent.iconSize;\n return h(\"div\", {\n \"ref\": \"icon\",\n \"class\": bem('icon', [this.shape, {\n disabled: this.isDisabled,\n checked: checked\n }]),\n \"style\": {\n fontSize: addUnit(iconSize)\n }\n }, [this.slots('icon', {\n checked: checked\n }) || h(Icon, {\n \"attrs\": {\n \"name\": \"success\"\n },\n \"style\": this.iconStyle\n })]);\n },\n genLabel: function genLabel() {\n var h = this.$createElement;\n var slot = this.slots();\n\n if (slot) {\n return h(\"span\", {\n \"class\": bem('label', [this.labelPosition, {\n disabled: this.isDisabled\n }])\n }, [slot]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var Children = [this.genIcon()];\n\n if (this.labelPosition === 'left') {\n Children.unshift(this.genLabel());\n } else {\n Children.push(this.genLabel());\n }\n\n return h(\"div\", {\n \"attrs\": {\n \"role\": role,\n \"tabindex\": this.tabindex,\n \"aria-checked\": String(this.checked)\n },\n \"class\": bem([{\n disabled: this.isDisabled,\n 'label-disabled': this.labelDisabled\n }, this.direction]),\n \"on\": {\n \"click\": this.onClick\n }\n }, [Children]);\n }\n };\n};","import { createNamespace } from '../utils';\nimport { CheckboxMixin } from '../mixins/checkbox';\n\nvar _createNamespace = createNamespace('radio'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [CheckboxMixin({\n bem: bem,\n role: 'radio',\n parent: 'vanRadio'\n })],\n computed: {\n currentValue: {\n get: function get() {\n return this.parent ? this.parent.value : this.value;\n },\n set: function set(val) {\n (this.parent || this).$emit('input', val);\n }\n },\n checked: function checked() {\n return this.currentValue === this.name;\n }\n },\n methods: {\n toggle: function toggle() {\n this.currentValue = this.name;\n }\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Tag from '../tag';\nimport Icon from '../icon';\nimport Cell from '../cell';\nimport Radio from '../radio'; // Types\n\nvar _createNamespace = createNamespace('address-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction AddressItem(h, props, slots, ctx) {\n var disabled = props.disabled,\n switchable = props.switchable;\n\n function onClick() {\n if (switchable) {\n emit(ctx, 'select');\n }\n\n emit(ctx, 'click');\n }\n\n var genRightIcon = function genRightIcon() {\n return h(Icon, {\n \"attrs\": {\n \"name\": \"edit\"\n },\n \"class\": bem('edit'),\n \"on\": {\n \"click\": function click(event) {\n event.stopPropagation();\n emit(ctx, 'edit');\n emit(ctx, 'click');\n }\n }\n });\n };\n\n function genTag() {\n if (slots.tag) {\n return slots.tag(_extends({}, props.data));\n }\n\n if (props.data.isDefault && props.defaultTagText) {\n return h(Tag, {\n \"attrs\": {\n \"type\": \"danger\",\n \"round\": true\n },\n \"class\": bem('tag')\n }, [props.defaultTagText]);\n }\n }\n\n function genContent() {\n var data = props.data;\n var Info = [h(\"div\", {\n \"class\": bem('name')\n }, [data.name + \" \" + data.tel, genTag()]), h(\"div\", {\n \"class\": bem('address')\n }, [data.address])];\n\n if (switchable && !disabled) {\n return h(Radio, {\n \"attrs\": {\n \"name\": data.id,\n \"iconSize\": 18\n }\n }, [Info]);\n }\n\n return Info;\n }\n\n return h(\"div\", {\n \"class\": bem({\n disabled: disabled\n }),\n \"on\": {\n \"click\": onClick\n }\n }, [h(Cell, _mergeJSXProps([{\n \"attrs\": {\n \"border\": false,\n \"valueClass\": bem('value')\n },\n \"scopedSlots\": {\n default: genContent,\n 'right-icon': genRightIcon\n }\n }, inherit(ctx)])), slots.bottom == null ? void 0 : slots.bottom(_extends({}, props.data, {\n disabled: disabled\n }))]);\n}\n\nAddressItem.props = {\n data: Object,\n disabled: Boolean,\n switchable: Boolean,\n defaultTagText: String\n};\nexport default createComponent(AddressItem);","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Button from '../button';\nimport RadioGroup from '../radio-group';\nimport AddressItem from './Item'; // Types\n\nvar _createNamespace = createNamespace('address-list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction AddressList(h, props, slots, ctx) {\n function genList(list, disabled) {\n if (!list) {\n return;\n }\n\n return list.map(function (item, index) {\n return h(AddressItem, {\n \"attrs\": {\n \"data\": item,\n \"disabled\": disabled,\n \"switchable\": props.switchable,\n \"defaultTagText\": props.defaultTagText\n },\n \"key\": item.id,\n \"scopedSlots\": {\n bottom: slots['item-bottom'],\n tag: slots.tag\n },\n \"on\": {\n \"select\": function select() {\n emit(ctx, disabled ? 'select-disabled' : 'select', item, index);\n\n if (!disabled) {\n emit(ctx, 'input', item.id);\n }\n },\n \"edit\": function edit() {\n emit(ctx, disabled ? 'edit-disabled' : 'edit', item, index);\n },\n \"click\": function click() {\n emit(ctx, 'click-item', item, index);\n }\n }\n });\n });\n }\n\n var List = genList(props.list);\n var DisabledList = genList(props.disabledList, true);\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem()\n }, inherit(ctx)]), [slots.top == null ? void 0 : slots.top(), h(RadioGroup, {\n \"attrs\": {\n \"value\": props.value\n }\n }, [List]), props.disabledText && h(\"div\", {\n \"class\": bem('disabled-text')\n }, [props.disabledText]), DisabledList, slots.default == null ? void 0 : slots.default(), h(\"div\", {\n \"class\": bem('bottom')\n }, [h(Button, {\n \"attrs\": {\n \"round\": true,\n \"block\": true,\n \"type\": \"danger\",\n \"text\": props.addButtonText || t('add')\n },\n \"class\": bem('add'),\n \"on\": {\n \"click\": function click() {\n emit(ctx, 'add');\n }\n }\n })])]);\n}\n\nAddressList.props = {\n list: Array,\n value: [Number, String],\n disabledList: Array,\n disabledText: String,\n addButtonText: String,\n defaultTagText: String,\n switchable: {\n type: Boolean,\n default: true\n }\n};\nexport default createComponent(AddressList);","import { isDef, createNamespace } from '../utils';\nimport { isNumeric } from '../utils/validate/number';\n\nvar _createNamespace = createNamespace('badge'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n dot: Boolean,\n max: [Number, String],\n color: String,\n content: [Number, String],\n tag: {\n type: String,\n default: 'div'\n }\n },\n methods: {\n hasContent: function hasContent() {\n return !!(this.$scopedSlots.content || isDef(this.content) && this.content !== '');\n },\n renderContent: function renderContent() {\n var dot = this.dot,\n max = this.max,\n content = this.content;\n\n if (!dot && this.hasContent()) {\n if (this.$scopedSlots.content) {\n return this.$scopedSlots.content();\n }\n\n if (isDef(max) && isNumeric(content) && +content > max) {\n return max + \"+\";\n }\n\n return content;\n }\n },\n renderBadge: function renderBadge() {\n var h = this.$createElement;\n\n if (this.hasContent() || this.dot) {\n return h(\"div\", {\n \"class\": bem({\n dot: this.dot,\n fixed: !!this.$scopedSlots.default\n }),\n \"style\": {\n background: this.color\n }\n }, [this.renderContent()]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n\n if (this.$scopedSlots.default) {\n var tag = this.tag;\n return h(tag, {\n \"class\": bem('wrapper')\n }, [this.$scopedSlots.default(), this.renderBadge()]);\n }\n\n return this.renderBadge();\n }\n});","import { isNaN } from './number';\nexport function isDate(val) {\n return Object.prototype.toString.call(val) === '[object Date]' && !isNaN(val.getTime());\n}","import { createNamespace } from '../utils';\n\nvar _createNamespace = createNamespace('calendar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport { createComponent, bem, t };\nexport function formatMonthTitle(date) {\n return t('monthTitle', date.getFullYear(), date.getMonth() + 1);\n}\nexport function compareMonth(date1, date2) {\n var year1 = date1.getFullYear();\n var year2 = date2.getFullYear();\n var month1 = date1.getMonth();\n var month2 = date2.getMonth();\n\n if (year1 === year2) {\n return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;\n }\n\n return year1 > year2 ? 1 : -1;\n}\nexport function compareDay(day1, day2) {\n var compareMonthResult = compareMonth(day1, day2);\n\n if (compareMonthResult === 0) {\n var date1 = day1.getDate();\n var date2 = day2.getDate();\n return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;\n }\n\n return compareMonthResult;\n}\nexport function getDayByOffset(date, offset) {\n date = new Date(date);\n date.setDate(date.getDate() + offset);\n return date;\n}\nexport function getPrevDay(date) {\n return getDayByOffset(date, -1);\n}\nexport function getNextDay(date) {\n return getDayByOffset(date, 1);\n}\nexport function calcDateNum(date) {\n var day1 = date[0].getTime();\n var day2 = date[1].getTime();\n return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;\n}\nexport function copyDate(dates) {\n return new Date(dates);\n}\nexport function copyDates(dates) {\n if (Array.isArray(dates)) {\n return dates.map(function (date) {\n if (date === null) {\n return date;\n }\n\n return copyDate(date);\n });\n }\n\n return copyDate(dates);\n}","import { isNaN } from '../utils/validate/number';\nexport function times(n, iteratee) {\n if (n < 0) {\n return [];\n }\n\n var index = -1;\n var result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n\n return result;\n}\nexport function getTrueValue(value) {\n if (!value) {\n return 0;\n }\n\n while (isNaN(parseInt(value, 10))) {\n if (value.length > 1) {\n value = value.slice(1);\n } else {\n return 0;\n }\n }\n\n return parseInt(value, 10);\n}\nexport function getMonthEndDay(year, month) {\n return 32 - new Date(year, month - 1, 32).getDate();\n}","import { createNamespace, addUnit } from '../../utils';\nimport { setScrollTop } from '../../utils/dom/scroll';\nimport { t, bem, compareDay, getPrevDay, getNextDay, formatMonthTitle } from '../utils';\nimport { getMonthEndDay } from '../../datetime-picker/utils';\n\nvar _createNamespace = createNamespace('calendar-month'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n props: {\n date: Date,\n type: String,\n color: String,\n minDate: Date,\n maxDate: Date,\n showMark: Boolean,\n rowHeight: [Number, String],\n formatter: Function,\n lazyRender: Boolean,\n currentDate: [Date, Array],\n allowSameDay: Boolean,\n showSubtitle: Boolean,\n showMonthTitle: Boolean,\n firstDayOfWeek: Number\n },\n data: function data() {\n return {\n visible: false\n };\n },\n computed: {\n title: function title() {\n return formatMonthTitle(this.date);\n },\n rowHeightWithUnit: function rowHeightWithUnit() {\n return addUnit(this.rowHeight);\n },\n offset: function offset() {\n var firstDayOfWeek = this.firstDayOfWeek;\n var realDay = this.date.getDay();\n\n if (!firstDayOfWeek) {\n return realDay;\n }\n\n return (realDay + 7 - this.firstDayOfWeek) % 7;\n },\n totalDay: function totalDay() {\n return getMonthEndDay(this.date.getFullYear(), this.date.getMonth() + 1);\n },\n shouldRender: function shouldRender() {\n return this.visible || !this.lazyRender;\n },\n placeholders: function placeholders() {\n var rows = [];\n var count = Math.ceil((this.totalDay + this.offset) / 7);\n\n for (var day = 1; day <= count; day++) {\n rows.push({\n type: 'placeholder'\n });\n }\n\n return rows;\n },\n days: function days() {\n var days = [];\n var year = this.date.getFullYear();\n var month = this.date.getMonth();\n\n for (var day = 1; day <= this.totalDay; day++) {\n var date = new Date(year, month, day);\n var type = this.getDayType(date);\n var config = {\n date: date,\n type: type,\n text: day,\n bottomInfo: this.getBottomInfo(type)\n };\n\n if (this.formatter) {\n config = this.formatter(config);\n }\n\n days.push(config);\n }\n\n return days;\n }\n },\n methods: {\n getHeight: function getHeight() {\n var _this$$el;\n\n return ((_this$$el = this.$el) == null ? void 0 : _this$$el.getBoundingClientRect().height) || 0;\n },\n scrollIntoView: function scrollIntoView(body) {\n var _this$$refs = this.$refs,\n days = _this$$refs.days,\n month = _this$$refs.month;\n var el = this.showSubtitle ? days : month;\n var scrollTop = el.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop;\n setScrollTop(body, scrollTop);\n },\n getMultipleDayType: function getMultipleDayType(day) {\n var _this = this;\n\n var isSelected = function isSelected(date) {\n return _this.currentDate.some(function (item) {\n return compareDay(item, date) === 0;\n });\n };\n\n if (isSelected(day)) {\n var prevDay = getPrevDay(day);\n var nextDay = getNextDay(day);\n var prevSelected = isSelected(prevDay);\n var nextSelected = isSelected(nextDay);\n\n if (prevSelected && nextSelected) {\n return 'multiple-middle';\n }\n\n if (prevSelected) {\n return 'end';\n }\n\n return nextSelected ? 'start' : 'multiple-selected';\n }\n\n return '';\n },\n getRangeDayType: function getRangeDayType(day) {\n var _this$currentDate = this.currentDate,\n startDay = _this$currentDate[0],\n endDay = _this$currentDate[1];\n\n if (!startDay) {\n return '';\n }\n\n var compareToStart = compareDay(day, startDay);\n\n if (!endDay) {\n return compareToStart === 0 ? 'start' : '';\n }\n\n var compareToEnd = compareDay(day, endDay);\n\n if (compareToStart === 0 && compareToEnd === 0 && this.allowSameDay) {\n return 'start-end';\n }\n\n if (compareToStart === 0) {\n return 'start';\n }\n\n if (compareToEnd === 0) {\n return 'end';\n }\n\n if (compareToStart > 0 && compareToEnd < 0) {\n return 'middle';\n }\n },\n getDayType: function getDayType(day) {\n var type = this.type,\n minDate = this.minDate,\n maxDate = this.maxDate,\n currentDate = this.currentDate;\n\n if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {\n return 'disabled';\n }\n\n if (currentDate === null) {\n return;\n }\n\n if (type === 'single') {\n return compareDay(day, currentDate) === 0 ? 'selected' : '';\n }\n\n if (type === 'multiple') {\n return this.getMultipleDayType(day);\n }\n /* istanbul ignore else */\n\n\n if (type === 'range') {\n return this.getRangeDayType(day);\n }\n },\n getBottomInfo: function getBottomInfo(type) {\n if (this.type === 'range') {\n if (type === 'start' || type === 'end') {\n return t(type);\n }\n\n if (type === 'start-end') {\n return t('startEnd');\n }\n }\n },\n getDayStyle: function getDayStyle(type, index) {\n var style = {\n height: this.rowHeightWithUnit\n };\n\n if (type === 'placeholder') {\n style.width = '100%';\n return style;\n }\n\n if (index === 0) {\n style.marginLeft = 100 * this.offset / 7 + \"%\";\n }\n\n if (this.color) {\n if (type === 'start' || type === 'end' || type === 'start-end' || type === 'multiple-selected' || type === 'multiple-middle') {\n style.background = this.color;\n } else if (type === 'middle') {\n style.color = this.color;\n }\n }\n\n return style;\n },\n genTitle: function genTitle() {\n var h = this.$createElement;\n\n if (this.showMonthTitle) {\n return h(\"div\", {\n \"class\": bem('month-title')\n }, [this.title]);\n }\n },\n genMark: function genMark() {\n var h = this.$createElement;\n\n if (this.showMark && this.shouldRender) {\n return h(\"div\", {\n \"class\": bem('month-mark')\n }, [this.date.getMonth() + 1]);\n }\n },\n genDays: function genDays() {\n var h = this.$createElement;\n var days = this.shouldRender ? this.days : this.placeholders;\n return h(\"div\", {\n \"ref\": \"days\",\n \"attrs\": {\n \"role\": \"grid\"\n },\n \"class\": bem('days')\n }, [this.genMark(), days.map(this.genDay)]);\n },\n genTopInfo: function genTopInfo(item) {\n var h = this.$createElement;\n var slot = this.$scopedSlots['top-info'];\n\n if (item.topInfo || slot) {\n return h(\"div\", {\n \"class\": bem('top-info')\n }, [slot ? slot(item) : item.topInfo]);\n }\n },\n genBottomInfo: function genBottomInfo(item) {\n var h = this.$createElement;\n var slot = this.$scopedSlots['bottom-info'];\n\n if (item.bottomInfo || slot) {\n return h(\"div\", {\n \"class\": bem('bottom-info')\n }, [slot ? slot(item) : item.bottomInfo]);\n }\n },\n genDay: function genDay(item, index) {\n var _this2 = this;\n\n var h = this.$createElement;\n var type = item.type;\n var style = this.getDayStyle(type, index);\n var disabled = type === 'disabled';\n\n var onClick = function onClick() {\n if (!disabled) {\n _this2.$emit('click', item);\n }\n };\n\n if (type === 'selected') {\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"gridcell\",\n \"tabindex\": -1\n },\n \"style\": style,\n \"class\": [bem('day'), item.className],\n \"on\": {\n \"click\": onClick\n }\n }, [h(\"div\", {\n \"class\": bem('selected-day'),\n \"style\": {\n width: this.rowHeightWithUnit,\n height: this.rowHeightWithUnit,\n background: this.color\n }\n }, [this.genTopInfo(item), item.text, this.genBottomInfo(item)])]);\n }\n\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"gridcell\",\n \"tabindex\": disabled ? null : -1\n },\n \"style\": style,\n \"class\": [bem('day', type), item.className],\n \"on\": {\n \"click\": onClick\n }\n }, [this.genTopInfo(item), item.text, this.genBottomInfo(item)]);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem('month'),\n \"ref\": \"month\"\n }, [this.genTitle(), this.genDays()]);\n }\n});","import { createNamespace } from '../../utils';\nimport { t, bem } from '../utils';\n\nvar _createNamespace = createNamespace('calendar-header'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n props: {\n title: String,\n subtitle: String,\n showTitle: Boolean,\n showSubtitle: Boolean,\n firstDayOfWeek: Number\n },\n methods: {\n genTitle: function genTitle() {\n var h = this.$createElement;\n\n if (this.showTitle) {\n var title = this.slots('title') || this.title || t('title');\n return h(\"div\", {\n \"class\": bem('header-title')\n }, [title]);\n }\n },\n genSubtitle: function genSubtitle() {\n var h = this.$createElement;\n\n if (this.showSubtitle) {\n return h(\"div\", {\n \"class\": bem('header-subtitle')\n }, [this.subtitle]);\n }\n },\n genWeekDays: function genWeekDays() {\n var h = this.$createElement;\n var weekdays = t('weekdays');\n var firstDayOfWeek = this.firstDayOfWeek;\n var renderWeekDays = [].concat(weekdays.slice(firstDayOfWeek, 7), weekdays.slice(0, firstDayOfWeek));\n return h(\"div\", {\n \"class\": bem('weekdays')\n }, [renderWeekDays.map(function (item) {\n return h(\"span\", {\n \"class\": bem('weekday')\n }, [item]);\n })]);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem('header')\n }, [this.genTitle(), this.genSubtitle(), this.genWeekDays()]);\n }\n});","// Utils\nimport { raf } from '../utils/dom/raf';\nimport { isDate } from '../utils/validate/date';\nimport { getScrollTop } from '../utils/dom/scroll';\nimport { t, bem, copyDate, copyDates, getNextDay, compareDay, calcDateNum, compareMonth, createComponent, getDayByOffset } from './utils'; // Components\n\nimport Popup from '../popup';\nimport Button from '../button';\nimport Toast from '../toast';\nimport Month from './components/Month';\nimport Header from './components/Header';\nexport default createComponent({\n props: {\n title: String,\n color: String,\n value: Boolean,\n readonly: Boolean,\n formatter: Function,\n rowHeight: [Number, String],\n confirmText: String,\n rangePrompt: String,\n defaultDate: [Date, Array],\n getContainer: [String, Function],\n allowSameDay: Boolean,\n confirmDisabledText: String,\n type: {\n type: String,\n default: 'single'\n },\n round: {\n type: Boolean,\n default: true\n },\n position: {\n type: String,\n default: 'bottom'\n },\n poppable: {\n type: Boolean,\n default: true\n },\n maxRange: {\n type: [Number, String],\n default: null\n },\n lazyRender: {\n type: Boolean,\n default: true\n },\n showMark: {\n type: Boolean,\n default: true\n },\n showTitle: {\n type: Boolean,\n default: true\n },\n showConfirm: {\n type: Boolean,\n default: true\n },\n showSubtitle: {\n type: Boolean,\n default: true\n },\n closeOnPopstate: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n },\n minDate: {\n type: Date,\n validator: isDate,\n default: function _default() {\n return new Date();\n }\n },\n maxDate: {\n type: Date,\n validator: isDate,\n default: function _default() {\n var now = new Date();\n return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());\n }\n },\n firstDayOfWeek: {\n type: [Number, String],\n default: 0,\n validator: function validator(val) {\n return val >= 0 && val <= 6;\n }\n }\n },\n inject: {\n vanPopup: {\n default: null\n }\n },\n data: function data() {\n return {\n subtitle: '',\n currentDate: this.getInitialDate()\n };\n },\n computed: {\n months: function months() {\n var months = [];\n var cursor = new Date(this.minDate);\n cursor.setDate(1);\n\n do {\n months.push(new Date(cursor));\n cursor.setMonth(cursor.getMonth() + 1);\n } while (compareMonth(cursor, this.maxDate) !== 1);\n\n return months;\n },\n buttonDisabled: function buttonDisabled() {\n var type = this.type,\n currentDate = this.currentDate;\n\n if (currentDate) {\n if (type === 'range') {\n return !currentDate[0] || !currentDate[1];\n }\n\n if (type === 'multiple') {\n return !currentDate.length;\n }\n }\n\n return !currentDate;\n },\n dayOffset: function dayOffset() {\n return this.firstDayOfWeek ? this.firstDayOfWeek % 7 : 0;\n }\n },\n watch: {\n value: 'init',\n type: function type() {\n this.reset();\n },\n defaultDate: function defaultDate(val) {\n this.currentDate = val;\n this.scrollIntoView();\n }\n },\n mounted: function mounted() {\n this.init(); // https://github.com/vant-ui/vant/issues/9845\n\n if (!this.poppable) {\n var _this$vanPopup;\n\n (_this$vanPopup = this.vanPopup) == null ? void 0 : _this$vanPopup.$on('opened', this.onScroll);\n }\n },\n\n /* istanbul ignore next */\n activated: function activated() {\n this.init();\n },\n methods: {\n // @exposed-api\n reset: function reset(date) {\n if (date === void 0) {\n date = this.getInitialDate();\n }\n\n this.currentDate = date;\n this.scrollIntoView();\n },\n init: function init() {\n var _this = this;\n\n if (this.poppable && !this.value) {\n return;\n }\n\n this.$nextTick(function () {\n // add Math.floor to avoid decimal height issues\n // https://github.com/vant-ui/vant/issues/5640\n _this.bodyHeight = Math.floor(_this.$refs.body.getBoundingClientRect().height);\n\n _this.onScroll();\n\n _this.scrollIntoView();\n });\n },\n // @exposed-api\n scrollToDate: function scrollToDate(targetDate) {\n var _this2 = this;\n\n raf(function () {\n var displayed = _this2.value || !_this2.poppable;\n /* istanbul ignore if */\n\n if (!targetDate || !displayed) {\n return;\n }\n\n _this2.months.some(function (month, index) {\n if (compareMonth(month, targetDate) === 0) {\n var _this2$$refs = _this2.$refs,\n body = _this2$$refs.body,\n months = _this2$$refs.months;\n months[index].scrollIntoView(body);\n return true;\n }\n\n return false;\n });\n\n _this2.onScroll();\n });\n },\n // scroll to current month\n scrollIntoView: function scrollIntoView() {\n var currentDate = this.currentDate;\n\n if (currentDate) {\n var targetDate = this.type === 'single' ? currentDate : currentDate[0];\n this.scrollToDate(targetDate);\n }\n },\n getInitialDate: function getInitialDate() {\n var type = this.type,\n minDate = this.minDate,\n maxDate = this.maxDate,\n defaultDate = this.defaultDate;\n\n if (defaultDate === null) {\n return defaultDate;\n }\n\n var defaultVal = new Date();\n\n if (compareDay(defaultVal, minDate) === -1) {\n defaultVal = minDate;\n } else if (compareDay(defaultVal, maxDate) === 1) {\n defaultVal = maxDate;\n }\n\n if (type === 'range') {\n var _ref = defaultDate || [],\n startDay = _ref[0],\n endDay = _ref[1];\n\n return [startDay || defaultVal, endDay || getNextDay(defaultVal)];\n }\n\n if (type === 'multiple') {\n return defaultDate || [defaultVal];\n }\n\n return defaultDate || defaultVal;\n },\n // calculate the position of the elements\n // and find the elements that needs to be rendered\n onScroll: function onScroll() {\n var _this$$refs = this.$refs,\n body = _this$$refs.body,\n months = _this$$refs.months;\n var top = getScrollTop(body);\n var bottom = top + this.bodyHeight;\n var heights = months.map(function (item) {\n return item.getHeight();\n });\n var heightSum = heights.reduce(function (a, b) {\n return a + b;\n }, 0); // iOS scroll bounce may exceed the range\n\n if (bottom > heightSum && top > 0) {\n return;\n }\n\n var height = 0;\n var currentMonth;\n var visibleRange = [-1, -1];\n\n for (var i = 0; i < months.length; i++) {\n var visible = height <= bottom && height + heights[i] >= top;\n\n if (visible) {\n visibleRange[1] = i;\n\n if (!currentMonth) {\n currentMonth = months[i];\n visibleRange[0] = i;\n }\n\n if (!months[i].showed) {\n months[i].showed = true;\n this.$emit('month-show', {\n date: months[i].date,\n title: months[i].title\n });\n }\n }\n\n height += heights[i];\n }\n\n months.forEach(function (month, index) {\n month.visible = index >= visibleRange[0] - 1 && index <= visibleRange[1] + 1;\n });\n /* istanbul ignore else */\n\n if (currentMonth) {\n this.subtitle = currentMonth.title;\n }\n },\n onClickDay: function onClickDay(item) {\n if (this.readonly) {\n return;\n }\n\n var date = item.date;\n var type = this.type,\n currentDate = this.currentDate;\n\n if (type === 'range') {\n if (!currentDate) {\n this.select([date, null]);\n return;\n }\n\n var startDay = currentDate[0],\n endDay = currentDate[1];\n\n if (startDay && !endDay) {\n var compareToStart = compareDay(date, startDay);\n\n if (compareToStart === 1) {\n this.select([startDay, date], true);\n } else if (compareToStart === -1) {\n this.select([date, null]);\n } else if (this.allowSameDay) {\n this.select([date, date], true);\n }\n } else {\n this.select([date, null]);\n }\n } else if (type === 'multiple') {\n if (!currentDate) {\n this.select([date]);\n return;\n }\n\n var selectedIndex;\n var selected = this.currentDate.some(function (dateItem, index) {\n var equal = compareDay(dateItem, date) === 0;\n\n if (equal) {\n selectedIndex = index;\n }\n\n return equal;\n });\n\n if (selected) {\n var _currentDate$splice = currentDate.splice(selectedIndex, 1),\n unselectedDate = _currentDate$splice[0];\n\n this.$emit('unselect', copyDate(unselectedDate));\n } else if (this.maxRange && currentDate.length >= this.maxRange) {\n Toast(this.rangePrompt || t('rangePrompt', this.maxRange));\n } else {\n this.select([].concat(currentDate, [date]));\n }\n } else {\n this.select(date, true);\n }\n },\n togglePopup: function togglePopup(val) {\n this.$emit('input', val);\n },\n select: function select(date, complete) {\n var _this3 = this;\n\n var emit = function emit(date) {\n _this3.currentDate = date;\n\n _this3.$emit('select', copyDates(_this3.currentDate));\n };\n\n if (complete && this.type === 'range') {\n var valid = this.checkRange(date);\n\n if (!valid) {\n // auto selected to max range if showConfirm\n if (this.showConfirm) {\n emit([date[0], getDayByOffset(date[0], this.maxRange - 1)]);\n } else {\n emit(date);\n }\n\n return;\n }\n }\n\n emit(date);\n\n if (complete && !this.showConfirm) {\n this.onConfirm();\n }\n },\n checkRange: function checkRange(date) {\n var maxRange = this.maxRange,\n rangePrompt = this.rangePrompt;\n\n if (maxRange && calcDateNum(date) > maxRange) {\n Toast(rangePrompt || t('rangePrompt', maxRange));\n return false;\n }\n\n return true;\n },\n onConfirm: function onConfirm() {\n this.$emit('confirm', copyDates(this.currentDate));\n },\n genMonth: function genMonth(date, index) {\n var h = this.$createElement;\n var showMonthTitle = index !== 0 || !this.showSubtitle;\n return h(Month, {\n \"ref\": \"months\",\n \"refInFor\": true,\n \"attrs\": {\n \"date\": date,\n \"type\": this.type,\n \"color\": this.color,\n \"minDate\": this.minDate,\n \"maxDate\": this.maxDate,\n \"showMark\": this.showMark,\n \"formatter\": this.formatter,\n \"rowHeight\": this.rowHeight,\n \"lazyRender\": this.lazyRender,\n \"currentDate\": this.currentDate,\n \"showSubtitle\": this.showSubtitle,\n \"allowSameDay\": this.allowSameDay,\n \"showMonthTitle\": showMonthTitle,\n \"firstDayOfWeek\": this.dayOffset\n },\n \"scopedSlots\": {\n 'top-info': this.$scopedSlots['top-info'],\n 'bottom-info': this.$scopedSlots['bottom-info']\n },\n \"on\": {\n \"click\": this.onClickDay\n }\n });\n },\n genFooterContent: function genFooterContent() {\n var h = this.$createElement;\n var slot = this.slots('footer');\n\n if (slot) {\n return slot;\n }\n\n if (this.showConfirm) {\n var text = this.buttonDisabled ? this.confirmDisabledText : this.confirmText;\n return h(Button, {\n \"attrs\": {\n \"round\": true,\n \"block\": true,\n \"type\": \"danger\",\n \"color\": this.color,\n \"disabled\": this.buttonDisabled,\n \"nativeType\": \"button\"\n },\n \"class\": bem('confirm'),\n \"on\": {\n \"click\": this.onConfirm\n }\n }, [text || t('confirm')]);\n }\n },\n genFooter: function genFooter() {\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": bem('footer', {\n unfit: !this.safeAreaInsetBottom\n })\n }, [this.genFooterContent()]);\n },\n genCalendar: function genCalendar() {\n var _this4 = this;\n\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": bem()\n }, [h(Header, {\n \"attrs\": {\n \"title\": this.title,\n \"showTitle\": this.showTitle,\n \"subtitle\": this.subtitle,\n \"showSubtitle\": this.showSubtitle,\n \"firstDayOfWeek\": this.dayOffset\n },\n \"scopedSlots\": {\n title: function title() {\n return _this4.slots('title');\n }\n }\n }), h(\"div\", {\n \"ref\": \"body\",\n \"class\": bem('body'),\n \"on\": {\n \"scroll\": this.onScroll\n }\n }, [this.months.map(this.genMonth)]), this.genFooter()]);\n }\n },\n render: function render() {\n var _this5 = this;\n\n var h = arguments[0];\n\n if (this.poppable) {\n var _attrs;\n\n var createListener = function createListener(name) {\n return function () {\n return _this5.$emit(name);\n };\n };\n\n return h(Popup, {\n \"attrs\": (_attrs = {\n \"round\": true,\n \"value\": this.value\n }, _attrs[\"round\"] = this.round, _attrs[\"position\"] = this.position, _attrs[\"closeable\"] = this.showTitle || this.showSubtitle, _attrs[\"getContainer\"] = this.getContainer, _attrs[\"closeOnPopstate\"] = this.closeOnPopstate, _attrs[\"closeOnClickOverlay\"] = this.closeOnClickOverlay, _attrs),\n \"class\": bem('popup'),\n \"on\": {\n \"input\": this.togglePopup,\n \"open\": createListener('open'),\n \"opened\": createListener('opened'),\n \"close\": createListener('close'),\n \"closed\": createListener('closed')\n }\n }, [this.genCalendar()]);\n }\n\n return this.genCalendar();\n }\n});","import _mergeJSXProps2 from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport { createNamespace, isDef, addUnit, inBrowser } from '../utils';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('image'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n src: String,\n fit: String,\n alt: String,\n round: Boolean,\n width: [Number, String],\n height: [Number, String],\n radius: [Number, String],\n lazyLoad: Boolean,\n iconPrefix: String,\n showError: {\n type: Boolean,\n default: true\n },\n showLoading: {\n type: Boolean,\n default: true\n },\n errorIcon: {\n type: String,\n default: 'photo-fail'\n },\n loadingIcon: {\n type: String,\n default: 'photo'\n }\n },\n data: function data() {\n return {\n loading: true,\n error: false\n };\n },\n watch: {\n src: function src() {\n this.loading = true;\n this.error = false;\n }\n },\n computed: {\n style: function style() {\n var style = {};\n\n if (isDef(this.width)) {\n style.width = addUnit(this.width);\n }\n\n if (isDef(this.height)) {\n style.height = addUnit(this.height);\n }\n\n if (isDef(this.radius)) {\n style.overflow = 'hidden';\n style.borderRadius = addUnit(this.radius);\n }\n\n return style;\n }\n },\n created: function created() {\n var $Lazyload = this.$Lazyload;\n\n if ($Lazyload && inBrowser) {\n $Lazyload.$on('loaded', this.onLazyLoaded);\n $Lazyload.$on('error', this.onLazyLoadError);\n }\n },\n beforeDestroy: function beforeDestroy() {\n var $Lazyload = this.$Lazyload;\n\n if ($Lazyload) {\n $Lazyload.$off('loaded', this.onLazyLoaded);\n $Lazyload.$off('error', this.onLazyLoadError);\n }\n },\n methods: {\n onLoad: function onLoad(event) {\n this.loading = false;\n this.$emit('load', event);\n },\n onLazyLoaded: function onLazyLoaded(_ref) {\n var el = _ref.el;\n\n if (el === this.$refs.image && this.loading) {\n this.onLoad();\n }\n },\n onLazyLoadError: function onLazyLoadError(_ref2) {\n var el = _ref2.el;\n\n if (el === this.$refs.image && !this.error) {\n this.onError();\n }\n },\n onError: function onError(event) {\n this.error = true;\n this.loading = false;\n this.$emit('error', event);\n },\n onClick: function onClick(event) {\n this.$emit('click', event);\n },\n genPlaceholder: function genPlaceholder() {\n var h = this.$createElement;\n\n if (this.loading && this.showLoading) {\n return h(\"div\", {\n \"class\": bem('loading')\n }, [this.slots('loading') || h(Icon, {\n \"attrs\": {\n \"name\": this.loadingIcon,\n \"classPrefix\": this.iconPrefix\n },\n \"class\": bem('loading-icon')\n })]);\n }\n\n if (this.error && this.showError) {\n return h(\"div\", {\n \"class\": bem('error')\n }, [this.slots('error') || h(Icon, {\n \"attrs\": {\n \"name\": this.errorIcon,\n \"classPrefix\": this.iconPrefix\n },\n \"class\": bem('error-icon')\n })]);\n }\n },\n genImage: function genImage() {\n var h = this.$createElement;\n var imgData = {\n class: bem('img'),\n attrs: {\n alt: this.alt\n },\n style: {\n objectFit: this.fit\n }\n };\n\n if (this.error) {\n return;\n }\n\n if (this.lazyLoad) {\n return h(\"img\", _mergeJSXProps([{\n \"ref\": \"image\",\n \"directives\": [{\n name: \"lazy\",\n value: this.src\n }]\n }, imgData]));\n }\n\n return h(\"img\", _mergeJSXProps2([{\n \"attrs\": {\n \"src\": this.src\n },\n \"on\": {\n \"load\": this.onLoad,\n \"error\": this.onError\n }\n }, imgData]));\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem({\n round: this.round\n }),\n \"style\": this.style,\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.genImage(), this.genPlaceholder(), this.slots()]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Tag from '../tag';\nimport Image from '../image'; // Types\n\nvar _createNamespace = createNamespace('card'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Card(h, props, slots, ctx) {\n var _slots$priceTop;\n\n var thumb = props.thumb;\n var showNum = slots.num || isDef(props.num);\n var showPrice = slots.price || isDef(props.price);\n var showOriginPrice = slots['origin-price'] || isDef(props.originPrice);\n var showBottom = showNum || showPrice || showOriginPrice || slots.bottom;\n\n function onThumbClick(event) {\n emit(ctx, 'click-thumb', event);\n }\n\n function ThumbTag() {\n if (slots.tag || props.tag) {\n return h(\"div\", {\n \"class\": bem('tag')\n }, [slots.tag ? slots.tag() : h(Tag, {\n \"attrs\": {\n \"mark\": true,\n \"type\": \"danger\"\n }\n }, [props.tag])]);\n }\n }\n\n function Thumb() {\n if (slots.thumb || thumb) {\n return h(\"a\", {\n \"attrs\": {\n \"href\": props.thumbLink\n },\n \"class\": bem('thumb'),\n \"on\": {\n \"click\": onThumbClick\n }\n }, [slots.thumb ? slots.thumb() : h(Image, {\n \"attrs\": {\n \"src\": thumb,\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"fit\": \"cover\",\n \"lazy-load\": props.lazyLoad\n }\n }), ThumbTag()]);\n }\n }\n\n function Title() {\n if (slots.title) {\n return slots.title();\n }\n\n if (props.title) {\n return h(\"div\", {\n \"class\": [bem('title'), 'van-multi-ellipsis--l2']\n }, [props.title]);\n }\n }\n\n function Desc() {\n if (slots.desc) {\n return slots.desc();\n }\n\n if (props.desc) {\n return h(\"div\", {\n \"class\": [bem('desc'), 'van-ellipsis']\n }, [props.desc]);\n }\n }\n\n function PriceContent() {\n var priceArr = props.price.toString().split('.');\n return h(\"div\", [h(\"span\", {\n \"class\": bem('price-currency')\n }, [props.currency]), h(\"span\", {\n \"class\": bem('price-integer')\n }, [priceArr[0]]), \".\", h(\"span\", {\n \"class\": bem('price-decimal')\n }, [priceArr[1]])]);\n }\n\n function Price() {\n if (showPrice) {\n return h(\"div\", {\n \"class\": bem('price')\n }, [slots.price ? slots.price() : PriceContent()]);\n }\n }\n\n function OriginPrice() {\n if (showOriginPrice) {\n var slot = slots['origin-price'];\n return h(\"div\", {\n \"class\": bem('origin-price')\n }, [slot ? slot() : props.currency + \" \" + props.originPrice]);\n }\n }\n\n function Num() {\n if (showNum) {\n return h(\"div\", {\n \"class\": bem('num')\n }, [slots.num ? slots.num() : \"x\" + props.num]);\n }\n }\n\n function Footer() {\n if (slots.footer) {\n return h(\"div\", {\n \"class\": bem('footer')\n }, [slots.footer()]);\n }\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem()\n }, inherit(ctx, true)]), [h(\"div\", {\n \"class\": bem('header')\n }, [Thumb(), h(\"div\", {\n \"class\": bem('content', {\n centered: props.centered\n })\n }, [h(\"div\", [Title(), Desc(), slots.tags == null ? void 0 : slots.tags()]), showBottom && h(\"div\", {\n \"class\": \"van-card__bottom\"\n }, [(_slots$priceTop = slots['price-top']) == null ? void 0 : _slots$priceTop.call(slots), Price(), OriginPrice(), Num(), slots.bottom == null ? void 0 : slots.bottom()])])]), Footer()]);\n}\n\nCard.props = {\n tag: String,\n desc: String,\n thumb: String,\n title: String,\n centered: Boolean,\n lazyLoad: Boolean,\n thumbLink: String,\n num: [Number, String],\n price: [Number, String],\n originPrice: [Number, String],\n currency: {\n type: String,\n default: '¥'\n }\n};\nexport default createComponent(Card);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { ChildrenMixin } from '../mixins/relation';\nimport { routeProps } from '../utils/router';\n\nvar _createNamespace = createNamespace('tab'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanTabs')],\n props: _extends({}, routeProps, {\n dot: Boolean,\n name: [Number, String],\n // @deprecated\n info: [Number, String],\n badge: [Number, String],\n title: String,\n titleStyle: null,\n titleClass: null,\n disabled: Boolean\n }),\n data: function data() {\n return {\n inited: false\n };\n },\n computed: {\n computedName: function computedName() {\n var _this$name;\n\n return (_this$name = this.name) != null ? _this$name : this.index;\n },\n isActive: function isActive() {\n var active = this.computedName === this.parent.currentName;\n\n if (active) {\n this.inited = true;\n }\n\n return active;\n }\n },\n watch: {\n title: function title() {\n this.parent.setLine();\n this.parent.scrollIntoView();\n },\n inited: function inited(val) {\n var _this = this;\n\n if (this.parent.lazyRender && val) {\n this.$nextTick(function () {\n _this.parent.$emit('rendered', _this.computedName, _this.title);\n });\n }\n }\n },\n render: function render(h) {\n var slots = this.slots,\n parent = this.parent,\n isActive = this.isActive;\n var slotContent = slots();\n\n if (process.env.NODE_ENV === 'development' && this.info) {\n console.warn('[Vant] Tab: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n if (!slotContent && !parent.animated) {\n return;\n }\n\n var show = parent.scrollspy || isActive;\n var shouldRender = this.inited || parent.scrollspy || !parent.lazyRender;\n var Content = shouldRender ? slotContent : h();\n\n if (parent.animated) {\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"tabpanel\",\n \"aria-hidden\": !isActive\n },\n \"class\": bem('pane-wrapper', {\n inactive: !isActive\n })\n }, [h(\"div\", {\n \"class\": bem('pane')\n }, [Content])]);\n }\n\n return h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: show\n }],\n \"attrs\": {\n \"role\": \"tabpanel\"\n },\n \"class\": bem('pane')\n }, [Content]);\n }\n});","import { raf } from '../utils/dom/raf';\nimport { getScrollTop, setScrollTop } from '../utils/dom/scroll';\nexport function scrollLeftTo(scroller, to, duration) {\n var count = 0;\n var from = scroller.scrollLeft;\n var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);\n\n function animate() {\n scroller.scrollLeft += (to - from) / frames;\n\n if (++count < frames) {\n raf(animate);\n }\n }\n\n animate();\n}\nexport function scrollTopTo(scroller, to, duration, callback) {\n var current = getScrollTop(scroller);\n var isDown = current < to;\n var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);\n var step = (to - current) / frames;\n\n function animate() {\n current += step;\n\n if (isDown && current > to || !isDown && current < to) {\n current = to;\n }\n\n setScrollTop(scroller, current);\n\n if (isDown && current < to || !isDown && current > to) {\n raf(animate);\n } else if (callback) {\n raf(callback);\n }\n }\n\n animate();\n}","export function isHidden(el) {\n var style = window.getComputedStyle(el);\n var hidden = style.display === 'none'; // offsetParent returns null in the following situations:\n // 1. The element or its parent element has the display property set to none.\n // 2. The element has the position property set to fixed\n\n var parentHidden = el.offsetParent === null && style.position !== 'fixed';\n return hidden || parentHidden;\n}","import { isPromise, noop } from '.';\nexport function callInterceptor(options) {\n var interceptor = options.interceptor,\n args = options.args,\n done = options.done;\n\n if (interceptor) {\n var returnVal = interceptor.apply(void 0, args);\n\n if (isPromise(returnVal)) {\n returnVal.then(function (value) {\n if (value) {\n done();\n }\n }).catch(noop);\n } else if (returnVal) {\n done();\n }\n } else {\n done();\n }\n}","import { createNamespace, isDef } from '../utils';\nimport Info from '../info';\n\nvar _createNamespace = createNamespace('tab'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n dot: Boolean,\n type: String,\n info: [Number, String],\n color: String,\n title: String,\n isActive: Boolean,\n disabled: Boolean,\n scrollable: Boolean,\n activeColor: String,\n inactiveColor: String\n },\n computed: {\n style: function style() {\n var style = {};\n var color = this.color,\n isActive = this.isActive;\n var isCard = this.type === 'card'; // card theme color\n\n if (color && isCard) {\n style.borderColor = color;\n\n if (!this.disabled) {\n if (isActive) {\n style.backgroundColor = color;\n } else {\n style.color = color;\n }\n }\n }\n\n var titleColor = isActive ? this.activeColor : this.inactiveColor;\n\n if (titleColor) {\n style.color = titleColor;\n }\n\n return style;\n }\n },\n methods: {\n onClick: function onClick() {\n this.$emit('click');\n },\n genText: function genText() {\n var h = this.$createElement;\n var Text = h(\"span\", {\n \"class\": bem('text', {\n ellipsis: !this.scrollable\n })\n }, [this.slots() || this.title]);\n\n if (this.dot || isDef(this.info) && this.info !== '') {\n return h(\"span\", {\n \"class\": bem('text-wrapper')\n }, [Text, h(Info, {\n \"attrs\": {\n \"dot\": this.dot,\n \"info\": this.info\n }\n })]);\n }\n\n return Text;\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"tab\",\n \"aria-selected\": this.isActive\n },\n \"class\": [bem({\n active: this.isActive,\n disabled: this.disabled\n })],\n \"style\": this.style,\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.genText()]);\n }\n});","import { isHidden } from '../utils/dom/style';\nimport { unitToPx } from '../utils/format/unit';\nimport { createNamespace, isDef, isServer } from '../utils';\nimport { getScrollTop, getElementTop, getScroller } from '../utils/dom/scroll';\nimport { BindEventMixin } from '../mixins/bind-event';\n\nvar _createNamespace = createNamespace('sticky'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind, isBind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n\n if (this.observer) {\n var method = isBind ? 'observe' : 'unobserve';\n this.observer[method](this.$el);\n }\n\n bind(this.scroller, 'scroll', this.onScroll, true);\n this.onScroll();\n })],\n props: {\n zIndex: [Number, String],\n container: null,\n offsetTop: {\n type: [Number, String],\n default: 0\n }\n },\n data: function data() {\n return {\n fixed: false,\n height: 0,\n transform: 0\n };\n },\n computed: {\n offsetTopPx: function offsetTopPx() {\n return unitToPx(this.offsetTop);\n },\n style: function style() {\n if (!this.fixed) {\n return;\n }\n\n var style = {};\n\n if (isDef(this.zIndex)) {\n style.zIndex = this.zIndex;\n }\n\n if (this.offsetTopPx && this.fixed) {\n style.top = this.offsetTopPx + \"px\";\n }\n\n if (this.transform) {\n style.transform = \"translate3d(0, \" + this.transform + \"px, 0)\";\n }\n\n return style;\n }\n },\n watch: {\n fixed: function fixed(isFixed) {\n this.$emit('change', isFixed);\n }\n },\n created: function created() {\n var _this = this;\n\n // compatibility: https://caniuse.com/#feat=intersectionobserver\n if (!isServer && window.IntersectionObserver) {\n this.observer = new IntersectionObserver(function (entries) {\n // trigger scroll when visibility changed\n if (entries[0].intersectionRatio > 0) {\n _this.onScroll();\n }\n }, {\n root: document.body\n });\n }\n },\n methods: {\n onScroll: function onScroll() {\n var _this2 = this;\n\n if (isHidden(this.$el)) {\n return;\n }\n\n this.height = this.$el.offsetHeight;\n var container = this.container,\n offsetTopPx = this.offsetTopPx;\n var scrollTop = getScrollTop(window);\n var topToPageTop = getElementTop(this.$el);\n\n var emitScrollEvent = function emitScrollEvent() {\n _this2.$emit('scroll', {\n scrollTop: scrollTop,\n isFixed: _this2.fixed\n });\n }; // The sticky component should be kept inside the container element\n\n\n if (container) {\n var bottomToPageTop = topToPageTop + container.offsetHeight;\n\n if (scrollTop + offsetTopPx + this.height > bottomToPageTop) {\n var distanceToBottom = this.height + scrollTop - bottomToPageTop;\n\n if (distanceToBottom < this.height) {\n this.fixed = true;\n this.transform = -(distanceToBottom + offsetTopPx);\n } else {\n this.fixed = false;\n }\n\n emitScrollEvent();\n return;\n }\n }\n\n if (scrollTop + offsetTopPx > topToPageTop) {\n this.fixed = true;\n this.transform = 0;\n } else {\n this.fixed = false;\n }\n\n emitScrollEvent();\n }\n },\n render: function render() {\n var h = arguments[0];\n var fixed = this.fixed;\n var style = {\n height: fixed ? this.height + \"px\" : null\n };\n return h(\"div\", {\n \"style\": style\n }, [h(\"div\", {\n \"class\": bem({\n fixed: fixed\n }),\n \"style\": this.style\n }, [this.slots()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { TouchMixin } from '../mixins/touch';\n\nvar _createNamespace = createNamespace('tabs'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar MIN_SWIPE_DISTANCE = 50;\nexport default createComponent({\n mixins: [TouchMixin],\n props: {\n count: Number,\n duration: [Number, String],\n animated: Boolean,\n swipeable: Boolean,\n currentIndex: Number\n },\n computed: {\n style: function style() {\n if (this.animated) {\n return {\n transform: \"translate3d(\" + -1 * this.currentIndex * 100 + \"%, 0, 0)\",\n transitionDuration: this.duration + \"s\"\n };\n }\n },\n listeners: function listeners() {\n if (this.swipeable) {\n return {\n touchstart: this.touchStart,\n touchmove: this.touchMove,\n touchend: this.onTouchEnd,\n touchcancel: this.onTouchEnd\n };\n }\n }\n },\n methods: {\n // watch swipe touch end\n onTouchEnd: function onTouchEnd() {\n var direction = this.direction,\n deltaX = this.deltaX,\n currentIndex = this.currentIndex;\n /* istanbul ignore else */\n\n if (direction === 'horizontal' && this.offsetX >= MIN_SWIPE_DISTANCE) {\n /* istanbul ignore else */\n if (deltaX > 0 && currentIndex !== 0) {\n this.$emit('change', currentIndex - 1);\n } else if (deltaX < 0 && currentIndex !== this.count - 1) {\n this.$emit('change', currentIndex + 1);\n }\n }\n },\n genChildren: function genChildren() {\n var h = this.$createElement;\n\n if (this.animated) {\n return h(\"div\", {\n \"class\": bem('track'),\n \"style\": this.style\n }, [this.slots()]);\n }\n\n return this.slots();\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem('content', {\n animated: this.animated\n }),\n \"on\": _extends({}, this.listeners)\n }, [this.genChildren()]);\n }\n});","// Utils\nimport { createNamespace, isDef, addUnit } from '../utils';\nimport { scrollLeftTo, scrollTopTo } from './utils';\nimport { route } from '../utils/router';\nimport { isHidden } from '../utils/dom/style';\nimport { on, off } from '../utils/dom/event';\nimport { unitToPx } from '../utils/format/unit';\nimport { BORDER_TOP_BOTTOM } from '../utils/constant';\nimport { callInterceptor } from '../utils/interceptor';\nimport { getScroller, getVisibleTop, getElementTop, getVisibleHeight, setRootScrollTop } from '../utils/dom/scroll'; // Mixins\n\nimport { ParentMixin } from '../mixins/relation';\nimport { BindEventMixin } from '../mixins/bind-event'; // Components\n\nimport Title from './Title';\nimport Sticky from '../sticky';\nimport Content from './Content';\n\nvar _createNamespace = createNamespace('tabs'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanTabs'), BindEventMixin(function (bind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n\n bind(window, 'resize', this.resize, true);\n\n if (this.scrollspy) {\n bind(this.scroller, 'scroll', this.onScroll, true);\n }\n })],\n inject: {\n vanPopup: {\n default: null\n }\n },\n model: {\n prop: 'active'\n },\n props: {\n color: String,\n border: Boolean,\n sticky: Boolean,\n animated: Boolean,\n swipeable: Boolean,\n scrollspy: Boolean,\n background: String,\n lineWidth: [Number, String],\n lineHeight: [Number, String],\n beforeChange: Function,\n titleActiveColor: String,\n titleInactiveColor: String,\n type: {\n type: String,\n default: 'line'\n },\n active: {\n type: [Number, String],\n default: 0\n },\n ellipsis: {\n type: Boolean,\n default: true\n },\n duration: {\n type: [Number, String],\n default: 0.3\n },\n offsetTop: {\n type: [Number, String],\n default: 0\n },\n lazyRender: {\n type: Boolean,\n default: true\n },\n swipeThreshold: {\n type: [Number, String],\n default: 5\n }\n },\n data: function data() {\n return {\n position: '',\n currentIndex: null,\n lineStyle: {\n backgroundColor: this.color\n }\n };\n },\n computed: {\n // whether the nav is scrollable\n scrollable: function scrollable() {\n return this.children.length > this.swipeThreshold || !this.ellipsis;\n },\n navStyle: function navStyle() {\n return {\n borderColor: this.color,\n background: this.background\n };\n },\n currentName: function currentName() {\n var activeTab = this.children[this.currentIndex];\n\n if (activeTab) {\n return activeTab.computedName;\n }\n },\n offsetTopPx: function offsetTopPx() {\n return unitToPx(this.offsetTop);\n },\n scrollOffset: function scrollOffset() {\n if (this.sticky) {\n return this.offsetTopPx + this.tabHeight;\n }\n\n return 0;\n }\n },\n watch: {\n color: 'setLine',\n active: function active(name) {\n if (name !== this.currentName) {\n this.setCurrentIndexByName(name);\n }\n },\n children: function children() {\n var _this = this;\n\n this.setCurrentIndexByName(this.active);\n this.setLine();\n this.$nextTick(function () {\n _this.scrollIntoView(true);\n });\n },\n currentIndex: function currentIndex() {\n this.scrollIntoView();\n this.setLine(); // scroll to correct position\n\n if (this.stickyFixed && !this.scrollspy) {\n setRootScrollTop(Math.ceil(getElementTop(this.$el) - this.offsetTopPx));\n }\n },\n scrollspy: function scrollspy(val) {\n if (val) {\n on(this.scroller, 'scroll', this.onScroll, true);\n } else {\n off(this.scroller, 'scroll', this.onScroll);\n }\n }\n },\n mounted: function mounted() {\n var _this2 = this;\n\n this.init(); // https://github.com/vant-ui/vant/issues/7959\n\n if (this.vanPopup) {\n this.vanPopup.onReopen(function () {\n _this2.setLine();\n });\n }\n },\n activated: function activated() {\n this.init();\n this.setLine();\n },\n methods: {\n // @exposed-api\n resize: function resize() {\n this.setLine();\n },\n init: function init() {\n var _this3 = this;\n\n this.$nextTick(function () {\n _this3.inited = true;\n _this3.tabHeight = getVisibleHeight(_this3.$refs.wrap);\n\n _this3.scrollIntoView(true);\n });\n },\n // update nav bar style\n setLine: function setLine() {\n var _this4 = this;\n\n var shouldAnimate = this.inited;\n this.$nextTick(function () {\n var titles = _this4.$refs.titles;\n\n if (!titles || !titles[_this4.currentIndex] || _this4.type !== 'line' || isHidden(_this4.$el)) {\n return;\n }\n\n var title = titles[_this4.currentIndex].$el;\n var lineWidth = _this4.lineWidth,\n lineHeight = _this4.lineHeight;\n var left = title.offsetLeft + title.offsetWidth / 2;\n var lineStyle = {\n width: addUnit(lineWidth),\n backgroundColor: _this4.color,\n transform: \"translateX(\" + left + \"px) translateX(-50%)\"\n };\n\n if (shouldAnimate) {\n lineStyle.transitionDuration = _this4.duration + \"s\";\n }\n\n if (isDef(lineHeight)) {\n var height = addUnit(lineHeight);\n lineStyle.height = height;\n lineStyle.borderRadius = height;\n }\n\n _this4.lineStyle = lineStyle;\n });\n },\n // correct the index of active tab\n setCurrentIndexByName: function setCurrentIndexByName(name) {\n var matched = this.children.filter(function (tab) {\n return tab.computedName === name;\n });\n var defaultIndex = (this.children[0] || {}).index || 0;\n this.setCurrentIndex(matched.length ? matched[0].index : defaultIndex);\n },\n setCurrentIndex: function setCurrentIndex(currentIndex) {\n var newIndex = this.findAvailableTab(currentIndex);\n\n if (!isDef(newIndex)) {\n return;\n }\n\n var newTab = this.children[newIndex];\n var newName = newTab.computedName;\n var shouldEmitChange = this.currentIndex !== null;\n this.currentIndex = newIndex;\n\n if (newName !== this.active) {\n this.$emit('input', newName);\n\n if (shouldEmitChange) {\n this.$emit('change', newName, newTab.title);\n }\n }\n },\n findAvailableTab: function findAvailableTab(index) {\n var diff = index < this.currentIndex ? -1 : 1;\n\n while (index >= 0 && index < this.children.length) {\n if (!this.children[index].disabled) {\n return index;\n }\n\n index += diff;\n }\n },\n // emit event when clicked\n onClick: function onClick(item, index) {\n var _this5 = this;\n\n var _this$children$index = this.children[index],\n title = _this$children$index.title,\n disabled = _this$children$index.disabled,\n computedName = _this$children$index.computedName;\n\n if (disabled) {\n this.$emit('disabled', computedName, title);\n } else {\n callInterceptor({\n interceptor: this.beforeChange,\n args: [computedName],\n done: function done() {\n _this5.setCurrentIndex(index);\n\n _this5.scrollToCurrentContent();\n }\n });\n this.$emit('click', computedName, title);\n route(item.$router, item);\n }\n },\n // scroll active tab into view\n scrollIntoView: function scrollIntoView(immediate) {\n var titles = this.$refs.titles;\n\n if (!this.scrollable || !titles || !titles[this.currentIndex]) {\n return;\n }\n\n var nav = this.$refs.nav;\n var title = titles[this.currentIndex].$el;\n var to = title.offsetLeft - (nav.offsetWidth - title.offsetWidth) / 2;\n scrollLeftTo(nav, to, immediate ? 0 : +this.duration);\n },\n onSticktScroll: function onSticktScroll(params) {\n this.stickyFixed = params.isFixed;\n this.$emit('scroll', params);\n },\n // @exposed-api\n scrollTo: function scrollTo(name) {\n var _this6 = this;\n\n this.$nextTick(function () {\n _this6.setCurrentIndexByName(name);\n\n _this6.scrollToCurrentContent(true);\n });\n },\n scrollToCurrentContent: function scrollToCurrentContent(immediate) {\n var _this7 = this;\n\n if (immediate === void 0) {\n immediate = false;\n }\n\n if (this.scrollspy) {\n var target = this.children[this.currentIndex];\n var el = target == null ? void 0 : target.$el;\n\n if (el) {\n var to = getElementTop(el, this.scroller) - this.scrollOffset;\n this.lockScroll = true;\n scrollTopTo(this.scroller, to, immediate ? 0 : +this.duration, function () {\n _this7.lockScroll = false;\n });\n }\n }\n },\n onScroll: function onScroll() {\n if (this.scrollspy && !this.lockScroll) {\n var index = this.getCurrentIndexOnScroll();\n this.setCurrentIndex(index);\n }\n },\n getCurrentIndexOnScroll: function getCurrentIndexOnScroll() {\n var children = this.children;\n\n for (var index = 0; index < children.length; index++) {\n var top = getVisibleTop(children[index].$el);\n\n if (top > this.scrollOffset) {\n return index === 0 ? 0 : index - 1;\n }\n }\n\n return children.length - 1;\n }\n },\n render: function render() {\n var _this8 = this,\n _ref;\n\n var h = arguments[0];\n var type = this.type,\n animated = this.animated,\n scrollable = this.scrollable;\n var Nav = this.children.map(function (item, index) {\n var _item$badge;\n\n return h(Title, {\n \"ref\": \"titles\",\n \"refInFor\": true,\n \"attrs\": {\n \"type\": type,\n \"dot\": item.dot,\n \"info\": (_item$badge = item.badge) != null ? _item$badge : item.info,\n \"title\": item.title,\n \"color\": _this8.color,\n \"isActive\": index === _this8.currentIndex,\n \"disabled\": item.disabled,\n \"scrollable\": scrollable,\n \"activeColor\": _this8.titleActiveColor,\n \"inactiveColor\": _this8.titleInactiveColor\n },\n \"style\": item.titleStyle,\n \"class\": item.titleClass,\n \"scopedSlots\": {\n default: function _default() {\n return item.slots('title');\n }\n },\n \"on\": {\n \"click\": function click() {\n _this8.onClick(item, index);\n }\n }\n });\n });\n var Wrap = h(\"div\", {\n \"ref\": \"wrap\",\n \"class\": [bem('wrap', {\n scrollable: scrollable\n }), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = type === 'line' && this.border, _ref)]\n }, [h(\"div\", {\n \"ref\": \"nav\",\n \"attrs\": {\n \"role\": \"tablist\"\n },\n \"class\": bem('nav', [type, {\n complete: this.scrollable\n }]),\n \"style\": this.navStyle\n }, [this.slots('nav-left'), Nav, type === 'line' && h(\"div\", {\n \"class\": bem('line'),\n \"style\": this.lineStyle\n }), this.slots('nav-right')])]);\n return h(\"div\", {\n \"class\": bem([type])\n }, [this.sticky ? h(Sticky, {\n \"attrs\": {\n \"container\": this.$el,\n \"offsetTop\": this.offsetTop\n },\n \"on\": {\n \"scroll\": this.onSticktScroll\n }\n }, [Wrap]) : Wrap, h(Content, {\n \"attrs\": {\n \"count\": this.children.length,\n \"animated\": animated,\n \"duration\": this.duration,\n \"swipeable\": this.swipeable,\n \"currentIndex\": this.currentIndex\n },\n \"on\": {\n \"change\": this.setCurrentIndex\n }\n }, [this.slots()])]);\n }\n});","import { createNamespace } from '../utils';\nimport Tab from '../tab';\nimport Tabs from '../tabs';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('cascader'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n props: {\n title: String,\n value: [Number, String],\n fieldNames: Object,\n placeholder: String,\n activeColor: String,\n options: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n closeable: {\n type: Boolean,\n default: true\n },\n showHeader: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n tabs: [],\n activeTab: 0\n };\n },\n computed: {\n textKey: function textKey() {\n var _this$fieldNames;\n\n return ((_this$fieldNames = this.fieldNames) == null ? void 0 : _this$fieldNames.text) || 'text';\n },\n valueKey: function valueKey() {\n var _this$fieldNames2;\n\n return ((_this$fieldNames2 = this.fieldNames) == null ? void 0 : _this$fieldNames2.value) || 'value';\n },\n childrenKey: function childrenKey() {\n var _this$fieldNames3;\n\n return ((_this$fieldNames3 = this.fieldNames) == null ? void 0 : _this$fieldNames3.children) || 'children';\n }\n },\n watch: {\n options: {\n deep: true,\n handler: 'updateTabs'\n },\n value: function value(_value) {\n var _this = this;\n\n if (_value || _value === 0) {\n var values = this.tabs.map(function (tab) {\n var _tab$selectedOption;\n\n return (_tab$selectedOption = tab.selectedOption) == null ? void 0 : _tab$selectedOption[_this.valueKey];\n });\n\n if (values.indexOf(_value) !== -1) {\n return;\n }\n }\n\n this.updateTabs();\n }\n },\n created: function created() {\n this.updateTabs();\n },\n methods: {\n getSelectedOptionsByValue: function getSelectedOptionsByValue(options, value) {\n for (var i = 0; i < options.length; i++) {\n var option = options[i];\n\n if (option[this.valueKey] === value) {\n return [option];\n }\n\n if (option[this.childrenKey]) {\n var selectedOptions = this.getSelectedOptionsByValue(option[this.childrenKey], value);\n\n if (selectedOptions) {\n return [option].concat(selectedOptions);\n }\n }\n }\n },\n updateTabs: function updateTabs() {\n var _this2 = this;\n\n if (this.value || this.value === 0) {\n var selectedOptions = this.getSelectedOptionsByValue(this.options, this.value);\n\n if (selectedOptions) {\n var optionsCursor = this.options;\n this.tabs = selectedOptions.map(function (option) {\n var tab = {\n options: optionsCursor,\n selectedOption: option\n };\n var next = optionsCursor.filter(function (item) {\n return item[_this2.valueKey] === option[_this2.valueKey];\n });\n\n if (next.length) {\n optionsCursor = next[0][_this2.childrenKey];\n }\n\n return tab;\n });\n\n if (optionsCursor) {\n this.tabs.push({\n options: optionsCursor,\n selectedOption: null\n });\n }\n\n this.$nextTick(function () {\n _this2.activeTab = _this2.tabs.length - 1;\n });\n return;\n }\n }\n\n this.tabs = [{\n options: this.options,\n selectedOption: null\n }];\n },\n onSelect: function onSelect(option, tabIndex) {\n var _this3 = this;\n\n this.tabs[tabIndex].selectedOption = option;\n\n if (this.tabs.length > tabIndex + 1) {\n this.tabs = this.tabs.slice(0, tabIndex + 1);\n }\n\n if (option[this.childrenKey]) {\n var nextTab = {\n options: option[this.childrenKey],\n selectedOption: null\n };\n\n if (this.tabs[tabIndex + 1]) {\n this.$set(this.tabs, tabIndex + 1, nextTab);\n } else {\n this.tabs.push(nextTab);\n }\n\n this.$nextTick(function () {\n _this3.activeTab++;\n });\n }\n\n var selectedOptions = this.tabs.map(function (tab) {\n return tab.selectedOption;\n }).filter(function (item) {\n return !!item;\n });\n var eventParams = {\n value: option[this.valueKey],\n tabIndex: tabIndex,\n selectedOptions: selectedOptions\n };\n this.$emit('input', option[this.valueKey]);\n this.$emit('change', eventParams);\n\n if (!option[this.childrenKey]) {\n this.$emit('finish', eventParams);\n }\n },\n onClose: function onClose() {\n this.$emit('close');\n },\n renderHeader: function renderHeader() {\n var h = this.$createElement;\n\n if (this.showHeader) {\n return h(\"div\", {\n \"class\": bem('header')\n }, [h(\"h2\", {\n \"class\": bem('title')\n }, [this.slots('title') || this.title]), this.closeable ? h(Icon, {\n \"attrs\": {\n \"name\": \"cross\"\n },\n \"class\": bem('close-icon'),\n \"on\": {\n \"click\": this.onClose\n }\n }) : null]);\n }\n },\n renderOptions: function renderOptions(options, selectedOption, tabIndex) {\n var _this4 = this;\n\n var h = this.$createElement;\n\n var renderOption = function renderOption(option) {\n var isSelected = selectedOption && option[_this4.valueKey] === selectedOption[_this4.valueKey];\n var Text = _this4.slots('option', {\n option: option,\n selected: isSelected\n }) || h(\"span\", [option[_this4.textKey]]);\n return h(\"li\", {\n \"class\": bem('option', {\n selected: isSelected\n }),\n \"style\": {\n color: isSelected ? _this4.activeColor : null\n },\n \"on\": {\n \"click\": function click() {\n _this4.onSelect(option, tabIndex);\n }\n }\n }, [Text, isSelected ? h(Icon, {\n \"attrs\": {\n \"name\": \"success\"\n },\n \"class\": bem('selected-icon')\n }) : null]);\n };\n\n return h(\"ul\", {\n \"class\": bem('options')\n }, [options.map(renderOption)]);\n },\n renderTab: function renderTab(item, tabIndex) {\n var h = this.$createElement;\n var options = item.options,\n selectedOption = item.selectedOption;\n var title = selectedOption ? selectedOption[this.textKey] : this.placeholder || t('select');\n return h(Tab, {\n \"attrs\": {\n \"title\": title,\n \"titleClass\": bem('tab', {\n unselected: !selectedOption\n })\n }\n }, [this.renderOptions(options, selectedOption, tabIndex)]);\n },\n renderTabs: function renderTabs() {\n var _this5 = this;\n\n var h = this.$createElement;\n return h(Tabs, {\n \"attrs\": {\n \"animated\": true,\n \"swipeable\": true,\n \"swipeThreshold\": 0,\n \"color\": this.activeColor\n },\n \"class\": bem('tabs'),\n \"model\": {\n value: _this5.activeTab,\n callback: function callback($$v) {\n _this5.activeTab = $$v;\n }\n }\n }, [this.tabs.map(this.renderTab)]);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [this.renderHeader(), this.renderTabs()]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit } from '../utils/functional';\nimport { BORDER_TOP_BOTTOM } from '../utils/constant'; // Types\n\nvar _createNamespace = createNamespace('cell-group'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction CellGroup(h, props, slots, ctx) {\n var _ref;\n\n var Group = h(\"div\", _mergeJSXProps([{\n \"class\": [bem({\n inset: props.inset\n }), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = props.border, _ref)]\n }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()]);\n\n if (props.title || slots.title) {\n return h(\"div\", {\n \"key\": ctx.data.key\n }, [h(\"div\", {\n \"class\": bem('title', {\n inset: props.inset\n })\n }, [slots.title ? slots.title() : props.title]), Group]);\n }\n\n return Group;\n}\n\nCellGroup.props = {\n title: String,\n inset: Boolean,\n border: {\n type: Boolean,\n default: true\n }\n};\nexport default createComponent(CellGroup);","import { createNamespace } from '../utils';\nimport { CheckboxMixin } from '../mixins/checkbox';\n\nvar _createNamespace = createNamespace('checkbox'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [CheckboxMixin({\n bem: bem,\n role: 'checkbox',\n parent: 'vanCheckbox'\n })],\n computed: {\n checked: {\n get: function get() {\n if (this.parent) {\n return this.parent.value.indexOf(this.name) !== -1;\n }\n\n return this.value;\n },\n set: function set(val) {\n if (this.parent) {\n this.setParentValue(val);\n } else {\n this.$emit('input', val);\n }\n }\n }\n },\n watch: {\n value: function value(val) {\n this.$emit('change', val);\n }\n },\n methods: {\n // @exposed-api\n toggle: function toggle(checked) {\n var _this = this;\n\n if (checked === void 0) {\n checked = !this.checked;\n }\n\n // When toggle method is called multiple times at the same time,\n // only the last call is valid.\n // This is a hack for usage inside Cell.\n clearTimeout(this.toggleTask);\n this.toggleTask = setTimeout(function () {\n _this.checked = checked;\n });\n },\n setParentValue: function setParentValue(val) {\n var parent = this.parent;\n var value = parent.value.slice();\n\n if (val) {\n if (parent.max && value.length >= parent.max) {\n return;\n }\n /* istanbul ignore else */\n\n\n if (value.indexOf(this.name) === -1) {\n value.push(this.name);\n parent.$emit('input', value);\n }\n } else {\n var index = value.indexOf(this.name);\n /* istanbul ignore else */\n\n if (index !== -1) {\n value.splice(index, 1);\n parent.$emit('input', value);\n }\n }\n }\n }\n});","import { createNamespace } from '../utils';\nimport { FieldMixin } from '../mixins/field';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('checkbox-group'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanCheckbox'), FieldMixin],\n props: {\n max: [Number, String],\n disabled: Boolean,\n direction: String,\n iconSize: [Number, String],\n checkedColor: String,\n value: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n watch: {\n value: function value(val) {\n this.$emit('change', val);\n }\n },\n methods: {\n // @exposed-api\n toggleAll: function toggleAll(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === 'boolean') {\n options = {\n checked: options\n };\n }\n\n var _options = options,\n checked = _options.checked,\n skipDisabled = _options.skipDisabled;\n var children = this.children.filter(function (item) {\n if (item.disabled && skipDisabled) {\n return item.checked;\n }\n\n return checked != null ? checked : !item.checked;\n });\n var names = children.map(function (item) {\n return item.name;\n });\n this.$emit('input', names);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem([this.direction])\n }, [this.slots()]);\n }\n});","import { createNamespace, isObject, addUnit } from '../utils';\nimport { raf, cancelRaf } from '../utils/dom/raf';\n\nvar _createNamespace = createNamespace('circle'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar PERIMETER = 3140;\nvar uid = 0;\n\nfunction format(rate) {\n return Math.min(Math.max(rate, 0), 100);\n}\n\nfunction getPath(clockwise, viewBoxSize) {\n var sweepFlag = clockwise ? 1 : 0;\n return \"M \" + viewBoxSize / 2 + \" \" + viewBoxSize / 2 + \" m 0, -500 a 500, 500 0 1, \" + sweepFlag + \" 0, 1000 a 500, 500 0 1, \" + sweepFlag + \" 0, -1000\";\n}\n\nexport default createComponent({\n props: {\n text: String,\n size: [Number, String],\n color: [String, Object],\n layerColor: String,\n strokeLinecap: String,\n value: {\n type: Number,\n default: 0\n },\n speed: {\n type: [Number, String],\n default: 0\n },\n fill: {\n type: String,\n default: 'none'\n },\n rate: {\n type: [Number, String],\n default: 100\n },\n strokeWidth: {\n type: [Number, String],\n default: 40\n },\n clockwise: {\n type: Boolean,\n default: true\n }\n },\n beforeCreate: function beforeCreate() {\n this.uid = \"van-circle-gradient-\" + uid++;\n },\n computed: {\n style: function style() {\n var size = addUnit(this.size);\n return {\n width: size,\n height: size\n };\n },\n path: function path() {\n return getPath(this.clockwise, this.viewBoxSize);\n },\n viewBoxSize: function viewBoxSize() {\n return +this.strokeWidth + 1000;\n },\n layerStyle: function layerStyle() {\n return {\n fill: \"\" + this.fill,\n stroke: \"\" + this.layerColor,\n strokeWidth: this.strokeWidth + \"px\"\n };\n },\n hoverStyle: function hoverStyle() {\n var offset = PERIMETER * this.value / 100;\n return {\n stroke: \"\" + (this.gradient ? \"url(#\" + this.uid + \")\" : this.color),\n strokeWidth: +this.strokeWidth + 1 + \"px\",\n strokeLinecap: this.strokeLinecap,\n strokeDasharray: offset + \"px \" + PERIMETER + \"px\"\n };\n },\n gradient: function gradient() {\n return isObject(this.color);\n },\n LinearGradient: function LinearGradient() {\n var _this = this;\n\n var h = this.$createElement;\n\n if (!this.gradient) {\n return;\n }\n\n var Stops = Object.keys(this.color).sort(function (a, b) {\n return parseFloat(a) - parseFloat(b);\n }).map(function (key, index) {\n return h(\"stop\", {\n \"key\": index,\n \"attrs\": {\n \"offset\": key,\n \"stop-color\": _this.color[key]\n }\n });\n });\n return h(\"defs\", [h(\"linearGradient\", {\n \"attrs\": {\n \"id\": this.uid,\n \"x1\": \"100%\",\n \"y1\": \"0%\",\n \"x2\": \"0%\",\n \"y2\": \"0%\"\n }\n }, [Stops])]);\n }\n },\n watch: {\n rate: {\n handler: function handler(rate) {\n this.startTime = Date.now();\n this.startRate = this.value;\n this.endRate = format(rate);\n this.increase = this.endRate > this.startRate;\n this.duration = Math.abs((this.startRate - this.endRate) * 1000 / this.speed);\n\n if (this.speed) {\n cancelRaf(this.rafId);\n this.rafId = raf(this.animate);\n } else {\n this.$emit('input', this.endRate);\n }\n },\n immediate: true\n }\n },\n methods: {\n animate: function animate() {\n var now = Date.now();\n var progress = Math.min((now - this.startTime) / this.duration, 1);\n var rate = progress * (this.endRate - this.startRate) + this.startRate;\n this.$emit('input', format(parseFloat(rate.toFixed(1))));\n\n if (this.increase ? rate < this.endRate : rate > this.endRate) {\n this.rafId = raf(this.animate);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem(),\n \"style\": this.style\n }, [h(\"svg\", {\n \"attrs\": {\n \"viewBox\": \"0 0 \" + this.viewBoxSize + \" \" + this.viewBoxSize\n }\n }, [this.LinearGradient, h(\"path\", {\n \"class\": bem('layer'),\n \"style\": this.layerStyle,\n \"attrs\": {\n \"d\": this.path\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": this.path\n },\n \"class\": bem('hover'),\n \"style\": this.hoverStyle\n })]), this.slots() || this.text && h(\"div\", {\n \"class\": bem('text')\n }, [this.text])]);\n }\n});","import { createNamespace } from '../utils';\nimport { ChildrenMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('col'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanRow')],\n props: {\n span: [Number, String],\n offset: [Number, String],\n tag: {\n type: String,\n default: 'div'\n }\n },\n computed: {\n style: function style() {\n var index = this.index;\n\n var _ref = this.parent || {},\n spaces = _ref.spaces;\n\n if (spaces && spaces[index]) {\n var _spaces$index = spaces[index],\n left = _spaces$index.left,\n right = _spaces$index.right;\n return {\n paddingLeft: left ? left + \"px\" : null,\n paddingRight: right ? right + \"px\" : null\n };\n }\n }\n },\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n }\n },\n render: function render() {\n var _bem;\n\n var h = arguments[0];\n var span = this.span,\n offset = this.offset;\n return h(this.tag, {\n \"style\": this.style,\n \"class\": bem((_bem = {}, _bem[span] = span, _bem[\"offset-\" + offset] = offset, _bem)),\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.slots()]);\n }\n});","import { createNamespace } from '../utils';\nimport { ParentMixin } from '../mixins/relation';\nimport { BORDER_TOP_BOTTOM } from '../utils/constant';\n\nvar _createNamespace = createNamespace('collapse'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanCollapse')],\n props: {\n accordion: Boolean,\n value: [String, Number, Array],\n border: {\n type: Boolean,\n default: true\n }\n },\n methods: {\n switch: function _switch(name, expanded) {\n if (!this.accordion) {\n name = expanded ? this.value.concat(name) : this.value.filter(function (activeName) {\n return activeName !== name;\n });\n }\n\n this.$emit('change', name);\n this.$emit('input', name);\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n return h(\"div\", {\n \"class\": [bem(), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = this.border, _ref)]\n }, [this.slots()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { raf, doubleRaf } from '../utils/dom/raf'; // Mixins\n\nimport { ChildrenMixin } from '../mixins/relation'; // Components\n\nimport Cell from '../cell';\nimport { cellProps } from '../cell/shared';\n\nvar _createNamespace = createNamespace('collapse-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar CELL_SLOTS = ['title', 'icon', 'right-icon'];\nexport default createComponent({\n mixins: [ChildrenMixin('vanCollapse')],\n props: _extends({}, cellProps, {\n name: [Number, String],\n disabled: Boolean,\n lazyRender: {\n type: Boolean,\n default: true\n },\n isLink: {\n type: Boolean,\n default: true\n }\n }),\n data: function data() {\n return {\n show: null,\n inited: null\n };\n },\n computed: {\n currentName: function currentName() {\n var _this$name;\n\n return (_this$name = this.name) != null ? _this$name : this.index;\n },\n expanded: function expanded() {\n var _this = this;\n\n if (!this.parent) {\n return null;\n }\n\n var _this$parent = this.parent,\n value = _this$parent.value,\n accordion = _this$parent.accordion;\n\n if (process.env.NODE_ENV === 'development' && !accordion && !Array.isArray(value)) {\n console.error('[Vant] Collapse: type of prop \"value\" should be Array');\n return;\n }\n\n return accordion ? value === this.currentName : value.some(function (name) {\n return name === _this.currentName;\n });\n }\n },\n created: function created() {\n this.show = this.expanded;\n this.inited = this.expanded;\n },\n watch: {\n expanded: function expanded(_expanded, prev) {\n var _this2 = this;\n\n if (prev === null) {\n return;\n }\n\n if (_expanded) {\n this.show = true;\n this.inited = true;\n } // Use raf: flick when opened in safari\n // Use nextTick: closing animation failed when set `user-select: none`\n\n\n var nextTick = _expanded ? this.$nextTick : raf;\n nextTick(function () {\n var _this2$$refs = _this2.$refs,\n content = _this2$$refs.content,\n wrapper = _this2$$refs.wrapper;\n\n if (!content || !wrapper) {\n return;\n }\n\n var offsetHeight = content.offsetHeight;\n\n if (offsetHeight) {\n var contentHeight = offsetHeight + \"px\";\n wrapper.style.height = _expanded ? 0 : contentHeight; // use double raf to ensure animation can start\n\n doubleRaf(function () {\n wrapper.style.height = _expanded ? contentHeight : 0;\n });\n } else {\n _this2.onTransitionEnd();\n }\n });\n }\n },\n methods: {\n onClick: function onClick() {\n if (!this.disabled) {\n this.toggle();\n }\n },\n // @exposed-api\n toggle: function toggle(expanded) {\n if (expanded === void 0) {\n expanded = !this.expanded;\n }\n\n var parent = this.parent,\n currentName = this.currentName;\n var close = parent.accordion && currentName === parent.value;\n var name = close ? '' : currentName;\n this.parent.switch(name, expanded);\n },\n onTransitionEnd: function onTransitionEnd() {\n if (!this.expanded) {\n this.show = false;\n } else {\n this.$refs.wrapper.style.height = '';\n }\n },\n genTitle: function genTitle() {\n var _this3 = this;\n\n var h = this.$createElement;\n var border = this.border,\n disabled = this.disabled,\n expanded = this.expanded;\n var titleSlots = CELL_SLOTS.reduce(function (slots, name) {\n if (_this3.slots(name)) {\n slots[name] = function () {\n return _this3.slots(name);\n };\n }\n\n return slots;\n }, {});\n\n if (this.slots('value')) {\n titleSlots.default = function () {\n return _this3.slots('value');\n };\n }\n\n return h(Cell, {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": disabled ? -1 : 0,\n \"aria-expanded\": String(expanded)\n },\n \"class\": bem('title', {\n disabled: disabled,\n expanded: expanded,\n borderless: !border\n }),\n \"on\": {\n \"click\": this.onClick\n },\n \"scopedSlots\": titleSlots,\n \"props\": _extends({}, this.$props)\n });\n },\n genContent: function genContent() {\n var h = this.$createElement;\n\n if (this.inited || !this.lazyRender) {\n return h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.show\n }],\n \"ref\": \"wrapper\",\n \"class\": bem('wrapper'),\n \"on\": {\n \"transitionend\": this.onTransitionEnd\n }\n }, [h(\"div\", {\n \"ref\": \"content\",\n \"class\": bem('content')\n }, [this.slots()])]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": [bem({\n border: this.index && this.border\n })]\n }, [this.genTitle(), this.genContent()]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Cell from '../cell'; // Types\n\nvar _createNamespace = createNamespace('contact-card'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction ContactCard(h, props, slots, ctx) {\n var type = props.type,\n editable = props.editable;\n\n function onClick(event) {\n if (editable) {\n emit(ctx, 'click', event);\n }\n }\n\n function Content() {\n if (type === 'add') {\n return props.addText || t('addText');\n }\n\n return [h(\"div\", [t('name') + \"\\uFF1A\" + props.name]), h(\"div\", [t('tel') + \"\\uFF1A\" + props.tel])];\n }\n\n return h(Cell, _mergeJSXProps([{\n \"attrs\": {\n \"center\": true,\n \"border\": false,\n \"isLink\": editable,\n \"valueClass\": bem('value'),\n \"icon\": type === 'edit' ? 'contact' : 'add-square'\n },\n \"class\": bem([type]),\n \"on\": {\n \"click\": onClick\n }\n }, inherit(ctx)]), [Content()]);\n}\n\nContactCard.props = {\n tel: String,\n name: String,\n addText: String,\n editable: {\n type: Boolean,\n default: true\n },\n type: {\n type: String,\n default: 'add'\n }\n};\nexport default createComponent(ContactCard);","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { isMobile } from '../utils/validate/mobile'; // Components\n\nimport Cell from '../cell';\nimport Field from '../field';\nimport Button from '../button';\nimport Dialog from '../dialog';\nimport Switch from '../switch';\n\nvar _createNamespace = createNamespace('contact-edit'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nvar defaultContact = {\n tel: '',\n name: ''\n};\nexport default createComponent({\n props: {\n isEdit: Boolean,\n isSaving: Boolean,\n isDeleting: Boolean,\n showSetDefault: Boolean,\n setDefaultLabel: String,\n contactInfo: {\n type: Object,\n default: function _default() {\n return _extends({}, defaultContact);\n }\n },\n telValidator: {\n type: Function,\n default: isMobile\n }\n },\n data: function data() {\n return {\n data: _extends({}, defaultContact, this.contactInfo),\n errorInfo: {\n name: '',\n tel: ''\n }\n };\n },\n watch: {\n contactInfo: function contactInfo(val) {\n this.data = _extends({}, defaultContact, val);\n }\n },\n methods: {\n onFocus: function onFocus(key) {\n this.errorInfo[key] = '';\n },\n getErrorMessageByKey: function getErrorMessageByKey(key) {\n var value = this.data[key].trim();\n\n switch (key) {\n case 'name':\n return value ? '' : t('nameInvalid');\n\n case 'tel':\n return this.telValidator(value) ? '' : t('telInvalid');\n }\n },\n onSave: function onSave() {\n var _this = this;\n\n var isValid = ['name', 'tel'].every(function (item) {\n var msg = _this.getErrorMessageByKey(item);\n\n if (msg) {\n _this.errorInfo[item] = msg;\n }\n\n return !msg;\n });\n\n if (isValid && !this.isSaving) {\n this.$emit('save', this.data);\n }\n },\n onDelete: function onDelete() {\n var _this2 = this;\n\n Dialog.confirm({\n title: t('confirmDelete')\n }).then(function () {\n _this2.$emit('delete', _this2.data);\n });\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n var data = this.data,\n errorInfo = this.errorInfo;\n\n var onFocus = function onFocus(name) {\n return function () {\n return _this3.onFocus(name);\n };\n };\n\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"class\": bem('fields')\n }, [h(Field, {\n \"attrs\": {\n \"clearable\": true,\n \"maxlength\": \"30\",\n \"label\": t('name'),\n \"placeholder\": t('nameEmpty'),\n \"errorMessage\": errorInfo.name\n },\n \"on\": {\n \"focus\": onFocus('name')\n },\n \"model\": {\n value: data.name,\n callback: function callback($$v) {\n _this3.$set(data, \"name\", $$v);\n }\n }\n }), h(Field, {\n \"attrs\": {\n \"clearable\": true,\n \"type\": \"tel\",\n \"label\": t('tel'),\n \"placeholder\": t('telEmpty'),\n \"errorMessage\": errorInfo.tel\n },\n \"on\": {\n \"focus\": onFocus('tel')\n },\n \"model\": {\n value: data.tel,\n callback: function callback($$v) {\n _this3.$set(data, \"tel\", $$v);\n }\n }\n })]), this.showSetDefault && h(Cell, {\n \"attrs\": {\n \"title\": this.setDefaultLabel,\n \"border\": false\n },\n \"class\": bem('switch-cell')\n }, [h(Switch, {\n \"attrs\": {\n \"size\": 24\n },\n \"slot\": \"right-icon\",\n \"on\": {\n \"change\": function change(event) {\n _this3.$emit('change-default', event);\n }\n },\n \"model\": {\n value: data.isDefault,\n callback: function callback($$v) {\n _this3.$set(data, \"isDefault\", $$v);\n }\n }\n })]), h(\"div\", {\n \"class\": bem('buttons')\n }, [h(Button, {\n \"attrs\": {\n \"block\": true,\n \"round\": true,\n \"type\": \"danger\",\n \"text\": t('save'),\n \"loading\": this.isSaving\n },\n \"on\": {\n \"click\": this.onSave\n }\n }), this.isEdit && h(Button, {\n \"attrs\": {\n \"block\": true,\n \"round\": true,\n \"text\": t('delete'),\n \"loading\": this.isDeleting\n },\n \"on\": {\n \"click\": this.onDelete\n }\n })])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { RED } from '../utils/constant';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Tag from '../tag';\nimport Icon from '../icon';\nimport Cell from '../cell';\nimport Radio from '../radio';\nimport Button from '../button';\nimport RadioGroup from '../radio-group'; // Types\n\nvar _createNamespace = createNamespace('contact-list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction ContactList(h, props, slots, ctx) {\n var List = props.list && props.list.map(function (item, index) {\n function onClick() {\n emit(ctx, 'input', item.id);\n emit(ctx, 'select', item, index);\n }\n\n function RightIcon() {\n return h(Radio, {\n \"attrs\": {\n \"name\": item.id,\n \"iconSize\": 16,\n \"checkedColor\": RED\n },\n \"on\": {\n \"click\": onClick\n }\n });\n }\n\n function LeftIcon() {\n return h(Icon, {\n \"attrs\": {\n \"name\": \"edit\"\n },\n \"class\": bem('edit'),\n \"on\": {\n \"click\": function click(event) {\n event.stopPropagation();\n emit(ctx, 'edit', item, index);\n }\n }\n });\n }\n\n function Content() {\n var nodes = [item.name + \"\\uFF0C\" + item.tel];\n\n if (item.isDefault && props.defaultTagText) {\n nodes.push(h(Tag, {\n \"attrs\": {\n \"type\": \"danger\",\n \"round\": true\n },\n \"class\": bem('item-tag')\n }, [props.defaultTagText]));\n }\n\n return nodes;\n }\n\n return h(Cell, {\n \"key\": item.id,\n \"attrs\": {\n \"isLink\": true,\n \"center\": true,\n \"valueClass\": bem('item-value')\n },\n \"class\": bem('item'),\n \"scopedSlots\": {\n icon: LeftIcon,\n default: Content,\n 'right-icon': RightIcon\n },\n \"on\": {\n \"click\": onClick\n }\n });\n });\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem()\n }, inherit(ctx)]), [h(RadioGroup, {\n \"attrs\": {\n \"value\": props.value\n },\n \"class\": bem('group')\n }, [List]), h(\"div\", {\n \"class\": bem('bottom')\n }, [h(Button, {\n \"attrs\": {\n \"round\": true,\n \"block\": true,\n \"type\": \"danger\",\n \"text\": props.addText || t('addText')\n },\n \"class\": bem('add'),\n \"on\": {\n \"click\": function click() {\n emit(ctx, 'add');\n }\n }\n })])]);\n}\n\nContactList.props = {\n value: null,\n list: Array,\n addText: String,\n defaultTagText: String\n};\nexport default createComponent(ContactList);","import { padZero } from '../utils/format/string';\nvar SECOND = 1000;\nvar MINUTE = 60 * SECOND;\nvar HOUR = 60 * MINUTE;\nvar DAY = 24 * HOUR;\nexport function parseTimeData(time) {\n var days = Math.floor(time / DAY);\n var hours = Math.floor(time % DAY / HOUR);\n var minutes = Math.floor(time % HOUR / MINUTE);\n var seconds = Math.floor(time % MINUTE / SECOND);\n var milliseconds = Math.floor(time % SECOND);\n return {\n days: days,\n hours: hours,\n minutes: minutes,\n seconds: seconds,\n milliseconds: milliseconds\n };\n}\nexport function parseFormat(format, timeData) {\n var days = timeData.days;\n var hours = timeData.hours,\n minutes = timeData.minutes,\n seconds = timeData.seconds,\n milliseconds = timeData.milliseconds;\n\n if (format.indexOf('DD') === -1) {\n hours += days * 24;\n } else {\n format = format.replace('DD', padZero(days));\n }\n\n if (format.indexOf('HH') === -1) {\n minutes += hours * 60;\n } else {\n format = format.replace('HH', padZero(hours));\n }\n\n if (format.indexOf('mm') === -1) {\n seconds += minutes * 60;\n } else {\n format = format.replace('mm', padZero(minutes));\n }\n\n if (format.indexOf('ss') === -1) {\n milliseconds += seconds * 1000;\n } else {\n format = format.replace('ss', padZero(seconds));\n }\n\n if (format.indexOf('S') !== -1) {\n var ms = padZero(milliseconds, 3);\n\n if (format.indexOf('SSS') !== -1) {\n format = format.replace('SSS', ms);\n } else if (format.indexOf('SS') !== -1) {\n format = format.replace('SS', ms.slice(0, 2));\n } else {\n format = format.replace('S', ms.charAt(0));\n }\n }\n\n return format;\n}\nexport function isSameSecond(time1, time2) {\n return Math.floor(time1 / 1000) === Math.floor(time2 / 1000);\n}","import { createNamespace, inBrowser } from '../utils';\nimport { raf, cancelRaf } from '../utils/dom/raf';\nimport { isSameSecond, parseTimeData, parseFormat } from './utils';\n\nvar _createNamespace = createNamespace('count-down'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n millisecond: Boolean,\n time: {\n type: [Number, String],\n default: 0\n },\n format: {\n type: String,\n default: 'HH:mm:ss'\n },\n autoStart: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n remain: 0\n };\n },\n computed: {\n timeData: function timeData() {\n return parseTimeData(this.remain);\n },\n formattedTime: function formattedTime() {\n return parseFormat(this.format, this.timeData);\n }\n },\n watch: {\n time: {\n immediate: true,\n handler: 'reset'\n }\n },\n activated: function activated() {\n if (this.keepAlivePaused) {\n this.counting = true;\n this.keepAlivePaused = false;\n this.tick();\n }\n },\n deactivated: function deactivated() {\n if (this.counting) {\n this.pause();\n this.keepAlivePaused = true;\n }\n },\n beforeDestroy: function beforeDestroy() {\n this.pause();\n },\n methods: {\n // @exposed-api\n start: function start() {\n if (this.counting) {\n return;\n }\n\n this.counting = true;\n this.endTime = Date.now() + this.remain;\n this.tick();\n },\n // @exposed-api\n pause: function pause() {\n this.counting = false;\n cancelRaf(this.rafId);\n },\n // @exposed-api\n reset: function reset() {\n this.pause();\n this.remain = +this.time;\n\n if (this.autoStart) {\n this.start();\n }\n },\n tick: function tick() {\n // should not start counting in server\n // see: https://github.com/vant-ui/vant/issues/7807\n if (!inBrowser) {\n return;\n }\n\n if (this.millisecond) {\n this.microTick();\n } else {\n this.macroTick();\n }\n },\n microTick: function microTick() {\n var _this = this;\n\n this.rafId = raf(function () {\n /* istanbul ignore if */\n // in case of call reset immediately after finish\n if (!_this.counting) {\n return;\n }\n\n _this.setRemain(_this.getRemain());\n\n if (_this.remain > 0) {\n _this.microTick();\n }\n });\n },\n macroTick: function macroTick() {\n var _this2 = this;\n\n this.rafId = raf(function () {\n /* istanbul ignore if */\n // in case of call reset immediately after finish\n if (!_this2.counting) {\n return;\n }\n\n var remain = _this2.getRemain();\n\n if (!isSameSecond(remain, _this2.remain) || remain === 0) {\n _this2.setRemain(remain);\n }\n\n if (_this2.remain > 0) {\n _this2.macroTick();\n }\n });\n },\n getRemain: function getRemain() {\n return Math.max(this.endTime - Date.now(), 0);\n },\n setRemain: function setRemain(remain) {\n this.remain = remain;\n this.$emit('change', this.timeData);\n\n if (remain === 0) {\n this.pause();\n this.$emit('finish');\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [this.slots('default', this.timeData) || this.formattedTime]);\n }\n});","import { createNamespace } from '../utils';\nimport { RED } from '../utils/constant';\nimport { padZero } from '../utils/format/string';\nimport Checkbox from '../checkbox';\n\nvar _createNamespace = createNamespace('coupon'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction formatTimeStamp(timeStamp) {\n // compatible when the timestamp is seconds\n if (timeStamp < Math.pow(10, 12)) {\n return timeStamp * 1000;\n }\n\n return +timeStamp;\n}\n\nfunction getDate(timeStamp) {\n var date = new Date(formatTimeStamp(timeStamp));\n return date.getFullYear() + \".\" + padZero(date.getMonth() + 1) + \".\" + padZero(date.getDate());\n}\n\nfunction formatDiscount(discount) {\n return (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);\n}\n\nfunction formatAmount(amount) {\n return (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);\n}\n\nexport default createComponent({\n props: {\n coupon: Object,\n chosen: Boolean,\n disabled: Boolean,\n currency: {\n type: String,\n default: '¥'\n }\n },\n computed: {\n validPeriod: function validPeriod() {\n var _this$coupon = this.coupon,\n startAt = _this$coupon.startAt,\n endAt = _this$coupon.endAt,\n customValidPeriod = _this$coupon.customValidPeriod;\n return customValidPeriod || getDate(startAt) + \" - \" + getDate(endAt);\n },\n faceAmount: function faceAmount() {\n var coupon = this.coupon;\n\n if (coupon.valueDesc) {\n return coupon.valueDesc + \"\" + (coupon.unitDesc || '') + \"\";\n }\n\n if (coupon.denominations) {\n var denominations = formatAmount(coupon.denominations);\n return \"\" + this.currency + \" \" + denominations;\n }\n\n if (coupon.discount) {\n return t('discount', formatDiscount(coupon.discount));\n }\n\n return '';\n },\n conditionMessage: function conditionMessage() {\n var condition = formatAmount(this.coupon.originCondition);\n return condition === '0' ? t('unlimited') : t('condition', condition);\n }\n },\n render: function render() {\n var h = arguments[0];\n var coupon = this.coupon,\n disabled = this.disabled;\n var description = disabled && coupon.reason || coupon.description;\n return h(\"div\", {\n \"class\": bem({\n disabled: disabled\n })\n }, [h(\"div\", {\n \"class\": bem('content')\n }, [h(\"div\", {\n \"class\": bem('head')\n }, [h(\"h2\", {\n \"class\": bem('amount'),\n \"domProps\": {\n \"innerHTML\": this.faceAmount\n }\n }), h(\"p\", {\n \"class\": bem('condition')\n }, [this.coupon.condition || this.conditionMessage])]), h(\"div\", {\n \"class\": bem('body')\n }, [h(\"p\", {\n \"class\": bem('name')\n }, [coupon.name]), h(\"p\", {\n \"class\": bem('valid')\n }, [this.validPeriod]), !this.disabled && h(Checkbox, {\n \"attrs\": {\n \"size\": 18,\n \"value\": this.chosen,\n \"checkedColor\": RED\n },\n \"class\": bem('corner')\n })])]), description && h(\"p\", {\n \"class\": bem('description')\n }, [description])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { inherit } from '../utils/functional'; // Components\n\nimport Cell from '../cell'; // Types\n\nvar _createNamespace = createNamespace('coupon-cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction formatValue(props) {\n var coupons = props.coupons,\n chosenCoupon = props.chosenCoupon,\n currency = props.currency;\n var coupon = coupons[+chosenCoupon];\n\n if (coupon) {\n var value = 0;\n\n if (isDef(coupon.value)) {\n value = coupon.value;\n } else if (isDef(coupon.denominations)) {\n value = coupon.denominations;\n }\n\n return \"-\" + currency + \" \" + (value / 100).toFixed(2);\n }\n\n return coupons.length === 0 ? t('tips') : t('count', coupons.length);\n}\n\nfunction CouponCell(h, props, slots, ctx) {\n var selected = props.coupons[+props.chosenCoupon];\n var value = formatValue(props);\n return h(Cell, _mergeJSXProps([{\n \"class\": bem(),\n \"attrs\": {\n \"value\": value,\n \"title\": props.title || t('title'),\n \"border\": props.border,\n \"isLink\": props.editable,\n \"valueClass\": bem('value', {\n selected: selected\n })\n }\n }, inherit(ctx, true)]));\n}\n\nCouponCell.model = {\n prop: 'chosenCoupon'\n};\nCouponCell.props = {\n title: String,\n coupons: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n currency: {\n type: String,\n default: '¥'\n },\n border: {\n type: Boolean,\n default: true\n },\n editable: {\n type: Boolean,\n default: true\n },\n chosenCoupon: {\n type: [Number, String],\n default: -1\n }\n};\nexport default createComponent(CouponCell);","// Utils\nimport { createNamespace } from '../utils'; // Components\n\nimport Tab from '../tab';\nimport Tabs from '../tabs';\nimport Field from '../field';\nimport Button from '../button';\nimport Coupon from '../coupon';\n\nvar _createNamespace = createNamespace('coupon-list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nvar EMPTY_IMAGE = 'https://img01.yzcdn.cn/vant/coupon-empty.png';\nexport default createComponent({\n model: {\n prop: 'code'\n },\n props: {\n code: String,\n closeButtonText: String,\n inputPlaceholder: String,\n enabledTitle: String,\n disabledTitle: String,\n exchangeButtonText: String,\n exchangeButtonLoading: Boolean,\n exchangeButtonDisabled: Boolean,\n exchangeMinLength: {\n type: Number,\n default: 1\n },\n chosenCoupon: {\n type: Number,\n default: -1\n },\n coupons: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n disabledCoupons: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n displayedCouponIndex: {\n type: Number,\n default: -1\n },\n showExchangeBar: {\n type: Boolean,\n default: true\n },\n showCloseButton: {\n type: Boolean,\n default: true\n },\n showCount: {\n type: Boolean,\n default: true\n },\n currency: {\n type: String,\n default: '¥'\n },\n emptyImage: {\n type: String,\n default: EMPTY_IMAGE\n }\n },\n data: function data() {\n return {\n tab: 0,\n winHeight: window.innerHeight,\n currentCode: this.code || ''\n };\n },\n computed: {\n buttonDisabled: function buttonDisabled() {\n return !this.exchangeButtonLoading && (this.exchangeButtonDisabled || !this.currentCode || this.currentCode.length < this.exchangeMinLength);\n },\n listStyle: function listStyle() {\n return {\n height: this.winHeight - (this.showExchangeBar ? 140 : 94) + 'px'\n };\n }\n },\n watch: {\n code: function code(_code) {\n this.currentCode = _code;\n },\n currentCode: function currentCode(code) {\n this.$emit('input', code);\n },\n displayedCouponIndex: 'scrollToShowCoupon'\n },\n mounted: function mounted() {\n this.scrollToShowCoupon(this.displayedCouponIndex);\n },\n methods: {\n onClickExchangeButton: function onClickExchangeButton() {\n this.$emit('exchange', this.currentCode); // auto clear currentCode when not use vModel\n\n if (!this.code) {\n this.currentCode = '';\n }\n },\n // scroll to show specific coupon\n scrollToShowCoupon: function scrollToShowCoupon(index) {\n var _this = this;\n\n if (index === -1) {\n return;\n }\n\n this.$nextTick(function () {\n var _this$$refs = _this.$refs,\n card = _this$$refs.card,\n list = _this$$refs.list;\n /* istanbul ignore next */\n\n if (list && card && card[index]) {\n list.scrollTop = card[index].$el.offsetTop - 100;\n }\n });\n },\n genEmpty: function genEmpty() {\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": bem('empty')\n }, [h(\"img\", {\n \"attrs\": {\n \"src\": this.emptyImage\n }\n }), h(\"p\", [t('empty')])]);\n },\n genExchangeButton: function genExchangeButton() {\n var h = this.$createElement;\n return h(Button, {\n \"attrs\": {\n \"plain\": true,\n \"type\": \"danger\",\n \"text\": this.exchangeButtonText || t('exchange'),\n \"loading\": this.exchangeButtonLoading,\n \"disabled\": this.buttonDisabled\n },\n \"class\": bem('exchange'),\n \"on\": {\n \"click\": this.onClickExchangeButton\n }\n });\n }\n },\n render: function render() {\n var _this2 = this;\n\n var h = arguments[0];\n var coupons = this.coupons,\n disabledCoupons = this.disabledCoupons;\n var count = this.showCount ? \" (\" + coupons.length + \")\" : '';\n var title = (this.enabledTitle || t('enable')) + count;\n var disabledCount = this.showCount ? \" (\" + disabledCoupons.length + \")\" : '';\n var disabledTitle = (this.disabledTitle || t('disabled')) + disabledCount;\n var ExchangeBar = this.showExchangeBar && h(\"div\", {\n \"class\": bem('exchange-bar')\n }, [h(Field, {\n \"attrs\": {\n \"clearable\": true,\n \"border\": false,\n \"placeholder\": this.inputPlaceholder || t('placeholder'),\n \"maxlength\": \"20\"\n },\n \"class\": bem('field'),\n \"model\": {\n value: _this2.currentCode,\n callback: function callback($$v) {\n _this2.currentCode = $$v;\n }\n }\n }), this.genExchangeButton()]);\n\n var onChange = function onChange(index) {\n return function () {\n return _this2.$emit('change', index);\n };\n };\n\n var CouponTab = h(Tab, {\n \"attrs\": {\n \"title\": title\n }\n }, [h(\"div\", {\n \"class\": bem('list', {\n 'with-bottom': this.showCloseButton\n }),\n \"style\": this.listStyle\n }, [coupons.map(function (coupon, index) {\n return h(Coupon, {\n \"ref\": \"card\",\n \"key\": coupon.id,\n \"attrs\": {\n \"coupon\": coupon,\n \"currency\": _this2.currency,\n \"chosen\": index === _this2.chosenCoupon\n },\n \"nativeOn\": {\n \"click\": onChange(index)\n }\n });\n }), !coupons.length && this.genEmpty(), this.slots('list-footer')])]);\n var DisabledCouponTab = h(Tab, {\n \"attrs\": {\n \"title\": disabledTitle\n }\n }, [h(\"div\", {\n \"class\": bem('list', {\n 'with-bottom': this.showCloseButton\n }),\n \"style\": this.listStyle\n }, [disabledCoupons.map(function (coupon) {\n return h(Coupon, {\n \"attrs\": {\n \"disabled\": true,\n \"coupon\": coupon,\n \"currency\": _this2.currency\n },\n \"key\": coupon.id\n });\n }), !disabledCoupons.length && this.genEmpty(), this.slots('disabled-list-footer')])]);\n return h(\"div\", {\n \"class\": bem()\n }, [ExchangeBar, h(Tabs, {\n \"class\": bem('tab'),\n \"attrs\": {\n \"border\": false\n },\n \"model\": {\n value: _this2.tab,\n callback: function callback($$v) {\n _this2.tab = $$v;\n }\n }\n }, [CouponTab, DisabledCouponTab]), h(\"div\", {\n \"class\": bem('bottom')\n }, [h(Button, {\n \"directives\": [{\n name: \"show\",\n value: this.showCloseButton\n }],\n \"attrs\": {\n \"round\": true,\n \"type\": \"danger\",\n \"block\": true,\n \"text\": this.closeButtonText || t('close')\n },\n \"class\": bem('close'),\n \"on\": {\n \"click\": onChange(-1)\n }\n })])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { times } from './utils';\nimport { padZero } from '../utils/format/string';\nimport { pickerProps } from '../picker/shared';\nimport Picker from '../picker';\nexport var sharedProps = _extends({}, pickerProps, {\n value: null,\n filter: Function,\n columnsOrder: Array,\n showToolbar: {\n type: Boolean,\n default: true\n },\n formatter: {\n type: Function,\n default: function _default(type, value) {\n return value;\n }\n }\n});\nexport var TimePickerMixin = {\n data: function data() {\n return {\n innerValue: this.formatValue(this.value)\n };\n },\n computed: {\n originColumns: function originColumns() {\n var _this = this;\n\n return this.ranges.map(function (_ref) {\n var type = _ref.type,\n rangeArr = _ref.range;\n var values = times(rangeArr[1] - rangeArr[0] + 1, function (index) {\n var value = padZero(rangeArr[0] + index);\n return value;\n });\n\n if (_this.filter) {\n values = _this.filter(type, values);\n }\n\n return {\n type: type,\n values: values\n };\n });\n },\n columns: function columns() {\n var _this2 = this;\n\n return this.originColumns.map(function (column) {\n return {\n values: column.values.map(function (value) {\n return _this2.formatter(column.type, value);\n })\n };\n });\n }\n },\n watch: {\n columns: 'updateColumnValue',\n innerValue: function innerValue(val, oldVal) {\n if (!oldVal) {\n this.$emit('input', null);\n } else {\n this.$emit('input', val);\n }\n }\n },\n mounted: function mounted() {\n var _this3 = this;\n\n this.updateColumnValue();\n this.$nextTick(function () {\n _this3.updateInnerValue();\n });\n },\n methods: {\n getPicker: function getPicker() {\n return this.$refs.picker;\n },\n // https://github.com/vant-ui/vant/issues/10013\n getProxiedPicker: function getProxiedPicker() {\n var _this4 = this;\n\n var picker = this.$refs.picker;\n\n if (picker) {\n var proxy = function proxy(fn) {\n return function () {\n picker[fn].apply(picker, arguments);\n\n _this4.updateInnerValue();\n };\n };\n\n return _extends({}, picker, {\n setValues: proxy('setValues'),\n setIndexes: proxy('setIndexes'),\n setColumnIndex: proxy('setColumnIndex'),\n setColumnValue: proxy('setColumnValue')\n });\n }\n },\n onConfirm: function onConfirm() {\n this.$emit('input', this.innerValue);\n this.$emit('confirm', this.innerValue);\n },\n onCancel: function onCancel() {\n this.$emit('cancel');\n }\n },\n render: function render() {\n var _this5 = this;\n\n var h = arguments[0];\n var props = {};\n Object.keys(pickerProps).forEach(function (key) {\n props[key] = _this5[key];\n });\n return h(Picker, {\n \"ref\": \"picker\",\n \"attrs\": {\n \"columns\": this.columns,\n \"readonly\": this.readonly\n },\n \"scopedSlots\": this.$scopedSlots,\n \"on\": {\n \"change\": this.onChange,\n \"confirm\": this.onConfirm,\n \"cancel\": this.onCancel\n },\n \"props\": _extends({}, props)\n });\n }\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { padZero } from '../utils/format/string';\nimport { range } from '../utils/format/number';\nimport { sharedProps, TimePickerMixin } from './shared';\n\nvar _createNamespace = createNamespace('time-picker'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n mixins: [TimePickerMixin],\n props: _extends({}, sharedProps, {\n minHour: {\n type: [Number, String],\n default: 0\n },\n maxHour: {\n type: [Number, String],\n default: 23\n },\n minMinute: {\n type: [Number, String],\n default: 0\n },\n maxMinute: {\n type: [Number, String],\n default: 59\n }\n }),\n computed: {\n ranges: function ranges() {\n return [{\n type: 'hour',\n range: [+this.minHour, +this.maxHour]\n }, {\n type: 'minute',\n range: [+this.minMinute, +this.maxMinute]\n }];\n }\n },\n watch: {\n filter: 'updateInnerValue',\n minHour: function minHour() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.updateInnerValue();\n });\n },\n maxHour: function maxHour(value) {\n var _this$innerValue$spli = this.innerValue.split(':'),\n hour = _this$innerValue$spli[0],\n minute = _this$innerValue$spli[1];\n\n if (hour >= value) {\n this.innerValue = this.formatValue(value + \":\" + minute);\n this.updateColumnValue();\n } else {\n this.updateInnerValue();\n }\n },\n minMinute: 'updateInnerValue',\n maxMinute: function maxMinute(value) {\n var _this$innerValue$spli2 = this.innerValue.split(':'),\n hour = _this$innerValue$spli2[0],\n minute = _this$innerValue$spli2[1];\n\n if (minute >= value) {\n this.innerValue = this.formatValue(hour + \":\" + value);\n this.updateColumnValue();\n } else {\n this.updateInnerValue();\n }\n },\n value: function value(val) {\n val = this.formatValue(val);\n\n if (val !== this.innerValue) {\n this.innerValue = val;\n this.updateColumnValue();\n }\n }\n },\n methods: {\n formatValue: function formatValue(value) {\n if (!value) {\n value = padZero(this.minHour) + \":\" + padZero(this.minMinute);\n }\n\n var _value$split = value.split(':'),\n hour = _value$split[0],\n minute = _value$split[1];\n\n hour = padZero(range(hour, this.minHour, this.maxHour));\n minute = padZero(range(minute, this.minMinute, this.maxMinute));\n return hour + \":\" + minute;\n },\n updateInnerValue: function updateInnerValue() {\n var _this$getPicker$getIn = this.getPicker().getIndexes(),\n hourIndex = _this$getPicker$getIn[0],\n minuteIndex = _this$getPicker$getIn[1];\n\n var _this$originColumns = this.originColumns,\n hourColumn = _this$originColumns[0],\n minuteColumn = _this$originColumns[1];\n var hour = hourColumn.values[hourIndex] || hourColumn.values[0];\n var minute = minuteColumn.values[minuteIndex] || minuteColumn.values[0];\n this.innerValue = this.formatValue(hour + \":\" + minute);\n this.updateColumnValue();\n },\n onChange: function onChange(picker) {\n var _this2 = this;\n\n this.updateInnerValue();\n this.$nextTick(function () {\n _this2.$nextTick(function () {\n // https://github.com/vant-ui/vant/issues/9775\n _this2.updateInnerValue();\n\n _this2.$emit('change', picker);\n });\n });\n },\n updateColumnValue: function updateColumnValue() {\n var _this3 = this;\n\n var formatter = this.formatter;\n var pair = this.innerValue.split(':');\n var values = [formatter('hour', pair[0]), formatter('minute', pair[1])];\n this.$nextTick(function () {\n _this3.getPicker().setValues(values);\n });\n }\n }\n});","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import _construct from \"@babel/runtime/helpers/esm/construct\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { isDate } from '../utils/validate/date';\nimport { padZero } from '../utils/format/string';\nimport { getTrueValue, getMonthEndDay } from './utils';\nimport { sharedProps, TimePickerMixin } from './shared';\nvar currentYear = new Date().getFullYear();\n\nvar _createNamespace = createNamespace('date-picker'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n mixins: [TimePickerMixin],\n props: _extends({}, sharedProps, {\n type: {\n type: String,\n default: 'datetime'\n },\n minDate: {\n type: Date,\n default: function _default() {\n return new Date(currentYear - 10, 0, 1);\n },\n validator: isDate\n },\n maxDate: {\n type: Date,\n default: function _default() {\n return new Date(currentYear + 10, 11, 31);\n },\n validator: isDate\n }\n }),\n watch: {\n filter: 'updateInnerValue',\n minDate: function minDate() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.updateInnerValue();\n });\n },\n maxDate: function maxDate(value) {\n if (this.innerValue.valueOf() >= value.valueOf()) {\n this.innerValue = value;\n } else {\n this.updateInnerValue();\n }\n },\n value: function value(val) {\n val = this.formatValue(val);\n\n if (val && val.valueOf() !== this.innerValue.valueOf()) {\n this.innerValue = val;\n }\n }\n },\n computed: {\n ranges: function ranges() {\n var _this$getBoundary = this.getBoundary('max', this.innerValue ? this.innerValue : this.minDate),\n maxYear = _this$getBoundary.maxYear,\n maxDate = _this$getBoundary.maxDate,\n maxMonth = _this$getBoundary.maxMonth,\n maxHour = _this$getBoundary.maxHour,\n maxMinute = _this$getBoundary.maxMinute;\n\n var _this$getBoundary2 = this.getBoundary('min', this.innerValue ? this.innerValue : this.minDate),\n minYear = _this$getBoundary2.minYear,\n minDate = _this$getBoundary2.minDate,\n minMonth = _this$getBoundary2.minMonth,\n minHour = _this$getBoundary2.minHour,\n minMinute = _this$getBoundary2.minMinute;\n\n var result = [{\n type: 'year',\n range: [minYear, maxYear]\n }, {\n type: 'month',\n range: [minMonth, maxMonth]\n }, {\n type: 'day',\n range: [minDate, maxDate]\n }, {\n type: 'hour',\n range: [minHour, maxHour]\n }, {\n type: 'minute',\n range: [minMinute, maxMinute]\n }];\n\n switch (this.type) {\n case 'date':\n result = result.slice(0, 3);\n break;\n\n case 'year-month':\n result = result.slice(0, 2);\n break;\n\n case 'month-day':\n result = result.slice(1, 3);\n break;\n\n case 'datehour':\n result = result.slice(0, 4);\n break;\n }\n\n if (this.columnsOrder) {\n var columnsOrder = this.columnsOrder.concat(result.map(function (column) {\n return column.type;\n }));\n result.sort(function (a, b) {\n return columnsOrder.indexOf(a.type) - columnsOrder.indexOf(b.type);\n });\n }\n\n return result;\n }\n },\n methods: {\n formatValue: function formatValue(value) {\n var _this2 = this;\n\n if (!isDate(value)) {\n return null;\n }\n\n var minDate = new Date(this.minDate);\n var maxDate = new Date(this.maxDate);\n var dateMethods = {\n year: 'getFullYear',\n month: 'getMonth',\n day: 'getDate',\n hour: 'getHours',\n minute: 'getMinutes'\n };\n\n if (this.originColumns) {\n var dateColumns = this.originColumns.map(function (_ref, index) {\n var type = _ref.type,\n values = _ref.values;\n var range = _this2.ranges[index].range;\n var minDateVal = minDate[dateMethods[type]]();\n var maxDateVal = maxDate[dateMethods[type]]();\n var min = type === 'month' ? +values[0] - 1 : +values[0];\n var max = type === 'month' ? +values[values.length - 1] - 1 : +values[values.length - 1];\n return {\n type: type,\n values: [minDateVal < range[0] ? Math.max(minDateVal, min) : min || minDateVal, maxDateVal > range[1] ? Math.min(maxDateVal, max) : max || maxDateVal]\n };\n });\n\n if (this.type === 'month-day') {\n var year = (this.innerValue || this.minDate).getFullYear();\n dateColumns.unshift({\n type: 'year',\n values: [year, year]\n });\n }\n\n var dates = Object.keys(dateMethods).map(function (type) {\n var _dateColumns$filter$;\n\n return (_dateColumns$filter$ = dateColumns.filter(function (item) {\n return item.type === type;\n })[0]) == null ? void 0 : _dateColumns$filter$.values;\n }).filter(function (item) {\n return item;\n });\n minDate = _construct(Date, dates.map(function (val) {\n return getTrueValue(val[0]);\n }));\n maxDate = _construct(Date, dates.map(function (val) {\n return getTrueValue(val[1]);\n }));\n }\n\n value = Math.max(value, minDate.getTime());\n value = Math.min(value, maxDate.getTime());\n return new Date(value);\n },\n getBoundary: function getBoundary(type, value) {\n var _ref2;\n\n var boundary = this[type + \"Date\"];\n var year = boundary.getFullYear();\n var month = 1;\n var date = 1;\n var hour = 0;\n var minute = 0;\n\n if (type === 'max') {\n month = 12;\n date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);\n hour = 23;\n minute = 59;\n }\n\n if (value.getFullYear() === year) {\n month = boundary.getMonth() + 1;\n\n if (value.getMonth() + 1 === month) {\n date = boundary.getDate();\n\n if (value.getDate() === date) {\n hour = boundary.getHours();\n\n if (value.getHours() === hour) {\n minute = boundary.getMinutes();\n }\n }\n }\n }\n\n return _ref2 = {}, _ref2[type + \"Year\"] = year, _ref2[type + \"Month\"] = month, _ref2[type + \"Date\"] = date, _ref2[type + \"Hour\"] = hour, _ref2[type + \"Minute\"] = minute, _ref2;\n },\n updateInnerValue: function updateInnerValue() {\n var _this3 = this;\n\n var type = this.type;\n var indexes = this.getPicker().getIndexes();\n\n var getValue = function getValue(type) {\n var index = 0;\n\n _this3.originColumns.forEach(function (column, columnIndex) {\n if (type === column.type) {\n index = columnIndex;\n }\n });\n\n var values = _this3.originColumns[index].values;\n return getTrueValue(values[indexes[index]]);\n };\n\n var year;\n var month;\n var day;\n\n if (type === 'month-day') {\n year = (this.innerValue || this.minDate).getFullYear();\n month = getValue('month');\n day = getValue('day');\n } else {\n year = getValue('year');\n month = getValue('month');\n day = type === 'year-month' ? 1 : getValue('day');\n }\n\n var maxDay = getMonthEndDay(year, month);\n day = day > maxDay ? maxDay : day;\n var hour = 0;\n var minute = 0;\n\n if (type === 'datehour') {\n hour = getValue('hour');\n }\n\n if (type === 'datetime') {\n hour = getValue('hour');\n minute = getValue('minute');\n }\n\n var value = new Date(year, month - 1, day, hour, minute);\n this.innerValue = this.formatValue(value);\n },\n onChange: function onChange(picker) {\n var _this4 = this;\n\n this.updateInnerValue();\n this.$nextTick(function () {\n _this4.$nextTick(function () {\n // https://github.com/vant-ui/vant/issues/9775\n _this4.updateInnerValue();\n\n _this4.$emit('change', picker);\n });\n });\n },\n updateColumnValue: function updateColumnValue() {\n var _this5 = this;\n\n var value = this.innerValue ? this.innerValue : this.minDate;\n var formatter = this.formatter;\n var values = this.originColumns.map(function (column) {\n switch (column.type) {\n case 'year':\n return formatter('year', \"\" + value.getFullYear());\n\n case 'month':\n return formatter('month', padZero(value.getMonth() + 1));\n\n case 'day':\n return formatter('day', padZero(value.getDate()));\n\n case 'hour':\n return formatter('hour', padZero(value.getHours()));\n\n case 'minute':\n return formatter('minute', padZero(value.getMinutes()));\n\n default:\n // no default\n return null;\n }\n });\n this.$nextTick(function () {\n _this5.getPicker().setValues(values);\n });\n }\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport TimePicker from './TimePicker';\nimport DatePicker from './DatePicker';\n\nvar _createNamespace = createNamespace('datetime-picker'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: _extends({}, TimePicker.props, DatePicker.props),\n methods: {\n // @exposed-api\n getPicker: function getPicker() {\n return this.$refs.root.getProxiedPicker();\n }\n },\n render: function render() {\n var h = arguments[0];\n var Component = this.type === 'time' ? TimePicker : DatePicker;\n return h(Component, {\n \"ref\": \"root\",\n \"class\": bem(),\n \"scopedSlots\": this.$scopedSlots,\n \"props\": _extends({}, this.$props),\n \"on\": _extends({}, this.$listeners)\n });\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit } from '../utils/functional'; // Types\n\nvar _createNamespace = createNamespace('divider'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Divider(h, props, slots, ctx) {\n var _bem;\n\n return h(\"div\", _mergeJSXProps([{\n \"attrs\": {\n \"role\": \"separator\"\n },\n \"style\": {\n borderColor: props.borderColor\n },\n \"class\": bem((_bem = {\n dashed: props.dashed,\n hairline: props.hairline\n }, _bem[\"content-\" + props.contentPosition] = slots.default, _bem))\n }, inherit(ctx, true)]), [slots.default && slots.default()]);\n}\n\nDivider.props = {\n dashed: Boolean,\n hairline: {\n type: Boolean,\n default: true\n },\n contentPosition: {\n type: String,\n default: 'center'\n }\n};\nexport default createComponent(Divider);","// Utils\nimport { createNamespace } from '../utils';\nimport { on, off } from '../utils/dom/event'; // Mixins\n\nimport { PortalMixin } from '../mixins/portal';\nimport { ChildrenMixin } from '../mixins/relation'; // Components\n\nimport Cell from '../cell';\nimport Icon from '../icon';\nimport Popup from '../popup';\n\nvar _createNamespace = createNamespace('dropdown-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [PortalMixin({\n ref: 'wrapper'\n }), ChildrenMixin('vanDropdownMenu')],\n props: {\n value: null,\n title: String,\n disabled: Boolean,\n titleClass: String,\n options: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n lazyRender: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n transition: true,\n showPopup: false,\n showWrapper: false\n };\n },\n computed: {\n displayTitle: function displayTitle() {\n var _this = this;\n\n if (this.title) {\n return this.title;\n }\n\n var match = this.options.filter(function (option) {\n return option.value === _this.value;\n });\n return match.length ? match[0].text : '';\n }\n },\n watch: {\n showPopup: function showPopup(val) {\n this.bindScroll(val);\n }\n },\n beforeCreate: function beforeCreate() {\n var _this2 = this;\n\n var createEmitter = function createEmitter(eventName) {\n return function () {\n return _this2.$emit(eventName);\n };\n };\n\n this.onOpen = createEmitter('open');\n this.onClose = createEmitter('close');\n this.onOpened = createEmitter('opened');\n },\n methods: {\n // @exposed-api\n toggle: function toggle(show, options) {\n if (show === void 0) {\n show = !this.showPopup;\n }\n\n if (options === void 0) {\n options = {};\n }\n\n if (show === this.showPopup) {\n return;\n }\n\n this.transition = !options.immediate;\n this.showPopup = show;\n\n if (show) {\n this.parent.updateOffset();\n this.showWrapper = true;\n }\n },\n bindScroll: function bindScroll(bind) {\n var scroller = this.parent.scroller;\n var action = bind ? on : off;\n action(scroller, 'scroll', this.onScroll, true);\n },\n onScroll: function onScroll() {\n this.parent.updateOffset();\n },\n onClickWrapper: function onClickWrapper(event) {\n // prevent being identified as clicking outside and closed when use get-contaienr\n if (this.getContainer) {\n event.stopPropagation();\n }\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n var _this$parent = this.parent,\n zIndex = _this$parent.zIndex,\n offset = _this$parent.offset,\n overlay = _this$parent.overlay,\n duration = _this$parent.duration,\n direction = _this$parent.direction,\n activeColor = _this$parent.activeColor,\n closeOnClickOverlay = _this$parent.closeOnClickOverlay;\n var Options = this.options.map(function (option) {\n var active = option.value === _this3.value;\n return h(Cell, {\n \"attrs\": {\n \"clickable\": true,\n \"icon\": option.icon,\n \"title\": option.text\n },\n \"key\": option.value,\n \"class\": bem('option', {\n active: active\n }),\n \"style\": {\n color: active ? activeColor : ''\n },\n \"on\": {\n \"click\": function click() {\n _this3.showPopup = false;\n\n if (option.value !== _this3.value) {\n _this3.$emit('input', option.value);\n\n _this3.$emit('change', option.value);\n }\n }\n }\n }, [active && h(Icon, {\n \"class\": bem('icon'),\n \"attrs\": {\n \"color\": activeColor,\n \"name\": \"success\"\n }\n })]);\n });\n var style = {\n zIndex: zIndex\n };\n\n if (direction === 'down') {\n style.top = offset + \"px\";\n } else {\n style.bottom = offset + \"px\";\n }\n\n return h(\"div\", [h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.showWrapper\n }],\n \"ref\": \"wrapper\",\n \"style\": style,\n \"class\": bem([direction]),\n \"on\": {\n \"click\": this.onClickWrapper\n }\n }, [h(Popup, {\n \"attrs\": {\n \"overlay\": overlay,\n \"position\": direction === 'down' ? 'top' : 'bottom',\n \"duration\": this.transition ? duration : 0,\n \"lazyRender\": this.lazyRender,\n \"overlayStyle\": {\n position: 'absolute'\n },\n \"closeOnClickOverlay\": closeOnClickOverlay\n },\n \"class\": bem('content'),\n \"on\": {\n \"open\": this.onOpen,\n \"close\": this.onClose,\n \"opened\": this.onOpened,\n \"closed\": function closed() {\n _this3.showWrapper = false;\n\n _this3.$emit('closed');\n }\n },\n \"model\": {\n value: _this3.showPopup,\n callback: function callback($$v) {\n _this3.showPopup = $$v;\n }\n }\n }, [Options, this.slots('default')])])]);\n }\n});","/**\n * Listen to click outside event\n */\nimport { on, off } from '../utils/dom/event';\nexport var ClickOutsideMixin = function ClickOutsideMixin(config) {\n return {\n props: {\n closeOnClickOutside: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n var _this = this;\n\n var clickOutsideHandler = function clickOutsideHandler(event) {\n if (_this.closeOnClickOutside && !_this.$el.contains(event.target)) {\n _this[config.method]();\n }\n };\n\n return {\n clickOutsideHandler: clickOutsideHandler\n };\n },\n mounted: function mounted() {\n on(document, config.event, this.clickOutsideHandler);\n },\n beforeDestroy: function beforeDestroy() {\n off(document, config.event, this.clickOutsideHandler);\n }\n };\n};","// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { getScroller } from '../utils/dom/scroll'; // Mixins\n\nimport { ParentMixin } from '../mixins/relation';\nimport { ClickOutsideMixin } from '../mixins/click-outside';\n\nvar _createNamespace = createNamespace('dropdown-menu'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanDropdownMenu'), ClickOutsideMixin({\n event: 'click',\n method: 'onClickOutside'\n })],\n props: {\n zIndex: [Number, String],\n activeColor: String,\n overlay: {\n type: Boolean,\n default: true\n },\n duration: {\n type: [Number, String],\n default: 0.2\n },\n direction: {\n type: String,\n default: 'down'\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n offset: 0\n };\n },\n computed: {\n scroller: function scroller() {\n return getScroller(this.$el);\n },\n opened: function opened() {\n return this.children.some(function (item) {\n return item.showWrapper;\n });\n },\n barStyle: function barStyle() {\n if (this.opened && isDef(this.zIndex)) {\n return {\n zIndex: 1 + this.zIndex\n };\n }\n }\n },\n methods: {\n updateOffset: function updateOffset() {\n if (!this.$refs.bar) {\n return;\n }\n\n var rect = this.$refs.bar.getBoundingClientRect();\n\n if (this.direction === 'down') {\n this.offset = rect.bottom;\n } else {\n this.offset = window.innerHeight - rect.top;\n }\n },\n toggleItem: function toggleItem(active) {\n this.children.forEach(function (item, index) {\n if (index === active) {\n item.toggle();\n } else if (item.showPopup) {\n item.toggle(false, {\n immediate: true\n });\n }\n });\n },\n onClickOutside: function onClickOutside() {\n this.children.forEach(function (item) {\n item.toggle(false);\n });\n }\n },\n render: function render() {\n var _this = this;\n\n var h = arguments[0];\n var Titles = this.children.map(function (item, index) {\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": item.disabled ? -1 : 0\n },\n \"class\": bem('item', {\n disabled: item.disabled\n }),\n \"on\": {\n \"click\": function click() {\n if (!item.disabled) {\n _this.toggleItem(index);\n }\n }\n }\n }, [h(\"span\", {\n \"class\": [bem('title', {\n active: item.showPopup,\n down: item.showPopup === (_this.direction === 'down')\n }), item.titleClass],\n \"style\": {\n color: item.showPopup ? _this.activeColor : ''\n }\n }, [h(\"div\", {\n \"class\": \"van-ellipsis\"\n }, [item.slots('title') || item.displayTitle])])]);\n });\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"ref\": \"bar\",\n \"style\": this.barStyle,\n \"class\": bem('bar', {\n opened: this.opened\n })\n }, [Titles]), this.slots('default')]);\n }\n});","var prefix = 'van-empty-network-';\nexport default {\n render: function render() {\n var h = arguments[0];\n\n var genStop = function genStop(color, offset, opacity) {\n return h(\"stop\", {\n \"attrs\": {\n \"stop-color\": color,\n \"offset\": offset + \"%\",\n \"stop-opacity\": opacity\n }\n });\n };\n\n return h(\"svg\", {\n \"attrs\": {\n \"viewBox\": \"0 0 160 160\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n }\n }, [h(\"defs\", [h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"1\",\n \"x1\": \"64.022%\",\n \"y1\": \"100%\",\n \"x2\": \"64.022%\",\n \"y2\": \"0%\"\n }\n }, [genStop('#FFF', 0, 0.5), genStop('#F2F3F5', 100)]), h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"2\",\n \"x1\": \"50%\",\n \"y1\": \"0%\",\n \"x2\": \"50%\",\n \"y2\": \"84.459%\"\n }\n }, [genStop('#EBEDF0', 0), genStop('#DCDEE0', 100, 0)]), h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"3\",\n \"x1\": \"100%\",\n \"y1\": \"0%\",\n \"x2\": \"100%\",\n \"y2\": \"100%\"\n }\n }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"4\",\n \"x1\": \"100%\",\n \"y1\": \"100%\",\n \"x2\": \"100%\",\n \"y2\": \"0%\"\n }\n }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"5\",\n \"x1\": \"0%\",\n \"y1\": \"43.982%\",\n \"x2\": \"100%\",\n \"y2\": \"54.703%\"\n }\n }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h(\"linearGradient\", {\n \"attrs\": {\n \"id\": prefix + \"6\",\n \"x1\": \"94.535%\",\n \"y1\": \"43.837%\",\n \"x2\": \"5.465%\",\n \"y2\": \"54.948%\"\n }\n }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h(\"radialGradient\", {\n \"attrs\": {\n \"id\": prefix + \"7\",\n \"cx\": \"50%\",\n \"cy\": \"0%\",\n \"fx\": \"50%\",\n \"fy\": \"0%\",\n \"r\": \"100%\",\n \"gradientTransform\": \"matrix(0 1 -.54835 0 .5 -.5)\"\n }\n }, [genStop('#EBEDF0', 0), genStop('#FFF', 100, 0)])]), h(\"g\", {\n \"attrs\": {\n \"fill\": \"none\",\n \"fill-rule\": \"evenodd\"\n }\n }, [h(\"g\", {\n \"attrs\": {\n \"opacity\": \".8\"\n }\n }, [h(\"path\", {\n \"attrs\": {\n \"d\": \"M0 124V46h20v20h14v58H0z\",\n \"fill\": \"url(#\" + prefix + \"1)\",\n \"transform\": \"matrix(-1 0 0 1 36 7)\"\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": \"M121 8h22.231v14H152v77.37h-31V8z\",\n \"fill\": \"url(#\" + prefix + \"1)\",\n \"transform\": \"translate(2 7)\"\n }\n })]), h(\"path\", {\n \"attrs\": {\n \"fill\": \"url(#\" + prefix + \"7)\",\n \"d\": \"M0 139h160v21H0z\"\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": \"M37 18a7 7 0 013 13.326v26.742c0 1.23-.997 2.227-2.227 2.227h-1.546A2.227 2.227 0 0134 58.068V31.326A7 7 0 0137 18z\",\n \"fill\": \"url(#\" + prefix + \"2)\",\n \"fill-rule\": \"nonzero\",\n \"transform\": \"translate(43 36)\"\n }\n }), h(\"g\", {\n \"attrs\": {\n \"opacity\": \".6\",\n \"stroke-linecap\": \"round\",\n \"stroke-width\": \"7\"\n }\n }, [h(\"path\", {\n \"attrs\": {\n \"d\": \"M20.875 11.136a18.868 18.868 0 00-5.284 13.121c0 5.094 2.012 9.718 5.284 13.12\",\n \"stroke\": \"url(#\" + prefix + \"3)\",\n \"transform\": \"translate(43 36)\"\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": \"M9.849 0C3.756 6.225 0 14.747 0 24.146c0 9.398 3.756 17.92 9.849 24.145\",\n \"stroke\": \"url(#\" + prefix + \"3)\",\n \"transform\": \"translate(43 36)\"\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": \"M57.625 11.136a18.868 18.868 0 00-5.284 13.121c0 5.094 2.012 9.718 5.284 13.12\",\n \"stroke\": \"url(#\" + prefix + \"4)\",\n \"transform\": \"rotate(-180 76.483 42.257)\"\n }\n }), h(\"path\", {\n \"attrs\": {\n \"d\": \"M73.216 0c-6.093 6.225-9.849 14.747-9.849 24.146 0 9.398 3.756 17.92 9.849 24.145\",\n \"stroke\": \"url(#\" + prefix + \"4)\",\n \"transform\": \"rotate(-180 89.791 42.146)\"\n }\n })]), h(\"g\", {\n \"attrs\": {\n \"transform\": \"translate(31 105)\",\n \"fill-rule\": \"nonzero\"\n }\n }, [h(\"rect\", {\n \"attrs\": {\n \"fill\": \"url(#\" + prefix + \"5)\",\n \"width\": \"98\",\n \"height\": \"34\",\n \"rx\": \"2\"\n }\n }), h(\"rect\", {\n \"attrs\": {\n \"fill\": \"#FFF\",\n \"x\": \"9\",\n \"y\": \"8\",\n \"width\": \"80\",\n \"height\": \"18\",\n \"rx\": \"1.114\"\n }\n }), h(\"rect\", {\n \"attrs\": {\n \"fill\": \"url(#\" + prefix + \"6)\",\n \"x\": \"15\",\n \"y\": \"12\",\n \"width\": \"18\",\n \"height\": \"6\",\n \"rx\": \"1.114\"\n }\n })])])]);\n }\n};","import { addUnit, createNamespace } from '../utils';\nimport Network from './Network';\n\nvar _createNamespace = createNamespace('empty'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar PRESETS = ['error', 'search', 'default'];\nexport default createComponent({\n props: {\n imageSize: [Number, String],\n description: String,\n image: {\n type: String,\n default: 'default'\n }\n },\n methods: {\n genImageContent: function genImageContent() {\n var h = this.$createElement;\n var slots = this.slots('image');\n\n if (slots) {\n return slots;\n }\n\n if (this.image === 'network') {\n return h(Network);\n }\n\n var image = this.image;\n\n if (PRESETS.indexOf(image) !== -1) {\n image = \"https://img01.yzcdn.cn/vant/empty-image-\" + image + \".png\";\n }\n\n return h(\"img\", {\n \"attrs\": {\n \"src\": image\n }\n });\n },\n genImage: function genImage() {\n var h = this.$createElement;\n var imageStyle = {\n width: addUnit(this.imageSize),\n height: addUnit(this.imageSize)\n };\n return h(\"div\", {\n \"class\": bem('image'),\n \"style\": imageStyle\n }, [this.genImageContent()]);\n },\n genDescription: function genDescription() {\n var h = this.$createElement;\n var description = this.slots('description') || this.description;\n\n if (description) {\n return h(\"p\", {\n \"class\": bem('description')\n }, [description]);\n }\n },\n genBottom: function genBottom() {\n var h = this.$createElement;\n var slot = this.slots();\n\n if (slot) {\n return h(\"div\", {\n \"class\": bem('bottom')\n }, [slot]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [this.genImage(), this.genDescription(), this.genBottom()]);\n }\n});","import { createNamespace } from '../utils';\nimport { sortChildren } from '../utils/vnodes';\n\nvar _createNamespace = createNamespace('form'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n colon: Boolean,\n disabled: Boolean,\n readonly: Boolean,\n labelWidth: [Number, String],\n labelAlign: String,\n inputAlign: String,\n scrollToError: Boolean,\n validateFirst: Boolean,\n errorMessageAlign: String,\n submitOnEnter: {\n type: Boolean,\n default: true\n },\n validateTrigger: {\n type: String,\n default: 'onBlur'\n },\n showError: {\n type: Boolean,\n default: true\n },\n showErrorMessage: {\n type: Boolean,\n default: true\n }\n },\n provide: function provide() {\n return {\n vanForm: this\n };\n },\n data: function data() {\n return {\n fields: []\n };\n },\n methods: {\n getFieldsByNames: function getFieldsByNames(names) {\n if (names) {\n return this.fields.filter(function (field) {\n return names.indexOf(field.name) !== -1;\n });\n }\n\n return this.fields;\n },\n validateSeq: function validateSeq(names) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n var errors = [];\n\n var fields = _this.getFieldsByNames(names);\n\n fields.reduce(function (promise, field) {\n return promise.then(function () {\n if (!errors.length) {\n return field.validate().then(function (error) {\n if (error) {\n errors.push(error);\n }\n });\n }\n });\n }, Promise.resolve()).then(function () {\n if (errors.length) {\n reject(errors);\n } else {\n resolve();\n }\n });\n });\n },\n validateFields: function validateFields(names) {\n var _this2 = this;\n\n return new Promise(function (resolve, reject) {\n var fields = _this2.getFieldsByNames(names);\n\n Promise.all(fields.map(function (item) {\n return item.validate();\n })).then(function (errors) {\n errors = errors.filter(function (item) {\n return item;\n });\n\n if (errors.length) {\n reject(errors);\n } else {\n resolve();\n }\n });\n });\n },\n // @exposed-api\n validate: function validate(name) {\n if (name && !Array.isArray(name)) {\n return this.validateField(name);\n }\n\n return this.validateFirst ? this.validateSeq(name) : this.validateFields(name);\n },\n validateField: function validateField(name) {\n var matched = this.fields.filter(function (item) {\n return item.name === name;\n });\n\n if (matched.length) {\n return new Promise(function (resolve, reject) {\n matched[0].validate().then(function (error) {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n return Promise.reject();\n },\n // @exposed-api\n resetValidation: function resetValidation(name) {\n if (name && !Array.isArray(name)) {\n name = [name];\n }\n\n var fields = this.getFieldsByNames(name);\n fields.forEach(function (item) {\n item.resetValidation();\n });\n },\n // @exposed-api\n scrollToField: function scrollToField(name, options) {\n this.fields.some(function (item) {\n if (item.name === name) {\n item.$el.scrollIntoView(options);\n return true;\n }\n\n return false;\n });\n },\n addField: function addField(field) {\n this.fields.push(field);\n sortChildren(this.fields, this);\n },\n removeField: function removeField(field) {\n this.fields = this.fields.filter(function (item) {\n return item !== field;\n });\n },\n getValues: function getValues() {\n return this.fields.reduce(function (form, field) {\n form[field.name] = field.formValue;\n return form;\n }, {});\n },\n onSubmit: function onSubmit(event) {\n event.preventDefault();\n this.submit();\n },\n // @exposed-api\n submit: function submit() {\n var _this3 = this;\n\n var values = this.getValues();\n this.validate().then(function () {\n _this3.$emit('submit', values);\n }).catch(function (errors) {\n _this3.$emit('failed', {\n values: values,\n errors: errors\n });\n\n if (_this3.scrollToError) {\n _this3.scrollToField(errors[0].name);\n }\n });\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"form\", {\n \"class\": bem(),\n \"on\": {\n \"submit\": this.onSubmit\n }\n }, [this.slots()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { route, routeProps } from '../utils/router';\nimport { ChildrenMixin } from '../mixins/relation';\nimport Info from '../info';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('goods-action-icon'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanGoodsAction')],\n props: _extends({}, routeProps, {\n dot: Boolean,\n text: String,\n icon: String,\n color: String,\n // @deprecated\n info: [Number, String],\n badge: [Number, String],\n iconClass: null\n }),\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n route(this.$router, this);\n },\n genIcon: function genIcon() {\n var _this$badge;\n\n var h = this.$createElement;\n var slot = this.slots('icon');\n var info = (_this$badge = this.badge) != null ? _this$badge : this.info;\n\n if (process.env.NODE_ENV === 'development' && this.info) {\n console.warn('[Vant] GoodsActionIcon: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n if (slot) {\n return h(\"div\", {\n \"class\": bem('icon')\n }, [slot, h(Info, {\n \"attrs\": {\n \"dot\": this.dot,\n \"info\": info\n }\n })]);\n }\n\n return h(Icon, {\n \"class\": [bem('icon'), this.iconClass],\n \"attrs\": {\n \"tag\": \"div\",\n \"dot\": this.dot,\n \"name\": this.icon,\n \"badge\": info,\n \"color\": this.color\n }\n });\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": \"0\"\n },\n \"class\": bem(),\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.genIcon(), this.slots() || this.text]);\n }\n});","import { createNamespace, addUnit } from '../utils';\nimport { BORDER_TOP } from '../utils/constant';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('grid'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanGrid')],\n props: {\n square: Boolean,\n gutter: [Number, String],\n iconSize: [Number, String],\n direction: String,\n clickable: Boolean,\n columnNum: {\n type: [Number, String],\n default: 4\n },\n center: {\n type: Boolean,\n default: true\n },\n border: {\n type: Boolean,\n default: true\n }\n },\n computed: {\n style: function style() {\n var gutter = this.gutter;\n\n if (gutter) {\n return {\n paddingLeft: addUnit(gutter)\n };\n }\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n return h(\"div\", {\n \"style\": this.style,\n \"class\": [bem(), (_ref = {}, _ref[BORDER_TOP] = this.border && !this.gutter, _ref)]\n }, [this.slots()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { BORDER } from '../utils/constant';\nimport { route, routeProps } from '../utils/router'; // Mixins\n\nimport { ChildrenMixin } from '../mixins/relation'; // Components\n\nimport Info from '../info';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('grid-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanGrid')],\n props: _extends({}, routeProps, {\n dot: Boolean,\n text: String,\n icon: String,\n iconPrefix: String,\n // @deprecated\n info: [Number, String],\n badge: [Number, String]\n }),\n computed: {\n style: function style() {\n var _this$parent = this.parent,\n square = _this$parent.square,\n gutter = _this$parent.gutter,\n columnNum = _this$parent.columnNum;\n var percent = 100 / columnNum + \"%\";\n var style = {\n flexBasis: percent\n };\n\n if (square) {\n style.paddingTop = percent;\n } else if (gutter) {\n var gutterValue = addUnit(gutter);\n style.paddingRight = gutterValue;\n\n if (this.index >= columnNum) {\n style.marginTop = gutterValue;\n }\n }\n\n return style;\n },\n contentStyle: function contentStyle() {\n var _this$parent2 = this.parent,\n square = _this$parent2.square,\n gutter = _this$parent2.gutter;\n\n if (square && gutter) {\n var gutterValue = addUnit(gutter);\n return {\n right: gutterValue,\n bottom: gutterValue,\n height: 'auto'\n };\n }\n }\n },\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n route(this.$router, this);\n },\n genIcon: function genIcon() {\n var _this$badge;\n\n var h = this.$createElement;\n var iconSlot = this.slots('icon');\n var info = (_this$badge = this.badge) != null ? _this$badge : this.info;\n\n if (process.env.NODE_ENV === 'development' && this.info) {\n console.warn('[Vant] GridItem: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n if (iconSlot) {\n return h(\"div\", {\n \"class\": bem('icon-wrapper')\n }, [iconSlot, h(Info, {\n \"attrs\": {\n \"dot\": this.dot,\n \"info\": info\n }\n })]);\n }\n\n if (this.icon) {\n return h(Icon, {\n \"attrs\": {\n \"name\": this.icon,\n \"dot\": this.dot,\n \"badge\": info,\n \"size\": this.parent.iconSize,\n \"classPrefix\": this.iconPrefix\n },\n \"class\": bem('icon')\n });\n }\n },\n getText: function getText() {\n var h = this.$createElement;\n var textSlot = this.slots('text');\n\n if (textSlot) {\n return textSlot;\n }\n\n if (this.text) {\n return h(\"span\", {\n \"class\": bem('text')\n }, [this.text]);\n }\n },\n genContent: function genContent() {\n var slot = this.slots();\n\n if (slot) {\n return slot;\n }\n\n return [this.genIcon(), this.getText()];\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n var _this$parent3 = this.parent,\n center = _this$parent3.center,\n border = _this$parent3.border,\n square = _this$parent3.square,\n gutter = _this$parent3.gutter,\n direction = _this$parent3.direction,\n clickable = _this$parent3.clickable;\n return h(\"div\", {\n \"class\": [bem({\n square: square\n })],\n \"style\": this.style\n }, [h(\"div\", {\n \"style\": this.contentStyle,\n \"attrs\": {\n \"role\": clickable ? 'button' : null,\n \"tabindex\": clickable ? 0 : null\n },\n \"class\": [bem('content', [direction, {\n center: center,\n square: square,\n clickable: clickable,\n surround: border && gutter\n }]), (_ref = {}, _ref[BORDER] = border, _ref)],\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.genContent()])]);\n }\n});","import { createNamespace } from '../utils';\n\nvar _createNamespace = createNamespace('image-preview'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport { createComponent, bem };","// Utils\nimport { createNamespace } from '../utils';\nimport { isHidden } from '../utils/dom/style';\nimport { preventDefault } from '../utils/dom/event';\nimport { doubleRaf } from '../utils/dom/raf';\nimport { range } from '../utils/format/number'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch';\nimport { ParentMixin } from '../mixins/relation';\nimport { BindEventMixin } from '../mixins/bind-event';\n\nvar _createNamespace = createNamespace('swipe'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [TouchMixin, ParentMixin('vanSwipe'), BindEventMixin(function (bind, isBind) {\n bind(window, 'resize', this.resize, true);\n bind(window, 'orientationchange', this.resize, true);\n bind(window, 'visibilitychange', this.onVisibilityChange);\n\n if (isBind) {\n this.initialize();\n } else {\n this.clear();\n }\n })],\n props: {\n width: [Number, String],\n height: [Number, String],\n autoplay: [Number, String],\n vertical: Boolean,\n lazyRender: Boolean,\n indicatorColor: String,\n loop: {\n type: Boolean,\n default: true\n },\n duration: {\n type: [Number, String],\n default: 500\n },\n touchable: {\n type: Boolean,\n default: true\n },\n initialSwipe: {\n type: [Number, String],\n default: 0\n },\n showIndicators: {\n type: Boolean,\n default: true\n },\n stopPropagation: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n rect: null,\n offset: 0,\n active: 0,\n deltaX: 0,\n deltaY: 0,\n swiping: false,\n computedWidth: 0,\n computedHeight: 0\n };\n },\n watch: {\n children: function children() {\n this.initialize();\n },\n initialSwipe: function initialSwipe() {\n this.initialize();\n },\n autoplay: function autoplay(_autoplay) {\n if (_autoplay > 0) {\n this.autoPlay();\n } else {\n this.clear();\n }\n }\n },\n computed: {\n count: function count() {\n return this.children.length;\n },\n maxCount: function maxCount() {\n return Math.ceil(Math.abs(this.minOffset) / this.size);\n },\n delta: function delta() {\n return this.vertical ? this.deltaY : this.deltaX;\n },\n size: function size() {\n return this[this.vertical ? 'computedHeight' : 'computedWidth'];\n },\n trackSize: function trackSize() {\n return this.count * this.size;\n },\n activeIndicator: function activeIndicator() {\n return (this.active + this.count) % this.count;\n },\n isCorrectDirection: function isCorrectDirection() {\n var expect = this.vertical ? 'vertical' : 'horizontal';\n return this.direction === expect;\n },\n trackStyle: function trackStyle() {\n var style = {\n transitionDuration: (this.swiping ? 0 : this.duration) + \"ms\",\n transform: \"translate\" + (this.vertical ? 'Y' : 'X') + \"(\" + this.offset + \"px)\"\n };\n\n if (this.size) {\n var mainAxis = this.vertical ? 'height' : 'width';\n var crossAxis = this.vertical ? 'width' : 'height';\n style[mainAxis] = this.trackSize + \"px\";\n style[crossAxis] = this[crossAxis] ? this[crossAxis] + \"px\" : '';\n }\n\n return style;\n },\n indicatorStyle: function indicatorStyle() {\n return {\n backgroundColor: this.indicatorColor\n };\n },\n minOffset: function minOffset() {\n return (this.vertical ? this.rect.height : this.rect.width) - this.size * this.count;\n }\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$refs.track);\n },\n methods: {\n // initialize swipe position\n initialize: function initialize(active) {\n if (active === void 0) {\n active = +this.initialSwipe;\n }\n\n if (!this.$el || isHidden(this.$el)) {\n return;\n }\n\n clearTimeout(this.timer);\n var rect = {\n width: this.$el.offsetWidth,\n height: this.$el.offsetHeight\n };\n this.rect = rect;\n this.swiping = true;\n this.active = active;\n this.computedWidth = +this.width || rect.width;\n this.computedHeight = +this.height || rect.height;\n this.offset = this.getTargetOffset(active);\n this.children.forEach(function (swipe) {\n swipe.offset = 0;\n });\n this.autoPlay();\n },\n // @exposed-api\n resize: function resize() {\n this.initialize(this.activeIndicator);\n },\n onVisibilityChange: function onVisibilityChange() {\n if (document.hidden) {\n this.clear();\n } else {\n this.autoPlay();\n }\n },\n onTouchStart: function onTouchStart(event) {\n if (!this.touchable) return;\n this.clear();\n this.touchStartTime = Date.now();\n this.touchStart(event);\n this.correctPosition();\n },\n onTouchMove: function onTouchMove(event) {\n if (!this.touchable || !this.swiping) return;\n this.touchMove(event);\n\n if (this.isCorrectDirection) {\n preventDefault(event, this.stopPropagation);\n this.move({\n offset: this.delta\n });\n }\n },\n onTouchEnd: function onTouchEnd() {\n if (!this.touchable || !this.swiping) return;\n var size = this.size,\n delta = this.delta;\n var duration = Date.now() - this.touchStartTime;\n var speed = delta / duration;\n var shouldSwipe = Math.abs(speed) > 0.25 || Math.abs(delta) > size / 2;\n\n if (shouldSwipe && this.isCorrectDirection) {\n var offset = this.vertical ? this.offsetY : this.offsetX;\n var pace = 0;\n\n if (this.loop) {\n pace = offset > 0 ? delta > 0 ? -1 : 1 : 0;\n } else {\n pace = -Math[delta > 0 ? 'ceil' : 'floor'](delta / size);\n }\n\n this.move({\n pace: pace,\n emitChange: true\n });\n } else if (delta) {\n this.move({\n pace: 0\n });\n }\n\n this.swiping = false;\n this.autoPlay();\n },\n getTargetActive: function getTargetActive(pace) {\n var active = this.active,\n count = this.count,\n maxCount = this.maxCount;\n\n if (pace) {\n if (this.loop) {\n return range(active + pace, -1, count);\n }\n\n return range(active + pace, 0, maxCount);\n }\n\n return active;\n },\n getTargetOffset: function getTargetOffset(targetActive, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n var currentPosition = targetActive * this.size;\n\n if (!this.loop) {\n currentPosition = Math.min(currentPosition, -this.minOffset);\n }\n\n var targetOffset = offset - currentPosition;\n\n if (!this.loop) {\n targetOffset = range(targetOffset, this.minOffset, 0);\n }\n\n return targetOffset;\n },\n move: function move(_ref) {\n var _ref$pace = _ref.pace,\n pace = _ref$pace === void 0 ? 0 : _ref$pace,\n _ref$offset = _ref.offset,\n offset = _ref$offset === void 0 ? 0 : _ref$offset,\n emitChange = _ref.emitChange;\n var loop = this.loop,\n count = this.count,\n active = this.active,\n children = this.children,\n trackSize = this.trackSize,\n minOffset = this.minOffset;\n\n if (count <= 1) {\n return;\n }\n\n var targetActive = this.getTargetActive(pace);\n var targetOffset = this.getTargetOffset(targetActive, offset); // auto move first and last swipe in loop mode\n\n if (loop) {\n if (children[0] && targetOffset !== minOffset) {\n var outRightBound = targetOffset < minOffset;\n children[0].offset = outRightBound ? trackSize : 0;\n }\n\n if (children[count - 1] && targetOffset !== 0) {\n var outLeftBound = targetOffset > 0;\n children[count - 1].offset = outLeftBound ? -trackSize : 0;\n }\n }\n\n this.active = targetActive;\n this.offset = targetOffset;\n\n if (emitChange && targetActive !== active) {\n this.$emit('change', this.activeIndicator);\n }\n },\n // @exposed-api\n prev: function prev() {\n var _this = this;\n\n this.correctPosition();\n this.resetTouchStatus();\n doubleRaf(function () {\n _this.swiping = false;\n\n _this.move({\n pace: -1,\n emitChange: true\n });\n });\n },\n // @exposed-api\n next: function next() {\n var _this2 = this;\n\n this.correctPosition();\n this.resetTouchStatus();\n doubleRaf(function () {\n _this2.swiping = false;\n\n _this2.move({\n pace: 1,\n emitChange: true\n });\n });\n },\n // @exposed-api\n swipeTo: function swipeTo(index, options) {\n var _this3 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n this.correctPosition();\n this.resetTouchStatus();\n doubleRaf(function () {\n var targetIndex;\n\n if (_this3.loop && index === _this3.count) {\n targetIndex = _this3.active === 0 ? 0 : index;\n } else {\n targetIndex = index % _this3.count;\n }\n\n if (options.immediate) {\n doubleRaf(function () {\n _this3.swiping = false;\n });\n } else {\n _this3.swiping = false;\n }\n\n _this3.move({\n pace: targetIndex - _this3.active,\n emitChange: true\n });\n });\n },\n correctPosition: function correctPosition() {\n this.swiping = true;\n\n if (this.active <= -1) {\n this.move({\n pace: this.count\n });\n }\n\n if (this.active >= this.count) {\n this.move({\n pace: -this.count\n });\n }\n },\n clear: function clear() {\n clearTimeout(this.timer);\n },\n autoPlay: function autoPlay() {\n var _this4 = this;\n\n var autoplay = this.autoplay;\n\n if (autoplay > 0 && this.count > 1) {\n this.clear();\n this.timer = setTimeout(function () {\n _this4.next();\n\n _this4.autoPlay();\n }, autoplay);\n }\n },\n genIndicator: function genIndicator() {\n var _this5 = this;\n\n var h = this.$createElement;\n var count = this.count,\n activeIndicator = this.activeIndicator;\n var slot = this.slots('indicator');\n\n if (slot) {\n return slot;\n }\n\n if (this.showIndicators && count > 1) {\n return h(\"div\", {\n \"class\": bem('indicators', {\n vertical: this.vertical\n })\n }, [Array.apply(void 0, Array(count)).map(function (empty, index) {\n return h(\"i\", {\n \"class\": bem('indicator', {\n active: index === activeIndicator\n }),\n \"style\": index === activeIndicator ? _this5.indicatorStyle : null\n });\n })]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"ref\": \"track\",\n \"style\": this.trackStyle,\n \"class\": bem('track', {\n vertical: this.vertical\n })\n }, [this.slots()]), this.genIndicator()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { ChildrenMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('swipe-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanSwipe')],\n data: function data() {\n return {\n offset: 0,\n inited: false,\n mounted: false\n };\n },\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.mounted = true;\n });\n },\n computed: {\n style: function style() {\n var style = {};\n var _this$parent = this.parent,\n size = _this$parent.size,\n vertical = _this$parent.vertical;\n\n if (size) {\n style[vertical ? 'height' : 'width'] = size + \"px\";\n }\n\n if (this.offset) {\n style.transform = \"translate\" + (vertical ? 'Y' : 'X') + \"(\" + this.offset + \"px)\";\n }\n\n return style;\n },\n shouldRender: function shouldRender() {\n var index = this.index,\n inited = this.inited,\n parent = this.parent,\n mounted = this.mounted;\n\n if (!parent.lazyRender || inited) {\n return true;\n } // wait for all item to mount, so we can get the exact count\n\n\n if (!mounted) {\n return false;\n }\n\n var active = parent.activeIndicator;\n var maxActive = parent.count - 1;\n var prevActive = active === 0 && parent.loop ? maxActive : active - 1;\n var nextActive = active === maxActive && parent.loop ? 0 : active + 1;\n var shouldRender = index === active || index === prevActive || index === nextActive;\n\n if (shouldRender) {\n this.inited = true;\n }\n\n return shouldRender;\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem(),\n \"style\": this.style,\n \"on\": _extends({}, this.$listeners)\n }, [this.shouldRender && this.slots()]);\n }\n});","// Utils\nimport { bem } from './shared';\nimport { range } from '../utils/format/number';\nimport { preventDefault } from '../utils/dom/event'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch'; // Component\n\nimport Image from '../image';\nimport Loading from '../loading';\nimport SwipeItem from '../swipe-item';\n\nfunction getDistance(touches) {\n return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));\n}\n\nexport default {\n mixins: [TouchMixin],\n props: {\n src: String,\n show: Boolean,\n active: Number,\n minZoom: [Number, String],\n maxZoom: [Number, String],\n rootWidth: Number,\n rootHeight: Number\n },\n data: function data() {\n return {\n scale: 1,\n moveX: 0,\n moveY: 0,\n moving: false,\n zooming: false,\n imageRatio: 0,\n displayWidth: 0,\n displayHeight: 0\n };\n },\n computed: {\n vertical: function vertical() {\n var rootWidth = this.rootWidth,\n rootHeight = this.rootHeight;\n var rootRatio = rootHeight / rootWidth;\n return this.imageRatio > rootRatio;\n },\n imageStyle: function imageStyle() {\n var scale = this.scale;\n var style = {\n transitionDuration: this.zooming || this.moving ? '0s' : '.3s'\n };\n\n if (scale !== 1) {\n var offsetX = this.moveX / scale;\n var offsetY = this.moveY / scale;\n style.transform = \"scale(\" + scale + \", \" + scale + \") translate(\" + offsetX + \"px, \" + offsetY + \"px)\";\n }\n\n return style;\n },\n maxMoveX: function maxMoveX() {\n if (this.imageRatio) {\n var displayWidth = this.vertical ? this.rootHeight / this.imageRatio : this.rootWidth;\n return Math.max(0, (this.scale * displayWidth - this.rootWidth) / 2);\n }\n\n return 0;\n },\n maxMoveY: function maxMoveY() {\n if (this.imageRatio) {\n var displayHeight = this.vertical ? this.rootHeight : this.rootWidth * this.imageRatio;\n return Math.max(0, (this.scale * displayHeight - this.rootHeight) / 2);\n }\n\n return 0;\n }\n },\n watch: {\n active: 'resetScale',\n show: function show(val) {\n if (!val) {\n this.resetScale();\n }\n }\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$el);\n },\n methods: {\n resetScale: function resetScale() {\n this.setScale(1);\n this.moveX = 0;\n this.moveY = 0;\n },\n setScale: function setScale(scale) {\n scale = range(scale, +this.minZoom, +this.maxZoom);\n\n if (scale !== this.scale) {\n this.scale = scale;\n this.$emit('scale', {\n scale: this.scale,\n index: this.active\n });\n }\n },\n toggleScale: function toggleScale() {\n var scale = this.scale > 1 ? 1 : 2;\n this.setScale(scale);\n this.moveX = 0;\n this.moveY = 0;\n },\n onTouchStart: function onTouchStart(event) {\n var touches = event.touches;\n var _this$offsetX = this.offsetX,\n offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;\n this.touchStart(event);\n this.touchStartTime = new Date();\n this.fingerNum = touches.length;\n this.startMoveX = this.moveX;\n this.startMoveY = this.moveY;\n this.moving = this.fingerNum === 1 && this.scale !== 1;\n this.zooming = this.fingerNum === 2 && !offsetX;\n\n if (this.zooming) {\n this.startScale = this.scale;\n this.startDistance = getDistance(event.touches);\n }\n },\n onTouchMove: function onTouchMove(event) {\n var touches = event.touches;\n this.touchMove(event);\n\n if (this.moving || this.zooming) {\n preventDefault(event, true);\n }\n\n if (this.moving) {\n var moveX = this.deltaX + this.startMoveX;\n var moveY = this.deltaY + this.startMoveY;\n this.moveX = range(moveX, -this.maxMoveX, this.maxMoveX);\n this.moveY = range(moveY, -this.maxMoveY, this.maxMoveY);\n }\n\n if (this.zooming && touches.length === 2) {\n var distance = getDistance(touches);\n var scale = this.startScale * distance / this.startDistance;\n this.setScale(scale);\n }\n },\n onTouchEnd: function onTouchEnd(event) {\n var stopPropagation = false;\n /* istanbul ignore else */\n\n if (this.moving || this.zooming) {\n stopPropagation = true;\n\n if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {\n stopPropagation = false;\n }\n\n if (!event.touches.length) {\n if (this.zooming) {\n this.moveX = range(this.moveX, -this.maxMoveX, this.maxMoveX);\n this.moveY = range(this.moveY, -this.maxMoveY, this.maxMoveY);\n this.zooming = false;\n }\n\n this.moving = false;\n this.startMoveX = 0;\n this.startMoveY = 0;\n this.startScale = 1;\n\n if (this.scale < 1) {\n this.resetScale();\n }\n }\n } // eliminate tap delay on safari\n\n\n preventDefault(event, stopPropagation);\n this.checkTap();\n this.resetTouchStatus();\n },\n checkTap: function checkTap() {\n var _this = this;\n\n if (this.fingerNum > 1) {\n return;\n }\n\n var _this$offsetX2 = this.offsetX,\n offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,\n _this$offsetY = this.offsetY,\n offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;\n var deltaTime = new Date() - this.touchStartTime;\n var TAP_TIME = 250;\n var TAP_OFFSET = 5;\n\n if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {\n if (this.doubleTapTimer) {\n clearTimeout(this.doubleTapTimer);\n this.doubleTapTimer = null;\n this.toggleScale();\n } else {\n this.doubleTapTimer = setTimeout(function () {\n _this.$emit('close');\n\n _this.doubleTapTimer = null;\n }, TAP_TIME);\n }\n }\n },\n onLoad: function onLoad(event) {\n var _event$target = event.target,\n naturalWidth = _event$target.naturalWidth,\n naturalHeight = _event$target.naturalHeight;\n this.imageRatio = naturalHeight / naturalWidth;\n }\n },\n render: function render() {\n var h = arguments[0];\n var imageSlots = {\n loading: function loading() {\n return h(Loading, {\n \"attrs\": {\n \"type\": \"spinner\"\n }\n });\n }\n };\n return h(SwipeItem, {\n \"class\": bem('swipe-item')\n }, [h(Image, {\n \"attrs\": {\n \"src\": this.src,\n \"fit\": \"contain\"\n },\n \"class\": bem('image', {\n vertical: this.vertical\n }),\n \"style\": this.imageStyle,\n \"scopedSlots\": imageSlots,\n \"on\": {\n \"load\": this.onLoad\n }\n })]);\n }\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nimport VueImagePreview from './ImagePreview';\nimport { isServer } from '../utils';\nvar instance;\nvar defaultConfig = {\n loop: true,\n value: true,\n images: [],\n maxZoom: 3,\n minZoom: 1 / 3,\n onClose: null,\n onChange: null,\n className: '',\n showIndex: true,\n closeable: false,\n closeIcon: 'clear',\n asyncClose: false,\n transition: 'van-fade',\n getContainer: 'body',\n overlayStyle: null,\n startPosition: 0,\n swipeDuration: 300,\n showIndicators: false,\n closeOnPopstate: true,\n closeIconPosition: 'top-right'\n};\n\nvar initInstance = function initInstance() {\n instance = new (Vue.extend(VueImagePreview))({\n el: document.createElement('div')\n });\n document.body.appendChild(instance.$el);\n instance.$on('change', function (index) {\n if (instance.onChange) {\n instance.onChange(index);\n }\n });\n instance.$on('scale', function (data) {\n if (instance.onScale) {\n instance.onScale(data);\n }\n });\n};\n\nvar ImagePreview = function ImagePreview(images, startPosition) {\n if (startPosition === void 0) {\n startPosition = 0;\n }\n\n /* istanbul ignore if */\n if (isServer) {\n return;\n }\n\n if (!instance) {\n initInstance();\n }\n\n var options = Array.isArray(images) ? {\n images: images,\n startPosition: startPosition\n } : images;\n\n _extends(instance, defaultConfig, options);\n\n instance.$once('input', function (show) {\n instance.value = show;\n });\n instance.$once('closed', function () {\n instance.images = [];\n });\n\n if (options.onClose) {\n instance.$off('close');\n instance.$once('close', options.onClose);\n }\n\n return instance;\n};\n\nImagePreview.Component = VueImagePreview;\n\nImagePreview.install = function () {\n Vue.use(VueImagePreview);\n};\n\nexport default ImagePreview;","// Utils\nimport { bem, createComponent } from './shared'; // Mixins\n\nimport { PopupMixin } from '../mixins/popup';\nimport { TouchMixin } from '../mixins/touch';\nimport { BindEventMixin } from '../mixins/bind-event'; // Components\n\nimport Icon from '../icon';\nimport Swipe from '../swipe';\nimport ImagePreviewItem from './ImagePreviewItem';\nexport default createComponent({\n mixins: [TouchMixin, PopupMixin({\n skipToggleEvent: true\n }), BindEventMixin(function (bind) {\n bind(window, 'resize', this.resize, true);\n bind(window, 'orientationchange', this.resize, true);\n })],\n props: {\n className: null,\n closeable: Boolean,\n asyncClose: Boolean,\n overlayStyle: Object,\n showIndicators: Boolean,\n images: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n loop: {\n type: Boolean,\n default: true\n },\n overlay: {\n type: Boolean,\n default: true\n },\n minZoom: {\n type: [Number, String],\n default: 1 / 3\n },\n maxZoom: {\n type: [Number, String],\n default: 3\n },\n transition: {\n type: String,\n default: 'van-fade'\n },\n showIndex: {\n type: Boolean,\n default: true\n },\n swipeDuration: {\n type: [Number, String],\n default: 300\n },\n startPosition: {\n type: [Number, String],\n default: 0\n },\n overlayClass: {\n type: String,\n default: bem('overlay')\n },\n closeIcon: {\n type: String,\n default: 'clear'\n },\n closeOnPopstate: {\n type: Boolean,\n default: true\n },\n closeIconPosition: {\n type: String,\n default: 'top-right'\n }\n },\n data: function data() {\n return {\n active: 0,\n rootWidth: 0,\n rootHeight: 0,\n doubleClickTimer: null\n };\n },\n mounted: function mounted() {\n this.resize();\n },\n watch: {\n startPosition: 'setActive',\n value: function value(val) {\n var _this = this;\n\n if (val) {\n this.setActive(+this.startPosition);\n this.$nextTick(function () {\n _this.resize();\n\n _this.$refs.swipe.swipeTo(+_this.startPosition, {\n immediate: true\n });\n });\n } else {\n this.$emit('close', {\n index: this.active,\n url: this.images[this.active]\n });\n }\n }\n },\n methods: {\n resize: function resize() {\n if (this.$el && this.$el.getBoundingClientRect) {\n var rect = this.$el.getBoundingClientRect();\n this.rootWidth = rect.width;\n this.rootHeight = rect.height;\n }\n },\n emitClose: function emitClose() {\n if (!this.asyncClose) {\n this.$emit('input', false);\n }\n },\n emitScale: function emitScale(args) {\n this.$emit('scale', args);\n },\n setActive: function setActive(active) {\n if (active !== this.active) {\n this.active = active;\n this.$emit('change', active);\n }\n },\n genIndex: function genIndex() {\n var h = this.$createElement;\n\n if (this.showIndex) {\n return h(\"div\", {\n \"class\": bem('index')\n }, [this.slots('index', {\n index: this.active\n }) || this.active + 1 + \" / \" + this.images.length]);\n }\n },\n genCover: function genCover() {\n var h = this.$createElement;\n var cover = this.slots('cover');\n\n if (cover) {\n return h(\"div\", {\n \"class\": bem('cover')\n }, [cover]);\n }\n },\n genImages: function genImages() {\n var _this2 = this;\n\n var h = this.$createElement;\n return h(Swipe, {\n \"ref\": \"swipe\",\n \"attrs\": {\n \"lazyRender\": true,\n \"loop\": this.loop,\n \"duration\": this.swipeDuration,\n \"initialSwipe\": this.startPosition,\n \"showIndicators\": this.showIndicators,\n \"indicatorColor\": \"white\"\n },\n \"class\": bem('swipe'),\n \"on\": {\n \"change\": this.setActive\n }\n }, [this.images.map(function (image) {\n return h(ImagePreviewItem, {\n \"attrs\": {\n \"src\": image,\n \"show\": _this2.value,\n \"active\": _this2.active,\n \"maxZoom\": _this2.maxZoom,\n \"minZoom\": _this2.minZoom,\n \"rootWidth\": _this2.rootWidth,\n \"rootHeight\": _this2.rootHeight\n },\n \"on\": {\n \"scale\": _this2.emitScale,\n \"close\": _this2.emitClose\n }\n });\n })]);\n },\n genClose: function genClose() {\n var h = this.$createElement;\n\n if (this.closeable) {\n return h(Icon, {\n \"attrs\": {\n \"role\": \"button\",\n \"name\": this.closeIcon\n },\n \"class\": bem('close-icon', this.closeIconPosition),\n \"on\": {\n \"click\": this.emitClose\n }\n });\n }\n },\n onClosed: function onClosed() {\n this.$emit('closed');\n },\n // @exposed-api\n swipeTo: function swipeTo(index, options) {\n if (this.$refs.swipe) {\n this.$refs.swipe.swipeTo(index, options);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"transition\", {\n \"attrs\": {\n \"name\": this.transition\n },\n \"on\": {\n \"afterLeave\": this.onClosed\n }\n }, [this.shouldRender ? h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.value\n }],\n \"class\": [bem(), this.className]\n }, [this.genClose(), this.genImages(), this.genIndex(), this.genCover()]) : null]);\n }\n});","import { createNamespace } from '../utils';\nimport { ChildrenMixin } from '../mixins/relation';\nimport { BORDER_BOTTOM } from '../utils/constant';\nimport { getScrollTop, getRootScrollTop } from '../utils/dom/scroll';\n\nvar _createNamespace = createNamespace('index-anchor'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanIndexBar', {\n indexKey: 'childrenIndex'\n })],\n props: {\n index: [Number, String]\n },\n data: function data() {\n return {\n top: 0,\n left: null,\n rect: {\n top: 0,\n height: 0\n },\n width: null,\n active: false\n };\n },\n computed: {\n sticky: function sticky() {\n return this.active && this.parent.sticky;\n },\n anchorStyle: function anchorStyle() {\n if (this.sticky) {\n return {\n zIndex: \"\" + this.parent.zIndex,\n left: this.left ? this.left + \"px\" : null,\n width: this.width ? this.width + \"px\" : null,\n transform: \"translate3d(0, \" + this.top + \"px, 0)\",\n color: this.parent.highlightColor\n };\n }\n }\n },\n mounted: function mounted() {\n var rect = this.$el.getBoundingClientRect();\n this.rect.height = rect.height;\n },\n methods: {\n scrollIntoView: function scrollIntoView() {\n this.$el.scrollIntoView();\n },\n getRect: function getRect(scroller, scrollerRect) {\n var el = this.$el;\n var elRect = el.getBoundingClientRect();\n this.rect.height = elRect.height;\n\n if (scroller === window || scroller === document.body) {\n this.rect.top = elRect.top + getRootScrollTop();\n } else {\n this.rect.top = elRect.top + getScrollTop(scroller) - scrollerRect.top;\n }\n\n return this.rect;\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n var sticky = this.sticky;\n return h(\"div\", {\n \"style\": {\n height: sticky ? this.rect.height + \"px\" : null\n }\n }, [h(\"div\", {\n \"style\": this.anchorStyle,\n \"class\": [bem({\n sticky: sticky\n }), (_ref = {}, _ref[BORDER_BOTTOM] = sticky, _ref)]\n }, [this.slots('default') || this.index])]);\n }\n});","// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { isHidden } from '../utils/dom/style';\nimport { preventDefault } from '../utils/dom/event';\nimport { getScroller, getScrollTop, getRootScrollTop, setRootScrollTop } from '../utils/dom/scroll'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch';\nimport { ParentMixin } from '../mixins/relation';\nimport { BindEventMixin } from '../mixins/bind-event';\n\nfunction genAlphabet() {\n var indexList = [];\n var charCodeOfA = 'A'.charCodeAt(0);\n\n for (var i = 0; i < 26; i++) {\n indexList.push(String.fromCharCode(charCodeOfA + i));\n }\n\n return indexList;\n}\n\nvar _createNamespace = createNamespace('index-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [TouchMixin, ParentMixin('vanIndexBar'), BindEventMixin(function (bind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n\n bind(this.scroller, 'scroll', this.onScroll);\n })],\n props: {\n zIndex: [Number, String],\n highlightColor: String,\n sticky: {\n type: Boolean,\n default: true\n },\n stickyOffsetTop: {\n type: Number,\n default: 0\n },\n indexList: {\n type: Array,\n default: genAlphabet\n }\n },\n data: function data() {\n return {\n activeAnchorIndex: null\n };\n },\n computed: {\n sidebarStyle: function sidebarStyle() {\n if (isDef(this.zIndex)) {\n return {\n zIndex: this.zIndex + 1\n };\n }\n },\n highlightStyle: function highlightStyle() {\n var highlightColor = this.highlightColor;\n\n if (highlightColor) {\n return {\n color: highlightColor\n };\n }\n }\n },\n watch: {\n indexList: function indexList() {\n this.$nextTick(this.onScroll);\n },\n activeAnchorIndex: function activeAnchorIndex(value) {\n if (value) {\n this.$emit('change', value);\n }\n }\n },\n methods: {\n onScroll: function onScroll() {\n var _this = this;\n\n if (isHidden(this.$el)) {\n return;\n }\n\n var scrollTop = getScrollTop(this.scroller);\n var scrollerRect = this.getScrollerRect();\n var rects = this.children.map(function (item) {\n return item.getRect(_this.scroller, scrollerRect);\n });\n var active = this.getActiveAnchorIndex(scrollTop, rects);\n this.activeAnchorIndex = this.indexList[active];\n\n if (this.sticky) {\n this.children.forEach(function (item, index) {\n if (index === active || index === active - 1) {\n var rect = item.$el.getBoundingClientRect();\n item.left = rect.left;\n item.width = rect.width;\n } else {\n item.left = null;\n item.width = null;\n }\n\n if (index === active) {\n item.active = true;\n item.top = Math.max(_this.stickyOffsetTop, rects[index].top - scrollTop) + scrollerRect.top;\n } else if (index === active - 1) {\n var activeItemTop = rects[active].top - scrollTop;\n item.active = activeItemTop > 0;\n item.top = activeItemTop + scrollerRect.top - rects[index].height;\n } else {\n item.active = false;\n }\n });\n }\n },\n getScrollerRect: function getScrollerRect() {\n if (this.scroller.getBoundingClientRect) {\n return this.scroller.getBoundingClientRect();\n }\n\n return {\n top: 0,\n left: 0\n };\n },\n getActiveAnchorIndex: function getActiveAnchorIndex(scrollTop, rects) {\n for (var i = this.children.length - 1; i >= 0; i--) {\n var prevHeight = i > 0 ? rects[i - 1].height : 0;\n var reachTop = this.sticky ? prevHeight + this.stickyOffsetTop : 0;\n\n if (scrollTop + reachTop >= rects[i].top) {\n return i;\n }\n }\n\n return -1;\n },\n onClick: function onClick(event) {\n this.scrollToElement(event.target);\n },\n onTouchMove: function onTouchMove(event) {\n this.touchMove(event);\n\n if (this.direction === 'vertical') {\n preventDefault(event);\n var _event$touches$ = event.touches[0],\n clientX = _event$touches$.clientX,\n clientY = _event$touches$.clientY;\n var target = document.elementFromPoint(clientX, clientY);\n\n if (target) {\n var index = target.dataset.index;\n /* istanbul ignore else */\n\n if (this.touchActiveIndex !== index) {\n this.touchActiveIndex = index;\n this.scrollToElement(target);\n }\n }\n }\n },\n scrollTo: function scrollTo(index) {\n var match = this.children.filter(function (item) {\n return String(item.index) === index;\n });\n\n if (match[0]) {\n match[0].scrollIntoView();\n\n if (this.sticky && this.stickyOffsetTop) {\n setRootScrollTop(getRootScrollTop() - this.stickyOffsetTop);\n }\n\n this.$emit('select', match[0].index);\n }\n },\n scrollToElement: function scrollToElement(element) {\n var index = element.dataset.index;\n this.scrollTo(index);\n },\n onTouchEnd: function onTouchEnd() {\n this.active = null;\n }\n },\n render: function render() {\n var _this2 = this;\n\n var h = arguments[0];\n var Indexes = this.indexList.map(function (index) {\n var active = index === _this2.activeAnchorIndex;\n return h(\"span\", {\n \"class\": bem('index', {\n active: active\n }),\n \"style\": active ? _this2.highlightStyle : null,\n \"attrs\": {\n \"data-index\": index\n }\n }, [index]);\n });\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"class\": bem('sidebar'),\n \"style\": this.sidebarStyle,\n \"on\": {\n \"click\": this.onClick,\n \"touchstart\": this.touchStart,\n \"touchmove\": this.onTouchMove,\n \"touchend\": this.onTouchEnd,\n \"touchcancel\": this.onTouchEnd\n }\n }, [Indexes]), this.slots('default')]);\n }\n});","// Utils\nimport { createNamespace } from '../utils';\nimport { isHidden } from '../utils/dom/style';\nimport { getScroller } from '../utils/dom/scroll'; // Mixins\n\nimport { BindEventMixin } from '../mixins/bind-event'; // Components\n\nimport Loading from '../loading';\n\nvar _createNamespace = createNamespace('list'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n if (!this.scroller) {\n this.scroller = getScroller(this.$el);\n }\n\n bind(this.scroller, 'scroll', this.check);\n })],\n model: {\n prop: 'loading'\n },\n props: {\n error: Boolean,\n loading: Boolean,\n finished: Boolean,\n errorText: String,\n loadingText: String,\n finishedText: String,\n immediateCheck: {\n type: Boolean,\n default: true\n },\n offset: {\n type: [Number, String],\n default: 300\n },\n direction: {\n type: String,\n default: 'down'\n }\n },\n data: function data() {\n return {\n // use sync innerLoading state to avoid repeated loading in some edge cases\n innerLoading: this.loading\n };\n },\n updated: function updated() {\n this.innerLoading = this.loading;\n },\n mounted: function mounted() {\n if (this.immediateCheck) {\n this.check();\n }\n },\n watch: {\n loading: 'check',\n finished: 'check'\n },\n methods: {\n // @exposed-api\n check: function check() {\n var _this = this;\n\n this.$nextTick(function () {\n if (_this.innerLoading || _this.finished || _this.error) {\n return;\n }\n\n var el = _this.$el,\n scroller = _this.scroller,\n offset = _this.offset,\n direction = _this.direction;\n var scrollerRect;\n\n if (scroller.getBoundingClientRect) {\n scrollerRect = scroller.getBoundingClientRect();\n } else {\n scrollerRect = {\n top: 0,\n bottom: scroller.innerHeight\n };\n }\n\n var scrollerHeight = scrollerRect.bottom - scrollerRect.top;\n /* istanbul ignore next */\n\n if (!scrollerHeight || isHidden(el)) {\n return false;\n }\n\n var isReachEdge = false;\n\n var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();\n\n if (direction === 'up') {\n isReachEdge = scrollerRect.top - placeholderRect.top <= offset;\n } else {\n isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;\n }\n\n if (isReachEdge) {\n _this.innerLoading = true;\n\n _this.$emit('input', true);\n\n _this.$emit('load');\n }\n });\n },\n clickErrorText: function clickErrorText() {\n this.$emit('update:error', false);\n this.check();\n },\n genLoading: function genLoading() {\n var h = this.$createElement;\n\n if (this.innerLoading && !this.finished) {\n return h(\"div\", {\n \"key\": \"loading\",\n \"class\": bem('loading')\n }, [this.slots('loading') || h(Loading, {\n \"attrs\": {\n \"size\": \"16\"\n }\n }, [this.loadingText || t('loading')])]);\n }\n },\n genFinishedText: function genFinishedText() {\n var h = this.$createElement;\n\n if (this.finished) {\n var text = this.slots('finished') || this.finishedText;\n\n if (text) {\n return h(\"div\", {\n \"class\": bem('finished-text')\n }, [text]);\n }\n }\n },\n genErrorText: function genErrorText() {\n var h = this.$createElement;\n\n if (this.error) {\n var text = this.slots('error') || this.errorText;\n\n if (text) {\n return h(\"div\", {\n \"on\": {\n \"click\": this.clickErrorText\n },\n \"class\": bem('error-text')\n }, [text]);\n }\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var Placeholder = h(\"div\", {\n \"ref\": \"placeholder\",\n \"key\": \"placeholder\",\n \"class\": bem('placeholder')\n });\n return h(\"div\", {\n \"class\": bem(),\n \"attrs\": {\n \"role\": \"feed\",\n \"aria-busy\": this.innerLoading\n }\n }, [this.direction === 'down' ? this.slots() : Placeholder, this.genLoading(), this.genFinishedText(), this.genErrorText(), this.direction === 'up' ? this.slots() : Placeholder]);\n }\n});","// Utils\nimport { createNamespace } from '../utils';\nimport { BORDER_BOTTOM } from '../utils/constant'; // Components\n\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('nav-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n props: {\n title: String,\n fixed: Boolean,\n zIndex: [Number, String],\n leftText: String,\n rightText: String,\n leftArrow: Boolean,\n placeholder: Boolean,\n safeAreaInsetTop: Boolean,\n border: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n height: null\n };\n },\n mounted: function mounted() {\n var _this = this;\n\n if (this.placeholder && this.fixed) {\n var setHeight = function setHeight() {\n _this.height = _this.$refs.navBar.getBoundingClientRect().height;\n };\n\n setHeight(); // https://github.com/vant-ui/vant/issues/10131\n\n setTimeout(setHeight, 100);\n }\n },\n methods: {\n genLeft: function genLeft() {\n var h = this.$createElement;\n var leftSlot = this.slots('left');\n\n if (leftSlot) {\n return leftSlot;\n }\n\n return [this.leftArrow && h(Icon, {\n \"class\": bem('arrow'),\n \"attrs\": {\n \"name\": \"arrow-left\"\n }\n }), this.leftText && h(\"span\", {\n \"class\": bem('text')\n }, [this.leftText])];\n },\n genRight: function genRight() {\n var h = this.$createElement;\n var rightSlot = this.slots('right');\n\n if (rightSlot) {\n return rightSlot;\n }\n\n if (this.rightText) {\n return h(\"span\", {\n \"class\": bem('text')\n }, [this.rightText]);\n }\n },\n genNavBar: function genNavBar() {\n var _ref;\n\n var h = this.$createElement;\n return h(\"div\", {\n \"ref\": \"navBar\",\n \"style\": {\n zIndex: this.zIndex\n },\n \"class\": [bem({\n fixed: this.fixed,\n 'safe-area-inset-top': this.safeAreaInsetTop\n }), (_ref = {}, _ref[BORDER_BOTTOM] = this.border, _ref)]\n }, [h(\"div\", {\n \"class\": bem('content')\n }, [this.hasLeft() && h(\"div\", {\n \"class\": bem('left'),\n \"on\": {\n \"click\": this.onClickLeft\n }\n }, [this.genLeft()]), h(\"div\", {\n \"class\": [bem('title'), 'van-ellipsis']\n }, [this.slots('title') || this.title]), this.hasRight() && h(\"div\", {\n \"class\": bem('right'),\n \"on\": {\n \"click\": this.onClickRight\n }\n }, [this.genRight()])])]);\n },\n hasLeft: function hasLeft() {\n return this.leftArrow || this.leftText || this.slots('left');\n },\n hasRight: function hasRight() {\n return this.rightText || this.slots('right');\n },\n onClickLeft: function onClickLeft(event) {\n this.$emit('click-left', event);\n },\n onClickRight: function onClickRight(event) {\n this.$emit('click-right', event);\n }\n },\n render: function render() {\n var h = arguments[0];\n\n if (this.placeholder && this.fixed) {\n return h(\"div\", {\n \"class\": bem('placeholder'),\n \"style\": {\n height: this.height + \"px\"\n }\n }, [this.genNavBar()]);\n }\n\n return this.genNavBar();\n }\n});","import { createNamespace, isDef } from '../utils';\nimport { doubleRaf, raf } from '../utils/dom/raf';\nimport { BindEventMixin } from '../mixins/bind-event';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('notice-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n // fix cache issues with forwards and back history in safari\n // see: https://guwii.com/cache-issues-with-forwards-and-back-history-in-safari/\n bind(window, 'pageshow', this.reset);\n })],\n inject: {\n vanPopup: {\n default: null\n }\n },\n props: {\n text: String,\n mode: String,\n color: String,\n leftIcon: String,\n wrapable: Boolean,\n background: String,\n scrollable: {\n type: Boolean,\n default: null\n },\n delay: {\n type: [Number, String],\n default: 1\n },\n speed: {\n type: [Number, String],\n default: 60\n }\n },\n data: function data() {\n return {\n show: true,\n offset: 0,\n duration: 0,\n wrapWidth: 0,\n contentWidth: 0\n };\n },\n watch: {\n scrollable: 'reset',\n text: {\n handler: 'reset',\n immediate: true\n }\n },\n created: function created() {\n // https://github.com/vant-ui/vant/issues/8634\n if (this.vanPopup) {\n this.vanPopup.onReopen(this.reset);\n }\n },\n activated: function activated() {\n this.reset();\n },\n methods: {\n onClickIcon: function onClickIcon(event) {\n if (this.mode === 'closeable') {\n this.show = false;\n this.$emit('close', event);\n }\n },\n onTransitionEnd: function onTransitionEnd() {\n var _this = this;\n\n this.offset = this.wrapWidth;\n this.duration = 0; // wait for Vue to render offset\n // using nextTick won't work in iOS14\n\n raf(function () {\n // use double raf to ensure animation can start\n doubleRaf(function () {\n _this.offset = -_this.contentWidth;\n _this.duration = (_this.contentWidth + _this.wrapWidth) / _this.speed;\n\n _this.$emit('replay');\n });\n });\n },\n // not an exposed-api, but may used by some users\n start: function start() {\n this.reset();\n },\n // @exposed-api\n reset: function reset() {\n var _this2 = this;\n\n var delay = isDef(this.delay) ? this.delay * 1000 : 0;\n this.offset = 0;\n this.duration = 0;\n this.wrapWidth = 0;\n this.contentWidth = 0;\n clearTimeout(this.startTimer);\n this.startTimer = setTimeout(function () {\n var _this2$$refs = _this2.$refs,\n wrap = _this2$$refs.wrap,\n content = _this2$$refs.content;\n\n if (!wrap || !content || _this2.scrollable === false) {\n return;\n }\n\n var wrapWidth = wrap.getBoundingClientRect().width;\n var contentWidth = content.getBoundingClientRect().width;\n\n if (_this2.scrollable || contentWidth > wrapWidth) {\n doubleRaf(function () {\n _this2.offset = -contentWidth;\n _this2.duration = contentWidth / _this2.speed;\n _this2.wrapWidth = wrapWidth;\n _this2.contentWidth = contentWidth;\n });\n }\n }, delay);\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n var slots = this.slots,\n mode = this.mode,\n leftIcon = this.leftIcon,\n onClickIcon = this.onClickIcon;\n var barStyle = {\n color: this.color,\n background: this.background\n };\n var contentStyle = {\n transform: this.offset ? \"translateX(\" + this.offset + \"px)\" : '',\n transitionDuration: this.duration + 's'\n };\n\n function LeftIcon() {\n var slot = slots('left-icon');\n\n if (slot) {\n return slot;\n }\n\n if (leftIcon) {\n return h(Icon, {\n \"class\": bem('left-icon'),\n \"attrs\": {\n \"name\": leftIcon\n }\n });\n }\n }\n\n function RightIcon() {\n var slot = slots('right-icon');\n\n if (slot) {\n return slot;\n }\n\n var iconName;\n\n if (mode === 'closeable') {\n iconName = 'cross';\n } else if (mode === 'link') {\n iconName = 'arrow';\n }\n\n if (iconName) {\n return h(Icon, {\n \"class\": bem('right-icon'),\n \"attrs\": {\n \"name\": iconName\n },\n \"on\": {\n \"click\": onClickIcon\n }\n });\n }\n }\n\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"alert\"\n },\n \"directives\": [{\n name: \"show\",\n value: this.show\n }],\n \"class\": bem({\n wrapable: this.wrapable\n }),\n \"style\": barStyle,\n \"on\": {\n \"click\": function click(event) {\n _this3.$emit('click', event);\n }\n }\n }, [LeftIcon(), h(\"div\", {\n \"ref\": \"wrap\",\n \"class\": bem('wrap'),\n \"attrs\": {\n \"role\": \"marquee\"\n }\n }, [h(\"div\", {\n \"ref\": \"content\",\n \"class\": [bem('content'), {\n 'van-ellipsis': this.scrollable === false && !this.wrapable\n }],\n \"style\": contentStyle,\n \"on\": {\n \"transitionend\": this.onTransitionEnd\n }\n }, [this.slots() || this.text])]), RightIcon()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit } from '../utils/functional'; // Mixins\n\nimport { popupMixinProps } from '../mixins/popup'; // Components\n\nimport Popup from '../popup'; // Types\n\nvar _createNamespace = createNamespace('notify'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Notify(h, props, slots, ctx) {\n var style = {\n color: props.color,\n background: props.background\n };\n return h(Popup, _mergeJSXProps([{\n \"attrs\": {\n \"value\": props.value,\n \"position\": \"top\",\n \"overlay\": false,\n \"duration\": 0.2,\n \"lockScroll\": false\n },\n \"style\": style,\n \"class\": [bem([props.type]), props.className]\n }, inherit(ctx, true)]), [(slots.default == null ? void 0 : slots.default()) || props.message]);\n}\n\nNotify.props = _extends({}, popupMixinProps, {\n color: String,\n message: [Number, String],\n duration: [Number, String],\n className: null,\n background: String,\n getContainer: [String, Function],\n type: {\n type: String,\n default: 'danger'\n }\n});\nexport default createComponent(Notify);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nimport VanNotify from './Notify';\nimport { isObject, isServer } from '../utils';\nimport { mount } from '../utils/functional';\nvar timer;\nvar instance;\n\nfunction parseOptions(message) {\n return isObject(message) ? message : {\n message: message\n };\n}\n\nfunction Notify(options) {\n /* istanbul ignore if */\n if (isServer) {\n return;\n }\n\n if (!instance) {\n instance = mount(VanNotify, {\n on: {\n click: function click(event) {\n if (instance.onClick) {\n instance.onClick(event);\n }\n },\n close: function close() {\n if (instance.onClose) {\n instance.onClose();\n }\n },\n opened: function opened() {\n if (instance.onOpened) {\n instance.onOpened();\n }\n }\n }\n });\n }\n\n options = _extends({}, Notify.currentOptions, parseOptions(options));\n\n _extends(instance, options);\n\n clearTimeout(timer);\n\n if (options.duration && options.duration > 0) {\n timer = setTimeout(Notify.clear, options.duration);\n }\n\n return instance;\n}\n\nfunction defaultOptions() {\n return {\n type: 'danger',\n value: true,\n message: '',\n color: undefined,\n background: undefined,\n duration: 3000,\n className: '',\n onClose: null,\n onClick: null,\n onOpened: null\n };\n}\n\nNotify.clear = function () {\n if (instance) {\n instance.value = false;\n }\n};\n\nNotify.currentOptions = defaultOptions();\n\nNotify.setDefaultOptions = function (options) {\n _extends(Notify.currentOptions, options);\n};\n\nNotify.resetDefaultOptions = function () {\n Notify.currentOptions = defaultOptions();\n};\n\nNotify.install = function () {\n Vue.use(VanNotify);\n};\n\nNotify.Component = VanNotify;\nVue.prototype.$notify = Notify;\nexport default Notify;","export default {\n render: function render() {\n var h = arguments[0];\n return h(\"svg\", {\n \"attrs\": {\n \"viewBox\": \"0 0 32 22\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n }\n }, [h(\"path\", {\n \"attrs\": {\n \"d\": \"M28.016 0A3.991 3.991 0 0132 3.987v14.026c0 2.2-1.787 3.987-3.98 3.987H10.382c-.509 0-.996-.206-1.374-.585L.89 13.09C.33 12.62 0 11.84 0 11.006c0-.86.325-1.62.887-2.08L9.01.585A1.936 1.936 0 0110.383 0zm0 1.947H10.368L2.24 10.28c-.224.226-.312.432-.312.73 0 .287.094.51.312.729l8.128 8.333h17.648a2.041 2.041 0 002.037-2.04V3.987c0-1.127-.915-2.04-2.037-2.04zM23.028 6a.96.96 0 01.678.292.95.95 0 01-.003 1.377l-3.342 3.348 3.326 3.333c.189.188.292.43.292.679 0 .248-.103.49-.292.679a.96.96 0 01-.678.292.959.959 0 01-.677-.292L18.99 12.36l-3.343 3.345a.96.96 0 01-.677.292.96.96 0 01-.678-.292.962.962 0 01-.292-.68c0-.248.104-.49.292-.679l3.342-3.348-3.342-3.348A.963.963 0 0114 6.971c0-.248.104-.49.292-.679A.96.96 0 0114.97 6a.96.96 0 01.677.292l3.358 3.348 3.345-3.348A.96.96 0 0123.028 6z\",\n \"fill\": \"currentColor\"\n }\n })]);\n }\n};","export default {\n render: function render() {\n var h = arguments[0];\n return h(\"svg\", {\n \"attrs\": {\n \"viewBox\": \"0 0 30 24\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n }\n }, [h(\"path\", {\n \"attrs\": {\n \"d\": \"M25.877 12.843h-1.502c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.5c.187 0 .187 0 .187-.188v-1.511c0-.19 0-.191-.185-.191zM17.999 10.2c0 .188 0 .188.188.188h1.687c.188 0 .188 0 .188-.188V8.688c0-.187.004-.187-.186-.19h-1.69c-.187 0-.187 0-.187.19V10.2zm2.25-3.967h1.5c.188 0 .188 0 .188-.188v-1.7c0-.19 0-.19-.188-.19h-1.5c-.189 0-.189 0-.189.19v1.7c0 .188 0 .188.19.188zm2.063 4.157h3.563c.187 0 .187 0 .187-.189V4.346c0-.19.004-.19-.185-.19h-1.69c-.187 0-.187 0-.187.188v4.155h-1.688c-.187 0-.187 0-.187.189v1.514c0 .19 0 .19.187.19zM14.812 24l2.812-3.4H12l2.813 3.4zm-9-11.157H4.31c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.502c.187 0 .187 0 .187-.188v-1.511c0-.19.01-.191-.189-.191zm15.937 0H8.25c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h13.5c.188 0 .188 0 .188-.188v-1.511c0-.19 0-.191-.188-.191zm-11.438-2.454h1.5c.188 0 .188 0 .188-.188V8.688c0-.187 0-.187-.188-.189h-1.5c-.187 0-.187 0-.187.189V10.2c0 .188 0 .188.187.188zM27.94 0c.563 0 .917.21 1.313.567.518.466.748.757.748 1.51v14.92c0 .567-.188 1.134-.562 1.512-.376.378-.938.566-1.313.566H2.063c-.563 0-.938-.188-1.313-.566-.562-.378-.75-.945-.75-1.511V2.078C0 1.51.188.944.562.567.938.189 1.5 0 1.875 0zm-.062 2H2v14.92h25.877V2zM5.81 4.157c.19 0 .19 0 .19.189v1.762c-.003.126-.024.126-.188.126H4.249c-.126-.003-.126-.023-.126-.188v-1.7c-.187-.19 0-.19.188-.19zm10.5 2.077h1.503c.187 0 .187 0 .187-.188v-1.7c0-.19 0-.19-.187-.19h-1.502c-.188 0-.188.001-.188.19v1.7c0 .188 0 .188.188.188zM7.875 8.5c.187 0 .187.002.187.189V10.2c0 .188 0 .188-.187.188H4.249c-.126-.002-.126-.023-.126-.188V8.625c.003-.126.024-.126.188-.126zm7.875 0c.19.002.19.002.19.189v1.575c-.003.126-.024.126-.19.126h-1.563c-.126-.002-.126-.023-.126-.188V8.625c.002-.126.023-.126.189-.126zm-6-4.342c.187 0 .187 0 .187.189v1.7c0 .188 0 .188-.187.188H8.187c-.126-.003-.126-.023-.126-.188V4.283c.003-.126.024-.126.188-.126zm3.94 0c.185 0 .372 0 .372.189v1.762c-.002.126-.023.126-.187.126h-1.75C12 6.231 12 6.211 12 6.046v-1.7c0-.19.187-.19.187-.19z\",\n \"fill\": \"currentColor\"\n }\n })]);\n }\n};","import { createNamespace } from '../utils';\nimport { TouchMixin } from '../mixins/touch';\nimport Loading from '../loading';\nimport DeleteIcon from './DeleteIcon';\nimport CollapseIcon from './CollapseIcon';\n\nvar _createNamespace = createNamespace('key'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [TouchMixin],\n props: {\n type: String,\n text: [Number, String],\n color: String,\n wider: Boolean,\n large: Boolean,\n loading: Boolean\n },\n data: function data() {\n return {\n active: false\n };\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$el);\n },\n methods: {\n onTouchStart: function onTouchStart(event) {\n // compatible with Vue 2.6 event bubble bug\n event.stopPropagation();\n this.touchStart(event);\n this.active = true;\n },\n onTouchMove: function onTouchMove(event) {\n this.touchMove(event);\n\n if (this.direction) {\n this.active = false;\n }\n },\n onTouchEnd: function onTouchEnd(event) {\n if (this.active) {\n // eliminate tap delay on safari\n // see: https://github.com/vant-ui/vant/issues/6836\n if (!this.slots('default')) {\n event.preventDefault();\n }\n\n this.active = false;\n this.$emit('press', this.text, this.type);\n }\n },\n genContent: function genContent() {\n var h = this.$createElement;\n var isExtra = this.type === 'extra';\n var isDelete = this.type === 'delete';\n var text = this.slots('default') || this.text;\n\n if (this.loading) {\n return h(Loading, {\n \"class\": bem('loading-icon')\n });\n }\n\n if (isDelete) {\n return text || h(DeleteIcon, {\n \"class\": bem('delete-icon')\n });\n }\n\n if (isExtra) {\n return text || h(CollapseIcon, {\n \"class\": bem('collapse-icon')\n });\n }\n\n return text;\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem('wrapper', {\n wider: this.wider\n })\n }, [h(\"div\", {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": \"0\"\n },\n \"class\": bem([this.color, {\n large: this.large,\n active: this.active,\n delete: this.type === 'delete'\n }])\n }, [this.genContent()])]);\n }\n});","import { createNamespace } from '../utils';\nimport { stopPropagation } from '../utils/dom/event';\nimport { PortalMixin } from '../mixins/portal';\nimport { BindEventMixin } from '../mixins/bind-event';\nimport Key from './Key';\n\nvar _createNamespace = createNamespace('number-keyboard'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [PortalMixin(), BindEventMixin(function (bind) {\n if (this.hideOnClickOutside) {\n bind(document.body, 'touchstart', this.onBlur);\n }\n })],\n model: {\n event: 'update:value'\n },\n props: {\n show: Boolean,\n title: String,\n zIndex: [Number, String],\n randomKeyOrder: Boolean,\n closeButtonText: String,\n deleteButtonText: String,\n closeButtonLoading: Boolean,\n theme: {\n type: String,\n default: 'default'\n },\n value: {\n type: String,\n default: ''\n },\n extraKey: {\n type: [String, Array],\n default: ''\n },\n maxlength: {\n type: [Number, String],\n default: Number.MAX_VALUE\n },\n transition: {\n type: Boolean,\n default: true\n },\n showDeleteKey: {\n type: Boolean,\n default: true\n },\n hideOnClickOutside: {\n type: Boolean,\n default: true\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n }\n },\n watch: {\n show: function show(val) {\n if (!this.transition) {\n this.$emit(val ? 'show' : 'hide');\n }\n }\n },\n computed: {\n keys: function keys() {\n if (this.theme === 'custom') {\n return this.genCustomKeys();\n }\n\n return this.genDefaultKeys();\n }\n },\n methods: {\n genBasicKeys: function genBasicKeys() {\n var keys = [];\n\n for (var i = 1; i <= 9; i++) {\n keys.push({\n text: i\n });\n }\n\n if (this.randomKeyOrder) {\n keys.sort(function () {\n return Math.random() > 0.5 ? 1 : -1;\n });\n }\n\n return keys;\n },\n genDefaultKeys: function genDefaultKeys() {\n return [].concat(this.genBasicKeys(), [{\n text: this.extraKey,\n type: 'extra'\n }, {\n text: 0\n }, {\n text: this.showDeleteKey ? this.deleteButtonText : '',\n type: this.showDeleteKey ? 'delete' : ''\n }]);\n },\n genCustomKeys: function genCustomKeys() {\n var keys = this.genBasicKeys();\n var extraKey = this.extraKey;\n var extraKeys = Array.isArray(extraKey) ? extraKey : [extraKey];\n\n if (extraKeys.length === 1) {\n keys.push({\n text: 0,\n wider: true\n }, {\n text: extraKeys[0],\n type: 'extra'\n });\n } else if (extraKeys.length === 2) {\n keys.push({\n text: extraKeys[0],\n type: 'extra'\n }, {\n text: 0\n }, {\n text: extraKeys[1],\n type: 'extra'\n });\n }\n\n return keys;\n },\n onBlur: function onBlur() {\n this.show && this.$emit('blur');\n },\n onClose: function onClose() {\n this.$emit('close');\n this.onBlur();\n },\n onAnimationEnd: function onAnimationEnd() {\n this.$emit(this.show ? 'show' : 'hide');\n },\n onPress: function onPress(text, type) {\n if (text === '') {\n if (type === 'extra') {\n this.onBlur();\n }\n\n return;\n }\n\n var value = this.value;\n\n if (type === 'delete') {\n this.$emit('delete');\n this.$emit('update:value', value.slice(0, value.length - 1));\n } else if (type === 'close') {\n this.onClose();\n } else if (value.length < this.maxlength) {\n this.$emit('input', text);\n this.$emit('update:value', value + text);\n }\n },\n genTitle: function genTitle() {\n var h = this.$createElement;\n var title = this.title,\n theme = this.theme,\n closeButtonText = this.closeButtonText;\n var titleLeft = this.slots('title-left');\n var showClose = closeButtonText && theme === 'default';\n var showTitle = title || showClose || titleLeft;\n\n if (!showTitle) {\n return;\n }\n\n return h(\"div\", {\n \"class\": bem('header')\n }, [titleLeft && h(\"span\", {\n \"class\": bem('title-left')\n }, [titleLeft]), title && h(\"h2\", {\n \"class\": bem('title')\n }, [title]), showClose && h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": bem('close'),\n \"on\": {\n \"click\": this.onClose\n }\n }, [closeButtonText])]);\n },\n genKeys: function genKeys() {\n var _this = this;\n\n var h = this.$createElement;\n return this.keys.map(function (key) {\n return h(Key, {\n \"key\": key.text,\n \"attrs\": {\n \"text\": key.text,\n \"type\": key.type,\n \"wider\": key.wider,\n \"color\": key.color\n },\n \"on\": {\n \"press\": _this.onPress\n }\n }, [key.type === 'delete' && _this.slots('delete'), key.type === 'extra' && _this.slots('extra-key')]);\n });\n },\n genSidebar: function genSidebar() {\n var h = this.$createElement;\n\n if (this.theme === 'custom') {\n return h(\"div\", {\n \"class\": bem('sidebar')\n }, [this.showDeleteKey && h(Key, {\n \"attrs\": {\n \"large\": true,\n \"text\": this.deleteButtonText,\n \"type\": \"delete\"\n },\n \"on\": {\n \"press\": this.onPress\n }\n }, [this.slots('delete')]), h(Key, {\n \"attrs\": {\n \"large\": true,\n \"text\": this.closeButtonText,\n \"type\": \"close\",\n \"color\": \"blue\",\n \"loading\": this.closeButtonLoading\n },\n \"on\": {\n \"press\": this.onPress\n }\n })]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var Title = this.genTitle();\n return h(\"transition\", {\n \"attrs\": {\n \"name\": this.transition ? 'van-slide-up' : ''\n }\n }, [h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.show\n }],\n \"style\": {\n zIndex: this.zIndex\n },\n \"class\": bem({\n unfit: !this.safeAreaInsetBottom,\n 'with-title': Title\n }),\n \"on\": {\n \"touchstart\": stopPropagation,\n \"animationend\": this.onAnimationEnd,\n \"webkitAnimationEnd\": this.onAnimationEnd\n }\n }, [Title, h(\"div\", {\n \"class\": bem('body')\n }, [h(\"div\", {\n \"class\": bem('keys')\n }, [this.genKeys()]), this.genSidebar()])])]);\n }\n});","import { createNamespace } from '../utils';\nimport { BORDER } from '../utils/constant';\n\nvar _createNamespace = createNamespace('pagination'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction makePage(number, text, active) {\n return {\n number: number,\n text: text,\n active: active\n };\n}\n\nexport default createComponent({\n props: {\n prevText: String,\n nextText: String,\n forceEllipses: Boolean,\n mode: {\n type: String,\n default: 'multi'\n },\n value: {\n type: Number,\n default: 0\n },\n pageCount: {\n type: [Number, String],\n default: 0\n },\n totalItems: {\n type: [Number, String],\n default: 0\n },\n itemsPerPage: {\n type: [Number, String],\n default: 10\n },\n showPageSize: {\n type: [Number, String],\n default: 5\n }\n },\n computed: {\n count: function count() {\n var count = this.pageCount || Math.ceil(this.totalItems / this.itemsPerPage);\n return Math.max(1, count);\n },\n pages: function pages() {\n var pages = [];\n var pageCount = this.count;\n var showPageSize = +this.showPageSize;\n\n if (this.mode !== 'multi') {\n return pages;\n } // Default page limits\n\n\n var startPage = 1;\n var endPage = pageCount;\n var isMaxSized = showPageSize < pageCount; // recompute if showPageSize\n\n if (isMaxSized) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(this.value - Math.floor(showPageSize / 2), 1);\n endPage = startPage + showPageSize - 1; // Adjust if limit is exceeded\n\n if (endPage > pageCount) {\n endPage = pageCount;\n startPage = endPage - showPageSize + 1;\n }\n } // Add page number links\n\n\n for (var number = startPage; number <= endPage; number++) {\n var page = makePage(number, number, number === this.value);\n pages.push(page);\n } // Add links to move between page sets\n\n\n if (isMaxSized && showPageSize > 0 && this.forceEllipses) {\n if (startPage > 1) {\n var previousPageSet = makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n\n if (endPage < pageCount) {\n var nextPageSet = makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n }\n\n return pages;\n }\n },\n watch: {\n value: {\n handler: function handler(page) {\n this.select(page || this.value);\n },\n immediate: true\n }\n },\n methods: {\n select: function select(page, emitChange) {\n page = Math.min(this.count, Math.max(1, page));\n\n if (this.value !== page) {\n this.$emit('input', page);\n\n if (emitChange) {\n this.$emit('change', page);\n }\n }\n }\n },\n render: function render() {\n var _this = this,\n _this$slots,\n _this$slots3;\n\n var h = arguments[0];\n var value = this.value;\n var simple = this.mode !== 'multi';\n\n var onSelect = function onSelect(value) {\n return function () {\n _this.select(value, true);\n };\n };\n\n return h(\"ul\", {\n \"class\": bem({\n simple: simple\n })\n }, [h(\"li\", {\n \"class\": [bem('item', {\n disabled: value === 1\n }), bem('prev'), BORDER],\n \"on\": {\n \"click\": onSelect(value - 1)\n }\n }, [((_this$slots = this.slots('prev-text')) != null ? _this$slots : this.prevText) || t('prev')]), this.pages.map(function (page) {\n var _this$slots2;\n\n return h(\"li\", {\n \"class\": [bem('item', {\n active: page.active\n }), bem('page'), BORDER],\n \"on\": {\n \"click\": onSelect(page.number)\n }\n }, [(_this$slots2 = _this.slots('page', page)) != null ? _this$slots2 : page.text]);\n }), simple && h(\"li\", {\n \"class\": bem('page-desc')\n }, [this.slots('pageDesc') || value + \"/\" + this.count]), h(\"li\", {\n \"class\": [bem('item', {\n disabled: value === this.count\n }), bem('next'), BORDER],\n \"on\": {\n \"click\": onSelect(value + 1)\n }\n }, [((_this$slots3 = this.slots('next-text')) != null ? _this$slots3 : this.nextText) || t('next')])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit } from '../utils/functional';\nimport { BORDER_TOP } from '../utils/constant'; // Components\n\nimport Cell from '../cell';\nimport CellGroup from '../cell-group'; // Types\n\nvar _createNamespace = createNamespace('panel'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Panel(h, props, slots, ctx) {\n var Content = function Content() {\n return [slots.header ? slots.header() : h(Cell, {\n \"attrs\": {\n \"icon\": props.icon,\n \"label\": props.desc,\n \"title\": props.title,\n \"value\": props.status,\n \"valueClass\": bem('header-value')\n },\n \"class\": bem('header')\n }), h(\"div\", {\n \"class\": bem('content')\n }, [slots.default && slots.default()]), slots.footer && h(\"div\", {\n \"class\": [bem('footer'), BORDER_TOP]\n }, [slots.footer()])];\n };\n\n return h(CellGroup, _mergeJSXProps([{\n \"class\": bem(),\n \"scopedSlots\": {\n default: Content\n }\n }, inherit(ctx, true)]));\n}\n\nPanel.props = {\n icon: String,\n desc: String,\n title: String,\n status: String\n};\nexport default createComponent(Panel);","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { emit, inherit } from '../utils/functional';\nimport { BORDER_LEFT, BORDER_SURROUND } from '../utils/constant'; // Types\n\nvar _createNamespace = createNamespace('password-input'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction PasswordInput(h, props, slots, ctx) {\n var _ref2;\n\n var mask = props.mask,\n value = props.value,\n length = props.length,\n gutter = props.gutter,\n focused = props.focused,\n errorInfo = props.errorInfo;\n var info = errorInfo || props.info;\n var Points = [];\n\n for (var i = 0; i < length; i++) {\n var _ref;\n\n var _char = value[i];\n var showBorder = i !== 0 && !gutter;\n var showCursor = focused && i === value.length;\n var style = void 0;\n\n if (i !== 0 && gutter) {\n style = {\n marginLeft: addUnit(gutter)\n };\n }\n\n Points.push(h(\"li\", {\n \"class\": [(_ref = {}, _ref[BORDER_LEFT] = showBorder, _ref), bem('item', {\n focus: showCursor\n })],\n \"style\": style\n }, [mask ? h(\"i\", {\n \"style\": {\n visibility: _char ? 'visible' : 'hidden'\n }\n }) : _char, showCursor && h(\"div\", {\n \"class\": bem('cursor')\n })]));\n }\n\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"ul\", _mergeJSXProps([{\n \"class\": [bem('security'), (_ref2 = {}, _ref2[BORDER_SURROUND] = !gutter, _ref2)],\n \"on\": {\n \"touchstart\": function touchstart(event) {\n event.stopPropagation();\n emit(ctx, 'focus', event);\n }\n }\n }, inherit(ctx, true)]), [Points]), info && h(\"div\", {\n \"class\": bem(errorInfo ? 'error-info' : 'info')\n }, [info])]);\n}\n\nPasswordInput.props = {\n info: String,\n gutter: [Number, String],\n focused: Boolean,\n errorInfo: String,\n mask: {\n type: Boolean,\n default: true\n },\n value: {\n type: String,\n default: ''\n },\n length: {\n type: [Number, String],\n default: 6\n }\n};\nexport default createComponent(PasswordInput);","// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindow.js\nfunction getWindow(node) {\n if (node == null) {\n return window;\n }\n if (node.toString() !== \"[object Window]\") {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n return node;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\nfunction isShadowRoot(node) {\n if (typeof ShadowRoot === \"undefined\") {\n return false;\n }\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/math.js\nvar round = Math.round;\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/userAgent.js\nfunction getUAString() {\n var uaData = navigator.userAgentData;\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(function(item) {\n return item.brand + \"/\" + item.version;\n }).join(\" \");\n }\n return navigator.userAgent;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js\nfunction isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width,\n height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x,\n y\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js\nfunction getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft,\n scrollTop\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js\nfunction getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js\nfunction getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js\nfunction getNodeName(element) {\n return element ? (element.nodeName || \"\").toLowerCase() : null;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js\nfunction getDocumentElement(element) {\n return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js\nfunction getWindowScrollBarX(element) {\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js\nfunction isScrollParent(element) {\n var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n}\nfunction getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== \"body\" || isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js\nfunction getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element);\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width,\n height\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js\nfunction getParentNode(element) {\n if (getNodeName(element) === \"html\") {\n return element;\n }\n return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js\nfunction getScrollParent(node) {\n if ([\"html\", \"body\", \"#document\"].indexOf(getNodeName(node)) >= 0) {\n return node.ownerDocument.body;\n }\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n return getScrollParent(getParentNode(node));\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js\nfunction listScrollParents(element, list) {\n var _element$ownerDocumen;\n if (list === void 0) {\n list = [];\n }\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js\nfunction isTableElement(element) {\n return [\"table\", \"td\", \"th\"].indexOf(getNodeName(element)) >= 0;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === \"fixed\") {\n return null;\n }\n return element.offsetParent;\n}\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n if (isIE && isHTMLElement(element)) {\n var elementCss = getComputedStyle(element);\n if (elementCss.position === \"fixed\") {\n return null;\n }\n }\n var currentNode = getParentNode(element);\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n while (isHTMLElement(currentNode) && [\"html\", \"body\"].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode);\n if (css.transform !== \"none\" || css.perspective !== \"none\" || css.contain === \"paint\" || [\"transform\", \"perspective\"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === \"filter\" || isFirefox && css.filter && css.filter !== \"none\") {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n return null;\n}\nfunction getOffsetParent(element) {\n var window2 = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === \"static\") {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n if (offsetParent && (getNodeName(offsetParent) === \"html\" || getNodeName(offsetParent) === \"body\" && getComputedStyle(offsetParent).position === \"static\")) {\n return window2;\n }\n return offsetParent || getContainingBlock(element) || window2;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/enums.js\nvar top = \"top\";\nvar bottom = \"bottom\";\nvar right = \"right\";\nvar left = \"left\";\nvar auto = \"auto\";\nvar basePlacements = [top, bottom, right, left];\nvar start = \"start\";\nvar end = \"end\";\nvar placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nvar beforeRead = \"beforeRead\";\nvar read = \"read\";\nvar afterRead = \"afterRead\";\nvar beforeMain = \"beforeMain\";\nvar main = \"main\";\nvar afterMain = \"afterMain\";\nvar beforeWrite = \"beforeWrite\";\nvar write = \"write\";\nvar afterWrite = \"afterWrite\";\nvar modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/orderModifiers.js\nfunction order(modifiers) {\n var map = /* @__PURE__ */ new Map();\n var visited = /* @__PURE__ */ new Set();\n var result = [];\n modifiers.forEach(function(modifier) {\n map.set(modifier.name, modifier);\n });\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function(dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n modifiers.forEach(function(modifier) {\n if (!visited.has(modifier.name)) {\n sort(modifier);\n }\n });\n return result;\n}\nfunction orderModifiers(modifiers) {\n var orderedModifiers = order(modifiers);\n return modifierPhases.reduce(function(acc, phase) {\n return acc.concat(orderedModifiers.filter(function(modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/debounce.js\nfunction debounce(fn2) {\n var pending;\n return function() {\n if (!pending) {\n pending = new Promise(function(resolve) {\n Promise.resolve().then(function() {\n pending = void 0;\n resolve(fn2());\n });\n });\n }\n return pending;\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/format.js\nfunction format(str) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return [].concat(args).reduce(function(p, c) {\n return p.replace(/%s/, c);\n }, str);\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/validateModifiers.js\nvar INVALID_MODIFIER_ERROR = 'Popper: modifier \"%s\" provided an invalid %s property, expected %s but got %s';\nvar MISSING_DEPENDENCY_ERROR = 'Popper: modifier \"%s\" requires \"%s\", but \"%s\" modifier is not available';\nvar VALID_PROPERTIES = [\"name\", \"enabled\", \"phase\", \"fn\", \"effect\", \"requires\", \"options\"];\nfunction validateModifiers(modifiers) {\n modifiers.forEach(function(modifier) {\n [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self) {\n return self.indexOf(value) === index;\n }).forEach(function(key) {\n switch (key) {\n case \"name\":\n if (typeof modifier.name !== \"string\") {\n console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '\"name\"', '\"string\"', '\"' + String(modifier.name) + '\"'));\n }\n break;\n case \"enabled\":\n if (typeof modifier.enabled !== \"boolean\") {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"enabled\"', '\"boolean\"', '\"' + String(modifier.enabled) + '\"'));\n }\n break;\n case \"phase\":\n if (modifierPhases.indexOf(modifier.phase) < 0) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"phase\"', \"either \" + modifierPhases.join(\", \"), '\"' + String(modifier.phase) + '\"'));\n }\n break;\n case \"fn\":\n if (typeof modifier.fn !== \"function\") {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"fn\"', '\"function\"', '\"' + String(modifier.fn) + '\"'));\n }\n break;\n case \"effect\":\n if (modifier.effect != null && typeof modifier.effect !== \"function\") {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"effect\"', '\"function\"', '\"' + String(modifier.fn) + '\"'));\n }\n break;\n case \"requires\":\n if (modifier.requires != null && !Array.isArray(modifier.requires)) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"requires\"', '\"array\"', '\"' + String(modifier.requires) + '\"'));\n }\n break;\n case \"requiresIfExists\":\n if (!Array.isArray(modifier.requiresIfExists)) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"requiresIfExists\"', '\"array\"', '\"' + String(modifier.requiresIfExists) + '\"'));\n }\n break;\n case \"options\":\n case \"data\":\n break;\n default:\n console.error('PopperJS: an invalid property has been provided to the \"' + modifier.name + '\" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {\n return '\"' + s + '\"';\n }).join(\", \") + '; but \"' + key + '\" was provided.');\n }\n modifier.requires && modifier.requires.forEach(function(requirement) {\n if (modifiers.find(function(mod) {\n return mod.name === requirement;\n }) == null) {\n console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));\n }\n });\n });\n });\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/uniqueBy.js\nfunction uniqueBy(arr, fn2) {\n var identifiers = /* @__PURE__ */ new Set();\n return arr.filter(function(item) {\n var identifier = fn2(item);\n if (!identifiers.has(identifier)) {\n identifiers.add(identifier);\n return true;\n }\n });\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getBasePlacement.js\nfunction getBasePlacement(placement) {\n return placement.split(\"-\")[0];\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/mergeByName.js\nfunction mergeByName(modifiers) {\n var merged = modifiers.reduce(function(merged2, current) {\n var existing = merged2[current.name];\n merged2[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged2;\n }, {});\n return Object.keys(merged).map(function(key) {\n return merged[key];\n });\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getVariation.js\nfunction getVariation(placement) {\n return placement.split(\"-\")[1];\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js\nfunction getMainAxisFromPlacement(placement) {\n return [\"top\", \"bottom\"].indexOf(placement) >= 0 ? \"x\" : \"y\";\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/computeOffsets.js\nfunction computeOffsets(_ref) {\n var reference = _ref.reference, element = _ref.element, placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n if (mainAxis != null) {\n var len = mainAxis === \"y\" ? \"height\" : \"width\";\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n return offsets;\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/createPopper.js\nvar INVALID_ELEMENT_ERROR = \"Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.\";\nvar INFINITE_LOOP_ERROR = \"Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.\";\nvar DEFAULT_OPTIONS = {\n placement: \"bottom\",\n modifiers: [],\n strategy: \"absolute\"\n};\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return !args.some(function(element) {\n return !(element && typeof element.getBoundingClientRect === \"function\");\n });\n}\nfunction popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper2(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n var state = {\n placement: \"bottom\",\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference,\n popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state,\n setOptions: function setOptions(setOptionsAction) {\n var options2 = typeof setOptionsAction === \"function\" ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options2);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n };\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));\n state.orderedModifiers = orderedModifiers.filter(function(m) {\n return m.enabled;\n });\n if (true) {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function(_ref2) {\n var name = _ref2.name;\n return name === \"flip\";\n });\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', \"present and enabled to work.\"].join(\" \"));\n }\n }\n var _getComputedStyle = getComputedStyle(popper), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', \"between the popper and its reference element or boundary.\", \"To replicate margin, use the `offset` modifier, as well as\", \"the `padding` option in the `preventOverflow` and `flip`\", \"modifiers.\"].join(\" \"));\n }\n }\n runModifierEffects();\n return instance.update();\n },\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;\n if (!areValidElements(reference2, popper2)) {\n if (true) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n }\n state.rects = {\n reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === \"fixed\"),\n popper: getLayoutRect(popper2)\n };\n state.reset = false;\n state.placement = state.options.placement;\n state.orderedModifiers.forEach(function(modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (true) {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;\n if (typeof fn2 === \"function\") {\n state = fn2({\n state,\n options: _options,\n name,\n instance\n }) || state;\n }\n }\n },\n update: debounce(function() {\n return new Promise(function(resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n if (!areValidElements(reference, popper)) {\n if (true) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n instance.setOptions(options).then(function(state2) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state2);\n }\n });\n function runModifierEffects() {\n state.orderedModifiers.forEach(function(_ref3) {\n var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect3 = _ref3.effect;\n if (typeof effect3 === \"function\") {\n var cleanupFn = effect3({\n state,\n name,\n instance,\n options: options2\n });\n var noopFn = function noopFn2() {\n };\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function(fn2) {\n return fn2();\n });\n effectCleanupFns = [];\n }\n return instance;\n };\n}\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/eventListeners.js\nvar passive = {\n passive: true\n};\nfunction effect(_ref) {\n var state = _ref.state, instance = _ref.instance, options = _ref.options;\n var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;\n var window2 = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n if (scroll) {\n scrollParents.forEach(function(scrollParent) {\n scrollParent.addEventListener(\"scroll\", instance.update, passive);\n });\n }\n if (resize) {\n window2.addEventListener(\"resize\", instance.update, passive);\n }\n return function() {\n if (scroll) {\n scrollParents.forEach(function(scrollParent) {\n scrollParent.removeEventListener(\"scroll\", instance.update, passive);\n });\n }\n if (resize) {\n window2.removeEventListener(\"resize\", instance.update, passive);\n }\n };\n}\nvar eventListeners_default = {\n name: \"eventListeners\",\n enabled: true,\n phase: \"write\",\n fn: function fn() {\n },\n effect,\n data: {}\n};\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js\nfunction popperOffsets(_ref) {\n var state = _ref.state, name = _ref.name;\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: \"absolute\",\n placement: state.placement\n });\n}\nvar popperOffsets_default = {\n name: \"popperOffsets\",\n enabled: true,\n phase: \"read\",\n fn: popperOffsets,\n data: {}\n};\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/computeStyles.js\nvar unsetSides = {\n top: \"auto\",\n right: \"auto\",\n bottom: \"auto\",\n left: \"auto\"\n};\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x, y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\nfunction mapToStyles(_ref2) {\n var _Object$assign2;\n var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;\n var _ref3 = typeof roundOffsets === \"function\" ? roundOffsets({\n x,\n y\n }) : {\n x,\n y\n };\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty(\"x\");\n var hasY = offsets.hasOwnProperty(\"y\");\n var sideX = left;\n var sideY = top;\n var win = window;\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = \"clientHeight\";\n var widthProp = \"clientWidth\";\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n if (getComputedStyle(offsetParent).position !== \"static\" && position === \"absolute\") {\n heightProp = \"scrollHeight\";\n widthProp = \"scrollWidth\";\n }\n }\n offsetParent = offsetParent;\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n var commonStyles = Object.assign({\n position\n }, adaptive && unsetSides);\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x,\n y\n }) : {\n x,\n y\n };\n x = _ref4.x;\n y = _ref4.y;\n if (gpuAcceleration) {\n var _Object$assign;\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? \"0\" : \"\", _Object$assign[sideX] = hasX ? \"0\" : \"\", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : \"\", _Object$assign2[sideX] = hasX ? x + \"px\" : \"\", _Object$assign2.transform = \"\", _Object$assign2));\n}\nfunction computeStyles(_ref5) {\n var state = _ref5.state, options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n if (true) {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || \"\";\n if (adaptive && [\"transform\", \"top\", \"right\", \"bottom\", \"left\"].some(function(property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn([\"Popper: Detected CSS transitions on at least one of the following\", 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', \"\\n\\n\", 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', \"for smooth transitions, or remove these properties from the CSS\", \"transition declaration on the popper element if only transitioning\", \"opacity or background-color for example.\", \"\\n\\n\", \"We recommend using the popper element as a wrapper around an inner\", \"element that can have any CSS property transitioned for animations.\"].join(\" \"));\n }\n }\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === \"fixed\"\n };\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets\n })));\n }\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: \"absolute\",\n adaptive: false,\n roundOffsets\n })));\n }\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n \"data-popper-placement\": state.placement\n });\n}\nvar computeStyles_default = {\n name: \"computeStyles\",\n enabled: true,\n phase: \"beforeWrite\",\n fn: computeStyles,\n data: {}\n};\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/applyStyles.js\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function(name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name];\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function(name2) {\n var value = attributes[name2];\n if (value === false) {\n element.removeAttribute(name2);\n } else {\n element.setAttribute(name2, value === true ? \"\" : value);\n }\n });\n });\n}\nfunction effect2(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: \"0\",\n top: \"0\",\n margin: \"0\"\n },\n arrow: {\n position: \"absolute\"\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n return function() {\n Object.keys(state.elements).forEach(function(name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);\n var style = styleProperties.reduce(function(style2, property) {\n style2[property] = \"\";\n return style2;\n }, {});\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function(attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n}\nvar applyStyles_default = {\n name: \"applyStyles\",\n enabled: true,\n phase: \"write\",\n fn: applyStyles,\n effect: effect2,\n requires: [\"computeStyles\"]\n};\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/popper-lite.js\nvar defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];\nvar createPopper = /* @__PURE__ */ popperGenerator({\n defaultModifiers\n});\n\n// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/offset.js\nfunction distanceAndSkiddingToXY(placement, rects, offset2) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n var _ref = typeof offset2 === \"function\" ? offset2(Object.assign({}, rects, {\n placement\n })) : offset2, skidding = _ref[0], distance = _ref[1];\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\nfunction offset(_ref2) {\n var state = _ref2.state, options = _ref2.options, name = _ref2.name;\n var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function(acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n state.modifiersData[name] = data;\n}\nvar offset_default = {\n name: \"offset\",\n enabled: true,\n phase: \"main\",\n requires: [\"popperOffsets\"],\n fn: offset\n};\nexport {\n createPopper,\n offset_default as offsetModifier\n};\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createPopper as _createPopper, offsetModifier } from '@vant/popperjs';\nimport { createNamespace, isServer } from '../utils';\nimport { BORDER_BOTTOM } from '../utils/constant'; // Mixins\n\nimport { ClickOutsideMixin } from '../mixins/click-outside'; // Components\n\nimport Icon from '../icon';\nimport Popup from '../popup';\n\nvar _createNamespace = createNamespace('popover'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ClickOutsideMixin({\n event: 'touchstart',\n method: 'onClickOutside'\n })],\n props: {\n value: Boolean,\n trigger: String,\n overlay: Boolean,\n offset: {\n type: Array,\n default: function _default() {\n return [0, 8];\n }\n },\n theme: {\n type: String,\n default: 'light'\n },\n actions: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n placement: {\n type: String,\n default: 'bottom'\n },\n getContainer: {\n type: [String, Function],\n default: 'body'\n },\n closeOnClickAction: {\n type: Boolean,\n default: true\n }\n },\n watch: {\n value: 'updateLocation',\n placement: 'updateLocation'\n },\n mounted: function mounted() {\n this.updateLocation();\n },\n beforeDestroy: function beforeDestroy() {\n if (this.popper) {\n if (!isServer) {\n window.removeEventListener('animationend', this.updateLocation);\n window.removeEventListener('transitionend', this.updateLocation);\n }\n\n this.popper.destroy();\n this.popper = null;\n }\n },\n methods: {\n createPopper: function createPopper() {\n var popper = _createPopper(this.$refs.wrapper, this.$refs.popover.$el, {\n placement: this.placement,\n modifiers: [{\n name: 'computeStyles',\n options: {\n adaptive: false,\n gpuAcceleration: false\n }\n }, _extends({}, offsetModifier, {\n options: {\n offset: this.offset\n }\n })]\n });\n\n if (!isServer) {\n window.addEventListener('animationend', this.updateLocation);\n window.addEventListener('transitionend', this.updateLocation);\n }\n\n return popper;\n },\n updateLocation: function updateLocation() {\n var _this = this;\n\n this.$nextTick(function () {\n if (!_this.value) {\n return;\n }\n\n if (!_this.popper) {\n _this.popper = _this.createPopper();\n } else {\n _this.popper.setOptions({\n placement: _this.placement\n });\n }\n });\n },\n renderAction: function renderAction(action, index) {\n var _this2 = this;\n\n var h = this.$createElement;\n var icon = action.icon,\n text = action.text,\n disabled = action.disabled,\n className = action.className;\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"menuitem\"\n },\n \"class\": [bem('action', {\n disabled: disabled,\n 'with-icon': icon\n }), className],\n \"on\": {\n \"click\": function click() {\n return _this2.onClickAction(action, index);\n }\n }\n }, [icon && h(Icon, {\n \"attrs\": {\n \"name\": icon\n },\n \"class\": bem('action-icon')\n }), h(\"div\", {\n \"class\": [bem('action-text'), BORDER_BOTTOM]\n }, [text])]);\n },\n onToggle: function onToggle(value) {\n this.$emit('input', value);\n },\n onClickWrapper: function onClickWrapper() {\n if (this.trigger === 'click') {\n this.onToggle(!this.value);\n }\n },\n onTouchstart: function onTouchstart(event) {\n event.stopPropagation();\n this.$emit('touchstart', event);\n },\n onClickAction: function onClickAction(action, index) {\n if (action.disabled) {\n return;\n }\n\n this.$emit('select', action, index);\n\n if (this.closeOnClickAction) {\n this.$emit('input', false);\n }\n },\n onClickOutside: function onClickOutside() {\n this.$emit('input', false);\n },\n onOpen: function onOpen() {\n this.$emit('open');\n },\n\n /* istanbul ignore next */\n onOpened: function onOpened() {\n this.$emit('opened');\n },\n onClose: function onClose() {\n this.$emit('close');\n },\n\n /* istanbul ignore next */\n onClosed: function onClosed() {\n this.$emit('closed');\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"span\", {\n \"ref\": \"wrapper\",\n \"class\": bem('wrapper'),\n \"on\": {\n \"click\": this.onClickWrapper\n }\n }, [h(Popup, {\n \"ref\": \"popover\",\n \"attrs\": {\n \"value\": this.value,\n \"overlay\": this.overlay,\n \"position\": null,\n \"transition\": \"van-popover-zoom\",\n \"lockScroll\": false,\n \"getContainer\": this.getContainer\n },\n \"class\": bem([this.theme]),\n \"on\": {\n \"open\": this.onOpen,\n \"close\": this.onClose,\n \"input\": this.onToggle,\n \"opened\": this.onOpened,\n \"closed\": this.onClosed\n },\n \"nativeOn\": {\n \"touchstart\": this.onTouchstart\n }\n }, [h(\"div\", {\n \"class\": bem('arrow')\n }), h(\"div\", {\n \"class\": bem('content'),\n \"attrs\": {\n \"role\": \"menu\"\n }\n }, [this.slots('default') || this.actions.map(this.renderAction)])]), this.slots('reference')]);\n }\n});","import { createNamespace, addUnit } from '../utils';\nimport { BindEventMixin } from '../mixins/bind-event';\n\nvar _createNamespace = createNamespace('progress'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [BindEventMixin(function (bind) {\n bind(window, 'resize', this.resize, true);\n bind(window, 'orientationchange', this.resize, true);\n })],\n props: {\n color: String,\n inactive: Boolean,\n pivotText: String,\n textColor: String,\n pivotColor: String,\n trackColor: String,\n strokeWidth: [Number, String],\n percentage: {\n type: [Number, String],\n required: true,\n validator: function validator(value) {\n return value >= 0 && value <= 100;\n }\n },\n showPivot: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n pivotWidth: 0,\n progressWidth: 0\n };\n },\n mounted: function mounted() {\n this.resize();\n },\n watch: {\n showPivot: 'resize',\n pivotText: 'resize'\n },\n methods: {\n // @exposed-api\n resize: function resize() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.progressWidth = _this.$el.offsetWidth;\n _this.pivotWidth = _this.$refs.pivot ? _this.$refs.pivot.offsetWidth : 0;\n });\n }\n },\n render: function render() {\n var h = arguments[0];\n var pivotText = this.pivotText,\n percentage = this.percentage;\n var text = pivotText != null ? pivotText : percentage + '%';\n var showPivot = this.showPivot && text;\n var background = this.inactive ? '#cacaca' : this.color;\n var pivotStyle = {\n color: this.textColor,\n left: (this.progressWidth - this.pivotWidth) * percentage / 100 + \"px\",\n background: this.pivotColor || background\n };\n var portionStyle = {\n background: background,\n width: this.progressWidth * percentage / 100 + 'px'\n };\n var wrapperStyle = {\n background: this.trackColor,\n height: addUnit(this.strokeWidth)\n };\n return h(\"div\", {\n \"class\": bem(),\n \"style\": wrapperStyle\n }, [h(\"span\", {\n \"class\": bem('portion'),\n \"style\": portionStyle\n }, [showPivot && h(\"span\", {\n \"ref\": \"pivot\",\n \"style\": pivotStyle,\n \"class\": bem('pivot')\n }, [text])])]);\n }\n});","// Utils\nimport { createNamespace } from '../utils';\nimport { preventDefault } from '../utils/dom/event';\nimport { getScrollTop, getScroller } from '../utils/dom/scroll'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch'; // Components\n\nimport Loading from '../loading';\n\nvar _createNamespace = createNamespace('pull-refresh'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nvar DEFAULT_HEAD_HEIGHT = 50;\nvar TEXT_STATUS = ['pulling', 'loosing', 'success'];\nexport default createComponent({\n mixins: [TouchMixin],\n props: {\n disabled: Boolean,\n successText: String,\n pullingText: String,\n loosingText: String,\n loadingText: String,\n pullDistance: [Number, String],\n value: {\n type: Boolean,\n required: true\n },\n successDuration: {\n type: [Number, String],\n default: 500\n },\n animationDuration: {\n type: [Number, String],\n default: 300\n },\n headHeight: {\n type: [Number, String],\n default: DEFAULT_HEAD_HEIGHT\n }\n },\n data: function data() {\n return {\n status: 'normal',\n distance: 0,\n duration: 0\n };\n },\n computed: {\n touchable: function touchable() {\n return this.status !== 'loading' && this.status !== 'success' && !this.disabled;\n },\n headStyle: function headStyle() {\n if (this.headHeight !== DEFAULT_HEAD_HEIGHT) {\n return {\n height: this.headHeight + \"px\"\n };\n }\n }\n },\n watch: {\n value: function value(loading) {\n this.duration = this.animationDuration;\n\n if (loading) {\n this.setStatus(+this.headHeight, true);\n } else if (this.slots('success') || this.successText) {\n this.showSuccessTip();\n } else {\n this.setStatus(0, false);\n }\n }\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$refs.track);\n this.scrollEl = getScroller(this.$el);\n },\n methods: {\n checkPullStart: function checkPullStart(event) {\n this.ceiling = getScrollTop(this.scrollEl) === 0;\n\n if (this.ceiling) {\n this.duration = 0;\n this.touchStart(event);\n }\n },\n onTouchStart: function onTouchStart(event) {\n if (this.touchable) {\n this.checkPullStart(event);\n }\n },\n onTouchMove: function onTouchMove(event) {\n if (!this.touchable) {\n return;\n }\n\n if (!this.ceiling) {\n this.checkPullStart(event);\n }\n\n this.touchMove(event);\n\n if (this.ceiling && this.deltaY >= 0 && this.direction === 'vertical') {\n preventDefault(event);\n this.setStatus(this.ease(this.deltaY));\n }\n },\n onTouchEnd: function onTouchEnd() {\n var _this = this;\n\n if (this.touchable && this.ceiling && this.deltaY) {\n this.duration = this.animationDuration;\n\n if (this.status === 'loosing') {\n this.setStatus(+this.headHeight, true);\n this.$emit('input', true); // ensure value change can be watched\n\n this.$nextTick(function () {\n _this.$emit('refresh');\n });\n } else {\n this.setStatus(0);\n }\n }\n },\n ease: function ease(distance) {\n var pullDistance = +(this.pullDistance || this.headHeight);\n\n if (distance > pullDistance) {\n if (distance < pullDistance * 2) {\n distance = pullDistance + (distance - pullDistance) / 2;\n } else {\n distance = pullDistance * 1.5 + (distance - pullDistance * 2) / 4;\n }\n }\n\n return Math.round(distance);\n },\n setStatus: function setStatus(distance, isLoading) {\n var status;\n\n if (isLoading) {\n status = 'loading';\n } else if (distance === 0) {\n status = 'normal';\n } else {\n status = distance < (this.pullDistance || this.headHeight) ? 'pulling' : 'loosing';\n }\n\n this.distance = distance;\n\n if (status !== this.status) {\n this.status = status;\n }\n },\n genStatus: function genStatus() {\n var h = this.$createElement;\n var status = this.status,\n distance = this.distance;\n var slot = this.slots(status, {\n distance: distance\n });\n\n if (slot) {\n return slot;\n }\n\n var nodes = [];\n var text = this[status + \"Text\"] || t(status);\n\n if (TEXT_STATUS.indexOf(status) !== -1) {\n nodes.push(h(\"div\", {\n \"class\": bem('text')\n }, [text]));\n }\n\n if (status === 'loading') {\n nodes.push(h(Loading, {\n \"attrs\": {\n \"size\": \"16\"\n }\n }, [text]));\n }\n\n return nodes;\n },\n showSuccessTip: function showSuccessTip() {\n var _this2 = this;\n\n this.status = 'success';\n setTimeout(function () {\n _this2.setStatus(0);\n }, this.successDuration);\n }\n },\n render: function render() {\n var h = arguments[0];\n var trackStyle = {\n transitionDuration: this.duration + \"ms\",\n transform: this.distance ? \"translate3d(0,\" + this.distance + \"px, 0)\" : ''\n };\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"ref\": \"track\",\n \"class\": bem('track'),\n \"style\": trackStyle\n }, [h(\"div\", {\n \"class\": bem('head'),\n \"style\": this.headStyle\n }, [this.genStatus()]), this.slots()])]);\n }\n});","// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { preventDefault } from '../utils/dom/event'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch';\nimport { FieldMixin } from '../mixins/field'; // Components\n\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('rate'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction getRateStatus(value, index, allowHalf) {\n if (value >= index) {\n return 'full';\n }\n\n if (value + 0.5 >= index && allowHalf) {\n return 'half';\n }\n\n return 'void';\n}\n\nexport default createComponent({\n mixins: [TouchMixin, FieldMixin],\n props: {\n size: [Number, String],\n color: String,\n gutter: [Number, String],\n readonly: Boolean,\n disabled: Boolean,\n allowHalf: Boolean,\n voidColor: String,\n iconPrefix: String,\n disabledColor: String,\n value: {\n type: Number,\n default: 0\n },\n icon: {\n type: String,\n default: 'star'\n },\n voidIcon: {\n type: String,\n default: 'star-o'\n },\n count: {\n type: [Number, String],\n default: 5\n },\n touchable: {\n type: Boolean,\n default: true\n }\n },\n computed: {\n list: function list() {\n var list = [];\n\n for (var i = 1; i <= this.count; i++) {\n list.push(getRateStatus(this.value, i, this.allowHalf));\n }\n\n return list;\n },\n sizeWithUnit: function sizeWithUnit() {\n return addUnit(this.size);\n },\n gutterWithUnit: function gutterWithUnit() {\n return addUnit(this.gutter);\n }\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$el);\n },\n methods: {\n select: function select(index) {\n if (!this.disabled && !this.readonly && index !== this.value) {\n this.$emit('input', index);\n this.$emit('change', index);\n }\n },\n onTouchStart: function onTouchStart(event) {\n var _this = this;\n\n if (this.readonly || this.disabled || !this.touchable) {\n return;\n }\n\n this.touchStart(event);\n var rects = this.$refs.items.map(function (item) {\n return item.getBoundingClientRect();\n });\n var ranges = [];\n rects.forEach(function (rect, index) {\n if (_this.allowHalf) {\n ranges.push({\n score: index + 0.5,\n left: rect.left\n }, {\n score: index + 1,\n left: rect.left + rect.width / 2\n });\n } else {\n ranges.push({\n score: index + 1,\n left: rect.left\n });\n }\n });\n this.ranges = ranges;\n },\n onTouchMove: function onTouchMove(event) {\n if (this.readonly || this.disabled || !this.touchable) {\n return;\n }\n\n this.touchMove(event);\n\n if (this.direction === 'horizontal') {\n preventDefault(event);\n var clientX = event.touches[0].clientX;\n this.select(this.getScoreByPosition(clientX));\n }\n },\n getScoreByPosition: function getScoreByPosition(x) {\n for (var i = this.ranges.length - 1; i > 0; i--) {\n if (x > this.ranges[i].left) {\n return this.ranges[i].score;\n }\n }\n\n return this.allowHalf ? 0.5 : 1;\n },\n genStar: function genStar(status, index) {\n var _this2 = this;\n\n var h = this.$createElement;\n var icon = this.icon,\n color = this.color,\n count = this.count,\n voidIcon = this.voidIcon,\n disabled = this.disabled,\n voidColor = this.voidColor,\n disabledColor = this.disabledColor;\n var score = index + 1;\n var isFull = status === 'full';\n var isVoid = status === 'void';\n var style;\n\n if (this.gutterWithUnit && score !== +count) {\n style = {\n paddingRight: this.gutterWithUnit\n };\n }\n\n return h(\"div\", {\n \"ref\": \"items\",\n \"refInFor\": true,\n \"key\": index,\n \"attrs\": {\n \"role\": \"radio\",\n \"tabindex\": \"0\",\n \"aria-setsize\": count,\n \"aria-posinset\": score,\n \"aria-checked\": String(!isVoid)\n },\n \"style\": style,\n \"class\": bem('item')\n }, [h(Icon, {\n \"attrs\": {\n \"size\": this.sizeWithUnit,\n \"name\": isFull ? icon : voidIcon,\n \"color\": disabled ? disabledColor : isFull ? color : voidColor,\n \"classPrefix\": this.iconPrefix,\n \"data-score\": score\n },\n \"class\": bem('icon', {\n disabled: disabled,\n full: isFull\n }),\n \"on\": {\n \"click\": function click() {\n _this2.select(score);\n }\n }\n }), this.allowHalf && h(Icon, {\n \"attrs\": {\n \"size\": this.sizeWithUnit,\n \"name\": isVoid ? voidIcon : icon,\n \"color\": disabled ? disabledColor : isVoid ? voidColor : color,\n \"classPrefix\": this.iconPrefix,\n \"data-score\": score - 0.5\n },\n \"class\": bem('icon', ['half', {\n disabled: disabled,\n full: !isVoid\n }]),\n \"on\": {\n \"click\": function click() {\n _this2.select(score - 0.5);\n }\n }\n })]);\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem({\n readonly: this.readonly,\n disabled: this.disabled\n }),\n \"attrs\": {\n \"tabindex\": \"0\",\n \"role\": \"radiogroup\"\n }\n }, [this.list.map(function (status, index) {\n return _this3.genStar(status, index);\n })]);\n }\n});","import { createNamespace } from '../utils';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('row'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanRow')],\n props: {\n type: String,\n align: String,\n justify: String,\n tag: {\n type: String,\n default: 'div'\n },\n gutter: {\n type: [Number, String],\n default: 0\n }\n },\n computed: {\n spaces: function spaces() {\n var gutter = Number(this.gutter);\n\n if (!gutter) {\n return;\n }\n\n var spaces = [];\n var groups = [[]];\n var totalSpan = 0;\n this.children.forEach(function (item, index) {\n totalSpan += Number(item.span);\n\n if (totalSpan > 24) {\n groups.push([index]);\n totalSpan -= 24;\n } else {\n groups[groups.length - 1].push(index);\n }\n });\n groups.forEach(function (group) {\n var averagePadding = gutter * (group.length - 1) / group.length;\n group.forEach(function (item, index) {\n if (index === 0) {\n spaces.push({\n right: averagePadding\n });\n } else {\n var left = gutter - spaces[item - 1].right;\n var right = averagePadding - left;\n spaces.push({\n left: left,\n right: right\n });\n }\n });\n });\n return spaces;\n }\n },\n methods: {\n onClick: function onClick(event) {\n this.$emit('click', event);\n }\n },\n render: function render() {\n var _bem;\n\n var h = arguments[0];\n var align = this.align,\n justify = this.justify;\n var flex = this.type === 'flex';\n return h(this.tag, {\n \"class\": bem((_bem = {\n flex: flex\n }, _bem[\"align-\" + align] = flex && align, _bem[\"justify-\" + justify] = flex && justify, _bem)),\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.slots()]);\n }\n});","import _mergeJSXProps2 from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit, emit } from '../utils/functional';\nimport { preventDefault } from '../utils/dom/event'; // Components\n\nimport Field from '../field'; // Types\n\nvar _createNamespace = createNamespace('search'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction Search(h, props, slots, ctx) {\n function Label() {\n if (slots.label || props.label) {\n return h(\"div\", {\n \"class\": bem('label')\n }, [slots.label ? slots.label() : props.label]);\n }\n }\n\n function Action() {\n if (!props.showAction) {\n return;\n }\n\n function onCancel() {\n if (slots.action) {\n return;\n }\n\n emit(ctx, 'input', '');\n emit(ctx, 'cancel');\n }\n\n return h(\"div\", {\n \"class\": bem('action'),\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": \"0\"\n },\n \"on\": {\n \"click\": onCancel\n }\n }, [slots.action ? slots.action() : props.actionText || t('cancel')]);\n }\n\n var fieldData = {\n attrs: ctx.data.attrs,\n on: _extends({}, ctx.listeners, {\n keypress: function keypress(event) {\n // press enter\n if (event.keyCode === 13) {\n preventDefault(event);\n emit(ctx, 'search', props.value);\n }\n\n emit(ctx, 'keypress', event);\n }\n })\n };\n var inheritData = inherit(ctx);\n inheritData.attrs = undefined;\n return h(\"div\", _mergeJSXProps2([{\n \"class\": bem({\n 'show-action': props.showAction\n }),\n \"style\": {\n background: props.background\n }\n }, inheritData]), [slots.left == null ? void 0 : slots.left(), h(\"div\", {\n \"class\": bem('content', props.shape)\n }, [Label(), h(Field, _mergeJSXProps([{\n \"attrs\": {\n \"type\": \"search\",\n \"border\": false,\n \"value\": props.value,\n \"leftIcon\": props.leftIcon,\n \"rightIcon\": props.rightIcon,\n \"clearable\": props.clearable,\n \"clearTrigger\": props.clearTrigger\n },\n \"scopedSlots\": {\n 'left-icon': slots['left-icon'],\n 'right-icon': slots['right-icon']\n }\n }, fieldData]))]), Action()]);\n}\n\nSearch.props = {\n value: String,\n label: String,\n rightIcon: String,\n actionText: String,\n background: String,\n showAction: Boolean,\n clearTrigger: String,\n shape: {\n type: String,\n default: 'square'\n },\n clearable: {\n type: Boolean,\n default: true\n },\n leftIcon: {\n type: String,\n default: 'search'\n }\n};\nexport default createComponent(Search);","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../utils'; // Mixins\n\nimport { popupMixinProps } from '../mixins/popup'; // Components\n\nimport Popup from '../popup';\nvar PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments'];\n\nvar _createNamespace = createNamespace('share-sheet'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n props: _extends({}, popupMixinProps, {\n title: String,\n duration: String,\n cancelText: String,\n description: String,\n getContainer: [String, Function],\n options: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n overlay: {\n type: Boolean,\n default: true\n },\n closeOnPopstate: {\n type: Boolean,\n default: true\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n }\n }),\n methods: {\n onCancel: function onCancel() {\n this.toggle(false);\n this.$emit('cancel');\n },\n onSelect: function onSelect(option, index) {\n this.$emit('select', option, index);\n },\n toggle: function toggle(val) {\n this.$emit('input', val);\n },\n getIconURL: function getIconURL(icon) {\n if (PRESET_ICONS.indexOf(icon) !== -1) {\n return \"https://img01.yzcdn.cn/vant/share-sheet-\" + icon + \".png\";\n }\n\n return icon;\n },\n genHeader: function genHeader() {\n var h = this.$createElement;\n var title = this.slots('title') || this.title;\n var description = this.slots('description') || this.description;\n\n if (!title && !description) {\n return;\n }\n\n return h(\"div\", {\n \"class\": bem('header')\n }, [title && h(\"h2\", {\n \"class\": bem('title')\n }, [title]), description && h(\"span\", {\n \"class\": bem('description')\n }, [description])]);\n },\n genOptions: function genOptions(options, showBorder) {\n var _this = this;\n\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": bem('options', {\n border: showBorder\n })\n }, [options.map(function (option, index) {\n return h(\"div\", {\n \"attrs\": {\n \"role\": \"button\",\n \"tabindex\": \"0\"\n },\n \"class\": [bem('option'), option.className],\n \"on\": {\n \"click\": function click() {\n _this.onSelect(option, index);\n }\n }\n }, [h(\"img\", {\n \"attrs\": {\n \"src\": _this.getIconURL(option.icon)\n },\n \"class\": bem('icon')\n }), option.name && h(\"span\", {\n \"class\": bem('name')\n }, [option.name]), option.description && h(\"span\", {\n \"class\": bem('option-description')\n }, [option.description])]);\n })]);\n },\n genRows: function genRows() {\n var _this2 = this;\n\n var options = this.options;\n\n if (Array.isArray(options[0])) {\n return options.map(function (item, index) {\n return _this2.genOptions(item, index !== 0);\n });\n }\n\n return this.genOptions(options);\n },\n genCancelText: function genCancelText() {\n var _this$cancelText;\n\n var h = this.$createElement;\n var cancelText = (_this$cancelText = this.cancelText) != null ? _this$cancelText : t('cancel');\n\n if (cancelText) {\n return h(\"button\", {\n \"attrs\": {\n \"type\": \"button\"\n },\n \"class\": bem('cancel'),\n \"on\": {\n \"click\": this.onCancel\n }\n }, [cancelText]);\n }\n },\n onClickOverlay: function onClickOverlay() {\n this.$emit('click-overlay');\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(Popup, {\n \"attrs\": {\n \"round\": true,\n \"value\": this.value,\n \"position\": \"bottom\",\n \"overlay\": this.overlay,\n \"duration\": this.duration,\n \"lazyRender\": this.lazyRender,\n \"lockScroll\": this.lockScroll,\n \"getContainer\": this.getContainer,\n \"closeOnPopstate\": this.closeOnPopstate,\n \"closeOnClickOverlay\": this.closeOnClickOverlay,\n \"safeAreaInsetBottom\": this.safeAreaInsetBottom\n },\n \"class\": bem(),\n \"on\": {\n \"input\": this.toggle,\n \"click-overlay\": this.onClickOverlay\n }\n }, [this.genHeader(), this.genRows(), this.genCancelText()]);\n }\n});","import { createNamespace } from '../utils';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('sidebar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanSidebar')],\n model: {\n prop: 'activeKey'\n },\n props: {\n activeKey: {\n type: [Number, String],\n default: 0\n }\n },\n data: function data() {\n return {\n index: +this.activeKey\n };\n },\n watch: {\n activeKey: function activeKey() {\n this.setIndex(+this.activeKey);\n }\n },\n methods: {\n setIndex: function setIndex(index) {\n if (index !== this.index) {\n this.index = index;\n this.$emit('change', index);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [this.slots()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../utils';\nimport { ChildrenMixin } from '../mixins/relation';\nimport { route, routeProps } from '../utils/router';\nimport Info from '../info';\n\nvar _createNamespace = createNamespace('sidebar-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanSidebar')],\n props: _extends({}, routeProps, {\n dot: Boolean,\n // @deprecated\n info: [Number, String],\n badge: [Number, String],\n title: String,\n disabled: Boolean\n }),\n computed: {\n select: function select() {\n return this.index === +this.parent.activeKey;\n }\n },\n methods: {\n onClick: function onClick() {\n if (this.disabled) {\n return;\n }\n\n this.$emit('click', this.index);\n this.parent.$emit('input', this.index);\n this.parent.setIndex(this.index);\n route(this.$router, this);\n }\n },\n render: function render() {\n var _this$slots, _this$badge;\n\n var h = arguments[0];\n\n if (process.env.NODE_ENV === 'development' && this.info) {\n console.warn('[Vant] SidebarItem: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n return h(\"a\", {\n \"class\": bem({\n select: this.select,\n disabled: this.disabled\n }),\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(\"div\", {\n \"class\": bem('text')\n }, [(_this$slots = this.slots('title')) != null ? _this$slots : this.title, h(Info, {\n \"attrs\": {\n \"dot\": this.dot,\n \"info\": (_this$badge = this.badge) != null ? _this$badge : this.info\n },\n \"class\": bem('info')\n })])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { inherit } from '../utils/functional'; // Types\n\nvar _createNamespace = createNamespace('skeleton'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar DEFAULT_ROW_WIDTH = '100%';\nvar DEFAULT_LAST_ROW_WIDTH = '60%';\n\nfunction Skeleton(h, props, slots, ctx) {\n if (!props.loading) {\n return slots.default && slots.default();\n }\n\n function Title() {\n if (props.title) {\n return h(\"h3\", {\n \"class\": bem('title'),\n \"style\": {\n width: addUnit(props.titleWidth)\n }\n });\n }\n }\n\n function Rows() {\n var Rows = [];\n var rowWidth = props.rowWidth;\n\n function getRowWidth(index) {\n if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {\n return DEFAULT_LAST_ROW_WIDTH;\n }\n\n if (Array.isArray(rowWidth)) {\n return rowWidth[index];\n }\n\n return rowWidth;\n }\n\n for (var i = 0; i < props.row; i++) {\n Rows.push(h(\"div\", {\n \"class\": bem('row'),\n \"style\": {\n width: addUnit(getRowWidth(i))\n }\n }));\n }\n\n return Rows;\n }\n\n function Avatar() {\n if (props.avatar) {\n var size = addUnit(props.avatarSize);\n return h(\"div\", {\n \"class\": bem('avatar', props.avatarShape),\n \"style\": {\n width: size,\n height: size\n }\n });\n }\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem({\n animate: props.animate,\n round: props.round\n })\n }, inherit(ctx)]), [Avatar(), h(\"div\", {\n \"class\": bem('content')\n }, [Title(), Rows()])]);\n}\n\nSkeleton.props = {\n title: Boolean,\n round: Boolean,\n avatar: Boolean,\n titleWidth: [Number, String],\n avatarSize: [Number, String],\n row: {\n type: [Number, String],\n default: 0\n },\n loading: {\n type: Boolean,\n default: true\n },\n animate: {\n type: Boolean,\n default: true\n },\n avatarShape: {\n type: String,\n default: 'round'\n },\n rowWidth: {\n type: [Number, String, Array],\n default: DEFAULT_ROW_WIDTH\n }\n};\nexport default createComponent(Skeleton);","/**\n * Sku only provide zh-CN lang by default\n */\nexport default {\n 'zh-CN': {\n vanSku: {\n select: '请选择',\n selected: '已选',\n selectSku: '请先选择商品规格',\n soldout: '库存不足',\n originPrice: '原价',\n minusTip: '至少选择一件',\n minusStartTip: function minusStartTip(start) {\n return start + \"\\u4EF6\\u8D77\\u552E\";\n },\n unavailable: '商品已经无法购买啦',\n stock: '剩余',\n stockUnit: '件',\n quotaTip: function quotaTip(quota) {\n return \"\\u6BCF\\u4EBA\\u9650\\u8D2D\" + quota + \"\\u4EF6\";\n },\n quotaUsedTip: function quotaUsedTip(quota, count) {\n return \"\\u6BCF\\u4EBA\\u9650\\u8D2D\" + quota + \"\\u4EF6\\uFF0C\\u4F60\\u5DF2\\u8D2D\\u4E70\" + count + \"\\u4EF6\";\n }\n },\n vanSkuActions: {\n buy: '立即购买',\n addCart: '加入购物车'\n },\n vanSkuImgUploader: {\n oversize: function oversize(maxSize) {\n return \"\\u6700\\u5927\\u53EF\\u4E0A\\u4F20\\u56FE\\u7247\\u4E3A\" + maxSize + \"MB\\uFF0C\\u8BF7\\u5C1D\\u8BD5\\u538B\\u7F29\\u56FE\\u7247\\u5C3A\\u5BF8\";\n },\n fail: '上传失败',\n uploading: '上传中...'\n },\n vanSkuStepper: {\n quotaLimit: function quotaLimit(quota) {\n return \"\\u9650\\u8D2D\" + quota + \"\\u4EF6\";\n },\n quotaStart: function quotaStart(start) {\n return start + \"\\u4EF6\\u8D77\\u552E\";\n },\n comma: ',',\n num: '购买数量'\n },\n vanSkuMessages: {\n fill: '请填写',\n upload: '请上传',\n imageLabel: '仅限一张',\n invalid: {\n tel: '请填写正确的数字格式留言',\n mobile: '手机号长度为6-20位数字',\n email: '请填写正确的邮箱',\n id_no: '请填写正确的身份证号码'\n },\n placeholder: {\n id_no: '请填写身份证号',\n text: '请填写留言',\n tel: '请填写数字',\n email: '请填写邮箱',\n date: '请选择日期',\n time: '请选择时间',\n textarea: '请填写留言',\n mobile: '请填写手机号'\n }\n },\n vanSkuRow: {\n multiple: '可多选'\n },\n vanSkuDatetimeField: {\n title: {\n date: '选择年月日',\n time: '选择时间',\n datetime: '选择日期时间'\n },\n format: {\n year: '年',\n month: '月',\n day: '日',\n hour: '时',\n minute: '分'\n }\n }\n }\n};","export var LIMIT_TYPE = {\n QUOTA_LIMIT: 0,\n STOCK_LIMIT: 1\n};\nexport var UNSELECTED_SKU_VALUE_ID = '';\nexport default {\n LIMIT_TYPE: LIMIT_TYPE,\n UNSELECTED_SKU_VALUE_ID: UNSELECTED_SKU_VALUE_ID\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { UNSELECTED_SKU_VALUE_ID } from '../constants';\n/*\n normalize sku tree\n\n [\n {\n count: 2,\n k: \"品种\", // 规格名称 skuKeyName\n k_id: \"1200\", // skuKeyId\n k_s: \"s1\" // skuKeyStr\n v: [ // skuValues\n { // skuValue\n id: \"1201\", // skuValueId\n name: \"萌\" // 具体的规格值 skuValueName\n }, {\n id: \"973\",\n name: \"帅\"\n }\n ]\n },\n ...\n ]\n |\n v\n {\n s1: [{\n id: \"1201\",\n name: \"萌\"\n }, {\n id: \"973\",\n name: \"帅\"\n }],\n ...\n }\n */\n\nexport var normalizeSkuTree = function normalizeSkuTree(skuTree) {\n var normalizedTree = {};\n skuTree.forEach(function (treeItem) {\n normalizedTree[treeItem.k_s] = treeItem.v;\n });\n return normalizedTree;\n};\nexport var normalizePropList = function normalizePropList(propList) {\n var normalizedProp = {};\n propList.forEach(function (item) {\n var itemObj = {};\n item.v.forEach(function (it) {\n itemObj[it.id] = it;\n });\n normalizedProp[item.k_id] = itemObj;\n });\n return normalizedProp;\n}; // 判断是否所有的sku都已经选中\n\nexport var isAllSelected = function isAllSelected(skuTree, selectedSku) {\n // 筛选selectedSku对象中key值不为空的值\n var selected = Object.keys(selectedSku).filter(function (skuKeyStr) {\n return selectedSku[skuKeyStr] !== UNSELECTED_SKU_VALUE_ID;\n });\n return skuTree.length === selected.length;\n}; // 根据已选择的 sku 获取 skuComb\n\nexport var getSkuComb = function getSkuComb(skuList, selectedSku) {\n var skuComb = skuList.filter(function (item) {\n return Object.keys(selectedSku).every(function (skuKeyStr) {\n return String(item[skuKeyStr]) === String(selectedSku[skuKeyStr]);\n });\n });\n return skuComb[0];\n}; // 获取已选择的sku名称\n\nexport var getSelectedSkuValues = function getSelectedSkuValues(skuTree, selectedSku) {\n var normalizedTree = normalizeSkuTree(skuTree);\n return Object.keys(selectedSku).reduce(function (selectedValues, skuKeyStr) {\n var skuValues = normalizedTree[skuKeyStr] || [];\n var skuValueId = selectedSku[skuKeyStr];\n\n if (skuValueId !== UNSELECTED_SKU_VALUE_ID && skuValues.length > 0) {\n var skuValue = skuValues.filter(function (value) {\n return value.id === skuValueId;\n })[0];\n skuValue && selectedValues.push(skuValue);\n }\n\n return selectedValues;\n }, []);\n}; // 判断sku是否可选\n\nexport var isSkuChoosable = function isSkuChoosable(skuList, selectedSku, skuToChoose) {\n var _extends2;\n\n var key = skuToChoose.key,\n valueId = skuToChoose.valueId; // 先假设sku已选中,拼入已选中sku对象中\n\n var matchedSku = _extends({}, selectedSku, (_extends2 = {}, _extends2[key] = valueId, _extends2)); // 再判断剩余sku是否全部不可选,若不可选则当前sku不可选中\n\n\n var skusToCheck = Object.keys(matchedSku).filter(function (skuKey) {\n return matchedSku[skuKey] !== UNSELECTED_SKU_VALUE_ID;\n });\n var filteredSku = skuList.filter(function (sku) {\n return skusToCheck.every(function (skuKey) {\n return String(matchedSku[skuKey]) === String(sku[skuKey]);\n });\n });\n var stock = filteredSku.reduce(function (total, sku) {\n total += sku.stock_num;\n return total;\n }, 0);\n return stock > 0;\n};\nexport var getSelectedPropValues = function getSelectedPropValues(propList, selectedProp) {\n var normalizeProp = normalizePropList(propList);\n return Object.keys(selectedProp).reduce(function (acc, cur) {\n selectedProp[cur].forEach(function (it) {\n acc.push(_extends({}, normalizeProp[cur][it]));\n });\n return acc;\n }, []);\n};\nexport var getSelectedProperties = function getSelectedProperties(propList, selectedProp) {\n var list = [];\n (propList || []).forEach(function (prop) {\n if (selectedProp[prop.k_id] && selectedProp[prop.k_id].length > 0) {\n var v = [];\n prop.v.forEach(function (it) {\n if (selectedProp[prop.k_id].indexOf(it.id) > -1) {\n v.push(_extends({}, it));\n }\n });\n list.push(_extends({}, prop, {\n v: v\n }));\n }\n });\n return list;\n};\nexport default {\n normalizeSkuTree: normalizeSkuTree,\n getSkuComb: getSkuComb,\n getSelectedSkuValues: getSelectedSkuValues,\n isAllSelected: isAllSelected,\n isSkuChoosable: isSkuChoosable,\n getSelectedPropValues: getSelectedPropValues,\n getSelectedProperties: getSelectedProperties\n};","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace } from '../../utils';\nimport { inherit } from '../../utils/functional';\nimport { BORDER_BOTTOM } from '../../utils/constant'; // Components\n\nimport Image from '../../image'; // Types\n\nvar _createNamespace = createNamespace('sku-header'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction getSkuImgValue(sku, selectedSku) {\n var imgValue;\n sku.tree.some(function (item) {\n var id = selectedSku[item.k_s];\n\n if (id && item.v) {\n var matchedSku = item.v.filter(function (skuValue) {\n return skuValue.id === id;\n })[0] || {};\n var img = matchedSku.previewImgUrl || matchedSku.imgUrl || matchedSku.img_url;\n\n if (img) {\n imgValue = _extends({}, matchedSku, {\n ks: item.k_s,\n imgUrl: img\n });\n return true;\n }\n }\n\n return false;\n });\n return imgValue;\n}\n\nfunction SkuHeader(h, props, slots, ctx) {\n var _slots$skuHeaderIma;\n\n var sku = props.sku,\n goods = props.goods,\n skuEventBus = props.skuEventBus,\n selectedSku = props.selectedSku,\n _props$showHeaderImag = props.showHeaderImage,\n showHeaderImage = _props$showHeaderImag === void 0 ? true : _props$showHeaderImag;\n var selectedValue = getSkuImgValue(sku, selectedSku);\n var imgUrl = selectedValue ? selectedValue.imgUrl : goods.picture;\n\n var previewImage = function previewImage() {\n skuEventBus.$emit('sku:previewImage', selectedValue);\n };\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": [bem(), BORDER_BOTTOM]\n }, inherit(ctx)]), [showHeaderImage && h(Image, {\n \"attrs\": {\n \"fit\": \"cover\",\n \"src\": imgUrl\n },\n \"class\": bem('img-wrap'),\n \"on\": {\n \"click\": previewImage\n }\n }, [(_slots$skuHeaderIma = slots['sku-header-image-extra']) == null ? void 0 : _slots$skuHeaderIma.call(slots)]), h(\"div\", {\n \"class\": bem('goods-info')\n }, [slots.default == null ? void 0 : slots.default()])]);\n}\n\nSkuHeader.props = {\n sku: Object,\n goods: Object,\n skuEventBus: Object,\n selectedSku: Object,\n showHeaderImage: Boolean\n};\nexport default createComponent(SkuHeader);","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../../utils';\nimport { inherit } from '../../utils/functional'; // Types\n\nvar _createNamespace = createNamespace('sku-header-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction SkuHeader(h, props, slots, ctx) {\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem()\n }, inherit(ctx)]), [slots.default && slots.default()]);\n}\n\nexport default createComponent(SkuHeader);","// Utils\nimport { createNamespace } from '../../utils';\nimport { BORDER_BOTTOM } from '../../utils/constant'; // Mixins\n\nimport { ParentMixin } from '../../mixins/relation';\nimport { BindEventMixin } from '../../mixins/bind-event';\n\nvar _createNamespace = createNamespace('sku-row'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport { bem };\nexport default createComponent({\n mixins: [ParentMixin('vanSkuRows'), BindEventMixin(function (bind) {\n if (this.scrollable && this.$refs.scroller) {\n bind(this.$refs.scroller, 'scroll', this.onScroll);\n }\n })],\n props: {\n skuRow: Object\n },\n data: function data() {\n return {\n progress: 0\n };\n },\n computed: {\n scrollable: function scrollable() {\n return this.skuRow.largeImageMode && this.skuRow.v.length > 6;\n }\n },\n methods: {\n onScroll: function onScroll() {\n var _this$$refs = this.$refs,\n scroller = _this$$refs.scroller,\n row = _this$$refs.row;\n var distance = row.offsetWidth - scroller.offsetWidth;\n this.progress = scroller.scrollLeft / distance;\n },\n genTitle: function genTitle() {\n var h = this.$createElement;\n return h(\"div\", {\n \"class\": bem('title')\n }, [this.skuRow.k, this.skuRow.is_multiple && h(\"span\", {\n \"class\": bem('title-multiple')\n }, [\"\\uFF08\", t('multiple'), \"\\uFF09\"])]);\n },\n genIndicator: function genIndicator() {\n var h = this.$createElement;\n\n if (this.scrollable) {\n var style = {\n transform: \"translate3d(\" + this.progress * 20 + \"px, 0, 0)\"\n };\n return h(\"div\", {\n \"class\": bem('indicator-wrapper')\n }, [h(\"div\", {\n \"class\": bem('indicator')\n }, [h(\"div\", {\n \"class\": bem('indicator-slider'),\n \"style\": style\n })])]);\n }\n },\n genContent: function genContent() {\n var h = this.$createElement;\n var nodes = this.slots();\n\n if (this.skuRow.largeImageMode) {\n var top = [];\n var bottom = [];\n nodes.forEach(function (node, index) {\n var group = Math.floor(index / 3) % 2 === 0 ? top : bottom;\n group.push(node);\n });\n return h(\"div\", {\n \"class\": bem('scroller'),\n \"ref\": \"scroller\"\n }, [h(\"div\", {\n \"class\": bem('row'),\n \"ref\": \"row\"\n }, [top]), bottom.length ? h(\"div\", {\n \"class\": bem('row')\n }, [bottom]) : null]);\n }\n\n return nodes;\n },\n centerItem: function centerItem(selectSkuId) {\n if (!this.skuRow.largeImageMode || !selectSkuId) {\n return;\n }\n\n var _this$children = this.children,\n children = _this$children === void 0 ? [] : _this$children;\n var _this$$refs2 = this.$refs,\n scroller = _this$$refs2.scroller,\n row = _this$$refs2.row;\n var child = children.find(function (it) {\n return +it.skuValue.id === +selectSkuId;\n });\n\n if (scroller && row && child && child.$el) {\n var target = child.$el;\n var to = target.offsetLeft - (scroller.offsetWidth - target.offsetWidth) / 2;\n scroller.scrollLeft = to;\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": [bem(), BORDER_BOTTOM]\n }, [this.genTitle(), this.genContent(), this.genIndicator()]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { bem } from './SkuRow';\nimport { createNamespace } from '../../utils';\nimport { isSkuChoosable } from '../utils/sku-helper';\nimport { ChildrenMixin } from '../../mixins/relation';\nimport Icon from '../../icon';\nimport Image from '../../image';\n\nvar _createNamespace = createNamespace('sku-row-item'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanSkuRows')],\n props: {\n lazyLoad: Boolean,\n skuValue: Object,\n skuKeyStr: String,\n skuEventBus: Object,\n selectedSku: Object,\n largeImageMode: Boolean,\n disableSoldoutSku: Boolean,\n skuList: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n computed: {\n imgUrl: function imgUrl() {\n var url = this.skuValue.imgUrl || this.skuValue.img_url;\n return this.largeImageMode ? url || 'https://img01.yzcdn.cn/upload_files/2020/06/24/FmKWDg0bN9rMcTp9ne8MXiQWGtLn.png' : url;\n },\n choosable: function choosable() {\n if (!this.disableSoldoutSku) {\n return true;\n }\n\n return isSkuChoosable(this.skuList, this.selectedSku, {\n key: this.skuKeyStr,\n valueId: this.skuValue.id\n });\n }\n },\n methods: {\n onSelect: function onSelect() {\n if (this.choosable) {\n this.skuEventBus.$emit('sku:select', _extends({}, this.skuValue, {\n skuKeyStr: this.skuKeyStr\n }));\n }\n },\n onPreviewImg: function onPreviewImg(event) {\n event.stopPropagation();\n var skuValue = this.skuValue,\n skuKeyStr = this.skuKeyStr;\n this.skuEventBus.$emit('sku:previewImage', _extends({}, skuValue, {\n ks: skuKeyStr,\n imgUrl: skuValue.imgUrl || skuValue.img_url\n }));\n },\n genImage: function genImage(classPrefix) {\n var h = this.$createElement;\n\n if (this.imgUrl) {\n return h(Image, {\n \"attrs\": {\n \"fit\": \"cover\",\n \"src\": this.imgUrl,\n \"lazyLoad\": this.lazyLoad\n },\n \"class\": classPrefix + \"-img\"\n });\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var choosed = this.skuValue.id === this.selectedSku[this.skuKeyStr];\n var classPrefix = this.largeImageMode ? bem('image-item') : bem('item');\n return h(\"span\", {\n \"class\": [classPrefix, choosed ? classPrefix + \"--active\" : '', !this.choosable ? classPrefix + \"--disabled\" : ''],\n \"on\": {\n \"click\": this.onSelect\n }\n }, [this.genImage(classPrefix), h(\"div\", {\n \"class\": classPrefix + \"-name\"\n }, [this.largeImageMode ? h(\"span\", {\n \"class\": {\n 'van-multi-ellipsis--l2': this.largeImageMode\n }\n }, [this.skuValue.name]) : this.skuValue.name]), this.largeImageMode && h(Icon, {\n \"attrs\": {\n \"name\": \"enlarge\"\n },\n \"class\": classPrefix + \"-img-icon\",\n \"on\": {\n \"click\": this.onPreviewImg\n }\n })]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { createNamespace } from '../../utils';\n\nvar _createNamespace = createNamespace('sku-row-prop-item'),\n createComponent = _createNamespace[0];\n\nexport default createComponent({\n props: {\n skuValue: Object,\n skuKeyStr: String,\n skuEventBus: Object,\n selectedProp: Object,\n multiple: Boolean,\n disabled: Boolean\n },\n computed: {\n choosed: function choosed() {\n var selectedProp = this.selectedProp,\n skuKeyStr = this.skuKeyStr,\n skuValue = this.skuValue;\n\n if (selectedProp && selectedProp[skuKeyStr]) {\n return selectedProp[skuKeyStr].indexOf(skuValue.id) > -1;\n }\n\n return false;\n }\n },\n methods: {\n onSelect: function onSelect() {\n if (this.disabled) return;\n this.skuEventBus.$emit('sku:propSelect', _extends({}, this.skuValue, {\n skuKeyStr: this.skuKeyStr,\n multiple: this.multiple\n }));\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"span\", {\n \"class\": ['van-sku-row__item', {\n 'van-sku-row__item--active': this.choosed\n }, {\n 'van-sku-row__item--disabled': this.disabled\n }],\n \"on\": {\n \"click\": this.onSelect\n }\n }, [h(\"span\", {\n \"class\": \"van-sku-row__item-name\"\n }, [this.skuValue.name])]);\n }\n});","import _mergeJSXProps2 from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport { createNamespace, isDef, addUnit } from '../utils';\nimport { resetScroll } from '../utils/dom/reset-scroll';\nimport { preventDefault } from '../utils/dom/event';\nimport { addNumber, formatNumber as _formatNumber } from '../utils/format/number';\nimport { isNaN } from '../utils/validate/number';\nimport { FieldMixin } from '../mixins/field';\n\nvar _createNamespace = createNamespace('stepper'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar LONG_PRESS_START_TIME = 600;\nvar LONG_PRESS_INTERVAL = 200;\n\nfunction equal(value1, value2) {\n return String(value1) === String(value2);\n}\n\nexport default createComponent({\n mixins: [FieldMixin],\n props: {\n value: null,\n theme: String,\n integer: Boolean,\n disabled: Boolean,\n allowEmpty: Boolean,\n inputWidth: [Number, String],\n buttonSize: [Number, String],\n asyncChange: Boolean,\n placeholder: String,\n disablePlus: Boolean,\n disableMinus: Boolean,\n disableInput: Boolean,\n decimalLength: [Number, String],\n name: {\n type: [Number, String],\n default: ''\n },\n min: {\n type: [Number, String],\n default: 1\n },\n max: {\n type: [Number, String],\n default: Infinity\n },\n step: {\n type: [Number, String],\n default: 1\n },\n defaultValue: {\n type: [Number, String],\n default: 1\n },\n showPlus: {\n type: Boolean,\n default: true\n },\n showMinus: {\n type: Boolean,\n default: true\n },\n showInput: {\n type: Boolean,\n default: true\n },\n longPress: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n var _this$value;\n\n var defaultValue = (_this$value = this.value) != null ? _this$value : this.defaultValue;\n var value = this.format(defaultValue);\n\n if (!equal(value, this.value)) {\n this.$emit('input', value);\n }\n\n return {\n currentValue: value\n };\n },\n computed: {\n minusDisabled: function minusDisabled() {\n return this.disabled || this.disableMinus || this.currentValue <= +this.min;\n },\n plusDisabled: function plusDisabled() {\n return this.disabled || this.disablePlus || this.currentValue >= +this.max;\n },\n inputStyle: function inputStyle() {\n var style = {};\n\n if (this.inputWidth) {\n style.width = addUnit(this.inputWidth);\n }\n\n if (this.buttonSize) {\n style.height = addUnit(this.buttonSize);\n }\n\n return style;\n },\n buttonStyle: function buttonStyle() {\n if (this.buttonSize) {\n var size = addUnit(this.buttonSize);\n return {\n width: size,\n height: size\n };\n }\n }\n },\n watch: {\n max: 'check',\n min: 'check',\n integer: 'check',\n decimalLength: 'check',\n value: function value(val) {\n if (!equal(val, this.currentValue)) {\n this.currentValue = this.format(val);\n }\n },\n currentValue: function currentValue(val) {\n this.$emit('input', val);\n this.$emit('change', val, {\n name: this.name\n });\n }\n },\n methods: {\n check: function check() {\n var val = this.format(this.currentValue);\n\n if (!equal(val, this.currentValue)) {\n this.currentValue = val;\n }\n },\n // formatNumber illegal characters\n formatNumber: function formatNumber(value) {\n return _formatNumber(String(value), !this.integer);\n },\n format: function format(value) {\n if (this.allowEmpty && value === '') {\n return value;\n }\n\n value = this.formatNumber(value); // format range\n\n value = value === '' ? 0 : +value;\n value = isNaN(value) ? this.min : value;\n value = Math.max(Math.min(this.max, value), this.min); // format decimal\n\n if (isDef(this.decimalLength)) {\n value = value.toFixed(this.decimalLength);\n }\n\n return value;\n },\n onInput: function onInput(event) {\n var value = event.target.value;\n var formatted = this.formatNumber(value); // limit max decimal length\n\n if (isDef(this.decimalLength) && formatted.indexOf('.') !== -1) {\n var pair = formatted.split('.');\n formatted = pair[0] + \".\" + pair[1].slice(0, this.decimalLength);\n }\n\n if (!equal(value, formatted)) {\n event.target.value = formatted;\n } // prefer number type\n\n\n if (formatted === String(+formatted)) {\n formatted = +formatted;\n }\n\n this.emitChange(formatted);\n },\n emitChange: function emitChange(value) {\n if (this.asyncChange) {\n this.$emit('input', value);\n this.$emit('change', value, {\n name: this.name\n });\n } else {\n this.currentValue = value;\n }\n },\n onChange: function onChange() {\n var type = this.type;\n\n if (this[type + \"Disabled\"]) {\n this.$emit('overlimit', type);\n return;\n }\n\n var diff = type === 'minus' ? -this.step : +this.step;\n var value = this.format(addNumber(+this.currentValue, diff));\n this.emitChange(value);\n this.$emit(type);\n },\n onFocus: function onFocus(event) {\n // readonly not work in legacy mobile safari\n if (this.disableInput && this.$refs.input) {\n this.$refs.input.blur();\n } else {\n this.$emit('focus', event);\n }\n },\n onBlur: function onBlur(event) {\n var value = this.format(event.target.value);\n event.target.value = value;\n this.emitChange(value);\n this.$emit('blur', event);\n resetScroll();\n },\n longPressStep: function longPressStep() {\n var _this = this;\n\n this.longPressTimer = setTimeout(function () {\n _this.onChange();\n\n _this.longPressStep(_this.type);\n }, LONG_PRESS_INTERVAL);\n },\n onTouchStart: function onTouchStart() {\n var _this2 = this;\n\n if (!this.longPress) {\n return;\n }\n\n clearTimeout(this.longPressTimer);\n this.isLongPress = false;\n this.longPressTimer = setTimeout(function () {\n _this2.isLongPress = true;\n\n _this2.onChange();\n\n _this2.longPressStep();\n }, LONG_PRESS_START_TIME);\n },\n onTouchEnd: function onTouchEnd(event) {\n if (!this.longPress) {\n return;\n }\n\n clearTimeout(this.longPressTimer);\n\n if (this.isLongPress) {\n preventDefault(event);\n }\n },\n onMousedown: function onMousedown(event) {\n // fix mobile safari page scroll down issue\n // see: https://github.com/vant-ui/vant/issues/7690\n if (this.disableInput) {\n event.preventDefault();\n }\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n\n var createListeners = function createListeners(type) {\n return {\n on: {\n click: function click(e) {\n // disable double tap scrolling on mobile safari\n e.preventDefault();\n _this3.type = type;\n\n _this3.onChange();\n },\n touchstart: function touchstart() {\n _this3.type = type;\n\n _this3.onTouchStart();\n },\n touchend: _this3.onTouchEnd,\n touchcancel: _this3.onTouchEnd\n }\n };\n };\n\n return h(\"div\", {\n \"class\": bem([this.theme])\n }, [h(\"button\", _mergeJSXProps([{\n \"directives\": [{\n name: \"show\",\n value: this.showMinus\n }],\n \"attrs\": {\n \"type\": \"button\"\n },\n \"style\": this.buttonStyle,\n \"class\": bem('minus', {\n disabled: this.minusDisabled\n })\n }, createListeners('minus')])), h(\"input\", {\n \"directives\": [{\n name: \"show\",\n value: this.showInput\n }],\n \"ref\": \"input\",\n \"attrs\": {\n \"type\": this.integer ? 'tel' : 'text',\n \"role\": \"spinbutton\",\n \"disabled\": this.disabled,\n \"readonly\": this.disableInput,\n \"inputmode\": this.integer ? 'numeric' : 'decimal',\n \"placeholder\": this.placeholder,\n \"aria-valuemax\": this.max,\n \"aria-valuemin\": this.min,\n \"aria-valuenow\": this.currentValue\n },\n \"class\": bem('input'),\n \"domProps\": {\n \"value\": this.currentValue\n },\n \"style\": this.inputStyle,\n \"on\": {\n \"input\": this.onInput,\n \"focus\": this.onFocus,\n \"blur\": this.onBlur,\n \"mousedown\": this.onMousedown\n }\n }), h(\"button\", _mergeJSXProps2([{\n \"directives\": [{\n name: \"show\",\n value: this.showPlus\n }],\n \"attrs\": {\n \"type\": \"button\"\n },\n \"style\": this.buttonStyle,\n \"class\": bem('plus', {\n disabled: this.plusDisabled\n })\n }, createListeners('plus')]))]);\n }\n});","import { createNamespace } from '../../utils';\nimport { LIMIT_TYPE } from '../constants';\nimport Stepper from '../../stepper';\nvar namespace = createNamespace('sku-stepper');\nvar createComponent = namespace[0];\nvar t = namespace[2];\nvar QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT,\n STOCK_LIMIT = LIMIT_TYPE.STOCK_LIMIT;\nexport default createComponent({\n props: {\n stock: Number,\n skuEventBus: Object,\n skuStockNum: Number,\n selectedNum: Number,\n stepperTitle: String,\n disableStepperInput: Boolean,\n customStepperConfig: Object,\n hideQuotaText: Boolean,\n quota: {\n type: Number,\n default: 0\n },\n quotaUsed: {\n type: Number,\n default: 0\n },\n startSaleNum: {\n type: Number,\n default: 1\n }\n },\n data: function data() {\n return {\n currentNum: this.selectedNum,\n // 购买限制类型: 限购/库存\n limitType: STOCK_LIMIT\n };\n },\n watch: {\n currentNum: function currentNum(num) {\n var intValue = parseInt(num, 10);\n\n if (intValue >= this.stepperMinLimit && intValue <= this.stepperLimit) {\n this.skuEventBus.$emit('sku:numChange', intValue);\n }\n },\n stepperLimit: function stepperLimit(limit) {\n if (limit < this.currentNum && this.stepperMinLimit <= limit) {\n this.currentNum = limit;\n }\n\n this.checkState(this.stepperMinLimit, limit);\n },\n stepperMinLimit: function stepperMinLimit(start) {\n if (start > this.currentNum || start > this.stepperLimit) {\n this.currentNum = start;\n }\n\n this.checkState(start, this.stepperLimit);\n }\n },\n computed: {\n stepperLimit: function stepperLimit() {\n var quotaLimit = this.quota - this.quotaUsed;\n var limit; // 无限购时直接取库存,有限购时取限购数和库存数中小的那个\n\n if (this.quota > 0 && quotaLimit <= this.stock) {\n // 修正负的limit\n limit = quotaLimit < 0 ? 0 : quotaLimit;\n this.limitType = QUOTA_LIMIT;\n } else {\n limit = this.stock;\n this.limitType = STOCK_LIMIT;\n }\n\n return limit;\n },\n stepperMinLimit: function stepperMinLimit() {\n return this.startSaleNum < 1 ? 1 : this.startSaleNum;\n },\n quotaText: function quotaText() {\n var _this$customStepperCo = this.customStepperConfig,\n quotaText = _this$customStepperCo.quotaText,\n hideQuotaText = _this$customStepperCo.hideQuotaText;\n if (hideQuotaText) return '';\n var text = '';\n\n if (quotaText) {\n text = quotaText;\n } else {\n var textArr = [];\n\n if (this.startSaleNum > 1) {\n textArr.push(t('quotaStart', this.startSaleNum));\n }\n\n if (this.quota > 0) {\n textArr.push(t('quotaLimit', this.quota));\n }\n\n text = textArr.join(t('comma'));\n }\n\n return text;\n }\n },\n created: function created() {\n this.checkState(this.stepperMinLimit, this.stepperLimit);\n },\n methods: {\n setCurrentNum: function setCurrentNum(num) {\n this.currentNum = num;\n this.checkState(this.stepperMinLimit, this.stepperLimit);\n },\n onOverLimit: function onOverLimit(action) {\n this.skuEventBus.$emit('sku:overLimit', {\n action: action,\n limitType: this.limitType,\n quota: this.quota,\n quotaUsed: this.quotaUsed,\n startSaleNum: this.startSaleNum\n });\n },\n onChange: function onChange(currentValue) {\n var intValue = parseInt(currentValue, 10);\n var handleStepperChange = this.customStepperConfig.handleStepperChange;\n handleStepperChange && handleStepperChange(intValue);\n this.$emit('change', intValue);\n },\n checkState: function checkState(min, max) {\n // 如果选择小于起售,则强制变为起售\n if (this.currentNum < min || min > max) {\n this.currentNum = min;\n } else if (this.currentNum > max) {\n // 当前选择数量大于最大可选时,需要重置已选数量\n this.currentNum = max;\n }\n\n this.skuEventBus.$emit('sku:stepperState', {\n valid: min <= max,\n min: min,\n max: max,\n limitType: this.limitType,\n quota: this.quota,\n quotaUsed: this.quotaUsed,\n startSaleNum: this.startSaleNum\n });\n }\n },\n render: function render() {\n var _this = this;\n\n var h = arguments[0];\n return h(\"div\", {\n \"class\": \"van-sku-stepper-stock\"\n }, [h(\"div\", {\n \"class\": \"van-sku__stepper-title\"\n }, [this.stepperTitle || t('num')]), h(Stepper, {\n \"attrs\": {\n \"integer\": true,\n \"min\": this.stepperMinLimit,\n \"max\": this.stepperLimit,\n \"disableInput\": this.disableStepperInput\n },\n \"class\": \"van-sku__stepper\",\n \"on\": {\n \"overlimit\": this.onOverLimit,\n \"change\": this.onChange\n },\n \"model\": {\n value: _this.currentNum,\n callback: function callback($$v) {\n _this.currentNum = $$v;\n }\n }\n }), !this.hideQuotaText && this.quotaText && h(\"span\", {\n \"class\": \"van-sku__stepper-quota\"\n }, [\"(\", this.quotaText, \")\"])]);\n }\n});","/* eslint-disable */\nexport function isEmail(value) {\n var reg = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/;\n return reg.test(value.trim());\n}","import { isFunction } from '../utils';\nexport function toArray(item) {\n if (Array.isArray(item)) {\n return item;\n }\n\n return [item];\n}\nexport function readFile(file, resultType) {\n return new Promise(function (resolve) {\n if (resultType === 'file') {\n resolve(null);\n return;\n }\n\n var reader = new FileReader();\n\n reader.onload = function (event) {\n resolve(event.target.result);\n };\n\n if (resultType === 'dataUrl') {\n reader.readAsDataURL(file);\n } else if (resultType === 'text') {\n reader.readAsText(file);\n }\n });\n}\nexport function isOversize(files, maxSize) {\n return toArray(files).some(function (file) {\n if (file) {\n if (isFunction(maxSize)) {\n return maxSize(file);\n }\n\n return file.size > maxSize;\n }\n\n return false;\n });\n}\nvar IMAGE_REGEXP = /\\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;\nexport function isImageUrl(url) {\n return IMAGE_REGEXP.test(url);\n}\nexport function isImageFile(item) {\n // some special urls cannot be recognized\n // user can add `isImage` flag to mark it as an image url\n if (item.isImage) {\n return true;\n }\n\n if (item.file && item.file.type) {\n return item.file.type.indexOf('image') === 0;\n }\n\n if (item.url) {\n return isImageUrl(item.url);\n }\n\n if (item.content) {\n return item.content.indexOf('data:image') === 0;\n }\n\n return false;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace, addUnit, noop, isPromise, isDef } from '../utils';\nimport { toArray, readFile as _readFile, isOversize, isImageFile } from './utils'; // Mixins\n\nimport { FieldMixin } from '../mixins/field'; // Components\n\nimport Icon from '../icon';\nimport Image from '../image';\nimport Loading from '../loading';\nimport ImagePreview from '../image-preview';\n\nvar _createNamespace = createNamespace('uploader'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n inheritAttrs: false,\n mixins: [FieldMixin],\n model: {\n prop: 'fileList'\n },\n props: {\n disabled: Boolean,\n readonly: Boolean,\n lazyLoad: Boolean,\n uploadText: String,\n afterRead: Function,\n beforeRead: Function,\n beforeDelete: Function,\n previewSize: [Number, String],\n previewOptions: Object,\n name: {\n type: [Number, String],\n default: ''\n },\n accept: {\n type: String,\n default: 'image/*'\n },\n fileList: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n maxSize: {\n type: [Number, String, Function],\n default: Number.MAX_VALUE\n },\n maxCount: {\n type: [Number, String],\n default: Number.MAX_VALUE\n },\n deletable: {\n type: Boolean,\n default: true\n },\n showUpload: {\n type: Boolean,\n default: true\n },\n previewImage: {\n type: Boolean,\n default: true\n },\n previewFullImage: {\n type: Boolean,\n default: true\n },\n imageFit: {\n type: String,\n default: 'cover'\n },\n resultType: {\n type: String,\n default: 'dataUrl'\n },\n uploadIcon: {\n type: String,\n default: 'photograph'\n }\n },\n computed: {\n previewSizeWithUnit: function previewSizeWithUnit() {\n return addUnit(this.previewSize);\n },\n // for form\n value: function value() {\n return this.fileList;\n }\n },\n created: function created() {\n this.urls = [];\n },\n beforeDestroy: function beforeDestroy() {\n this.urls.forEach(function (url) {\n return URL.revokeObjectURL(url);\n });\n },\n methods: {\n getDetail: function getDetail(index) {\n if (index === void 0) {\n index = this.fileList.length;\n }\n\n return {\n name: this.name,\n index: index\n };\n },\n onChange: function onChange(event) {\n var _this = this;\n\n var files = event.target.files;\n\n if (this.disabled || !files.length) {\n return;\n }\n\n files = files.length === 1 ? files[0] : [].slice.call(files);\n\n if (this.beforeRead) {\n var response = this.beforeRead(files, this.getDetail());\n\n if (!response) {\n this.resetInput();\n return;\n }\n\n if (isPromise(response)) {\n response.then(function (data) {\n if (data) {\n _this.readFile(data);\n } else {\n _this.readFile(files);\n }\n }).catch(this.resetInput);\n return;\n }\n }\n\n this.readFile(files);\n },\n readFile: function readFile(files) {\n var _this2 = this;\n\n var oversize = isOversize(files, this.maxSize);\n\n if (Array.isArray(files)) {\n var maxCount = this.maxCount - this.fileList.length;\n\n if (files.length > maxCount) {\n files = files.slice(0, maxCount);\n }\n\n Promise.all(files.map(function (file) {\n return _readFile(file, _this2.resultType);\n })).then(function (contents) {\n var fileList = files.map(function (file, index) {\n var result = {\n file: file,\n status: '',\n message: ''\n };\n\n if (contents[index]) {\n result.content = contents[index];\n }\n\n return result;\n });\n\n _this2.onAfterRead(fileList, oversize);\n });\n } else {\n _readFile(files, this.resultType).then(function (content) {\n var result = {\n file: files,\n status: '',\n message: ''\n };\n\n if (content) {\n result.content = content;\n }\n\n _this2.onAfterRead(result, oversize);\n });\n }\n },\n onAfterRead: function onAfterRead(files, oversize) {\n var _this3 = this;\n\n this.resetInput();\n var validFiles = files;\n\n if (oversize) {\n var oversizeFiles = files;\n\n if (Array.isArray(files)) {\n oversizeFiles = [];\n validFiles = [];\n files.forEach(function (item) {\n if (item.file) {\n if (isOversize(item.file, _this3.maxSize)) {\n oversizeFiles.push(item);\n } else {\n validFiles.push(item);\n }\n }\n });\n } else {\n validFiles = null;\n }\n\n this.$emit('oversize', oversizeFiles, this.getDetail());\n }\n\n var isValidFiles = Array.isArray(validFiles) ? Boolean(validFiles.length) : Boolean(validFiles);\n\n if (isValidFiles) {\n this.$emit('input', [].concat(this.fileList, toArray(validFiles)));\n\n if (this.afterRead) {\n this.afterRead(validFiles, this.getDetail());\n }\n }\n },\n onDelete: function onDelete(file, index) {\n var _file$beforeDelete,\n _this4 = this;\n\n var beforeDelete = (_file$beforeDelete = file.beforeDelete) != null ? _file$beforeDelete : this.beforeDelete;\n\n if (beforeDelete) {\n var response = beforeDelete(file, this.getDetail(index));\n\n if (!response) {\n return;\n }\n\n if (isPromise(response)) {\n response.then(function () {\n _this4.deleteFile(file, index);\n }).catch(noop);\n return;\n }\n }\n\n this.deleteFile(file, index);\n },\n deleteFile: function deleteFile(file, index) {\n var fileList = this.fileList.slice(0);\n fileList.splice(index, 1);\n this.$emit('input', fileList);\n this.$emit('delete', file, this.getDetail(index));\n },\n resetInput: function resetInput() {\n /* istanbul ignore else */\n if (this.$refs.input) {\n this.$refs.input.value = '';\n }\n },\n onClickUpload: function onClickUpload(event) {\n this.$emit('click-upload', event);\n },\n onPreviewImage: function onPreviewImage(item) {\n var _this5 = this;\n\n if (!this.previewFullImage) {\n return;\n }\n\n var imageFiles = this.fileList.filter(function (item) {\n return isImageFile(item);\n });\n var imageContents = imageFiles.map(function (item) {\n if (item.file && !item.url && item.status !== 'failed') {\n item.url = URL.createObjectURL(item.file);\n\n _this5.urls.push(item.url);\n }\n\n return item.url;\n });\n this.imagePreview = ImagePreview(_extends({\n images: imageContents,\n startPosition: imageFiles.indexOf(item),\n onClose: function onClose() {\n _this5.$emit('close-preview');\n }\n }, this.previewOptions));\n },\n // @exposed-api\n closeImagePreview: function closeImagePreview() {\n if (this.imagePreview) {\n this.imagePreview.close();\n }\n },\n // @exposed-api\n chooseFile: function chooseFile() {\n if (this.disabled) {\n return;\n }\n /* istanbul ignore else */\n\n\n if (this.$refs.input) {\n this.$refs.input.click();\n }\n },\n genPreviewMask: function genPreviewMask(item) {\n var h = this.$createElement;\n var status = item.status,\n message = item.message;\n\n if (status === 'uploading' || status === 'failed') {\n var MaskIcon = status === 'failed' ? h(Icon, {\n \"attrs\": {\n \"name\": \"close\"\n },\n \"class\": bem('mask-icon')\n }) : h(Loading, {\n \"class\": bem('loading')\n });\n var showMessage = isDef(message) && message !== '';\n return h(\"div\", {\n \"class\": bem('mask')\n }, [MaskIcon, showMessage && h(\"div\", {\n \"class\": bem('mask-message')\n }, [message])]);\n }\n },\n genPreviewItem: function genPreviewItem(item, index) {\n var _item$deletable,\n _this6 = this,\n _item$previewSize,\n _item$imageFit;\n\n var h = this.$createElement;\n var deleteAble = (_item$deletable = item.deletable) != null ? _item$deletable : this.deletable;\n var showDelete = item.status !== 'uploading' && deleteAble;\n var DeleteIcon = showDelete && h(\"div\", {\n \"class\": bem('preview-delete'),\n \"on\": {\n \"click\": function click(event) {\n event.stopPropagation();\n\n _this6.onDelete(item, index);\n }\n }\n }, [h(Icon, {\n \"attrs\": {\n \"name\": \"cross\"\n },\n \"class\": bem('preview-delete-icon')\n })]);\n var PreviewCoverContent = this.slots('preview-cover', _extends({\n index: index\n }, item));\n var PreviewCover = PreviewCoverContent && h(\"div\", {\n \"class\": bem('preview-cover')\n }, [PreviewCoverContent]);\n var previewSize = (_item$previewSize = item.previewSize) != null ? _item$previewSize : this.previewSize;\n var imageFit = (_item$imageFit = item.imageFit) != null ? _item$imageFit : this.imageFit;\n var Preview = isImageFile(item) ? h(Image, {\n \"attrs\": {\n \"fit\": imageFit,\n \"src\": item.content || item.url,\n \"width\": previewSize,\n \"height\": previewSize,\n \"lazyLoad\": this.lazyLoad\n },\n \"class\": bem('preview-image'),\n \"on\": {\n \"click\": function click() {\n _this6.onPreviewImage(item);\n }\n }\n }, [PreviewCover]) : h(\"div\", {\n \"class\": bem('file'),\n \"style\": {\n width: this.previewSizeWithUnit,\n height: this.previewSizeWithUnit\n }\n }, [h(Icon, {\n \"class\": bem('file-icon'),\n \"attrs\": {\n \"name\": \"description\"\n }\n }), h(\"div\", {\n \"class\": [bem('file-name'), 'van-ellipsis']\n }, [item.file ? item.file.name : item.url]), PreviewCover]);\n return h(\"div\", {\n \"class\": bem('preview'),\n \"on\": {\n \"click\": function click() {\n _this6.$emit('click-preview', item, _this6.getDetail(index));\n }\n }\n }, [Preview, this.genPreviewMask(item), DeleteIcon]);\n },\n genPreviewList: function genPreviewList() {\n if (this.previewImage) {\n return this.fileList.map(this.genPreviewItem);\n }\n },\n genUpload: function genUpload() {\n var h = this.$createElement;\n\n if (this.fileList.length >= this.maxCount) {\n return;\n }\n\n var slot = this.slots();\n var Input = this.readonly ? null : h(\"input\", {\n \"attrs\": _extends({}, this.$attrs, {\n \"type\": \"file\",\n \"accept\": this.accept,\n \"disabled\": this.disabled\n }),\n \"ref\": \"input\",\n \"class\": bem('input'),\n \"on\": {\n \"change\": this.onChange\n }\n });\n\n if (slot) {\n return h(\"div\", {\n \"class\": bem('input-wrapper'),\n \"key\": \"input-wrapper\",\n \"on\": {\n \"click\": this.onClickUpload\n }\n }, [slot, Input]);\n }\n\n var style;\n\n if (this.previewSize) {\n var size = this.previewSizeWithUnit;\n style = {\n width: size,\n height: size\n };\n }\n\n return h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.showUpload\n }],\n \"class\": bem('upload', {\n readonly: this.readonly\n }),\n \"style\": style,\n \"on\": {\n \"click\": this.onClickUpload\n }\n }, [h(Icon, {\n \"attrs\": {\n \"name\": this.uploadIcon\n },\n \"class\": bem('upload-icon')\n }), this.uploadText && h(\"span\", {\n \"class\": bem('upload-text')\n }, [this.uploadText]), Input]);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [h(\"div\", {\n \"class\": bem('wrapper', {\n disabled: this.disabled\n })\n }, [this.genPreviewList(), this.genUpload()])]);\n }\n});","// Utils\nimport { createNamespace } from '../../utils'; // Components\n\nimport Uploader from '../../uploader';\nvar namespace = createNamespace('sku-img-uploader');\nvar createComponent = namespace[0];\nvar t = namespace[2];\nexport default createComponent({\n props: {\n value: String,\n uploadImg: Function,\n customUpload: Function,\n maxSize: {\n type: Number,\n default: 6\n }\n },\n data: function data() {\n return {\n fileList: []\n };\n },\n watch: {\n value: function value(val) {\n if (val) {\n this.fileList = [{\n url: val,\n isImage: true\n }];\n } else {\n this.fileList = [];\n }\n }\n },\n methods: {\n afterReadFile: function afterReadFile(file) {\n var _this = this;\n\n file.status = 'uploading';\n file.message = t('uploading');\n this.uploadImg(file.file, file.content).then(function (img) {\n file.status = 'done';\n\n _this.$emit('input', img);\n }).catch(function () {\n file.status = 'failed';\n file.message = t('fail');\n });\n },\n onOversize: function onOversize() {\n this.$toast(t('oversize', this.maxSize));\n },\n onDelete: function onDelete() {\n this.$emit('input', '');\n },\n onClickUpload: function onClickUpload() {\n var _this2 = this;\n\n if (this.customUpload) {\n this.customUpload().then(function (url) {\n _this2.fileList.push({\n url: url\n });\n\n _this2.$emit('input', url);\n });\n }\n }\n },\n render: function render() {\n var _this3 = this;\n\n var h = arguments[0];\n return h(Uploader, {\n \"attrs\": {\n \"maxCount\": 1,\n \"readonly\": !!this.customUpload,\n \"maxSize\": this.maxSize * 1024 * 1024,\n \"afterRead\": this.afterReadFile\n },\n \"on\": {\n \"oversize\": this.onOversize,\n \"delete\": this.onDelete,\n \"click-upload\": this.onClickUpload\n },\n \"model\": {\n value: _this3.fileList,\n callback: function callback($$v) {\n _this3.fileList = $$v;\n }\n }\n });\n }\n});","import { padZero } from '../../utils/format/string'; // 字符串转 Date\n// 只处理 YYYY-MM-DD 或者 YYYY-MM-DD HH:MM 格式\n\nexport function stringToDate(timeString) {\n if (!timeString) {\n return null;\n }\n\n return new Date(timeString.replace(/-/g, '/'));\n} // Date 转字符串\n// type: date or datetime\n\nexport function dateToString(date, type) {\n if (type === void 0) {\n type = 'date';\n }\n\n if (!date) {\n return '';\n }\n\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n var timeString = year + \"-\" + padZero(month) + \"-\" + padZero(day);\n\n if (type === 'datetime') {\n var hours = date.getHours();\n var minute = date.getMinutes();\n timeString += \" \" + padZero(hours) + \":\" + padZero(minute);\n }\n\n return timeString;\n}","// Utils\nimport { createNamespace } from '../../utils';\nimport { stringToDate, dateToString } from '../utils/time-helper'; // Components\n\nimport Popup from '../../popup';\nimport DateTimePicker from '../../datetime-picker';\nimport Field from '../../field';\nvar namespace = createNamespace('sku-datetime-field');\nvar createComponent = namespace[0];\nvar t = namespace[2];\nexport default createComponent({\n props: {\n value: String,\n label: String,\n required: Boolean,\n placeholder: String,\n type: {\n type: String,\n default: 'date'\n }\n },\n data: function data() {\n return {\n showDatePicker: false,\n currentDate: this.type === 'time' ? '' : new Date(),\n minDate: new Date(new Date().getFullYear() - 60, 0, 1)\n };\n },\n watch: {\n value: function value(val) {\n switch (this.type) {\n case 'time':\n this.currentDate = val;\n break;\n\n case 'date':\n case 'datetime':\n this.currentDate = stringToDate(val) || new Date();\n break;\n }\n }\n },\n computed: {\n title: function title() {\n return t(\"title.\" + this.type);\n }\n },\n methods: {\n onClick: function onClick() {\n this.showDatePicker = true;\n },\n onConfirm: function onConfirm(val) {\n var data = val;\n\n if (this.type !== 'time') {\n data = dateToString(val, this.type);\n }\n\n this.$emit('input', data);\n this.showDatePicker = false;\n },\n onCancel: function onCancel() {\n this.showDatePicker = false;\n },\n formatter: function formatter(type, val) {\n var word = t(\"format.\" + type);\n return \"\" + val + word;\n }\n },\n render: function render() {\n var _this = this;\n\n var h = arguments[0];\n return h(Field, {\n \"attrs\": {\n \"readonly\": true,\n \"is-link\": true,\n \"center\": true,\n \"value\": this.value,\n \"label\": this.label,\n \"required\": this.required,\n \"placeholder\": this.placeholder\n },\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(Popup, {\n \"attrs\": {\n \"round\": true,\n \"position\": \"bottom\",\n \"getContainer\": \"body\"\n },\n \"slot\": \"extra\",\n \"model\": {\n value: _this.showDatePicker,\n callback: function callback($$v) {\n _this.showDatePicker = $$v;\n }\n }\n }, [h(DateTimePicker, {\n \"attrs\": {\n \"type\": this.type,\n \"title\": this.title,\n \"value\": this.currentDate,\n \"minDate\": this.minDate,\n \"formatter\": this.formatter\n },\n \"on\": {\n \"cancel\": this.onCancel,\n \"confirm\": this.onConfirm\n }\n })])]);\n }\n});","// Utils\nimport { createNamespace } from '../../utils';\nimport { isEmail } from '../../utils/validate/email';\nimport { isNumeric } from '../../utils/validate/number'; // Components\n\nimport Cell from '../../cell';\nimport Field from '../../field';\nimport SkuImgUploader from './SkuImgUploader';\nimport SkuDateTimeField from './SkuDateTimeField';\n\nvar _createNamespace = createNamespace('sku-messages'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nexport default createComponent({\n props: {\n messageConfig: Object,\n goodsId: [Number, String],\n messages: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n },\n data: function data() {\n return {\n messageValues: this.resetMessageValues(this.messages)\n };\n },\n watch: {\n messages: function messages(val) {\n this.messageValues = this.resetMessageValues(val);\n }\n },\n methods: {\n resetMessageValues: function resetMessageValues(messages) {\n var messageConfig = this.messageConfig;\n var _messageConfig$initia = messageConfig.initialMessages,\n initialMessages = _messageConfig$initia === void 0 ? {} : _messageConfig$initia;\n return (messages || []).map(function (message) {\n return {\n value: initialMessages[message.name] || ''\n };\n });\n },\n getType: function getType(message) {\n if (+message.multiple === 1) {\n return 'textarea';\n }\n\n if (message.type === 'id_no') {\n return 'text';\n }\n\n return message.datetime > 0 ? 'datetime' : message.type;\n },\n getMessages: function getMessages() {\n var messages = {};\n this.messageValues.forEach(function (item, index) {\n messages[\"message_\" + index] = item.value;\n });\n return messages;\n },\n getCartMessages: function getCartMessages() {\n var _this = this;\n\n var messages = {};\n this.messageValues.forEach(function (item, index) {\n var message = _this.messages[index];\n messages[message.name] = item.value;\n });\n return messages;\n },\n getPlaceholder: function getPlaceholder(message) {\n var type = +message.multiple === 1 ? 'textarea' : message.type;\n var map = this.messageConfig.placeholderMap || {};\n return message.placeholder || map[type] || t(\"placeholder.\" + type);\n },\n validateMessages: function validateMessages() {\n var values = this.messageValues;\n\n for (var i = 0; i < values.length; i++) {\n var value = values[i].value;\n var message = this.messages[i];\n\n if (value === '') {\n // 必填字段的校验\n if (String(message.required) === '1') {\n var textType = t(message.type === 'image' ? 'upload' : 'fill');\n return textType + message.name;\n }\n } else {\n if (message.type === 'tel' && !isNumeric(value)) {\n return t('invalid.tel');\n }\n\n if (message.type === 'mobile' && !/^\\d{6,20}$/.test(value)) {\n return t('invalid.mobile');\n }\n\n if (message.type === 'email' && !isEmail(value)) {\n return t('invalid.email');\n }\n\n if (message.type === 'id_no' && (value.length < 15 || value.length > 18)) {\n return t('invalid.id_no');\n }\n }\n }\n },\n\n /**\n * The phone number copied from IOS mobile phone address book\n * will add spaces and invisible Unicode characters\n * which cannot pass the /^\\d+$/ verification\n * so keep numbers and dots\n */\n getFormatter: function getFormatter(message) {\n return function formatter(value) {\n if (message.type === 'mobile' || message.type === 'tel') {\n return value.replace(/[^\\d.]/g, '');\n }\n\n return value;\n };\n },\n getExtraDesc: function getExtraDesc(message) {\n var h = this.$createElement;\n var extraDesc = message.extraDesc;\n\n if (extraDesc) {\n return h(\"div\", {\n \"class\": bem('extra-message')\n }, [extraDesc]);\n }\n },\n genMessage: function genMessage(message, index) {\n var _this2 = this;\n\n var h = this.$createElement;\n\n if (message.type === 'image') {\n return h(Cell, {\n \"key\": this.goodsId + \"-\" + index,\n \"attrs\": {\n \"title\": message.name,\n \"required\": String(message.required) === '1',\n \"valueClass\": bem('image-cell-value')\n },\n \"class\": bem('image-cell')\n }, [h(SkuImgUploader, {\n \"attrs\": {\n \"maxSize\": this.messageConfig.uploadMaxSize,\n \"uploadImg\": this.messageConfig.uploadImg,\n \"customUpload\": this.messageConfig.customUpload\n },\n \"model\": {\n value: _this2.messageValues[index].value,\n callback: function callback($$v) {\n _this2.$set(_this2.messageValues[index], \"value\", $$v);\n }\n }\n }), h(\"div\", {\n \"class\": bem('image-cell-label')\n }, [t('imageLabel')])]);\n } // 时间和日期使用的vant选择器\n\n\n var isDateOrTime = ['date', 'time'].indexOf(message.type) > -1;\n\n if (isDateOrTime) {\n return h(SkuDateTimeField, {\n \"attrs\": {\n \"label\": message.name,\n \"required\": String(message.required) === '1',\n \"placeholder\": this.getPlaceholder(message),\n \"type\": this.getType(message)\n },\n \"key\": this.goodsId + \"-\" + index,\n \"model\": {\n value: _this2.messageValues[index].value,\n callback: function callback($$v) {\n _this2.$set(_this2.messageValues[index], \"value\", $$v);\n }\n }\n });\n }\n\n return h(\"div\", {\n \"class\": bem('cell-block')\n }, [h(Field, {\n \"attrs\": {\n \"maxlength\": \"200\",\n \"center\": !message.multiple,\n \"label\": message.name,\n \"required\": String(message.required) === '1',\n \"placeholder\": this.getPlaceholder(message),\n \"type\": this.getType(message),\n \"formatter\": this.getFormatter(message),\n \"border\": false\n },\n \"key\": this.goodsId + \"-\" + index,\n \"model\": {\n value: _this2.messageValues[index].value,\n callback: function callback($$v) {\n _this2.$set(_this2.messageValues[index], \"value\", $$v);\n }\n }\n }), this.getExtraDesc(message)]);\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem()\n }, [this.messages.map(this.genMessage)]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../../utils';\nimport { inherit } from '../../utils/functional'; // Components\n\nimport Button from '../../button'; // Types\n\nvar _createNamespace = createNamespace('sku-actions'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction SkuActions(h, props, slots, ctx) {\n var createEmitter = function createEmitter(name) {\n return function () {\n props.skuEventBus.$emit(name);\n };\n };\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem()\n }, inherit(ctx)]), [props.showAddCartBtn && h(Button, {\n \"attrs\": {\n \"size\": \"large\",\n \"type\": \"warning\",\n \"text\": props.addCartText || t('addCart')\n },\n \"on\": {\n \"click\": createEmitter('sku:addCart')\n }\n }), h(Button, {\n \"attrs\": {\n \"size\": \"large\",\n \"type\": \"danger\",\n \"text\": props.buyText || t('buy')\n },\n \"on\": {\n \"click\": createEmitter('sku:buy')\n }\n })]);\n}\n\nSkuActions.props = {\n buyText: String,\n addCartText: String,\n skuEventBus: Object,\n showAddCartBtn: Boolean\n};\nexport default createComponent(SkuActions);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nimport Popup from '../popup';\nimport Toast from '../toast';\nimport ImagePreview from '../image-preview';\nimport SkuHeader from './components/SkuHeader';\nimport SkuHeaderItem from './components/SkuHeaderItem';\nimport SkuRow from './components/SkuRow';\nimport SkuRowItem from './components/SkuRowItem';\nimport SkuRowPropItem from './components/SkuRowPropItem';\nimport SkuStepper from './components/SkuStepper';\nimport SkuMessages from './components/SkuMessages';\nimport SkuActions from './components/SkuActions';\nimport { createNamespace, isEmpty } from '../utils';\nimport { isAllSelected, isSkuChoosable, getSkuComb, getSelectedSkuValues, getSelectedPropValues, getSelectedProperties } from './utils/sku-helper';\nimport { LIMIT_TYPE, UNSELECTED_SKU_VALUE_ID } from './constants';\nvar namespace = createNamespace('sku');\nvar createComponent = namespace[0],\n bem = namespace[1],\n t = namespace[2];\nvar QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT;\nexport default createComponent({\n props: {\n sku: Object,\n goods: Object,\n value: Boolean,\n buyText: String,\n goodsId: [Number, String],\n priceTag: String,\n lazyLoad: Boolean,\n hideStock: Boolean,\n properties: Array,\n addCartText: String,\n stepperTitle: String,\n getContainer: [String, Function],\n hideQuotaText: Boolean,\n hideSelectedText: Boolean,\n resetStepperOnHide: Boolean,\n customSkuValidator: Function,\n disableStepperInput: Boolean,\n resetSelectedSkuOnHide: Boolean,\n quota: {\n type: Number,\n default: 0\n },\n quotaUsed: {\n type: Number,\n default: 0\n },\n startSaleNum: {\n type: Number,\n default: 1\n },\n initialSku: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n stockThreshold: {\n type: Number,\n default: 50\n },\n showSoldoutSku: {\n type: Boolean,\n default: true\n },\n showAddCartBtn: {\n type: Boolean,\n default: true\n },\n disableSoldoutSku: {\n type: Boolean,\n default: true\n },\n customStepperConfig: {\n type: Object,\n default: function _default() {\n return {};\n }\n },\n showHeaderImage: {\n type: Boolean,\n default: true\n },\n previewOnClickImage: {\n type: Boolean,\n default: true\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n },\n closeOnClickOverlay: {\n type: Boolean,\n default: true\n },\n bodyOffsetTop: {\n type: Number,\n default: 200\n },\n messageConfig: {\n type: Object,\n default: function _default() {\n return {\n initialMessages: {},\n placeholderMap: {},\n uploadImg: function uploadImg() {\n return Promise.resolve();\n },\n uploadMaxSize: 5\n };\n }\n }\n },\n data: function data() {\n return {\n selectedSku: {},\n selectedProp: {},\n selectedNum: 1,\n show: this.value\n };\n },\n watch: {\n show: function show(val) {\n this.$emit('input', val);\n\n if (!val) {\n this.$emit('sku-close', {\n selectedSkuValues: this.selectedSkuValues,\n selectedNum: this.selectedNum,\n selectedSkuComb: this.selectedSkuComb\n });\n\n if (this.resetStepperOnHide) {\n this.resetStepper();\n }\n\n if (this.resetSelectedSkuOnHide) {\n this.resetSelectedSku();\n }\n }\n },\n value: function value(val) {\n this.show = val;\n },\n skuTree: 'resetSelectedSku',\n initialSku: function initialSku() {\n this.resetStepper();\n this.resetSelectedSku();\n }\n },\n computed: {\n skuGroupClass: function skuGroupClass() {\n return ['van-sku-group-container', {\n 'van-sku-group-container--hide-soldout': !this.showSoldoutSku\n }];\n },\n bodyStyle: function bodyStyle() {\n if (this.$isServer) {\n return;\n }\n\n var maxHeight = window.innerHeight - this.bodyOffsetTop;\n return {\n maxHeight: maxHeight + 'px'\n };\n },\n isSkuCombSelected: function isSkuCombSelected() {\n var _this = this;\n\n // SKU 未选完\n if (this.hasSku && !isAllSelected(this.skuTree, this.selectedSku)) {\n return false;\n } // 属性未全选\n\n\n return !this.propList.filter(function (i) {\n return i.is_necessary !== false;\n }).some(function (i) {\n return (_this.selectedProp[i.k_id] || []).length === 0;\n });\n },\n isSkuEmpty: function isSkuEmpty() {\n return Object.keys(this.sku).length === 0;\n },\n hasSku: function hasSku() {\n return !this.sku.none_sku;\n },\n hasSkuOrAttr: function hasSkuOrAttr() {\n return this.hasSku || this.propList.length > 0;\n },\n selectedSkuComb: function selectedSkuComb() {\n var skuComb = null;\n\n if (this.isSkuCombSelected) {\n if (this.hasSku) {\n skuComb = getSkuComb(this.skuList, this.selectedSku);\n } else {\n skuComb = {\n id: this.sku.collection_id,\n price: Math.round(this.sku.price * 100),\n stock_num: this.sku.stock_num\n };\n }\n\n if (skuComb) {\n skuComb.properties = getSelectedProperties(this.propList, this.selectedProp);\n skuComb.property_price = this.selectedPropValues.reduce(function (acc, cur) {\n return acc + (cur.price || 0);\n }, 0);\n }\n }\n\n return skuComb;\n },\n selectedSkuValues: function selectedSkuValues() {\n return getSelectedSkuValues(this.skuTree, this.selectedSku);\n },\n selectedPropValues: function selectedPropValues() {\n return getSelectedPropValues(this.propList, this.selectedProp);\n },\n price: function price() {\n if (this.selectedSkuComb) {\n return ((this.selectedSkuComb.price + this.selectedSkuComb.property_price) / 100).toFixed(2);\n } // sku.price是一个格式化好的价格区间\n\n\n return this.sku.price;\n },\n originPrice: function originPrice() {\n if (this.selectedSkuComb && this.selectedSkuComb.origin_price) {\n return ((this.selectedSkuComb.origin_price + this.selectedSkuComb.property_price) / 100).toFixed(2);\n }\n\n return this.sku.origin_price;\n },\n skuTree: function skuTree() {\n return this.sku.tree || [];\n },\n skuList: function skuList() {\n return this.sku.list || [];\n },\n propList: function propList() {\n return this.properties || [];\n },\n imageList: function imageList() {\n var imageList = [this.goods.picture];\n\n if (this.skuTree.length > 0) {\n this.skuTree.forEach(function (treeItem) {\n if (!treeItem.v) {\n return;\n }\n\n treeItem.v.forEach(function (vItem) {\n var imgUrl = vItem.previewImgUrl || vItem.imgUrl || vItem.img_url;\n\n if (imgUrl && imageList.indexOf(imgUrl) === -1) {\n imageList.push(imgUrl);\n }\n });\n });\n }\n\n return imageList;\n },\n stock: function stock() {\n var stockNum = this.customStepperConfig.stockNum;\n\n if (stockNum !== undefined) {\n return stockNum;\n }\n\n if (this.selectedSkuComb) {\n return this.selectedSkuComb.stock_num;\n }\n\n return this.sku.stock_num;\n },\n stockText: function stockText() {\n var h = this.$createElement;\n var stockFormatter = this.customStepperConfig.stockFormatter;\n\n if (stockFormatter) {\n return stockFormatter(this.stock);\n }\n\n return [t('stock') + \" \", h(\"span\", {\n \"class\": bem('stock-num', {\n highlight: this.stock < this.stockThreshold\n })\n }, [this.stock]), \" \" + t('stockUnit')];\n },\n selectedText: function selectedText() {\n var _this2 = this;\n\n if (this.selectedSkuComb) {\n var values = this.selectedSkuValues.concat(this.selectedPropValues);\n return t('selected') + \" \" + values.map(function (item) {\n return item.name;\n }).join(' ');\n }\n\n var unselectedSku = this.skuTree.filter(function (item) {\n return _this2.selectedSku[item.k_s] === UNSELECTED_SKU_VALUE_ID;\n }).map(function (item) {\n return item.k;\n });\n var unselectedProp = this.propList.filter(function (item) {\n return (_this2.selectedProp[item.k_id] || []).length < 1;\n }).map(function (item) {\n return item.k;\n });\n return t('select') + \" \" + unselectedSku.concat(unselectedProp).join(' ');\n }\n },\n created: function created() {\n var skuEventBus = new Vue();\n this.skuEventBus = skuEventBus;\n skuEventBus.$on('sku:select', this.onSelect);\n skuEventBus.$on('sku:propSelect', this.onPropSelect);\n skuEventBus.$on('sku:numChange', this.onNumChange);\n skuEventBus.$on('sku:previewImage', this.onPreviewImage);\n skuEventBus.$on('sku:overLimit', this.onOverLimit);\n skuEventBus.$on('sku:stepperState', this.onStepperState);\n skuEventBus.$on('sku:addCart', this.onAddCart);\n skuEventBus.$on('sku:buy', this.onBuy);\n this.resetStepper();\n this.resetSelectedSku(); // 组件初始化后的钩子,抛出skuEventBus\n\n this.$emit('after-sku-create', skuEventBus);\n },\n methods: {\n resetStepper: function resetStepper() {\n var skuStepper = this.$refs.skuStepper;\n var selectedNum = this.initialSku.selectedNum;\n var num = selectedNum != null ? selectedNum : this.startSaleNum; // 用来缓存不合法的情况\n\n this.stepperError = null;\n\n if (skuStepper) {\n skuStepper.setCurrentNum(num);\n } else {\n // 当首次加载(skuStepper 为空)时,传入数量如果不合法,可能会存在问题\n this.selectedNum = num;\n }\n },\n // @exposed-api\n resetSelectedSku: function resetSelectedSku() {\n var _this3 = this;\n\n this.selectedSku = {}; // 重置 selectedSku\n\n this.skuTree.forEach(function (item) {\n _this3.selectedSku[item.k_s] = UNSELECTED_SKU_VALUE_ID;\n });\n this.skuTree.forEach(function (item) {\n var key = item.k_s; // 规格值只有1个时,优先判断\n\n var valueId = item.v.length === 1 ? item.v[0].id : _this3.initialSku[key];\n\n if (valueId && isSkuChoosable(_this3.skuList, _this3.selectedSku, {\n key: key,\n valueId: valueId\n })) {\n _this3.selectedSku[key] = valueId;\n }\n });\n var skuValues = this.selectedSkuValues;\n\n if (skuValues.length > 0) {\n this.$nextTick(function () {\n _this3.$emit('sku-selected', {\n skuValue: skuValues[skuValues.length - 1],\n selectedSku: _this3.selectedSku,\n selectedSkuComb: _this3.selectedSkuComb\n });\n });\n } // 重置商品属性\n\n\n this.selectedProp = {};\n var _this$initialSku$sele = this.initialSku.selectedProp,\n selectedProp = _this$initialSku$sele === void 0 ? {} : _this$initialSku$sele; // 选中外部传入信息\n\n this.propList.forEach(function (item) {\n if (selectedProp[item.k_id]) {\n _this3.selectedProp[item.k_id] = selectedProp[item.k_id];\n }\n });\n\n if (isEmpty(this.selectedProp)) {\n this.propList.forEach(function (item) {\n var _item$v;\n\n // 没有加价的属性,默认选中第一个\n if ((item == null ? void 0 : (_item$v = item.v) == null ? void 0 : _item$v.length) > 0) {\n var v = item.v,\n k_id = item.k_id;\n var isHasConfigPrice = v.some(function (i) {\n return +i.price !== 0;\n }); // 没有加价属性\n\n if (!isHasConfigPrice) {\n // 找到第一个不被禁用的属性\n // 历史如果没有 text_status 字段的,就相当于沿用直接原来的逻辑取第一个属性\n var firstEnableProp = v.find(function (prop) {\n return prop.text_status !== 0;\n });\n\n if (firstEnableProp) {\n _this3.selectedProp[k_id] = [firstEnableProp.id];\n }\n }\n }\n });\n }\n\n var propValues = this.selectedPropValues;\n\n if (propValues.length > 0) {\n this.$emit('sku-prop-selected', {\n propValue: propValues[propValues.length - 1],\n selectedProp: this.selectedProp,\n selectedSkuComb: this.selectedSkuComb\n });\n } // 抛出重置事件\n\n\n this.$emit('sku-reset', {\n selectedSku: this.selectedSku,\n selectedProp: this.selectedProp,\n selectedSkuComb: this.selectedSkuComb\n });\n this.centerInitialSku();\n },\n getSkuMessages: function getSkuMessages() {\n return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {};\n },\n getSkuCartMessages: function getSkuCartMessages() {\n return this.$refs.skuMessages ? this.$refs.skuMessages.getCartMessages() : {};\n },\n validateSkuMessages: function validateSkuMessages() {\n return this.$refs.skuMessages ? this.$refs.skuMessages.validateMessages() : '';\n },\n validateSku: function validateSku() {\n if (this.selectedNum === 0) {\n return t('unavailable');\n }\n\n if (this.isSkuCombSelected) {\n return this.validateSkuMessages();\n } // 自定义sku校验\n\n\n if (this.customSkuValidator) {\n var err = this.customSkuValidator(this);\n if (err) return err;\n }\n\n return t('selectSku');\n },\n onSelect: function onSelect(skuValue) {\n var _extends2, _extends3;\n\n // 点击已选中的sku时则取消选中\n this.selectedSku = this.selectedSku[skuValue.skuKeyStr] === skuValue.id ? _extends({}, this.selectedSku, (_extends2 = {}, _extends2[skuValue.skuKeyStr] = UNSELECTED_SKU_VALUE_ID, _extends2)) : _extends({}, this.selectedSku, (_extends3 = {}, _extends3[skuValue.skuKeyStr] = skuValue.id, _extends3));\n this.$emit('sku-selected', {\n skuValue: skuValue,\n selectedSku: this.selectedSku,\n selectedSkuComb: this.selectedSkuComb\n });\n },\n onPropSelect: function onPropSelect(propValue) {\n var _extends4;\n\n var arr = this.selectedProp[propValue.skuKeyStr] || [];\n var pos = arr.indexOf(propValue.id);\n\n if (pos > -1) {\n arr.splice(pos, 1);\n } else if (propValue.multiple) {\n arr.push(propValue.id);\n } else {\n arr.splice(0, 1, propValue.id);\n }\n\n this.selectedProp = _extends({}, this.selectedProp, (_extends4 = {}, _extends4[propValue.skuKeyStr] = arr, _extends4));\n this.$emit('sku-prop-selected', {\n propValue: propValue,\n selectedProp: this.selectedProp,\n selectedSkuComb: this.selectedSkuComb\n });\n },\n onNumChange: function onNumChange(num) {\n this.selectedNum = num;\n },\n onPreviewImage: function onPreviewImage(selectedValue) {\n var _this4 = this;\n\n var imageList = this.imageList;\n var index = 0;\n var indexImage = imageList[0];\n\n if (selectedValue && selectedValue.imgUrl) {\n this.imageList.some(function (image, pos) {\n if (image === selectedValue.imgUrl) {\n index = pos;\n return true;\n }\n\n return false;\n });\n indexImage = selectedValue.imgUrl;\n }\n\n var params = _extends({}, selectedValue, {\n index: index,\n imageList: this.imageList,\n indexImage: indexImage\n });\n\n this.$emit('open-preview', params);\n\n if (!this.previewOnClickImage) {\n return;\n }\n\n ImagePreview({\n images: this.imageList,\n startPosition: index,\n onClose: function onClose() {\n _this4.$emit('close-preview', params);\n }\n });\n },\n onOverLimit: function onOverLimit(data) {\n var action = data.action,\n limitType = data.limitType,\n quota = data.quota,\n quotaUsed = data.quotaUsed;\n var handleOverLimit = this.customStepperConfig.handleOverLimit;\n\n if (handleOverLimit) {\n handleOverLimit(data);\n return;\n }\n\n if (action === 'minus') {\n if (this.startSaleNum > 1) {\n Toast(t('minusStartTip', this.startSaleNum));\n } else {\n Toast(t('minusTip'));\n }\n } else if (action === 'plus') {\n if (limitType === QUOTA_LIMIT) {\n if (quotaUsed > 0) {\n Toast(t('quotaUsedTip', quota, quotaUsed));\n } else {\n Toast(t('quotaTip', quota));\n }\n } else {\n Toast(t('soldout'));\n }\n }\n },\n onStepperState: function onStepperState(data) {\n this.stepperError = data.valid ? null : _extends({}, data, {\n action: 'plus'\n });\n },\n onAddCart: function onAddCart() {\n this.onBuyOrAddCart('add-cart');\n },\n onBuy: function onBuy() {\n this.onBuyOrAddCart('buy-clicked');\n },\n onBuyOrAddCart: function onBuyOrAddCart(type) {\n // sku 不符合购买条件\n if (this.stepperError) {\n return this.onOverLimit(this.stepperError);\n }\n\n var error = this.validateSku();\n\n if (error) {\n Toast(error);\n } else {\n this.$emit(type, this.getSkuData());\n }\n },\n // @exposed-api\n getSkuData: function getSkuData() {\n return {\n goodsId: this.goodsId,\n messages: this.getSkuMessages(),\n selectedNum: this.selectedNum,\n cartMessages: this.getSkuCartMessages(),\n selectedSkuComb: this.selectedSkuComb\n };\n },\n // 当 popup 完全打开后执行\n onOpened: function onOpened() {\n this.centerInitialSku();\n },\n centerInitialSku: function centerInitialSku() {\n var _this5 = this;\n\n (this.$refs.skuRows || []).forEach(function (it) {\n var _ref = it.skuRow || {},\n k_s = _ref.k_s;\n\n it.centerItem(_this5.initialSku[k_s]);\n });\n }\n },\n render: function render() {\n var _this6 = this;\n\n var h = arguments[0];\n\n if (this.isSkuEmpty) {\n return;\n }\n\n var sku = this.sku,\n skuList = this.skuList,\n goods = this.goods,\n price = this.price,\n lazyLoad = this.lazyLoad,\n originPrice = this.originPrice,\n skuEventBus = this.skuEventBus,\n selectedSku = this.selectedSku,\n selectedProp = this.selectedProp,\n selectedNum = this.selectedNum,\n stepperTitle = this.stepperTitle,\n selectedSkuComb = this.selectedSkuComb,\n showHeaderImage = this.showHeaderImage,\n disableSoldoutSku = this.disableSoldoutSku;\n var slotsProps = {\n price: price,\n originPrice: originPrice,\n selectedNum: selectedNum,\n skuEventBus: skuEventBus,\n selectedSku: selectedSku,\n selectedSkuComb: selectedSkuComb\n };\n\n var slots = function slots(name) {\n return _this6.slots(name, slotsProps);\n };\n\n var Header = slots('sku-header') || h(SkuHeader, {\n \"attrs\": {\n \"sku\": sku,\n \"goods\": goods,\n \"skuEventBus\": skuEventBus,\n \"selectedSku\": selectedSku,\n \"showHeaderImage\": showHeaderImage\n }\n }, [h(\"template\", {\n \"slot\": \"sku-header-image-extra\"\n }, [slots('sku-header-image-extra')]), slots('sku-header-price') || h(\"div\", {\n \"class\": \"van-sku__goods-price\"\n }, [h(\"span\", {\n \"class\": \"van-sku__price-symbol\"\n }, [\"\\uFFE5\"]), h(\"span\", {\n \"class\": \"van-sku__price-num\"\n }, [price]), this.priceTag && h(\"span\", {\n \"class\": \"van-sku__price-tag\"\n }, [this.priceTag])]), slots('sku-header-origin-price') || originPrice && h(SkuHeaderItem, [t('originPrice'), \" \\uFFE5\", originPrice]), !this.hideStock && h(SkuHeaderItem, [h(\"span\", {\n \"class\": \"van-sku__stock\"\n }, [this.stockText])]), this.hasSkuOrAttr && !this.hideSelectedText && h(SkuHeaderItem, [this.selectedText]), slots('sku-header-extra')]);\n var Group = slots('sku-group') || this.hasSkuOrAttr && h(\"div\", {\n \"class\": this.skuGroupClass\n }, [this.skuTree.map(function (skuTreeItem) {\n return h(SkuRow, {\n \"attrs\": {\n \"skuRow\": skuTreeItem\n },\n \"ref\": \"skuRows\",\n \"refInFor\": true\n }, [skuTreeItem.v.map(function (skuValue) {\n return h(SkuRowItem, {\n \"attrs\": {\n \"skuList\": skuList,\n \"lazyLoad\": lazyLoad,\n \"skuValue\": skuValue,\n \"skuKeyStr\": skuTreeItem.k_s,\n \"selectedSku\": selectedSku,\n \"skuEventBus\": skuEventBus,\n \"disableSoldoutSku\": disableSoldoutSku,\n \"largeImageMode\": skuTreeItem.largeImageMode\n }\n });\n })]);\n }), this.propList.map(function (skuTreeItem) {\n return h(SkuRow, {\n \"attrs\": {\n \"skuRow\": skuTreeItem\n }\n }, [skuTreeItem.v.map(function (skuValue) {\n return h(SkuRowPropItem, {\n \"attrs\": {\n \"skuValue\": skuValue,\n \"skuKeyStr\": skuTreeItem.k_id + '',\n \"selectedProp\": selectedProp,\n \"skuEventBus\": skuEventBus,\n \"multiple\": skuTreeItem.is_multiple,\n \"disabled\": skuValue.text_status === 0\n }\n });\n })]);\n })]);\n var Stepper = slots('sku-stepper') || h(SkuStepper, {\n \"ref\": \"skuStepper\",\n \"attrs\": {\n \"stock\": this.stock,\n \"quota\": this.quota,\n \"quotaUsed\": this.quotaUsed,\n \"startSaleNum\": this.startSaleNum,\n \"skuEventBus\": skuEventBus,\n \"selectedNum\": selectedNum,\n \"stepperTitle\": stepperTitle,\n \"skuStockNum\": sku.stock_num,\n \"disableStepperInput\": this.disableStepperInput,\n \"customStepperConfig\": this.customStepperConfig,\n \"hideQuotaText\": this.hideQuotaText\n },\n \"on\": {\n \"change\": function change(event) {\n _this6.$emit('stepper-change', event);\n }\n }\n });\n var Messages = slots('sku-messages') || h(SkuMessages, {\n \"ref\": \"skuMessages\",\n \"attrs\": {\n \"goodsId\": this.goodsId,\n \"messageConfig\": this.messageConfig,\n \"messages\": sku.messages\n }\n });\n var Actions = slots('sku-actions') || h(SkuActions, {\n \"attrs\": {\n \"buyText\": this.buyText,\n \"skuEventBus\": skuEventBus,\n \"addCartText\": this.addCartText,\n \"showAddCartBtn\": this.showAddCartBtn\n }\n });\n return h(Popup, {\n \"attrs\": {\n \"round\": true,\n \"closeable\": true,\n \"position\": \"bottom\",\n \"getContainer\": this.getContainer,\n \"closeOnClickOverlay\": this.closeOnClickOverlay,\n \"safeAreaInsetBottom\": this.safeAreaInsetBottom\n },\n \"class\": \"van-sku-container\",\n \"on\": {\n \"opened\": this.onOpened\n },\n \"model\": {\n value: _this6.show,\n callback: function callback($$v) {\n _this6.show = $$v;\n }\n }\n }, [Header, h(\"div\", {\n \"class\": \"van-sku-body\",\n \"style\": this.bodyStyle\n }, [slots('sku-body-top'), Group, slots('extra-sku-group'), Stepper, Messages]), slots('sku-actions-top'), Actions]);\n }\n});","// Utils\nimport lang from './lang';\nimport constants from './constants';\nimport skuHelper from './utils/sku-helper'; // Components\n\nimport Sku from './Sku';\nimport Locale from '../locale';\nimport SkuActions from './components/SkuActions';\nimport SkuHeader from './components/SkuHeader';\nimport SkuHeaderItem from './components/SkuHeaderItem';\nimport SkuMessages from './components/SkuMessages';\nimport SkuStepper from './components/SkuStepper';\nimport SkuRow from './components/SkuRow';\nimport SkuRowItem from './components/SkuRowItem';\nimport SkuRowPropItem from './components/SkuRowPropItem';\nLocale.add(lang);\nSku.SkuActions = SkuActions;\nSku.SkuHeader = SkuHeader;\nSku.SkuHeaderItem = SkuHeaderItem;\nSku.SkuMessages = SkuMessages;\nSku.SkuStepper = SkuStepper;\nSku.SkuRow = SkuRow;\nSku.SkuRowItem = SkuRowItem;\nSku.SkuRowPropItem = SkuRowPropItem;\nSku.skuHelper = skuHelper;\nSku.skuConstants = constants;\nexport default Sku;","import { createNamespace, addUnit } from '../utils';\nimport { deepClone } from '../utils/deep-clone';\nimport { preventDefault } from '../utils/dom/event';\nimport { range, addNumber } from '../utils/format/number';\nimport { TouchMixin } from '../mixins/touch';\nimport { FieldMixin } from '../mixins/field';\n\nvar _createNamespace = createNamespace('slider'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar isSameValue = function isSameValue(newValue, oldValue) {\n return JSON.stringify(newValue) === JSON.stringify(oldValue);\n};\n\nexport default createComponent({\n mixins: [TouchMixin, FieldMixin],\n props: {\n disabled: Boolean,\n vertical: Boolean,\n range: Boolean,\n barHeight: [Number, String],\n buttonSize: [Number, String],\n activeColor: String,\n inactiveColor: String,\n min: {\n type: [Number, String],\n default: 0\n },\n max: {\n type: [Number, String],\n default: 100\n },\n step: {\n type: [Number, String],\n default: 1\n },\n value: {\n type: [Number, Array],\n default: 0\n }\n },\n data: function data() {\n return {\n dragStatus: ''\n };\n },\n computed: {\n scope: function scope() {\n return this.max - this.min;\n },\n buttonStyle: function buttonStyle() {\n if (this.buttonSize) {\n var size = addUnit(this.buttonSize);\n return {\n width: size,\n height: size\n };\n }\n }\n },\n created: function created() {\n // format initial value\n this.updateValue(this.value);\n },\n mounted: function mounted() {\n if (this.range) {\n this.bindTouchEvent(this.$refs.wrapper0);\n this.bindTouchEvent(this.$refs.wrapper1);\n } else {\n this.bindTouchEvent(this.$refs.wrapper);\n }\n },\n methods: {\n onTouchStart: function onTouchStart(event) {\n if (this.disabled) {\n return;\n }\n\n this.touchStart(event);\n this.currentValue = this.value;\n\n if (this.range) {\n this.startValue = this.value.map(this.format);\n } else {\n this.startValue = this.format(this.value);\n }\n\n this.dragStatus = 'start';\n },\n onTouchMove: function onTouchMove(event) {\n if (this.disabled) {\n return;\n }\n\n if (this.dragStatus === 'start') {\n this.$emit('drag-start');\n }\n\n preventDefault(event, true);\n this.touchMove(event);\n this.dragStatus = 'draging';\n var rect = this.$el.getBoundingClientRect();\n var delta = this.vertical ? this.deltaY : this.deltaX;\n var total = this.vertical ? rect.height : rect.width;\n var diff = delta / total * this.scope;\n\n if (this.range) {\n this.currentValue[this.index] = this.startValue[this.index] + diff;\n } else {\n this.currentValue = this.startValue + diff;\n }\n\n this.updateValue(this.currentValue);\n },\n onTouchEnd: function onTouchEnd() {\n if (this.disabled) {\n return;\n }\n\n if (this.dragStatus === 'draging') {\n this.updateValue(this.currentValue, true);\n this.$emit('drag-end');\n }\n\n this.dragStatus = '';\n },\n onClick: function onClick(event) {\n event.stopPropagation();\n if (this.disabled) return;\n var rect = this.$el.getBoundingClientRect();\n var delta = this.vertical ? event.clientY - rect.top : event.clientX - rect.left;\n var total = this.vertical ? rect.height : rect.width;\n var value = +this.min + delta / total * this.scope;\n\n if (this.range) {\n var _this$value = this.value,\n left = _this$value[0],\n right = _this$value[1];\n var middle = (left + right) / 2;\n\n if (value <= middle) {\n left = value;\n } else {\n right = value;\n }\n\n value = [left, right];\n }\n\n this.startValue = this.value;\n this.updateValue(value, true);\n },\n // 处理两个滑块重叠之后的情况\n handleOverlap: function handleOverlap(value) {\n if (value[0] > value[1]) {\n value = deepClone(value);\n return value.reverse();\n }\n\n return value;\n },\n updateValue: function updateValue(value, end) {\n if (this.range) {\n value = this.handleOverlap(value).map(this.format);\n } else {\n value = this.format(value);\n }\n\n if (!isSameValue(value, this.value)) {\n this.$emit('input', value);\n }\n\n if (end && !isSameValue(value, this.startValue)) {\n this.$emit('change', value);\n }\n },\n format: function format(value) {\n var min = +this.min;\n var max = +this.max;\n var step = +this.step;\n value = range(value, min, max);\n var diff = Math.round((value - min) / step) * step;\n return addNumber(min, diff);\n }\n },\n render: function render() {\n var _wrapperStyle,\n _this = this,\n _barStyle;\n\n var h = arguments[0];\n var vertical = this.vertical;\n var mainAxis = vertical ? 'height' : 'width';\n var crossAxis = vertical ? 'width' : 'height';\n var wrapperStyle = (_wrapperStyle = {\n background: this.inactiveColor\n }, _wrapperStyle[crossAxis] = addUnit(this.barHeight), _wrapperStyle); // 计算选中条的长度百分比\n\n var calcMainAxis = function calcMainAxis() {\n var value = _this.value,\n min = _this.min,\n range = _this.range,\n scope = _this.scope;\n\n if (range) {\n return (value[1] - value[0]) * 100 / scope + \"%\";\n }\n\n return (value - min) * 100 / scope + \"%\";\n }; // 计算选中条的开始位置的偏移量\n\n\n var calcOffset = function calcOffset() {\n var value = _this.value,\n min = _this.min,\n range = _this.range,\n scope = _this.scope;\n\n if (range) {\n return (value[0] - min) * 100 / scope + \"%\";\n }\n\n return null;\n };\n\n var barStyle = (_barStyle = {}, _barStyle[mainAxis] = calcMainAxis(), _barStyle.left = this.vertical ? null : calcOffset(), _barStyle.top = this.vertical ? calcOffset() : null, _barStyle.background = this.activeColor, _barStyle);\n\n if (this.dragStatus) {\n barStyle.transition = 'none';\n }\n\n var renderButton = function renderButton(i) {\n var map = ['left', 'right'];\n var isNumber = typeof i === 'number';\n var current = isNumber ? _this.value[i] : _this.value;\n\n var getClassName = function getClassName() {\n if (isNumber) {\n return \"button-wrapper-\" + map[i];\n }\n\n return \"button-wrapper\";\n };\n\n var getRefName = function getRefName() {\n if (isNumber) {\n return \"wrapper\" + i;\n }\n\n return \"wrapper\";\n };\n\n var renderButtonContent = function renderButtonContent() {\n if (isNumber) {\n var slot = _this.slots(i === 0 ? 'left-button' : 'right-button', {\n value: current\n });\n\n if (slot) {\n return slot;\n }\n }\n\n if (_this.slots('button')) {\n return _this.slots('button');\n }\n\n return h(\"div\", {\n \"class\": bem('button'),\n \"style\": _this.buttonStyle\n });\n };\n\n return h(\"div\", {\n \"ref\": getRefName(),\n \"attrs\": {\n \"role\": \"slider\",\n \"tabindex\": _this.disabled ? -1 : 0,\n \"aria-valuemin\": _this.min,\n \"aria-valuenow\": _this.value,\n \"aria-valuemax\": _this.max,\n \"aria-orientation\": _this.vertical ? 'vertical' : 'horizontal'\n },\n \"class\": bem(getClassName()),\n \"on\": {\n \"touchstart\": function touchstart() {\n if (isNumber) {\n // 保存当前按钮的索引\n _this.index = i;\n }\n },\n \"click\": function click(e) {\n return e.stopPropagation();\n }\n }\n }, [renderButtonContent()]);\n };\n\n return h(\"div\", {\n \"style\": wrapperStyle,\n \"class\": bem({\n disabled: this.disabled,\n vertical: vertical\n }),\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(\"div\", {\n \"class\": bem('bar'),\n \"style\": barStyle\n }, [this.range ? [renderButton(0), renderButton(1)] : renderButton()])]);\n }\n});","import { createNamespace } from '../utils';\nimport { BORDER } from '../utils/constant';\nimport { ChildrenMixin } from '../mixins/relation';\nimport Icon from '../icon';\n\nvar _createNamespace = createNamespace('step'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanSteps')],\n computed: {\n status: function status() {\n if (this.index < this.parent.active) {\n return 'finish';\n }\n\n if (this.index === +this.parent.active) {\n return 'process';\n }\n },\n active: function active() {\n return this.status === 'process';\n },\n lineStyle: function lineStyle() {\n var _this$parent = this.parent,\n activeColor = _this$parent.activeColor,\n inactiveColor = _this$parent.inactiveColor,\n center = _this$parent.center,\n direction = _this$parent.direction;\n var style = {\n background: this.status === 'finish' ? activeColor : inactiveColor\n };\n\n if (center && direction === 'vertical') {\n style.top = '50%';\n }\n\n return style;\n },\n circleContainerStyle: function circleContainerStyle() {\n if (this.parent.center && this.parent.direction === 'vertical') {\n return {\n top: '50%'\n };\n }\n },\n titleStyle: function titleStyle() {\n if (this.active) {\n return {\n color: this.parent.activeColor\n };\n }\n\n if (!this.status) {\n return {\n color: this.parent.inactiveColor\n };\n }\n }\n },\n methods: {\n genCircle: function genCircle() {\n var h = this.$createElement;\n var _this$parent2 = this.parent,\n activeIcon = _this$parent2.activeIcon,\n iconPrefix = _this$parent2.iconPrefix,\n activeColor = _this$parent2.activeColor,\n finishIcon = _this$parent2.finishIcon,\n inactiveIcon = _this$parent2.inactiveIcon;\n\n if (this.active) {\n return this.slots('active-icon') || h(Icon, {\n \"class\": bem('icon', 'active'),\n \"attrs\": {\n \"name\": activeIcon,\n \"color\": activeColor,\n \"classPrefix\": iconPrefix\n }\n });\n }\n\n var finishIconSlot = this.slots('finish-icon');\n\n if (this.status === 'finish' && (finishIcon || finishIconSlot)) {\n return finishIconSlot || h(Icon, {\n \"class\": bem('icon', 'finish'),\n \"attrs\": {\n \"name\": finishIcon,\n \"color\": activeColor,\n \"classPrefix\": iconPrefix\n }\n });\n }\n\n var inactiveIconSlot = this.slots('inactive-icon');\n\n if (inactiveIcon || inactiveIconSlot) {\n return inactiveIconSlot || h(Icon, {\n \"class\": bem('icon'),\n \"attrs\": {\n \"name\": inactiveIcon,\n \"classPrefix\": iconPrefix\n }\n });\n }\n\n return h(\"i\", {\n \"class\": bem('circle'),\n \"style\": this.lineStyle\n });\n },\n onClickStep: function onClickStep() {\n this.parent.$emit('click-step', this.index);\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n var status = this.status,\n active = this.active;\n var direction = this.parent.direction;\n return h(\"div\", {\n \"class\": [BORDER, bem([direction, (_ref = {}, _ref[status] = status, _ref)])]\n }, [h(\"div\", {\n \"class\": bem('title', {\n active: active\n }),\n \"style\": this.titleStyle,\n \"on\": {\n \"click\": this.onClickStep\n }\n }, [this.slots()]), h(\"div\", {\n \"class\": bem('circle-container'),\n \"on\": {\n \"click\": this.onClickStep\n },\n \"style\": this.circleContainerStyle\n }, [this.genCircle()]), h(\"div\", {\n \"class\": bem('line'),\n \"style\": this.lineStyle\n })]);\n }\n});","import { createNamespace } from '../utils';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('steps'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanSteps')],\n props: {\n center: Boolean,\n iconPrefix: String,\n finishIcon: String,\n activeColor: String,\n inactiveIcon: String,\n inactiveColor: String,\n active: {\n type: [Number, String],\n default: 0\n },\n direction: {\n type: String,\n default: 'horizontal'\n },\n activeIcon: {\n type: String,\n default: 'checked'\n }\n },\n render: function render() {\n var h = arguments[0];\n return h(\"div\", {\n \"class\": bem([this.direction])\n }, [h(\"div\", {\n \"class\": bem('items')\n }, [this.slots()])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Icon from '../icon';\nimport Button from '../button'; // Types\n\nvar _createNamespace = createNamespace('submit-bar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction SubmitBar(h, props, slots, ctx) {\n var tip = props.tip,\n price = props.price,\n tipIcon = props.tipIcon;\n\n function Text() {\n if (typeof price === 'number') {\n var priceArr = (price / 100).toFixed(props.decimalLength).split('.');\n var decimalStr = props.decimalLength ? \".\" + priceArr[1] : '';\n return h(\"div\", {\n \"style\": {\n textAlign: props.textAlign ? props.textAlign : ''\n },\n \"class\": bem('text')\n }, [h(\"span\", [props.label || t('label')]), h(\"span\", {\n \"class\": bem('price')\n }, [props.currency, h(\"span\", {\n \"class\": bem('price', 'integer')\n }, [priceArr[0]]), decimalStr]), props.suffixLabel && h(\"span\", {\n \"class\": bem('suffix-label')\n }, [props.suffixLabel])]);\n }\n }\n\n function Tip() {\n if (slots.tip || tip) {\n return h(\"div\", {\n \"class\": bem('tip')\n }, [tipIcon && h(Icon, {\n \"class\": bem('tip-icon'),\n \"attrs\": {\n \"name\": tipIcon\n }\n }), tip && h(\"span\", {\n \"class\": bem('tip-text')\n }, [tip]), slots.tip && slots.tip()]);\n }\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem({\n unfit: !props.safeAreaInsetBottom\n })\n }, inherit(ctx)]), [slots.top && slots.top(), Tip(), h(\"div\", {\n \"class\": bem('bar')\n }, [slots.default && slots.default(), Text(), slots.button ? slots.button() : h(Button, {\n \"attrs\": {\n \"round\": true,\n \"type\": props.buttonType,\n \"text\": props.loading ? '' : props.buttonText,\n \"color\": props.buttonColor,\n \"loading\": props.loading,\n \"disabled\": props.disabled\n },\n \"class\": bem('button', props.buttonType),\n \"on\": {\n \"click\": function click() {\n emit(ctx, 'submit');\n }\n }\n })])]);\n}\n\nSubmitBar.props = {\n tip: String,\n label: String,\n price: Number,\n tipIcon: String,\n loading: Boolean,\n disabled: Boolean,\n textAlign: String,\n buttonText: String,\n buttonColor: String,\n suffixLabel: String,\n safeAreaInsetBottom: {\n type: Boolean,\n default: true\n },\n decimalLength: {\n type: [Number, String],\n default: 2\n },\n currency: {\n type: String,\n default: '¥'\n },\n buttonType: {\n type: String,\n default: 'danger'\n }\n};\nexport default createComponent(SubmitBar);","// Utils\nimport { createNamespace } from '../utils';\nimport { range } from '../utils/format/number';\nimport { preventDefault } from '../utils/dom/event'; // Mixins\n\nimport { TouchMixin } from '../mixins/touch';\nimport { ClickOutsideMixin } from '../mixins/click-outside';\n\nvar _createNamespace = createNamespace('swipe-cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nvar THRESHOLD = 0.15;\nexport default createComponent({\n mixins: [TouchMixin, ClickOutsideMixin({\n event: 'touchstart',\n method: 'onClick'\n })],\n props: {\n // @deprecated\n // should be removed in next major version, use beforeClose instead\n onClose: Function,\n disabled: Boolean,\n leftWidth: [Number, String],\n rightWidth: [Number, String],\n beforeClose: Function,\n stopPropagation: Boolean,\n name: {\n type: [Number, String],\n default: ''\n }\n },\n data: function data() {\n return {\n offset: 0,\n dragging: false\n };\n },\n computed: {\n computedLeftWidth: function computedLeftWidth() {\n return +this.leftWidth || this.getWidthByRef('left');\n },\n computedRightWidth: function computedRightWidth() {\n return +this.rightWidth || this.getWidthByRef('right');\n }\n },\n mounted: function mounted() {\n this.bindTouchEvent(this.$el);\n },\n methods: {\n getWidthByRef: function getWidthByRef(ref) {\n if (this.$refs[ref]) {\n var rect = this.$refs[ref].getBoundingClientRect();\n return rect.width;\n }\n\n return 0;\n },\n // @exposed-api\n open: function open(position) {\n var offset = position === 'left' ? this.computedLeftWidth : -this.computedRightWidth;\n this.opened = true;\n this.offset = offset;\n this.$emit('open', {\n position: position,\n name: this.name,\n // @deprecated\n // should be removed in next major version\n detail: this.name\n });\n },\n // @exposed-api\n close: function close(position) {\n this.offset = 0;\n\n if (this.opened) {\n this.opened = false;\n this.$emit('close', {\n position: position,\n name: this.name\n });\n }\n },\n onTouchStart: function onTouchStart(event) {\n if (this.disabled) {\n return;\n }\n\n this.startOffset = this.offset;\n this.touchStart(event);\n },\n onTouchMove: function onTouchMove(event) {\n if (this.disabled) {\n return;\n }\n\n this.touchMove(event);\n\n if (this.direction === 'horizontal') {\n this.dragging = true;\n this.lockClick = true;\n var isPrevent = !this.opened || this.deltaX * this.startOffset < 0;\n\n if (isPrevent) {\n preventDefault(event, this.stopPropagation);\n }\n\n this.offset = range(this.deltaX + this.startOffset, -this.computedRightWidth, this.computedLeftWidth);\n }\n },\n onTouchEnd: function onTouchEnd() {\n var _this = this;\n\n if (this.disabled) {\n return;\n }\n\n if (this.dragging) {\n this.toggle(this.offset > 0 ? 'left' : 'right');\n this.dragging = false; // compatible with desktop scenario\n\n setTimeout(function () {\n _this.lockClick = false;\n }, 0);\n }\n },\n toggle: function toggle(direction) {\n var offset = Math.abs(this.offset);\n var threshold = this.opened ? 1 - THRESHOLD : THRESHOLD;\n var computedLeftWidth = this.computedLeftWidth,\n computedRightWidth = this.computedRightWidth;\n\n if (computedRightWidth && direction === 'right' && offset > computedRightWidth * threshold) {\n this.open('right');\n } else if (computedLeftWidth && direction === 'left' && offset > computedLeftWidth * threshold) {\n this.open('left');\n } else {\n this.close();\n }\n },\n onClick: function onClick(position) {\n if (position === void 0) {\n position = 'outside';\n }\n\n this.$emit('click', position);\n\n if (this.opened && !this.lockClick) {\n if (this.beforeClose) {\n this.beforeClose({\n position: position,\n name: this.name,\n instance: this\n });\n } else if (this.onClose) {\n this.onClose(position, this, {\n name: this.name\n });\n } else {\n this.close(position);\n }\n }\n },\n getClickHandler: function getClickHandler(position, stop) {\n var _this2 = this;\n\n return function (event) {\n if (stop) {\n event.stopPropagation();\n }\n\n _this2.onClick(position);\n };\n },\n genLeftPart: function genLeftPart() {\n var h = this.$createElement;\n var content = this.slots('left');\n\n if (content) {\n return h(\"div\", {\n \"ref\": \"left\",\n \"class\": bem('left'),\n \"on\": {\n \"click\": this.getClickHandler('left', true)\n }\n }, [content]);\n }\n },\n genRightPart: function genRightPart() {\n var h = this.$createElement;\n var content = this.slots('right');\n\n if (content) {\n return h(\"div\", {\n \"ref\": \"right\",\n \"class\": bem('right'),\n \"on\": {\n \"click\": this.getClickHandler('right', true)\n }\n }, [content]);\n }\n }\n },\n render: function render() {\n var h = arguments[0];\n var wrapperStyle = {\n transform: \"translate3d(\" + this.offset + \"px, 0, 0)\",\n transitionDuration: this.dragging ? '0s' : '.6s'\n };\n return h(\"div\", {\n \"class\": bem(),\n \"on\": {\n \"click\": this.getClickHandler('cell')\n }\n }, [h(\"div\", {\n \"class\": bem('wrapper'),\n \"style\": wrapperStyle\n }, [this.genLeftPart(), this.slots(), this.genRightPart()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace } from '../utils';\nimport { inherit } from '../utils/functional'; // Components\n\nimport Cell from '../cell';\nimport Switch from '../switch';\nimport { switchProps } from '../switch/shared'; // Types\n\nvar _createNamespace = createNamespace('switch-cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction SwitchCell(h, props, slots, ctx) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('[Vant] \"SwitchCell\" component is deprecated, see: https://vant-ui.github.io/vant/v2/#/zh-CN/switch-cell.');\n }\n\n return h(Cell, _mergeJSXProps([{\n \"attrs\": {\n \"center\": true,\n \"size\": props.cellSize,\n \"title\": props.title,\n \"border\": props.border\n },\n \"class\": bem([props.cellSize])\n }, inherit(ctx)]), [h(Switch, {\n \"props\": _extends({}, props),\n \"on\": _extends({}, ctx.listeners)\n })]);\n}\n\nSwitchCell.props = _extends({}, switchProps, {\n title: String,\n cellSize: String,\n border: {\n type: Boolean,\n default: true\n },\n size: {\n type: String,\n default: '24px'\n }\n});\nexport default createComponent(SwitchCell);","import { createNamespace } from '../utils';\nimport { BORDER_TOP_BOTTOM } from '../utils/constant';\nimport { callInterceptor } from '../utils/interceptor';\nimport { ParentMixin } from '../mixins/relation';\n\nvar _createNamespace = createNamespace('tabbar'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ParentMixin('vanTabbar')],\n props: {\n route: Boolean,\n zIndex: [Number, String],\n placeholder: Boolean,\n activeColor: String,\n beforeChange: Function,\n inactiveColor: String,\n value: {\n type: [Number, String],\n default: 0\n },\n border: {\n type: Boolean,\n default: true\n },\n fixed: {\n type: Boolean,\n default: true\n },\n safeAreaInsetBottom: {\n type: Boolean,\n default: null\n }\n },\n data: function data() {\n return {\n height: null\n };\n },\n computed: {\n fit: function fit() {\n if (this.safeAreaInsetBottom !== null) {\n return this.safeAreaInsetBottom;\n } // enable safe-area-inset-bottom by default when fixed\n\n\n return this.fixed;\n }\n },\n watch: {\n value: 'setActiveItem',\n children: 'setActiveItem'\n },\n mounted: function mounted() {\n var _this = this;\n\n if (this.placeholder && this.fixed) {\n var setHeight = function setHeight() {\n _this.height = _this.$refs.tabbar.getBoundingClientRect().height;\n };\n\n setHeight(); // https://github.com/vant-ui/vant/issues/10131\n\n setTimeout(setHeight, 100);\n }\n },\n methods: {\n setActiveItem: function setActiveItem() {\n var _this2 = this;\n\n this.children.forEach(function (item, index) {\n item.nameMatched = item.name === _this2.value || index === _this2.value;\n });\n },\n triggerChange: function triggerChange(active, afterChange) {\n var _this3 = this;\n\n callInterceptor({\n interceptor: this.beforeChange,\n args: [active],\n done: function done() {\n _this3.$emit('input', active);\n\n _this3.$emit('change', active);\n\n afterChange();\n }\n });\n },\n genTabbar: function genTabbar() {\n var _ref;\n\n var h = this.$createElement;\n return h(\"div\", {\n \"ref\": \"tabbar\",\n \"style\": {\n zIndex: this.zIndex\n },\n \"class\": [(_ref = {}, _ref[BORDER_TOP_BOTTOM] = this.border, _ref), bem({\n unfit: !this.fit,\n fixed: this.fixed\n })]\n }, [this.slots()]);\n }\n },\n render: function render() {\n var h = arguments[0];\n\n if (this.placeholder && this.fixed) {\n return h(\"div\", {\n \"class\": bem('placeholder'),\n \"style\": {\n height: this.height + \"px\"\n }\n }, [this.genTabbar()]);\n }\n\n return this.genTabbar();\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace, isObject, isDef } from '../utils';\nimport { route, routeProps } from '../utils/router'; // Mixins\n\nimport { ChildrenMixin } from '../mixins/relation'; // Components\n\nimport Icon from '../icon';\nimport Info from '../info';\n\nvar _createNamespace = createNamespace('tabbar-item'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [ChildrenMixin('vanTabbar')],\n props: _extends({}, routeProps, {\n dot: Boolean,\n icon: String,\n name: [Number, String],\n // @deprecated\n info: [Number, String],\n badge: [Number, String],\n iconPrefix: String\n }),\n data: function data() {\n return {\n nameMatched: false\n };\n },\n computed: {\n active: function active() {\n var routeMode = this.parent.route;\n\n if (routeMode && '$route' in this) {\n var to = this.to,\n $route = this.$route;\n var config = isObject(to) ? to : {\n path: to\n };\n return !!$route.matched.find(function (r) {\n // vue-router 3.x $route.matched[0].path is empty in / and its children paths\n var path = r.path === '' ? '/' : r.path;\n var pathMatched = config.path === path;\n var nameMatched = isDef(config.name) && config.name === r.name;\n return pathMatched || nameMatched;\n });\n }\n\n return this.nameMatched;\n }\n },\n methods: {\n onClick: function onClick(event) {\n var _this = this;\n\n if (!this.active) {\n this.parent.triggerChange(this.name || this.index, function () {\n route(_this.$router, _this);\n });\n }\n\n this.$emit('click', event);\n },\n genIcon: function genIcon() {\n var h = this.$createElement;\n var slot = this.slots('icon', {\n active: this.active\n });\n\n if (slot) {\n return slot;\n }\n\n if (this.icon) {\n return h(Icon, {\n \"attrs\": {\n \"name\": this.icon,\n \"classPrefix\": this.iconPrefix\n }\n });\n }\n }\n },\n render: function render() {\n var _this$badge;\n\n var h = arguments[0];\n var active = this.active;\n var color = this.parent[active ? 'activeColor' : 'inactiveColor'];\n\n if (process.env.NODE_ENV === 'development' && this.info) {\n console.warn('[Vant] TabbarItem: \"info\" prop is deprecated, use \"badge\" prop instead.');\n }\n\n return h(\"div\", {\n \"class\": bem({\n active: active\n }),\n \"style\": {\n color: color\n },\n \"on\": {\n \"click\": this.onClick\n }\n }, [h(\"div\", {\n \"class\": bem('icon')\n }, [this.genIcon(), h(Info, {\n \"attrs\": {\n \"dot\": this.dot,\n \"info\": (_this$badge = this.badge) != null ? _this$badge : this.info\n }\n })]), h(\"div\", {\n \"class\": bem('text')\n }, [this.slots('default', {\n active: active\n })])]);\n }\n});","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { emit, inherit } from '../utils/functional'; // Components\n\nimport Icon from '../icon';\nimport Sidebar from '../sidebar';\nimport SidebarItem from '../sidebar-item'; // Types\n\nvar _createNamespace = createNamespace('tree-select'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction TreeSelect(h, props, slots, ctx) {\n var items = props.items,\n height = props.height,\n activeId = props.activeId,\n selectedIcon = props.selectedIcon,\n mainActiveIndex = props.mainActiveIndex;\n\n if (process.env.NODE_ENV === 'development') {\n if (ctx.listeners.navclick) {\n console.warn('[Vant] TreeSelect: \"navclick\" event is deprecated, use \"click-nav\" instead.');\n }\n\n if (ctx.listeners.itemclick) {\n console.warn('[Vant] TreeSelect: \"itemclick\" event is deprecated, use \"click-item\" instead.');\n }\n }\n\n var selectedItem = items[+mainActiveIndex] || {};\n var subItems = selectedItem.children || [];\n var isMultiple = Array.isArray(activeId);\n\n function isActiveItem(id) {\n return isMultiple ? activeId.indexOf(id) !== -1 : activeId === id;\n }\n\n var Navs = items.map(function (item) {\n var _item$badge;\n\n return h(SidebarItem, {\n \"attrs\": {\n \"dot\": item.dot,\n \"info\": (_item$badge = item.badge) != null ? _item$badge : item.info,\n \"title\": item.text,\n \"disabled\": item.disabled\n },\n \"class\": [bem('nav-item'), item.className]\n });\n });\n\n function Content() {\n if (slots.content) {\n return slots.content();\n }\n\n return subItems.map(function (item) {\n return h(\"div\", {\n \"key\": item.id,\n \"class\": ['van-ellipsis', bem('item', {\n active: isActiveItem(item.id),\n disabled: item.disabled\n })],\n \"on\": {\n \"click\": function click() {\n if (!item.disabled) {\n var newActiveId = item.id;\n\n if (isMultiple) {\n newActiveId = activeId.slice();\n var index = newActiveId.indexOf(item.id);\n\n if (index !== -1) {\n newActiveId.splice(index, 1);\n } else if (newActiveId.length < props.max) {\n newActiveId.push(item.id);\n }\n }\n\n emit(ctx, 'update:active-id', newActiveId);\n emit(ctx, 'click-item', item); // compatible with legacy usage, should be removed in next major version\n\n emit(ctx, 'itemclick', item);\n }\n }\n }\n }, [item.text, isActiveItem(item.id) && h(Icon, {\n \"attrs\": {\n \"name\": selectedIcon\n },\n \"class\": bem('selected')\n })]);\n });\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem(),\n \"style\": {\n height: addUnit(height)\n }\n }, inherit(ctx)]), [h(Sidebar, {\n \"class\": bem('nav'),\n \"attrs\": {\n \"activeKey\": mainActiveIndex\n },\n \"on\": {\n \"change\": function change(index) {\n emit(ctx, 'update:main-active-index', index);\n emit(ctx, 'click-nav', index); // compatible with legacy usage, should be removed in next major version\n\n emit(ctx, 'navclick', index);\n }\n }\n }, [Navs]), h(\"div\", {\n \"class\": bem('content')\n }, [Content()])]);\n}\n\nTreeSelect.props = {\n max: {\n type: [Number, String],\n default: Infinity\n },\n items: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n height: {\n type: [Number, String],\n default: 300\n },\n activeId: {\n type: [Number, String, Array],\n default: 0\n },\n selectedIcon: {\n type: String,\n default: 'success'\n },\n mainActiveIndex: {\n type: [Number, String],\n default: 0\n }\n};\nexport default createComponent(TreeSelect);","import ActionSheet from './action-sheet';\nimport AddressEdit from './address-edit';\nimport AddressList from './address-list';\nimport Area from './area';\nimport Badge from './badge';\nimport Button from './button';\nimport Calendar from './calendar';\nimport Card from './card';\nimport Cascader from './cascader';\nimport Cell from './cell';\nimport CellGroup from './cell-group';\nimport Checkbox from './checkbox';\nimport CheckboxGroup from './checkbox-group';\nimport Circle from './circle';\nimport Col from './col';\nimport Collapse from './collapse';\nimport CollapseItem from './collapse-item';\nimport ContactCard from './contact-card';\nimport ContactEdit from './contact-edit';\nimport ContactList from './contact-list';\nimport CountDown from './count-down';\nimport Coupon from './coupon';\nimport CouponCell from './coupon-cell';\nimport CouponList from './coupon-list';\nimport DatetimePicker from './datetime-picker';\nimport Dialog from './dialog';\nimport Divider from './divider';\nimport DropdownItem from './dropdown-item';\nimport DropdownMenu from './dropdown-menu';\nimport Empty from './empty';\nimport Field from './field';\nimport Form from './form';\nimport GoodsAction from './goods-action';\nimport GoodsActionButton from './goods-action-button';\nimport GoodsActionIcon from './goods-action-icon';\nimport Grid from './grid';\nimport GridItem from './grid-item';\nimport Icon from './icon';\nimport Image from './image';\nimport ImagePreview from './image-preview';\nimport IndexAnchor from './index-anchor';\nimport IndexBar from './index-bar';\nimport Info from './info';\nimport Lazyload from './lazyload';\nimport List from './list';\nimport Loading from './loading';\nimport Locale from './locale';\nimport NavBar from './nav-bar';\nimport NoticeBar from './notice-bar';\nimport Notify from './notify';\nimport NumberKeyboard from './number-keyboard';\nimport Overlay from './overlay';\nimport Pagination from './pagination';\nimport Panel from './panel';\nimport PasswordInput from './password-input';\nimport Picker from './picker';\nimport Popover from './popover';\nimport Popup from './popup';\nimport Progress from './progress';\nimport PullRefresh from './pull-refresh';\nimport Radio from './radio';\nimport RadioGroup from './radio-group';\nimport Rate from './rate';\nimport Row from './row';\nimport Search from './search';\nimport ShareSheet from './share-sheet';\nimport Sidebar from './sidebar';\nimport SidebarItem from './sidebar-item';\nimport Skeleton from './skeleton';\nimport Sku from './sku';\nimport Slider from './slider';\nimport Step from './step';\nimport Stepper from './stepper';\nimport Steps from './steps';\nimport Sticky from './sticky';\nimport SubmitBar from './submit-bar';\nimport Swipe from './swipe';\nimport SwipeCell from './swipe-cell';\nimport SwipeItem from './swipe-item';\nimport Switch from './switch';\nimport SwitchCell from './switch-cell';\nimport Tab from './tab';\nimport Tabbar from './tabbar';\nimport TabbarItem from './tabbar-item';\nimport Tabs from './tabs';\nimport Tag from './tag';\nimport Toast from './toast';\nimport TreeSelect from './tree-select';\nimport Uploader from './uploader';\nvar version = '2.12.54';\n\nfunction install(Vue) {\n var components = [ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, GoodsAction, GoodsActionButton, GoodsActionIcon, Grid, GridItem, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Panel, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Sku, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];\n components.forEach(function (item) {\n if (item.install) {\n Vue.use(item);\n } else if (item.name) {\n Vue.component(item.name, item);\n }\n });\n}\n\nif (typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n}\n\nexport { install, version, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, GoodsAction, GoodsActionButton, GoodsActionIcon, Grid, GridItem, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, Panel, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Sku, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader };\nexport default {\n install: install,\n version: version\n};","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { inherit } from '../utils/functional'; // Types\n\nvar _createNamespace = createNamespace('info'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction Info(h, props, slots, ctx) {\n var dot = props.dot,\n info = props.info;\n var showInfo = isDef(info) && info !== '';\n\n if (!dot && !showInfo) {\n return;\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem({\n dot: dot\n })\n }, inherit(ctx, true)]), [dot ? '' : props.info]);\n}\n\nInfo.props = {\n dot: Boolean,\n info: [Number, String]\n};\nexport default createComponent(Info);","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, addUnit } from '../utils';\nimport { inherit } from '../utils/functional'; // Types\n\nvar _createNamespace = createNamespace('loading'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction LoadingIcon(h, props) {\n if (props.type === 'spinner') {\n var Spin = [];\n\n for (var i = 0; i < 12; i++) {\n Spin.push(h(\"i\"));\n }\n\n return Spin;\n }\n\n return h(\"svg\", {\n \"class\": bem('circular'),\n \"attrs\": {\n \"viewBox\": \"25 25 50 50\"\n }\n }, [h(\"circle\", {\n \"attrs\": {\n \"cx\": \"50\",\n \"cy\": \"50\",\n \"r\": \"20\",\n \"fill\": \"none\"\n }\n })]);\n}\n\nfunction LoadingText(h, props, slots) {\n if (slots.default) {\n var _props$textColor;\n\n var style = {\n fontSize: addUnit(props.textSize),\n color: (_props$textColor = props.textColor) != null ? _props$textColor : props.color\n };\n return h(\"span\", {\n \"class\": bem('text'),\n \"style\": style\n }, [slots.default()]);\n }\n}\n\nfunction Loading(h, props, slots, ctx) {\n var color = props.color,\n size = props.size,\n type = props.type;\n var style = {\n color: color\n };\n\n if (size) {\n var iconSize = addUnit(size);\n style.width = iconSize;\n style.height = iconSize;\n }\n\n return h(\"div\", _mergeJSXProps([{\n \"class\": bem([type, {\n vertical: props.vertical\n }])\n }, inherit(ctx, true)]), [h(\"span\", {\n \"class\": bem('spinner', type),\n \"style\": style\n }, [LoadingIcon(h, props)]), LoadingText(h, props, slots)]);\n}\n\nLoading.props = {\n color: String,\n size: [Number, String],\n vertical: Boolean,\n textSize: [Number, String],\n textColor: String,\n type: {\n type: String,\n default: 'circular'\n }\n};\nexport default createComponent(Loading);","import { isDef, isObject } from '.';\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction assignKey(to, from, key) {\n var val = from[key];\n\n if (!isDef(val)) {\n return;\n }\n\n if (!hasOwnProperty.call(to, key) || !isObject(val)) {\n to[key] = val;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n to[key] = deepAssign(Object(to[key]), from[key]);\n }\n}\n\nexport function deepAssign(to, from) {\n Object.keys(from).forEach(function (key) {\n assignKey(to, from, key);\n });\n return to;\n}","export default {\n name: '姓名',\n tel: '电话',\n save: '保存',\n confirm: '确认',\n cancel: '取消',\n delete: '删除',\n complete: '完成',\n loading: '加载中...',\n telEmpty: '请填写电话',\n nameEmpty: '请填写姓名',\n nameInvalid: '请输入正确的姓名',\n confirmDelete: '确定要删除吗',\n telInvalid: '请输入正确的手机号',\n vanCalendar: {\n end: '结束',\n start: '开始',\n title: '日期选择',\n confirm: '确定',\n startEnd: '开始/结束',\n weekdays: ['日', '一', '二', '三', '四', '五', '六'],\n monthTitle: function monthTitle(year, month) {\n return year + \"\\u5E74\" + month + \"\\u6708\";\n },\n rangePrompt: function rangePrompt(maxRange) {\n return \"\\u9009\\u62E9\\u5929\\u6570\\u4E0D\\u80FD\\u8D85\\u8FC7 \" + maxRange + \" \\u5929\";\n }\n },\n vanCascader: {\n select: '请选择'\n },\n vanContactCard: {\n addText: '添加联系人'\n },\n vanContactList: {\n addText: '新建联系人'\n },\n vanPagination: {\n prev: '上一页',\n next: '下一页'\n },\n vanPullRefresh: {\n pulling: '下拉即可刷新...',\n loosing: '释放即可刷新...'\n },\n vanSubmitBar: {\n label: '合计:'\n },\n vanCoupon: {\n unlimited: '无使用门槛',\n discount: function discount(_discount) {\n return _discount + \"\\u6298\";\n },\n condition: function condition(_condition) {\n return \"\\u6EE1\" + _condition + \"\\u5143\\u53EF\\u7528\";\n }\n },\n vanCouponCell: {\n title: '优惠券',\n tips: '暂无可用',\n count: function count(_count) {\n return _count + \"\\u5F20\\u53EF\\u7528\";\n }\n },\n vanCouponList: {\n empty: '暂无优惠券',\n exchange: '兑换',\n close: '不使用优惠券',\n enable: '可用',\n disabled: '不可用',\n placeholder: '请输入优惠码'\n },\n vanAddressEdit: {\n area: '地区',\n postal: '邮政编码',\n areaEmpty: '请选择地区',\n addressEmpty: '请填写详细地址',\n postalEmpty: '邮政编码格式不正确',\n defaultAddress: '设为默认收货地址',\n telPlaceholder: '收货人手机号',\n namePlaceholder: '收货人姓名',\n areaPlaceholder: '选择省 / 市 / 区'\n },\n vanAddressEditDetail: {\n label: '详细地址',\n placeholder: '街道门牌、楼层房间号等信息'\n },\n vanAddressList: {\n add: '新增地址'\n }\n};","import Vue from 'vue';\nimport { deepAssign } from '../utils/deep-assign';\nimport defaultMessages from './lang/zh-CN';\nvar proto = Vue.prototype;\nvar defineReactive = Vue.util.defineReactive;\ndefineReactive(proto, '$vantLang', 'zh-CN');\ndefineReactive(proto, '$vantMessages', {\n 'zh-CN': defaultMessages\n});\nexport default {\n messages: function messages() {\n return proto.$vantMessages[proto.$vantLang];\n },\n use: function use(lang, messages) {\n var _this$add;\n\n proto.$vantLang = lang;\n this.add((_this$add = {}, _this$add[lang] = messages, _this$add));\n },\n add: function add(messages) {\n if (messages === void 0) {\n messages = {};\n }\n\n deepAssign(proto.$vantMessages, messages);\n }\n};","/**\n * Bind event when mounted or activated\n */\nimport { on, off } from '../utils/dom/event';\nvar uid = 0;\nexport function BindEventMixin(handler) {\n var key = \"binded_\" + uid++;\n\n function bind() {\n if (!this[key]) {\n handler.call(this, on, true);\n this[key] = true;\n }\n }\n\n function unbind() {\n if (this[key]) {\n handler.call(this, off, false);\n this[key] = false;\n }\n }\n\n return {\n mounted: bind,\n activated: bind,\n deactivated: unbind,\n beforeDestroy: unbind\n };\n}","import { on, off } from '../utils/dom/event';\nimport { BindEventMixin } from './bind-event';\nexport var CloseOnPopstateMixin = {\n mixins: [BindEventMixin(function (bind, isBind) {\n this.handlePopstate(isBind && this.closeOnPopstate);\n })],\n props: {\n closeOnPopstate: Boolean\n },\n data: function data() {\n return {\n bindStatus: false\n };\n },\n watch: {\n closeOnPopstate: function closeOnPopstate(val) {\n this.handlePopstate(val);\n }\n },\n methods: {\n onPopstate: function onPopstate() {\n this.close();\n this.shouldReopen = false;\n },\n handlePopstate: function handlePopstate(bind) {\n /* istanbul ignore if */\n if (this.$isServer) {\n return;\n }\n\n if (this.bindStatus !== bind) {\n this.bindStatus = bind;\n var action = bind ? on : off;\n action(window, 'popstate', this.onPopstate);\n }\n }\n }\n};","export var FieldMixin = {\n inject: {\n vanField: {\n default: null\n }\n },\n watch: {\n value: function value() {\n var field = this.vanField;\n\n if (field) {\n field.resetValidation();\n field.validateWithTrigger('onChange');\n }\n }\n },\n created: function created() {\n var field = this.vanField;\n\n if (field && !field.children) {\n field.children = this;\n }\n }\n};","export var context = {\n zIndex: 2000,\n lockCount: 0,\n stack: [],\n find: function find(vm) {\n return this.stack.filter(function (item) {\n return item.vm === vm;\n })[0];\n },\n remove: function remove(vm) {\n var item = this.find(vm);\n if (!item) return;\n item.vm = null;\n item.overlay = null;\n var index = this.stack.indexOf(item);\n this.stack.splice(index, 1);\n }\n};","// Context\nimport { context } from './context';\nimport { openOverlay, closeOverlay, updateOverlay, removeOverlay } from './overlay'; // Utils\n\nimport { on, off, preventDefault } from '../../utils/dom/event';\nimport { removeNode } from '../../utils/dom/node';\nimport { getScroller } from '../../utils/dom/scroll'; // Mixins\n\nimport { TouchMixin } from '../touch';\nimport { PortalMixin } from '../portal';\nimport { CloseOnPopstateMixin } from '../close-on-popstate';\nexport var popupMixinProps = {\n // Initial rendering animation\n transitionAppear: Boolean,\n // whether to show popup\n value: Boolean,\n // whether to show overlay\n overlay: Boolean,\n // overlay custom style\n overlayStyle: Object,\n // overlay custom class name\n overlayClass: String,\n // whether to close popup when overlay is clicked\n closeOnClickOverlay: Boolean,\n // z-index\n zIndex: [Number, String],\n // prevent body scroll\n lockScroll: {\n type: Boolean,\n default: true\n },\n // whether to lazy render\n lazyRender: {\n type: Boolean,\n default: true\n }\n};\nexport function PopupMixin(options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n mixins: [TouchMixin, CloseOnPopstateMixin, PortalMixin({\n afterPortal: function afterPortal() {\n if (this.overlay) {\n updateOverlay();\n }\n }\n })],\n provide: function provide() {\n return {\n vanPopup: this\n };\n },\n props: popupMixinProps,\n data: function data() {\n this.onReopenCallback = [];\n return {\n inited: this.value\n };\n },\n computed: {\n shouldRender: function shouldRender() {\n return this.inited || !this.lazyRender;\n }\n },\n watch: {\n value: function value(val) {\n var type = val ? 'open' : 'close';\n this.inited = this.inited || this.value;\n this[type]();\n\n if (!options.skipToggleEvent) {\n this.$emit(type);\n }\n },\n overlay: 'renderOverlay'\n },\n mounted: function mounted() {\n if (this.value) {\n this.open();\n }\n },\n\n /* istanbul ignore next */\n activated: function activated() {\n if (this.shouldReopen) {\n this.$emit('input', true);\n this.shouldReopen = false;\n }\n },\n beforeDestroy: function beforeDestroy() {\n removeOverlay(this);\n\n if (this.opened) {\n this.removeLock();\n }\n\n if (this.getContainer) {\n removeNode(this.$el);\n }\n },\n\n /* istanbul ignore next */\n deactivated: function deactivated() {\n if (this.value) {\n this.close();\n this.shouldReopen = true;\n }\n },\n methods: {\n open: function open() {\n /* istanbul ignore next */\n if (this.$isServer || this.opened) {\n return;\n } // cover default zIndex\n\n\n if (this.zIndex !== undefined) {\n context.zIndex = this.zIndex;\n }\n\n this.opened = true;\n this.renderOverlay();\n this.addLock();\n this.onReopenCallback.forEach(function (callback) {\n callback();\n });\n },\n addLock: function addLock() {\n if (this.lockScroll) {\n on(document, 'touchstart', this.touchStart);\n on(document, 'touchmove', this.onTouchMove);\n\n if (!context.lockCount) {\n document.body.classList.add('van-overflow-hidden');\n }\n\n context.lockCount++;\n }\n },\n removeLock: function removeLock() {\n if (this.lockScroll && context.lockCount) {\n context.lockCount--;\n off(document, 'touchstart', this.touchStart);\n off(document, 'touchmove', this.onTouchMove);\n\n if (!context.lockCount) {\n document.body.classList.remove('van-overflow-hidden');\n }\n }\n },\n close: function close() {\n if (!this.opened) {\n return;\n }\n\n closeOverlay(this);\n this.opened = false;\n this.removeLock();\n this.$emit('input', false);\n },\n onTouchMove: function onTouchMove(event) {\n this.touchMove(event);\n var direction = this.deltaY > 0 ? '10' : '01';\n var el = getScroller(event.target, this.$el);\n var scrollHeight = el.scrollHeight,\n offsetHeight = el.offsetHeight,\n scrollTop = el.scrollTop;\n var status = '11';\n /* istanbul ignore next */\n\n if (scrollTop === 0) {\n status = offsetHeight >= scrollHeight ? '00' : '01';\n } else if (scrollTop + offsetHeight >= scrollHeight) {\n status = '10';\n }\n /* istanbul ignore next */\n\n\n if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {\n preventDefault(event, true);\n }\n },\n renderOverlay: function renderOverlay() {\n var _this = this;\n\n if (this.$isServer || !this.value) {\n return;\n }\n\n this.$nextTick(function () {\n _this.updateZIndex(_this.overlay ? 1 : 0);\n\n if (_this.overlay) {\n openOverlay(_this, {\n zIndex: context.zIndex++,\n duration: _this.duration,\n className: _this.overlayClass,\n customStyle: _this.overlayStyle\n });\n } else {\n closeOverlay(_this);\n }\n });\n },\n updateZIndex: function updateZIndex(value) {\n if (value === void 0) {\n value = 0;\n }\n\n this.$el.style.zIndex = ++context.zIndex + value;\n },\n onReopen: function onReopen(callback) {\n this.onReopenCallback.push(callback);\n }\n }\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Overlay from '../../overlay';\nimport { context } from './context';\nimport { mount } from '../../utils/functional';\nimport { removeNode } from '../../utils/dom/node';\nvar defaultConfig = {\n className: '',\n customStyle: {}\n};\n\nfunction mountOverlay(vm) {\n return mount(Overlay, {\n on: {\n // close popup when overlay clicked & closeOnClickOverlay is true\n click: function click() {\n vm.$emit('click-overlay');\n\n if (vm.closeOnClickOverlay) {\n if (vm.onClickOverlay) {\n vm.onClickOverlay();\n } else {\n vm.close();\n }\n }\n }\n }\n });\n}\n\nexport function updateOverlay(vm) {\n var item = context.find(vm);\n\n if (item) {\n var el = vm.$el;\n var config = item.config,\n overlay = item.overlay;\n\n if (el && el.parentNode) {\n el.parentNode.insertBefore(overlay.$el, el);\n }\n\n _extends(overlay, defaultConfig, config, {\n show: true\n });\n }\n}\nexport function openOverlay(vm, config) {\n var item = context.find(vm);\n\n if (item) {\n item.config = config;\n } else {\n var overlay = mountOverlay(vm);\n context.stack.push({\n vm: vm,\n config: config,\n overlay: overlay\n });\n }\n\n updateOverlay(vm);\n}\nexport function closeOverlay(vm) {\n var item = context.find(vm);\n\n if (item) {\n item.overlay.show = false;\n }\n}\nexport function removeOverlay(vm) {\n var item = context.find(vm);\n\n if (item) {\n removeNode(item.overlay.$el);\n context.remove(vm);\n }\n}","function getElement(selector) {\n if (typeof selector === 'string') {\n return document.querySelector(selector);\n }\n\n return selector();\n}\n\nexport function PortalMixin(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n ref = _ref.ref,\n afterPortal = _ref.afterPortal;\n\n return {\n props: {\n getContainer: [String, Function]\n },\n watch: {\n getContainer: 'portal'\n },\n mounted: function mounted() {\n if (this.getContainer) {\n this.portal();\n }\n },\n methods: {\n portal: function portal() {\n var getContainer = this.getContainer;\n var el = ref ? this.$refs[ref] : this.$el;\n var container;\n\n if (getContainer) {\n container = getElement(getContainer);\n } else if (this.$parent) {\n container = this.$parent.$el;\n }\n\n if (container && container !== el.parentNode) {\n container.appendChild(el);\n }\n\n if (afterPortal) {\n afterPortal.call(this);\n }\n }\n }\n };\n}","import { sortChildren } from '../utils/vnodes';\nexport function ChildrenMixin(_parent, options) {\n var _inject, _computed;\n\n if (options === void 0) {\n options = {};\n }\n\n var indexKey = options.indexKey || 'index';\n return {\n inject: (_inject = {}, _inject[_parent] = {\n default: null\n }, _inject),\n computed: (_computed = {\n parent: function parent() {\n if (this.disableBindRelation) {\n return null;\n }\n\n return this[_parent];\n }\n }, _computed[indexKey] = function () {\n this.bindRelation();\n\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n\n return null;\n }, _computed),\n watch: {\n disableBindRelation: function disableBindRelation(val) {\n if (!val) {\n this.bindRelation();\n }\n }\n },\n mounted: function mounted() {\n this.bindRelation();\n },\n beforeDestroy: function beforeDestroy() {\n var _this = this;\n\n if (this.parent) {\n this.parent.children = this.parent.children.filter(function (item) {\n return item !== _this;\n });\n }\n },\n methods: {\n bindRelation: function bindRelation() {\n if (!this.parent || this.parent.children.indexOf(this) !== -1) {\n return;\n }\n\n var children = [].concat(this.parent.children, [this]);\n sortChildren(children, this.parent);\n this.parent.children = children;\n }\n }\n };\n}\nexport function ParentMixin(parent) {\n return {\n provide: function provide() {\n var _ref;\n\n return _ref = {}, _ref[parent] = this, _ref;\n },\n data: function data() {\n return {\n children: []\n };\n }\n };\n}","/**\n * Use scopedSlots in Vue 2.6+\n * downgrade to slots in lower version\n */\nexport var SlotsMixin = {\n methods: {\n slots: function slots(name, props) {\n if (name === void 0) {\n name = 'default';\n }\n\n var $slots = this.$slots,\n $scopedSlots = this.$scopedSlots;\n var scopedSlot = $scopedSlots[name];\n\n if (scopedSlot) {\n return scopedSlot(props);\n }\n\n return $slots[name];\n }\n }\n};","import { on } from '../utils/dom/event';\n\nfunction getDirection(x, y) {\n if (x > y) {\n return 'horizontal';\n }\n\n if (y > x) {\n return 'vertical';\n }\n\n return '';\n}\n\nexport var TouchMixin = {\n data: function data() {\n return {\n direction: ''\n };\n },\n methods: {\n touchStart: function touchStart(event) {\n this.resetTouchStatus();\n this.startX = event.touches[0].clientX;\n this.startY = event.touches[0].clientY;\n },\n touchMove: function touchMove(event) {\n var touch = event.touches[0]; // safari back will set clientX to negative number\n\n this.deltaX = touch.clientX < 0 ? 0 : touch.clientX - this.startX;\n this.deltaY = touch.clientY - this.startY;\n this.offsetX = Math.abs(this.deltaX);\n this.offsetY = Math.abs(this.deltaY); // lock direction when distance is greater than a certain value\n\n var LOCK_DIRECTION_DISTANCE = 10;\n\n if (!this.direction || this.offsetX < LOCK_DIRECTION_DISTANCE && this.offsetY < LOCK_DIRECTION_DISTANCE) {\n this.direction = getDirection(this.offsetX, this.offsetY);\n }\n },\n resetTouchStatus: function resetTouchStatus() {\n this.direction = '';\n this.deltaX = 0;\n this.deltaY = 0;\n this.offsetX = 0;\n this.offsetY = 0;\n },\n // avoid Vue 2.6 event bubble issues by manually binding events\n // https://github.com/vant-ui/vant/issues/3015\n bindTouchEvent: function bindTouchEvent(el) {\n var onTouchStart = this.onTouchStart,\n onTouchMove = this.onTouchMove,\n onTouchEnd = this.onTouchEnd;\n on(el, 'touchstart', onTouchStart);\n on(el, 'touchmove', onTouchMove);\n\n if (onTouchEnd) {\n on(el, 'touchend', onTouchEnd);\n on(el, 'touchcancel', onTouchEnd);\n }\n }\n }\n};","import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n// Utils\nimport { createNamespace, isDef, noop } from '../utils';\nimport { inherit } from '../utils/functional';\nimport { preventDefault } from '../utils/dom/event'; // Types\n\nvar _createNamespace = createNamespace('overlay'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nfunction preventTouchMove(event) {\n preventDefault(event, true);\n}\n\nfunction Overlay(h, props, slots, ctx) {\n var style = _extends({\n zIndex: props.zIndex\n }, props.customStyle);\n\n if (isDef(props.duration)) {\n style.animationDuration = props.duration + \"s\";\n }\n\n return h(\"transition\", {\n \"attrs\": {\n \"name\": \"van-fade\"\n }\n }, [h(\"div\", _mergeJSXProps([{\n \"directives\": [{\n name: \"show\",\n value: props.show\n }],\n \"style\": style,\n \"class\": [bem(), props.className],\n \"on\": {\n \"touchmove\": props.lockScroll ? preventTouchMove : noop\n }\n }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()])]);\n}\n\nOverlay.props = {\n show: Boolean,\n zIndex: [Number, String],\n duration: [Number, String],\n className: null,\n customStyle: Object,\n lockScroll: {\n type: Boolean,\n default: true\n }\n};\nexport default createComponent(Overlay);","var lockCount = 0;\nexport function lockClick(lock) {\n if (lock) {\n if (!lockCount) {\n document.body.classList.add('van-toast--unclickable');\n }\n\n lockCount++;\n } else {\n lockCount--;\n\n if (!lockCount) {\n document.body.classList.remove('van-toast--unclickable');\n }\n }\n}","// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { lockClick } from './lock-click'; // Mixins\n\nimport { PopupMixin } from '../mixins/popup'; // Components\n\nimport Icon from '../icon';\nimport Loading from '../loading';\n\nvar _createNamespace = createNamespace('toast'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1];\n\nexport default createComponent({\n mixins: [PopupMixin()],\n props: {\n icon: String,\n className: null,\n iconPrefix: String,\n loadingType: String,\n forbidClick: Boolean,\n closeOnClick: Boolean,\n message: [Number, String],\n type: {\n type: String,\n default: 'text'\n },\n position: {\n type: String,\n default: 'middle'\n },\n transition: {\n type: String,\n default: 'van-fade'\n },\n lockScroll: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n clickable: false\n };\n },\n mounted: function mounted() {\n this.toggleClickable();\n },\n destroyed: function destroyed() {\n this.toggleClickable();\n },\n watch: {\n value: 'toggleClickable',\n forbidClick: 'toggleClickable'\n },\n methods: {\n onClick: function onClick() {\n if (this.closeOnClick) {\n this.close();\n }\n },\n toggleClickable: function toggleClickable() {\n var clickable = this.value && this.forbidClick;\n\n if (this.clickable !== clickable) {\n this.clickable = clickable;\n lockClick(clickable);\n }\n },\n\n /* istanbul ignore next */\n onAfterEnter: function onAfterEnter() {\n this.$emit('opened');\n\n if (this.onOpened) {\n this.onOpened();\n }\n },\n onAfterLeave: function onAfterLeave() {\n this.$emit('closed');\n },\n genIcon: function genIcon() {\n var h = this.$createElement;\n var icon = this.icon,\n type = this.type,\n iconPrefix = this.iconPrefix,\n loadingType = this.loadingType;\n var hasIcon = icon || type === 'success' || type === 'fail';\n\n if (hasIcon) {\n return h(Icon, {\n \"class\": bem('icon'),\n \"attrs\": {\n \"classPrefix\": iconPrefix,\n \"name\": icon || type\n }\n });\n }\n\n if (type === 'loading') {\n return h(Loading, {\n \"class\": bem('loading'),\n \"attrs\": {\n \"type\": loadingType\n }\n });\n }\n },\n genMessage: function genMessage() {\n var h = this.$createElement;\n var type = this.type,\n message = this.message;\n\n if (!isDef(message) || message === '') {\n return;\n }\n\n if (type === 'html') {\n return h(\"div\", {\n \"class\": bem('text'),\n \"domProps\": {\n \"innerHTML\": message\n }\n });\n }\n\n return h(\"div\", {\n \"class\": bem('text')\n }, [message]);\n }\n },\n render: function render() {\n var _ref;\n\n var h = arguments[0];\n return h(\"transition\", {\n \"attrs\": {\n \"name\": this.transition\n },\n \"on\": {\n \"afterEnter\": this.onAfterEnter,\n \"afterLeave\": this.onAfterLeave\n }\n }, [h(\"div\", {\n \"directives\": [{\n name: \"show\",\n value: this.value\n }],\n \"class\": [bem([this.position, (_ref = {}, _ref[this.type] = !this.icon, _ref)]), this.className],\n \"on\": {\n \"click\": this.onClick\n }\n }, [this.genIcon(), this.genMessage()])]);\n }\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nimport VueToast from './Toast';\nimport { isObject, isServer } from '../utils';\nimport { removeNode } from '../utils/dom/node';\nvar defaultOptions = {\n icon: '',\n type: 'text',\n // @deprecated\n mask: false,\n value: true,\n message: '',\n className: '',\n overlay: false,\n onClose: null,\n onOpened: null,\n duration: 2000,\n iconPrefix: undefined,\n position: 'middle',\n transition: 'van-fade',\n forbidClick: false,\n loadingType: undefined,\n getContainer: 'body',\n overlayStyle: null,\n closeOnClick: false,\n closeOnClickOverlay: false\n}; // default options of specific type\n\nvar defaultOptionsMap = {};\nvar queue = [];\nvar multiple = false;\n\nvar currentOptions = _extends({}, defaultOptions);\n\nfunction parseOptions(message) {\n if (isObject(message)) {\n return message;\n }\n\n return {\n message: message\n };\n}\n\nfunction isInDocument(element) {\n return document.body.contains(element);\n}\n\nfunction createInstance() {\n /* istanbul ignore if */\n if (isServer) {\n return {};\n }\n\n queue = queue.filter(function (item) {\n return !item.$el.parentNode || isInDocument(item.$el);\n });\n\n if (!queue.length || multiple) {\n var toast = new (Vue.extend(VueToast))({\n el: document.createElement('div')\n });\n toast.$on('input', function (value) {\n toast.value = value;\n });\n queue.push(toast);\n }\n\n return queue[queue.length - 1];\n} // transform toast options to popup props\n\n\nfunction transformOptions(options) {\n return _extends({}, options, {\n overlay: options.mask || options.overlay,\n mask: undefined,\n duration: undefined\n });\n}\n\nfunction Toast(options) {\n if (options === void 0) {\n options = {};\n }\n\n var toast = createInstance(); // should add z-index if previous toast has not disappeared\n\n if (toast.value) {\n toast.updateZIndex();\n }\n\n options = parseOptions(options);\n options = _extends({}, currentOptions, defaultOptionsMap[options.type || currentOptions.type], options);\n\n if (process.env.NODE_ENV === 'development' && options.mask) {\n console.warn('[Vant] Toast: \"mask\" option is deprecated, use \"overlay\" option instead.');\n }\n\n options.clear = function () {\n toast.value = false;\n\n if (options.onClose) {\n options.onClose();\n options.onClose = null;\n }\n\n if (multiple && !isServer) {\n toast.$on('closed', function () {\n clearTimeout(toast.timer);\n queue = queue.filter(function (item) {\n return item !== toast;\n });\n removeNode(toast.$el);\n toast.$destroy();\n });\n }\n };\n\n _extends(toast, transformOptions(options));\n\n clearTimeout(toast.timer);\n\n if (options.duration > 0) {\n toast.timer = setTimeout(function () {\n toast.clear();\n }, options.duration);\n }\n\n return toast;\n}\n\nvar createMethod = function createMethod(type) {\n return function (options) {\n return Toast(_extends({\n type: type\n }, parseOptions(options)));\n };\n};\n\n['loading', 'success', 'fail'].forEach(function (method) {\n Toast[method] = createMethod(method);\n});\n\nToast.clear = function (all) {\n if (queue.length) {\n if (all) {\n queue.forEach(function (toast) {\n toast.clear();\n });\n queue = [];\n } else if (!multiple) {\n queue[0].clear();\n } else {\n queue.shift().clear();\n }\n }\n};\n\nToast.setDefaultOptions = function (type, options) {\n if (typeof type === 'string') {\n defaultOptionsMap[type] = options;\n } else {\n _extends(currentOptions, type);\n }\n};\n\nToast.resetDefaultOptions = function (type) {\n if (typeof type === 'string') {\n defaultOptionsMap[type] = null;\n } else {\n currentOptions = _extends({}, defaultOptions);\n defaultOptionsMap = {};\n }\n};\n\nToast.allowMultiple = function (value) {\n if (value === void 0) {\n value = true;\n }\n\n multiple = value;\n};\n\nToast.install = function () {\n Vue.use(VueToast);\n};\n\nVue.prototype.$toast = Toast;\nexport default Toast;","/**\n * bem helper\n * b() // 'button'\n * b('text') // 'button__text'\n * b({ disabled }) // 'button button--disabled'\n * b('text', { disabled }) // 'button__text button__text--disabled'\n * b(['disabled', 'primary']) // 'button button--disabled button--primary'\n */\nfunction gen(name, mods) {\n if (!mods) {\n return '';\n }\n\n if (typeof mods === 'string') {\n return \" \" + name + \"--\" + mods;\n }\n\n if (Array.isArray(mods)) {\n return mods.reduce(function (ret, item) {\n return ret + gen(name, item);\n }, '');\n }\n\n return Object.keys(mods).reduce(function (ret, key) {\n return ret + (mods[key] ? gen(name, key) : '');\n }, '');\n}\n\nexport function createBEM(name) {\n return function (el, mods) {\n if (el && typeof el !== 'string') {\n mods = el;\n el = '';\n }\n\n el = el ? name + \"__\" + el : name;\n return \"\" + el + gen(el, mods);\n };\n}","/**\n * Create a basic component with common options\n */\nimport '../../locale';\nimport { isFunction } from '..';\nimport { camelize } from '../format/string';\nimport { SlotsMixin } from '../../mixins/slots';\nimport Vue from 'vue';\n\nfunction install(Vue) {\n var name = this.name;\n Vue.component(name, this);\n Vue.component(camelize(\"-\" + name), this);\n} // unify slots & scopedSlots\n\n\nexport function unifySlots(context) {\n // use data.scopedSlots in lower Vue version\n var scopedSlots = context.scopedSlots || context.data.scopedSlots || {};\n var slots = context.slots();\n Object.keys(slots).forEach(function (key) {\n if (!scopedSlots[key]) {\n scopedSlots[key] = function () {\n return slots[key];\n };\n }\n });\n return scopedSlots;\n} // should be removed after Vue 3\n\nfunction transformFunctionComponent(pure) {\n return {\n functional: true,\n props: pure.props,\n model: pure.model,\n render: function render(h, context) {\n return pure(h, context.props, unifySlots(context), context);\n }\n };\n}\n\nexport function createComponent(name) {\n return function (sfc) {\n if (isFunction(sfc)) {\n sfc = transformFunctionComponent(sfc);\n }\n\n if (!sfc.functional) {\n sfc.mixins = sfc.mixins || [];\n sfc.mixins.push(SlotsMixin);\n }\n\n sfc.name = name;\n sfc.install = install;\n return sfc;\n };\n}","import { get, isFunction } from '..';\nimport { camelize } from '../format/string';\nimport locale from '../../locale';\nexport function createI18N(name) {\n var prefix = camelize(name) + '.';\n return function (path) {\n var messages = locale.messages();\n var message = get(messages, prefix + path) || get(messages, path);\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return isFunction(message) ? message.apply(void 0, args) : message;\n };\n}","import { createBEM } from './bem';\nimport { createComponent } from './component';\nimport { createI18N } from './i18n';\nexport function createNamespace(name) {\n name = 'van-' + name;\n return [createComponent(name), createBEM(name), createI18N(name)];\n}","import { isServer } from '..';\n// eslint-disable-next-line import/no-mutable-exports\nexport var supportsPassive = false;\n\nif (!isServer) {\n try {\n var opts = {};\n Object.defineProperty(opts, 'passive', {\n // eslint-disable-next-line getter-return\n get: function get() {\n /* istanbul ignore next */\n supportsPassive = true;\n }\n });\n window.addEventListener('test-passive', null, opts); // eslint-disable-next-line no-empty\n } catch (e) {}\n}\n\nexport function on(target, event, handler, passive) {\n if (passive === void 0) {\n passive = false;\n }\n\n if (!isServer) {\n target.addEventListener(event, handler, supportsPassive ? {\n capture: false,\n passive: passive\n } : false);\n }\n}\nexport function off(target, event, handler) {\n if (!isServer) {\n target.removeEventListener(event, handler);\n }\n}\nexport function stopPropagation(event) {\n event.stopPropagation();\n}\nexport function preventDefault(event, isStopPropagation) {\n /* istanbul ignore else */\n if (typeof event.cancelable !== 'boolean' || event.cancelable) {\n event.preventDefault();\n }\n\n if (isStopPropagation) {\n stopPropagation(event);\n }\n}","export function removeNode(el) {\n var parent = el.parentNode;\n\n if (parent) {\n parent.removeChild(el);\n }\n}","/**\n * requestAnimationFrame polyfill\n */\nimport { isServer } from '..';\nvar prev = Date.now();\n/* istanbul ignore next */\n\nfunction fallback(fn) {\n var curr = Date.now();\n var ms = Math.max(0, 16 - (curr - prev));\n var id = setTimeout(fn, ms);\n prev = curr + ms;\n return id;\n}\n/* istanbul ignore next */\n\n\nvar root = isServer ? global : window;\n/* istanbul ignore next */\n\nvar iRaf = root.requestAnimationFrame || fallback;\n/* istanbul ignore next */\n\nvar iCancel = root.cancelAnimationFrame || root.clearTimeout;\nexport function raf(fn) {\n return iRaf.call(root, fn);\n} // double raf for animation\n\nexport function doubleRaf(fn) {\n raf(function () {\n raf(fn);\n });\n}\nexport function cancelRaf(id) {\n iCancel.call(root, id);\n}","function isWindow(val) {\n return val === window;\n} // get nearest scroll element\n// https://github.com/vant-ui/vant/issues/3823\n\n\nvar overflowScrollReg = /scroll|auto|overlay/i;\nexport function getScroller(el, root) {\n if (root === void 0) {\n root = window;\n }\n\n var node = el;\n\n while (node && node.tagName !== 'HTML' && node.tagName !== 'BODY' && node.nodeType === 1 && node !== root) {\n var _window$getComputedSt = window.getComputedStyle(node),\n overflowY = _window$getComputedSt.overflowY;\n\n if (overflowScrollReg.test(overflowY)) {\n return node;\n }\n\n node = node.parentNode;\n }\n\n return root;\n}\nexport function getScrollTop(el) {\n var top = 'scrollTop' in el ? el.scrollTop : el.pageYOffset; // iOS scroll bounce cause minus scrollTop\n\n return Math.max(top, 0);\n}\nexport function setScrollTop(el, value) {\n if ('scrollTop' in el) {\n el.scrollTop = value;\n } else {\n el.scrollTo(el.scrollX, value);\n }\n}\nexport function getRootScrollTop() {\n return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;\n}\nexport function setRootScrollTop(value) {\n setScrollTop(window, value);\n setScrollTop(document.body, value);\n} // get distance from element top to page top or scroller top\n\nexport function getElementTop(el, scroller) {\n if (isWindow(el)) {\n return 0;\n }\n\n var scrollTop = scroller ? getScrollTop(scroller) : getRootScrollTop();\n return el.getBoundingClientRect().top + scrollTop;\n}\nexport function getVisibleHeight(el) {\n if (isWindow(el)) {\n return el.innerHeight;\n }\n\n return el.getBoundingClientRect().height;\n}\nexport function getVisibleTop(el) {\n if (isWindow(el)) {\n return 0;\n }\n\n return el.getBoundingClientRect().top;\n}","var camelizeRE = /-(\\w)/g;\nexport function camelize(str) {\n return str.replace(camelizeRE, function (_, c) {\n return c.toUpperCase();\n });\n}\nexport function padZero(num, targetLength) {\n if (targetLength === void 0) {\n targetLength = 2;\n }\n\n var str = num + '';\n\n while (str.length < targetLength) {\n str = '0' + str;\n }\n\n return str;\n}","import { isDef, inBrowser } from '..';\nimport { isNumeric } from '../validate/number';\nexport function addUnit(value) {\n if (!isDef(value)) {\n return undefined;\n }\n\n value = String(value);\n return isNumeric(value) ? value + \"px\" : value;\n} // cache\n\nvar rootFontSize;\n\nfunction getRootFontSize() {\n if (!rootFontSize) {\n var doc = document.documentElement;\n var fontSize = doc.style.fontSize || window.getComputedStyle(doc).fontSize;\n rootFontSize = parseFloat(fontSize);\n }\n\n return rootFontSize;\n}\n\nfunction convertRem(value) {\n value = value.replace(/rem/g, '');\n return +value * getRootFontSize();\n}\n\nfunction convertVw(value) {\n value = value.replace(/vw/g, '');\n return +value * window.innerWidth / 100;\n}\n\nfunction convertVh(value) {\n value = value.replace(/vh/g, '');\n return +value * window.innerHeight / 100;\n}\n\nexport function unitToPx(value) {\n if (typeof value === 'number') {\n return value;\n }\n\n if (inBrowser) {\n if (value.indexOf('rem') !== -1) {\n return convertRem(value);\n }\n\n if (value.indexOf('vw') !== -1) {\n return convertVw(value);\n }\n\n if (value.indexOf('vh') !== -1) {\n return convertVh(value);\n }\n }\n\n return parseFloat(value);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport Vue from 'vue';\nvar inheritKey = ['ref', 'key', 'style', 'class', 'attrs', 'refInFor', 'nativeOn', 'directives', 'staticClass', 'staticStyle'];\nvar mapInheritKey = {\n nativeOn: 'on'\n}; // inherit partial context, map nativeOn to on\n\nexport function inherit(context, inheritListeners) {\n var result = inheritKey.reduce(function (obj, key) {\n if (context.data[key]) {\n obj[mapInheritKey[key] || key] = context.data[key];\n }\n\n return obj;\n }, {});\n\n if (inheritListeners) {\n result.on = result.on || {};\n\n _extends(result.on, context.data.on);\n }\n\n return result;\n} // emit event\n\nexport function emit(context, eventName) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n var listeners = context.listeners[eventName];\n\n if (listeners) {\n if (Array.isArray(listeners)) {\n listeners.forEach(function (listener) {\n listener.apply(void 0, args);\n });\n } else {\n listeners.apply(void 0, args);\n }\n }\n} // mount functional component\n\nexport function mount(Component, data) {\n var instance = new Vue({\n el: document.createElement('div'),\n props: Component.props,\n render: function render(h) {\n return h(Component, _extends({\n props: this.$props\n }, data));\n }\n });\n document.body.appendChild(instance.$el);\n return instance;\n}","import Vue from 'vue';\nexport { createNamespace } from './create';\nexport { addUnit } from './format/unit';\nexport var inBrowser = typeof window !== 'undefined';\nexport var isServer = Vue.prototype.$isServer; // eslint-disable-next-line @typescript-eslint/no-empty-function\n\nexport function noop() {}\nexport function isDef(val) {\n return val !== undefined && val !== null;\n}\nexport function isFunction(val) {\n return typeof val === 'function';\n}\nexport function isObject(val) {\n return val !== null && typeof val === 'object';\n}\nexport function isPromise(val) {\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n}\nexport function get(object, path) {\n var keys = path.split('.');\n var result = object;\n keys.forEach(function (key) {\n var _result$key;\n\n result = isObject(result) ? (_result$key = result[key]) != null ? _result$key : '' : '';\n });\n return result;\n}\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @function isEmpty\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n\nexport function isEmpty(value) {\n if (value == null) {\n return true;\n }\n\n if (typeof value !== 'object') {\n return true;\n }\n\n return Object.keys(value).length === 0;\n}","export function isNumeric(val) {\n return /^\\d+(\\.\\d+)?$/.test(val);\n}\nexport function isNaN(val) {\n if (Number.isNaN) {\n return Number.isNaN(val);\n } // eslint-disable-next-line no-self-compare\n\n\n return val !== val;\n}","function flattenVNodes(vnodes) {\n var result = [];\n\n function traverse(vnodes) {\n vnodes.forEach(function (vnode) {\n result.push(vnode);\n\n if (vnode.componentInstance) {\n traverse(vnode.componentInstance.$children.map(function (item) {\n return item.$vnode;\n }));\n }\n\n if (vnode.children) {\n traverse(vnode.children);\n }\n });\n }\n\n traverse(vnodes);\n return result;\n} // sort children instances by vnodes order\n\n\nexport function sortChildren(children, parent) {\n var componentOptions = parent.$vnode.componentOptions;\n\n if (!componentOptions || !componentOptions.children) {\n return;\n }\n\n var vnodes = flattenVNodes(componentOptions.children);\n children.sort(function (a, b) {\n return vnodes.indexOf(a.$vnode) - vnodes.indexOf(b.$vnode);\n });\n}","/*!\n * vue-router v3.6.5\n * (c) 2022 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/(?:\\s*\\/)+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\\n\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\" with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'}\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1$1.ensureURL();\n this$1$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1$1.ready) {\n this$1$1.ready = true;\n this$1$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1$1.ready = true;\n this$1$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1$1.errorCbs.length) {\n this$1$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1$1.replace(to);\n } else {\n this$1$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1$1.pending = null;\n onComplete(route);\n if (this$1$1.router.app) {\n this$1$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1$1.base);\n if (this$1$1.current === START && location === this$1$1._startLocation) {\n return\n }\n\n this$1$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1$1.base + route.fullPath));\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1$1.base + route.fullPath));\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1$1.stack = this$1$1.stack.slice(0, this$1$1.index + 1).concat(route);\n this$1$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1$1.stack = this$1$1.stack.slice(0, this$1$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1$1.current;\n this$1$1.index = targetIndex;\n this$1$1.updateRoute(route);\n this$1$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\n\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1$1.apps.indexOf(app);\n if (index > -1) { this$1$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1$1.app === app) { this$1$1.app = this$1$1.apps[0] || null; }\n\n if (!this$1$1.app) { this$1$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nvar VueRouter$1 = VueRouter;\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\n// We cannot remove this as it would be a breaking change\nVueRouter.install = install;\nVueRouter.version = '3.6.5';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nvar version = '3.6.5';\n\nexport { NavigationFailureType, Link as RouterLink, View as RouterView, START as START_LOCATION, VueRouter$1 as default, isNavigationFailure, version };\n","/*!\n * Vue.js v2.7.10\n * (c) 2014-2022 Evan You\n * Released under the MIT License.\n */\nvar emptyObject = Object.freeze({});\r\nvar isArray = Array.isArray;\r\n// These helpers produce better VM code in JS engines due to their\r\n// explicitness and function inlining.\r\nfunction isUndef(v) {\r\n return v === undefined || v === null;\r\n}\r\nfunction isDef(v) {\r\n return v !== undefined && v !== null;\r\n}\r\nfunction isTrue(v) {\r\n return v === true;\r\n}\r\nfunction isFalse(v) {\r\n return v === false;\r\n}\r\n/**\r\n * Check if value is primitive.\r\n */\r\nfunction isPrimitive(value) {\r\n return (typeof value === 'string' ||\r\n typeof value === 'number' ||\r\n // $flow-disable-line\r\n typeof value === 'symbol' ||\r\n typeof value === 'boolean');\r\n}\r\nfunction isFunction(value) {\r\n return typeof value === 'function';\r\n}\r\n/**\r\n * Quick object check - this is primarily used to tell\r\n * objects from primitive values when we know the value\r\n * is a JSON-compliant type.\r\n */\r\nfunction isObject(obj) {\r\n return obj !== null && typeof obj === 'object';\r\n}\r\n/**\r\n * Get the raw type string of a value, e.g., [object Object].\r\n */\r\nvar _toString = Object.prototype.toString;\r\nfunction toRawType(value) {\r\n return _toString.call(value).slice(8, -1);\r\n}\r\n/**\r\n * Strict object type check. Only returns true\r\n * for plain JavaScript objects.\r\n */\r\nfunction isPlainObject(obj) {\r\n return _toString.call(obj) === '[object Object]';\r\n}\r\nfunction isRegExp(v) {\r\n return _toString.call(v) === '[object RegExp]';\r\n}\r\n/**\r\n * Check if val is a valid array index.\r\n */\r\nfunction isValidArrayIndex(val) {\r\n var n = parseFloat(String(val));\r\n return n >= 0 && Math.floor(n) === n && isFinite(val);\r\n}\r\nfunction isPromise(val) {\r\n return (isDef(val) &&\r\n typeof val.then === 'function' &&\r\n typeof val.catch === 'function');\r\n}\r\n/**\r\n * Convert a value to a string that is actually rendered.\r\n */\r\nfunction toString(val) {\r\n return val == null\r\n ? ''\r\n : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\r\n ? JSON.stringify(val, null, 2)\r\n : String(val);\r\n}\r\n/**\r\n * Convert an input value to a number for persistence.\r\n * If the conversion fails, return original string.\r\n */\r\nfunction toNumber(val) {\r\n var n = parseFloat(val);\r\n return isNaN(n) ? val : n;\r\n}\r\n/**\r\n * Make a map and return a function for checking if a key\r\n * is in that map.\r\n */\r\nfunction makeMap(str, expectsLowerCase) {\r\n var map = Object.create(null);\r\n var list = str.split(',');\r\n for (var i = 0; i < list.length; i++) {\r\n map[list[i]] = true;\r\n }\r\n return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };\r\n}\r\n/**\r\n * Check if a tag is a built-in tag.\r\n */\r\nvar isBuiltInTag = makeMap('slot,component', true);\r\n/**\r\n * Check if an attribute is a reserved attribute.\r\n */\r\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\r\n/**\r\n * Remove an item from an array.\r\n */\r\nfunction remove$2(arr, item) {\r\n if (arr.length) {\r\n var index = arr.indexOf(item);\r\n if (index > -1) {\r\n return arr.splice(index, 1);\r\n }\r\n }\r\n}\r\n/**\r\n * Check whether an object has the property.\r\n */\r\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\r\nfunction hasOwn(obj, key) {\r\n return hasOwnProperty.call(obj, key);\r\n}\r\n/**\r\n * Create a cached version of a pure function.\r\n */\r\nfunction cached(fn) {\r\n var cache = Object.create(null);\r\n return function cachedFn(str) {\r\n var hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n };\r\n}\r\n/**\r\n * Camelize a hyphen-delimited string.\r\n */\r\nvar camelizeRE = /-(\\w)/g;\r\nvar camelize = cached(function (str) {\r\n return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });\r\n});\r\n/**\r\n * Capitalize a string.\r\n */\r\nvar capitalize = cached(function (str) {\r\n return str.charAt(0).toUpperCase() + str.slice(1);\r\n});\r\n/**\r\n * Hyphenate a camelCase string.\r\n */\r\nvar hyphenateRE = /\\B([A-Z])/g;\r\nvar hyphenate = cached(function (str) {\r\n return str.replace(hyphenateRE, '-$1').toLowerCase();\r\n});\r\n/**\r\n * Simple bind polyfill for environments that do not support it,\r\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\r\n * since native bind is now performant enough in most browsers.\r\n * But removing it would mean breaking code that was able to run in\r\n * PhantomJS 1.x, so this must be kept for backward compatibility.\r\n */\r\n/* istanbul ignore next */\r\nfunction polyfillBind(fn, ctx) {\r\n function boundFn(a) {\r\n var l = arguments.length;\r\n return l\r\n ? l > 1\r\n ? fn.apply(ctx, arguments)\r\n : fn.call(ctx, a)\r\n : fn.call(ctx);\r\n }\r\n boundFn._length = fn.length;\r\n return boundFn;\r\n}\r\nfunction nativeBind(fn, ctx) {\r\n return fn.bind(ctx);\r\n}\r\n// @ts-expect-error bind cannot be `undefined`\r\nvar bind = Function.prototype.bind ? nativeBind : polyfillBind;\r\n/**\r\n * Convert an Array-like object to a real Array.\r\n */\r\nfunction toArray(list, start) {\r\n start = start || 0;\r\n var i = list.length - start;\r\n var ret = new Array(i);\r\n while (i--) {\r\n ret[i] = list[i + start];\r\n }\r\n return ret;\r\n}\r\n/**\r\n * Mix properties into target object.\r\n */\r\nfunction extend(to, _from) {\r\n for (var key in _from) {\r\n to[key] = _from[key];\r\n }\r\n return to;\r\n}\r\n/**\r\n * Merge an Array of Objects into a single Object.\r\n */\r\nfunction toObject(arr) {\r\n var res = {};\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i]) {\r\n extend(res, arr[i]);\r\n }\r\n }\r\n return res;\r\n}\r\n/* eslint-disable no-unused-vars */\r\n/**\r\n * Perform no operation.\r\n * Stubbing args to make Flow happy without leaving useless transpiled code\r\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\r\n */\r\nfunction noop(a, b, c) { }\r\n/**\r\n * Always return false.\r\n */\r\nvar no = function (a, b, c) { return false; };\r\n/* eslint-enable no-unused-vars */\r\n/**\r\n * Return the same value.\r\n */\r\nvar identity = function (_) { return _; };\r\n/**\r\n * Check if two values are loosely equal - that is,\r\n * if they are plain objects, do they have the same shape?\r\n */\r\nfunction looseEqual(a, b) {\r\n if (a === b)\r\n return true;\r\n var isObjectA = isObject(a);\r\n var isObjectB = isObject(b);\r\n if (isObjectA && isObjectB) {\r\n try {\r\n var isArrayA = Array.isArray(a);\r\n var isArrayB = Array.isArray(b);\r\n if (isArrayA && isArrayB) {\r\n return (a.length === b.length &&\r\n a.every(function (e, i) {\r\n return looseEqual(e, b[i]);\r\n }));\r\n }\r\n else if (a instanceof Date && b instanceof Date) {\r\n return a.getTime() === b.getTime();\r\n }\r\n else if (!isArrayA && !isArrayB) {\r\n var keysA = Object.keys(a);\r\n var keysB = Object.keys(b);\r\n return (keysA.length === keysB.length &&\r\n keysA.every(function (key) {\r\n return looseEqual(a[key], b[key]);\r\n }));\r\n }\r\n else {\r\n /* istanbul ignore next */\r\n return false;\r\n }\r\n }\r\n catch (e) {\r\n /* istanbul ignore next */\r\n return false;\r\n }\r\n }\r\n else if (!isObjectA && !isObjectB) {\r\n return String(a) === String(b);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Return the first index at which a loosely equal value can be\r\n * found in the array (if value is a plain object, the array must\r\n * contain an object of the same shape), or -1 if it is not present.\r\n */\r\nfunction looseIndexOf(arr, val) {\r\n for (var i = 0; i < arr.length; i++) {\r\n if (looseEqual(arr[i], val))\r\n return i;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Ensure a function is called only once.\r\n */\r\nfunction once(fn) {\r\n var called = false;\r\n return function () {\r\n if (!called) {\r\n called = true;\r\n fn.apply(this, arguments);\r\n }\r\n };\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill\r\nfunction hasChanged(x, y) {\r\n if (x === y) {\r\n return x === 0 && 1 / x !== 1 / y;\r\n }\r\n else {\r\n return x === x || y === y;\r\n }\r\n}\n\nvar SSR_ATTR = 'data-server-rendered';\r\nvar ASSET_TYPES = ['component', 'directive', 'filter'];\r\nvar LIFECYCLE_HOOKS = [\r\n 'beforeCreate',\r\n 'created',\r\n 'beforeMount',\r\n 'mounted',\r\n 'beforeUpdate',\r\n 'updated',\r\n 'beforeDestroy',\r\n 'destroyed',\r\n 'activated',\r\n 'deactivated',\r\n 'errorCaptured',\r\n 'serverPrefetch',\r\n 'renderTracked',\r\n 'renderTriggered'\r\n];\n\nvar config = {\r\n /**\r\n * Option merge strategies (used in core/util/options)\r\n */\r\n // $flow-disable-line\r\n optionMergeStrategies: Object.create(null),\r\n /**\r\n * Whether to suppress warnings.\r\n */\r\n silent: false,\r\n /**\r\n * Show production mode tip message on boot?\r\n */\r\n productionTip: process.env.NODE_ENV !== 'production',\r\n /**\r\n * Whether to enable devtools\r\n */\r\n devtools: process.env.NODE_ENV !== 'production',\r\n /**\r\n * Whether to record perf\r\n */\r\n performance: false,\r\n /**\r\n * Error handler for watcher errors\r\n */\r\n errorHandler: null,\r\n /**\r\n * Warn handler for watcher warns\r\n */\r\n warnHandler: null,\r\n /**\r\n * Ignore certain custom elements\r\n */\r\n ignoredElements: [],\r\n /**\r\n * Custom user key aliases for v-on\r\n */\r\n // $flow-disable-line\r\n keyCodes: Object.create(null),\r\n /**\r\n * Check if a tag is reserved so that it cannot be registered as a\r\n * component. This is platform-dependent and may be overwritten.\r\n */\r\n isReservedTag: no,\r\n /**\r\n * Check if an attribute is reserved so that it cannot be used as a component\r\n * prop. This is platform-dependent and may be overwritten.\r\n */\r\n isReservedAttr: no,\r\n /**\r\n * Check if a tag is an unknown element.\r\n * Platform-dependent.\r\n */\r\n isUnknownElement: no,\r\n /**\r\n * Get the namespace of an element\r\n */\r\n getTagNamespace: noop,\r\n /**\r\n * Parse the real tag name for the specific platform.\r\n */\r\n parsePlatformTagName: identity,\r\n /**\r\n * Check if an attribute must be bound using property, e.g. value\r\n * Platform-dependent.\r\n */\r\n mustUseProp: no,\r\n /**\r\n * Perform updates asynchronously. Intended to be used by Vue Test Utils\r\n * This will significantly reduce performance if set to false.\r\n */\r\n async: true,\r\n /**\r\n * Exposed for legacy reasons\r\n */\r\n _lifecycleHooks: LIFECYCLE_HOOKS\r\n};\n\n/**\r\n * unicode letters used for parsing html tags, component names and property paths.\r\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\r\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\r\n */\r\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\r\n/**\r\n * Check if a string starts with $ or _\r\n */\r\nfunction isReserved(str) {\r\n var c = (str + '').charCodeAt(0);\r\n return c === 0x24 || c === 0x5f;\r\n}\r\n/**\r\n * Define a property.\r\n */\r\nfunction def(obj, key, val, enumerable) {\r\n Object.defineProperty(obj, key, {\r\n value: val,\r\n enumerable: !!enumerable,\r\n writable: true,\r\n configurable: true\r\n });\r\n}\r\n/**\r\n * Parse simple path.\r\n */\r\nvar bailRE = new RegExp(\"[^\".concat(unicodeRegExp.source, \".$_\\\\d]\"));\r\nfunction parsePath(path) {\r\n if (bailRE.test(path)) {\r\n return;\r\n }\r\n var segments = path.split('.');\r\n return function (obj) {\r\n for (var i = 0; i < segments.length; i++) {\r\n if (!obj)\r\n return;\r\n obj = obj[segments[i]];\r\n }\r\n return obj;\r\n };\r\n}\n\n// can we use __proto__?\r\nvar hasProto = '__proto__' in {};\r\n// Browser environment sniffing\r\nvar inBrowser = typeof window !== 'undefined';\r\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\r\nvar isIE = UA && /msie|trident/.test(UA);\r\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\r\nvar isEdge = UA && UA.indexOf('edge/') > 0;\r\nUA && UA.indexOf('android') > 0;\r\nvar isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);\r\nUA && /chrome\\/\\d+/.test(UA) && !isEdge;\r\nUA && /phantomjs/.test(UA);\r\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\r\n// Firefox has a \"watch\" function on Object.prototype...\r\n// @ts-expect-error firebox support\r\nvar nativeWatch = {}.watch;\r\nvar supportsPassive = false;\r\nif (inBrowser) {\r\n try {\r\n var opts = {};\r\n Object.defineProperty(opts, 'passive', {\r\n get: function () {\r\n /* istanbul ignore next */\r\n supportsPassive = true;\r\n }\r\n }); // https://github.com/facebook/flow/issues/285\r\n window.addEventListener('test-passive', null, opts);\r\n }\r\n catch (e) { }\r\n}\r\n// this needs to be lazy-evaled because vue may be required before\r\n// vue-server-renderer can set VUE_ENV\r\nvar _isServer;\r\nvar isServerRendering = function () {\r\n if (_isServer === undefined) {\r\n /* istanbul ignore if */\r\n if (!inBrowser && typeof global !== 'undefined') {\r\n // detect presence of vue-server-renderer and avoid\r\n // Webpack shimming the process\r\n _isServer =\r\n global['process'] && global['process'].env.VUE_ENV === 'server';\r\n }\r\n else {\r\n _isServer = false;\r\n }\r\n }\r\n return _isServer;\r\n};\r\n// detect devtools\r\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\r\n/* istanbul ignore next */\r\nfunction isNative(Ctor) {\r\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString());\r\n}\r\nvar hasSymbol = typeof Symbol !== 'undefined' &&\r\n isNative(Symbol) &&\r\n typeof Reflect !== 'undefined' &&\r\n isNative(Reflect.ownKeys);\r\nvar _Set; // $flow-disable-line\r\n/* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {\r\n // use native Set when available.\r\n _Set = Set;\r\n}\r\nelse {\r\n // a non-standard Set polyfill that only works with primitive keys.\r\n _Set = /** @class */ (function () {\r\n function Set() {\r\n this.set = Object.create(null);\r\n }\r\n Set.prototype.has = function (key) {\r\n return this.set[key] === true;\r\n };\r\n Set.prototype.add = function (key) {\r\n this.set[key] = true;\r\n };\r\n Set.prototype.clear = function () {\r\n this.set = Object.create(null);\r\n };\r\n return Set;\r\n }());\r\n}\n\nvar currentInstance = null;\r\n/**\r\n * This is exposed for compatibility with v3 (e.g. some functions in VueUse\r\n * relies on it). Do not use this internally, just use `currentInstance`.\r\n *\r\n * @internal this function needs manual type declaration because it relies\r\n * on previously manually authored types from Vue 2\r\n */\r\nfunction getCurrentInstance() {\r\n return currentInstance && { proxy: currentInstance };\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction setCurrentInstance(vm) {\r\n if (vm === void 0) { vm = null; }\r\n if (!vm)\r\n currentInstance && currentInstance._scope.off();\r\n currentInstance = vm;\r\n vm && vm._scope.on();\r\n}\n\n/**\r\n * @internal\r\n */\r\nvar VNode = /** @class */ (function () {\r\n function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {\r\n this.tag = tag;\r\n this.data = data;\r\n this.children = children;\r\n this.text = text;\r\n this.elm = elm;\r\n this.ns = undefined;\r\n this.context = context;\r\n this.fnContext = undefined;\r\n this.fnOptions = undefined;\r\n this.fnScopeId = undefined;\r\n this.key = data && data.key;\r\n this.componentOptions = componentOptions;\r\n this.componentInstance = undefined;\r\n this.parent = undefined;\r\n this.raw = false;\r\n this.isStatic = false;\r\n this.isRootInsert = true;\r\n this.isComment = false;\r\n this.isCloned = false;\r\n this.isOnce = false;\r\n this.asyncFactory = asyncFactory;\r\n this.asyncMeta = undefined;\r\n this.isAsyncPlaceholder = false;\r\n }\r\n Object.defineProperty(VNode.prototype, \"child\", {\r\n // DEPRECATED: alias for componentInstance for backwards compat.\r\n /* istanbul ignore next */\r\n get: function () {\r\n return this.componentInstance;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return VNode;\r\n}());\r\nvar createEmptyVNode = function (text) {\r\n if (text === void 0) { text = ''; }\r\n var node = new VNode();\r\n node.text = text;\r\n node.isComment = true;\r\n return node;\r\n};\r\nfunction createTextVNode(val) {\r\n return new VNode(undefined, undefined, undefined, String(val));\r\n}\r\n// optimized shallow clone\r\n// used for static nodes and slot nodes because they may be reused across\r\n// multiple renders, cloning them avoids errors when DOM manipulations rely\r\n// on their elm reference.\r\nfunction cloneVNode(vnode) {\r\n var cloned = new VNode(vnode.tag, vnode.data, \r\n // #7975\r\n // clone children array to avoid mutating original in case of cloning\r\n // a child.\r\n vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);\r\n cloned.ns = vnode.ns;\r\n cloned.isStatic = vnode.isStatic;\r\n cloned.key = vnode.key;\r\n cloned.isComment = vnode.isComment;\r\n cloned.fnContext = vnode.fnContext;\r\n cloned.fnOptions = vnode.fnOptions;\r\n cloned.fnScopeId = vnode.fnScopeId;\r\n cloned.asyncMeta = vnode.asyncMeta;\r\n cloned.isCloned = true;\r\n return cloned;\r\n}\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar uid$2 = 0;\r\n/**\r\n * A dep is an observable that can have multiple\r\n * directives subscribing to it.\r\n * @internal\r\n */\r\nvar Dep = /** @class */ (function () {\r\n function Dep() {\r\n this.id = uid$2++;\r\n this.subs = [];\r\n }\r\n Dep.prototype.addSub = function (sub) {\r\n this.subs.push(sub);\r\n };\r\n Dep.prototype.removeSub = function (sub) {\r\n remove$2(this.subs, sub);\r\n };\r\n Dep.prototype.depend = function (info) {\r\n if (Dep.target) {\r\n Dep.target.addDep(this);\r\n if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {\r\n Dep.target.onTrack(__assign({ effect: Dep.target }, info));\r\n }\r\n }\r\n };\r\n Dep.prototype.notify = function (info) {\r\n // stabilize the subscriber list first\r\n var subs = this.subs.slice();\r\n if (process.env.NODE_ENV !== 'production' && !config.async) {\r\n // subs aren't sorted in scheduler if not running async\r\n // we need to sort them now to make sure they fire in correct\r\n // order\r\n subs.sort(function (a, b) { return a.id - b.id; });\r\n }\r\n for (var i = 0, l = subs.length; i < l; i++) {\r\n if (process.env.NODE_ENV !== 'production' && info) {\r\n var sub = subs[i];\r\n sub.onTrigger &&\r\n sub.onTrigger(__assign({ effect: subs[i] }, info));\r\n }\r\n subs[i].update();\r\n }\r\n };\r\n return Dep;\r\n}());\r\n// The current target watcher being evaluated.\r\n// This is globally unique because only one watcher\r\n// can be evaluated at a time.\r\nDep.target = null;\r\nvar targetStack = [];\r\nfunction pushTarget(target) {\r\n targetStack.push(target);\r\n Dep.target = target;\r\n}\r\nfunction popTarget() {\r\n targetStack.pop();\r\n Dep.target = targetStack[targetStack.length - 1];\r\n}\n\n/*\r\n * not type checking this file because flow doesn't play well with\r\n * dynamically accessing methods on Array prototype\r\n */\r\nvar arrayProto = Array.prototype;\r\nvar arrayMethods = Object.create(arrayProto);\r\nvar methodsToPatch = [\r\n 'push',\r\n 'pop',\r\n 'shift',\r\n 'unshift',\r\n 'splice',\r\n 'sort',\r\n 'reverse'\r\n];\r\n/**\r\n * Intercept mutating methods and emit events\r\n */\r\nmethodsToPatch.forEach(function (method) {\r\n // cache original method\r\n var original = arrayProto[method];\r\n def(arrayMethods, method, function mutator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var result = original.apply(this, args);\r\n var ob = this.__ob__;\r\n var inserted;\r\n switch (method) {\r\n case 'push':\r\n case 'unshift':\r\n inserted = args;\r\n break;\r\n case 'splice':\r\n inserted = args.slice(2);\r\n break;\r\n }\r\n if (inserted)\r\n ob.observeArray(inserted);\r\n // notify change\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"array mutation\" /* TriggerOpTypes.ARRAY_MUTATION */,\r\n target: this,\r\n key: method\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n return result;\r\n });\r\n});\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\r\nvar NO_INIITIAL_VALUE = {};\r\n/**\r\n * In some cases we may want to disable observation inside a component's\r\n * update computation.\r\n */\r\nvar shouldObserve = true;\r\nfunction toggleObserving(value) {\r\n shouldObserve = value;\r\n}\r\n// ssr mock dep\r\nvar mockDep = {\r\n notify: noop,\r\n depend: noop,\r\n addSub: noop,\r\n removeSub: noop\r\n};\r\n/**\r\n * Observer class that is attached to each observed\r\n * object. Once attached, the observer converts the target\r\n * object's property keys into getter/setters that\r\n * collect dependencies and dispatch updates.\r\n */\r\nvar Observer = /** @class */ (function () {\r\n function Observer(value, shallow, mock) {\r\n if (shallow === void 0) { shallow = false; }\r\n if (mock === void 0) { mock = false; }\r\n this.value = value;\r\n this.shallow = shallow;\r\n this.mock = mock;\r\n // this.value = value\r\n this.dep = mock ? mockDep : new Dep();\r\n this.vmCount = 0;\r\n def(value, '__ob__', this);\r\n if (isArray(value)) {\r\n if (!mock) {\r\n if (hasProto) {\r\n value.__proto__ = arrayMethods;\r\n /* eslint-enable no-proto */\r\n }\r\n else {\r\n for (var i = 0, l = arrayKeys.length; i < l; i++) {\r\n var key = arrayKeys[i];\r\n def(value, key, arrayMethods[key]);\r\n }\r\n }\r\n }\r\n if (!shallow) {\r\n this.observeArray(value);\r\n }\r\n }\r\n else {\r\n /**\r\n * Walk through all properties and convert them into\r\n * getter/setters. This method should only be called when\r\n * value type is Object.\r\n */\r\n var keys = Object.keys(value);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n defineReactive(value, key, NO_INIITIAL_VALUE, undefined, shallow, mock);\r\n }\r\n }\r\n }\r\n /**\r\n * Observe a list of Array items.\r\n */\r\n Observer.prototype.observeArray = function (value) {\r\n for (var i = 0, l = value.length; i < l; i++) {\r\n observe(value[i], false, this.mock);\r\n }\r\n };\r\n return Observer;\r\n}());\r\n// helpers\r\n/**\r\n * Attempt to create an observer instance for a value,\r\n * returns the new observer if successfully observed,\r\n * or the existing observer if the value already has one.\r\n */\r\nfunction observe(value, shallow, ssrMockReactivity) {\r\n if (!isObject(value) || isRef(value) || value instanceof VNode) {\r\n return;\r\n }\r\n var ob;\r\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\r\n ob = value.__ob__;\r\n }\r\n else if (shouldObserve &&\r\n (ssrMockReactivity || !isServerRendering()) &&\r\n (isArray(value) || isPlainObject(value)) &&\r\n Object.isExtensible(value) &&\r\n !value.__v_skip /* ReactiveFlags.SKIP */) {\r\n ob = new Observer(value, shallow, ssrMockReactivity);\r\n }\r\n return ob;\r\n}\r\n/**\r\n * Define a reactive property on an Object.\r\n */\r\nfunction defineReactive(obj, key, val, customSetter, shallow, mock) {\r\n var dep = new Dep();\r\n var property = Object.getOwnPropertyDescriptor(obj, key);\r\n if (property && property.configurable === false) {\r\n return;\r\n }\r\n // cater for pre-defined getter/setters\r\n var getter = property && property.get;\r\n var setter = property && property.set;\r\n if ((!getter || setter) &&\r\n (val === NO_INIITIAL_VALUE || arguments.length === 2)) {\r\n val = obj[key];\r\n }\r\n var childOb = !shallow && observe(val, false, mock);\r\n Object.defineProperty(obj, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function reactiveGetter() {\r\n var value = getter ? getter.call(obj) : val;\r\n if (Dep.target) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.depend({\r\n target: obj,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: key\r\n });\r\n }\r\n else {\r\n dep.depend();\r\n }\r\n if (childOb) {\r\n childOb.dep.depend();\r\n if (isArray(value)) {\r\n dependArray(value);\r\n }\r\n }\r\n }\r\n return isRef(value) && !shallow ? value.value : value;\r\n },\r\n set: function reactiveSetter(newVal) {\r\n var value = getter ? getter.call(obj) : val;\r\n if (!hasChanged(value, newVal)) {\r\n return;\r\n }\r\n if (process.env.NODE_ENV !== 'production' && customSetter) {\r\n customSetter();\r\n }\r\n if (setter) {\r\n setter.call(obj, newVal);\r\n }\r\n else if (getter) {\r\n // #7981: for accessor properties without setter\r\n return;\r\n }\r\n else if (!shallow && isRef(value) && !isRef(newVal)) {\r\n value.value = newVal;\r\n return;\r\n }\r\n else {\r\n val = newVal;\r\n }\r\n childOb = !shallow && observe(newVal, false, mock);\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.notify({\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n target: obj,\r\n key: key,\r\n newValue: newVal,\r\n oldValue: value\r\n });\r\n }\r\n else {\r\n dep.notify();\r\n }\r\n }\r\n });\r\n return dep;\r\n}\r\nfunction set(target, key, val) {\r\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\r\n warn(\"Cannot set reactive property on undefined, null, or primitive value: \".concat(target));\r\n }\r\n if (isReadonly(target)) {\r\n process.env.NODE_ENV !== 'production' && warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n return;\r\n }\r\n var ob = target.__ob__;\r\n if (isArray(target) && isValidArrayIndex(key)) {\r\n target.length = Math.max(target.length, key);\r\n target.splice(key, 1, val);\r\n // when mocking for SSR, array methods are not hijacked\r\n if (ob && !ob.shallow && ob.mock) {\r\n observe(val, false, true);\r\n }\r\n return val;\r\n }\r\n if (key in target && !(key in Object.prototype)) {\r\n target[key] = val;\r\n return val;\r\n }\r\n if (target._isVue || (ob && ob.vmCount)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('Avoid adding reactive properties to a Vue instance or its root $data ' +\r\n 'at runtime - declare it upfront in the data option.');\r\n return val;\r\n }\r\n if (!ob) {\r\n target[key] = val;\r\n return val;\r\n }\r\n defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"add\" /* TriggerOpTypes.ADD */,\r\n target: target,\r\n key: key,\r\n newValue: val,\r\n oldValue: undefined\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n return val;\r\n}\r\nfunction del(target, key) {\r\n if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {\r\n warn(\"Cannot delete reactive property on undefined, null, or primitive value: \".concat(target));\r\n }\r\n if (isArray(target) && isValidArrayIndex(key)) {\r\n target.splice(key, 1);\r\n return;\r\n }\r\n var ob = target.__ob__;\r\n if (target._isVue || (ob && ob.vmCount)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('Avoid deleting properties on a Vue instance or its root $data ' +\r\n '- just set it to null.');\r\n return;\r\n }\r\n if (isReadonly(target)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Delete operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n return;\r\n }\r\n if (!hasOwn(target, key)) {\r\n return;\r\n }\r\n delete target[key];\r\n if (!ob) {\r\n return;\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n ob.dep.notify({\r\n type: \"delete\" /* TriggerOpTypes.DELETE */,\r\n target: target,\r\n key: key\r\n });\r\n }\r\n else {\r\n ob.dep.notify();\r\n }\r\n}\r\n/**\r\n * Collect dependencies on array elements when the array is touched, since\r\n * we cannot intercept array element access like property getters.\r\n */\r\nfunction dependArray(value) {\r\n for (var e = void 0, i = 0, l = value.length; i < l; i++) {\r\n e = value[i];\r\n if (e && e.__ob__) {\r\n e.__ob__.dep.depend();\r\n }\r\n if (isArray(e)) {\r\n dependArray(e);\r\n }\r\n }\r\n}\n\nfunction reactive(target) {\r\n makeReactive(target, false);\r\n return target;\r\n}\r\n/**\r\n * Return a shallowly-reactive copy of the original object, where only the root\r\n * level properties are reactive. It also does not auto-unwrap refs (even at the\r\n * root level).\r\n */\r\nfunction shallowReactive(target) {\r\n makeReactive(target, true);\r\n def(target, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\r\n return target;\r\n}\r\nfunction makeReactive(target, shallow) {\r\n // if trying to observe a readonly proxy, return the readonly version.\r\n if (!isReadonly(target)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (isArray(target)) {\r\n warn(\"Avoid using Array as root value for \".concat(shallow ? \"shallowReactive()\" : \"reactive()\", \" as it cannot be tracked in watch() or watchEffect(). Use \").concat(shallow ? \"shallowRef()\" : \"ref()\", \" instead. This is a Vue-2-only limitation.\"));\r\n }\r\n var existingOb = target && target.__ob__;\r\n if (existingOb && existingOb.shallow !== shallow) {\r\n warn(\"Target is already a \".concat(existingOb.shallow ? \"\" : \"non-\", \"shallow reactive object, and cannot be converted to \").concat(shallow ? \"\" : \"non-\", \"shallow.\"));\r\n }\r\n }\r\n var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);\r\n if (process.env.NODE_ENV !== 'production' && !ob) {\r\n if (target == null || isPrimitive(target)) {\r\n warn(\"value cannot be made reactive: \".concat(String(target)));\r\n }\r\n if (isCollectionType(target)) {\r\n warn(\"Vue 2 does not support reactive collection types such as Map or Set.\");\r\n }\r\n }\r\n }\r\n}\r\nfunction isReactive(value) {\r\n if (isReadonly(value)) {\r\n return isReactive(value[\"__v_raw\" /* ReactiveFlags.RAW */]);\r\n }\r\n return !!(value && value.__ob__);\r\n}\r\nfunction isShallow(value) {\r\n return !!(value && value.__v_isShallow);\r\n}\r\nfunction isReadonly(value) {\r\n return !!(value && value.__v_isReadonly);\r\n}\r\nfunction isProxy(value) {\r\n return isReactive(value) || isReadonly(value);\r\n}\r\nfunction toRaw(observed) {\r\n var raw = observed && observed[\"__v_raw\" /* ReactiveFlags.RAW */];\r\n return raw ? toRaw(raw) : observed;\r\n}\r\nfunction markRaw(value) {\r\n def(value, \"__v_skip\" /* ReactiveFlags.SKIP */, true);\r\n return value;\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction isCollectionType(value) {\r\n var type = toRawType(value);\r\n return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');\r\n}\n\n/**\r\n * @internal\r\n */\r\nvar RefFlag = \"__v_isRef\";\r\nfunction isRef(r) {\r\n return !!(r && r.__v_isRef === true);\r\n}\r\nfunction ref$1(value) {\r\n return createRef(value, false);\r\n}\r\nfunction shallowRef(value) {\r\n return createRef(value, true);\r\n}\r\nfunction createRef(rawValue, shallow) {\r\n if (isRef(rawValue)) {\r\n return rawValue;\r\n }\r\n var ref = {};\r\n def(ref, RefFlag, true);\r\n def(ref, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, shallow);\r\n def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));\r\n return ref;\r\n}\r\nfunction triggerRef(ref) {\r\n if (process.env.NODE_ENV !== 'production' && !ref.dep) {\r\n warn(\"received object is not a triggerable ref.\");\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n ref.dep &&\r\n ref.dep.notify({\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n target: ref,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n ref.dep && ref.dep.notify();\r\n }\r\n}\r\nfunction unref(ref) {\r\n return isRef(ref) ? ref.value : ref;\r\n}\r\nfunction proxyRefs(objectWithRefs) {\r\n if (isReactive(objectWithRefs)) {\r\n return objectWithRefs;\r\n }\r\n var proxy = {};\r\n var keys = Object.keys(objectWithRefs);\r\n for (var i = 0; i < keys.length; i++) {\r\n proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);\r\n }\r\n return proxy;\r\n}\r\nfunction proxyWithRefUnwrap(target, source, key) {\r\n Object.defineProperty(target, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function () {\r\n var val = source[key];\r\n if (isRef(val)) {\r\n return val.value;\r\n }\r\n else {\r\n var ob = val && val.__ob__;\r\n if (ob)\r\n ob.dep.depend();\r\n return val;\r\n }\r\n },\r\n set: function (value) {\r\n var oldValue = source[key];\r\n if (isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n }\r\n else {\r\n source[key] = value;\r\n }\r\n }\r\n });\r\n}\r\nfunction customRef(factory) {\r\n var dep = new Dep();\r\n var _a = factory(function () {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.depend({\r\n target: ref,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n dep.depend();\r\n }\r\n }, function () {\r\n if (process.env.NODE_ENV !== 'production') {\r\n dep.notify({\r\n target: ref,\r\n type: \"set\" /* TriggerOpTypes.SET */,\r\n key: 'value'\r\n });\r\n }\r\n else {\r\n dep.notify();\r\n }\r\n }), get = _a.get, set = _a.set;\r\n var ref = {\r\n get value() {\r\n return get();\r\n },\r\n set value(newVal) {\r\n set(newVal);\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n return ref;\r\n}\r\nfunction toRefs(object) {\r\n if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {\r\n warn(\"toRefs() expects a reactive object but received a plain one.\");\r\n }\r\n var ret = isArray(object) ? new Array(object.length) : {};\r\n for (var key in object) {\r\n ret[key] = toRef(object, key);\r\n }\r\n return ret;\r\n}\r\nfunction toRef(object, key, defaultValue) {\r\n var val = object[key];\r\n if (isRef(val)) {\r\n return val;\r\n }\r\n var ref = {\r\n get value() {\r\n var val = object[key];\r\n return val === undefined ? defaultValue : val;\r\n },\r\n set value(newVal) {\r\n object[key] = newVal;\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n return ref;\r\n}\n\nvar rawToReadonlyFlag = \"__v_rawToReadonly\";\r\nvar rawToShallowReadonlyFlag = \"__v_rawToShallowReadonly\";\r\nfunction readonly(target) {\r\n return createReadonly(target, false);\r\n}\r\nfunction createReadonly(target, shallow) {\r\n if (!isPlainObject(target)) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (isArray(target)) {\r\n warn(\"Vue 2 does not support readonly arrays.\");\r\n }\r\n else if (isCollectionType(target)) {\r\n warn(\"Vue 2 does not support readonly collection types such as Map or Set.\");\r\n }\r\n else {\r\n warn(\"value cannot be made readonly: \".concat(typeof target));\r\n }\r\n }\r\n return target;\r\n }\r\n // already a readonly object\r\n if (isReadonly(target)) {\r\n return target;\r\n }\r\n // already has a readonly proxy\r\n var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;\r\n var existingProxy = target[existingFlag];\r\n if (existingProxy) {\r\n return existingProxy;\r\n }\r\n var proxy = Object.create(Object.getPrototypeOf(target));\r\n def(target, existingFlag, proxy);\r\n def(proxy, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, true);\r\n def(proxy, \"__v_raw\" /* ReactiveFlags.RAW */, target);\r\n if (isRef(target)) {\r\n def(proxy, RefFlag, true);\r\n }\r\n if (shallow || isShallow(target)) {\r\n def(proxy, \"__v_isShallow\" /* ReactiveFlags.IS_SHALLOW */, true);\r\n }\r\n var keys = Object.keys(target);\r\n for (var i = 0; i < keys.length; i++) {\r\n defineReadonlyProperty(proxy, target, keys[i], shallow);\r\n }\r\n return proxy;\r\n}\r\nfunction defineReadonlyProperty(proxy, target, key, shallow) {\r\n Object.defineProperty(proxy, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: function () {\r\n var val = target[key];\r\n return shallow || !isPlainObject(val) ? val : readonly(val);\r\n },\r\n set: function () {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Set operation on key \\\"\".concat(key, \"\\\" failed: target is readonly.\"));\r\n }\r\n });\r\n}\r\n/**\r\n * Returns a reactive-copy of the original object, where only the root level\r\n * properties are readonly, and does NOT unwrap refs nor recursively convert\r\n * returned properties.\r\n * This is used for creating the props proxy object for stateful components.\r\n */\r\nfunction shallowReadonly(target) {\r\n return createReadonly(target, true);\r\n}\n\nfunction computed(getterOrOptions, debugOptions) {\r\n var getter;\r\n var setter;\r\n var onlyGetter = isFunction(getterOrOptions);\r\n if (onlyGetter) {\r\n getter = getterOrOptions;\r\n setter = process.env.NODE_ENV !== 'production'\r\n ? function () {\r\n warn('Write operation failed: computed value is readonly');\r\n }\r\n : noop;\r\n }\r\n else {\r\n getter = getterOrOptions.get;\r\n setter = getterOrOptions.set;\r\n }\r\n var watcher = isServerRendering()\r\n ? null\r\n : new Watcher(currentInstance, getter, noop, { lazy: true });\r\n if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {\r\n watcher.onTrack = debugOptions.onTrack;\r\n watcher.onTrigger = debugOptions.onTrigger;\r\n }\r\n var ref = {\r\n // some libs rely on the presence effect for checking computed refs\r\n // from normal refs, but the implementation doesn't matter\r\n effect: watcher,\r\n get value() {\r\n if (watcher) {\r\n if (watcher.dirty) {\r\n watcher.evaluate();\r\n }\r\n if (Dep.target) {\r\n if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {\r\n Dep.target.onTrack({\r\n effect: Dep.target,\r\n target: ref,\r\n type: \"get\" /* TrackOpTypes.GET */,\r\n key: 'value'\r\n });\r\n }\r\n watcher.depend();\r\n }\r\n return watcher.value;\r\n }\r\n else {\r\n return getter();\r\n }\r\n },\r\n set value(newVal) {\r\n setter(newVal);\r\n }\r\n };\r\n def(ref, RefFlag, true);\r\n def(ref, \"__v_isReadonly\" /* ReactiveFlags.IS_READONLY */, onlyGetter);\r\n return ref;\r\n}\n\nvar WATCHER = \"watcher\";\r\nvar WATCHER_CB = \"\".concat(WATCHER, \" callback\");\r\nvar WATCHER_GETTER = \"\".concat(WATCHER, \" getter\");\r\nvar WATCHER_CLEANUP = \"\".concat(WATCHER, \" cleanup\");\r\n// Simple effect.\r\nfunction watchEffect(effect, options) {\r\n return doWatch(effect, null, options);\r\n}\r\nfunction watchPostEffect(effect, options) {\r\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\r\n ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));\r\n}\r\nfunction watchSyncEffect(effect, options) {\r\n return doWatch(effect, null, (process.env.NODE_ENV !== 'production'\r\n ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));\r\n}\r\n// initial value for watchers to trigger on undefined initial values\r\nvar INITIAL_WATCHER_VALUE = {};\r\n// implementation\r\nfunction watch(source, cb, options) {\r\n if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {\r\n warn(\"`watch(fn, options?)` signature has been moved to a separate API. \" +\r\n \"Use `watchEffect(fn, options?)` instead. `watch` now only \" +\r\n \"supports `watch(source, cb, options?) signature.\");\r\n }\r\n return doWatch(source, cb, options);\r\n}\r\nfunction doWatch(source, cb, _a) {\r\n var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;\r\n if (process.env.NODE_ENV !== 'production' && !cb) {\r\n if (immediate !== undefined) {\r\n warn(\"watch() \\\"immediate\\\" option is only respected when using the \" +\r\n \"watch(source, callback, options?) signature.\");\r\n }\r\n if (deep !== undefined) {\r\n warn(\"watch() \\\"deep\\\" option is only respected when using the \" +\r\n \"watch(source, callback, options?) signature.\");\r\n }\r\n }\r\n var warnInvalidSource = function (s) {\r\n warn(\"Invalid watch source: \".concat(s, \". A watch source can only be a getter/effect \") +\r\n \"function, a ref, a reactive object, or an array of these types.\");\r\n };\r\n var instance = currentInstance;\r\n var call = function (fn, type, args) {\r\n if (args === void 0) { args = null; }\r\n return invokeWithErrorHandling(fn, null, args, instance, type);\r\n };\r\n var getter;\r\n var forceTrigger = false;\r\n var isMultiSource = false;\r\n if (isRef(source)) {\r\n getter = function () { return source.value; };\r\n forceTrigger = isShallow(source);\r\n }\r\n else if (isReactive(source)) {\r\n getter = function () {\r\n source.__ob__.dep.depend();\r\n return source;\r\n };\r\n deep = true;\r\n }\r\n else if (isArray(source)) {\r\n isMultiSource = true;\r\n forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });\r\n getter = function () {\r\n return source.map(function (s) {\r\n if (isRef(s)) {\r\n return s.value;\r\n }\r\n else if (isReactive(s)) {\r\n return traverse(s);\r\n }\r\n else if (isFunction(s)) {\r\n return call(s, WATCHER_GETTER);\r\n }\r\n else {\r\n process.env.NODE_ENV !== 'production' && warnInvalidSource(s);\r\n }\r\n });\r\n };\r\n }\r\n else if (isFunction(source)) {\r\n if (cb) {\r\n // getter with cb\r\n getter = function () { return call(source, WATCHER_GETTER); };\r\n }\r\n else {\r\n // no cb -> simple effect\r\n getter = function () {\r\n if (instance && instance._isDestroyed) {\r\n return;\r\n }\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n return call(source, WATCHER, [onCleanup]);\r\n };\r\n }\r\n }\r\n else {\r\n getter = noop;\r\n process.env.NODE_ENV !== 'production' && warnInvalidSource(source);\r\n }\r\n if (cb && deep) {\r\n var baseGetter_1 = getter;\r\n getter = function () { return traverse(baseGetter_1()); };\r\n }\r\n var cleanup;\r\n var onCleanup = function (fn) {\r\n cleanup = watcher.onStop = function () {\r\n call(fn, WATCHER_CLEANUP);\r\n };\r\n };\r\n // in SSR there is no need to setup an actual effect, and it should be noop\r\n // unless it's eager\r\n if (isServerRendering()) {\r\n // we will also not call the invalidate callback (+ runner is not set up)\r\n onCleanup = noop;\r\n if (!cb) {\r\n getter();\r\n }\r\n else if (immediate) {\r\n call(cb, WATCHER_CB, [\r\n getter(),\r\n isMultiSource ? [] : undefined,\r\n onCleanup\r\n ]);\r\n }\r\n return noop;\r\n }\r\n var watcher = new Watcher(currentInstance, getter, noop, {\r\n lazy: true\r\n });\r\n watcher.noRecurse = !cb;\r\n var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;\r\n // overwrite default run\r\n watcher.run = function () {\r\n if (!watcher.active) {\r\n return;\r\n }\r\n if (cb) {\r\n // watch(source, cb)\r\n var newValue = watcher.get();\r\n if (deep ||\r\n forceTrigger ||\r\n (isMultiSource\r\n ? newValue.some(function (v, i) {\r\n return hasChanged(v, oldValue[i]);\r\n })\r\n : hasChanged(newValue, oldValue))) {\r\n // cleanup before running cb again\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n call(cb, WATCHER_CB, [\r\n newValue,\r\n // pass undefined as the old value when it's changed for the first time\r\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\r\n onCleanup\r\n ]);\r\n oldValue = newValue;\r\n }\r\n }\r\n else {\r\n // watchEffect\r\n watcher.get();\r\n }\r\n };\r\n if (flush === 'sync') {\r\n watcher.update = watcher.run;\r\n }\r\n else if (flush === 'post') {\r\n watcher.post = true;\r\n watcher.update = function () { return queueWatcher(watcher); };\r\n }\r\n else {\r\n // pre\r\n watcher.update = function () {\r\n if (instance && instance === currentInstance && !instance._isMounted) {\r\n // pre-watcher triggered before\r\n var buffer = instance._preWatchers || (instance._preWatchers = []);\r\n if (buffer.indexOf(watcher) < 0)\r\n buffer.push(watcher);\r\n }\r\n else {\r\n queueWatcher(watcher);\r\n }\r\n };\r\n }\r\n if (process.env.NODE_ENV !== 'production') {\r\n watcher.onTrack = onTrack;\r\n watcher.onTrigger = onTrigger;\r\n }\r\n // initial run\r\n if (cb) {\r\n if (immediate) {\r\n watcher.run();\r\n }\r\n else {\r\n oldValue = watcher.get();\r\n }\r\n }\r\n else if (flush === 'post' && instance) {\r\n instance.$once('hook:mounted', function () { return watcher.get(); });\r\n }\r\n else {\r\n watcher.get();\r\n }\r\n return function () {\r\n watcher.teardown();\r\n };\r\n}\n\nvar activeEffectScope;\r\nvar EffectScope = /** @class */ (function () {\r\n function EffectScope(detached) {\r\n if (detached === void 0) { detached = false; }\r\n /**\r\n * @internal\r\n */\r\n this.active = true;\r\n /**\r\n * @internal\r\n */\r\n this.effects = [];\r\n /**\r\n * @internal\r\n */\r\n this.cleanups = [];\r\n if (!detached && activeEffectScope) {\r\n this.parent = activeEffectScope;\r\n this.index =\r\n (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;\r\n }\r\n }\r\n EffectScope.prototype.run = function (fn) {\r\n if (this.active) {\r\n var currentEffectScope = activeEffectScope;\r\n try {\r\n activeEffectScope = this;\r\n return fn();\r\n }\r\n finally {\r\n activeEffectScope = currentEffectScope;\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"cannot run an inactive effect scope.\");\r\n }\r\n };\r\n /**\r\n * This should only be called on non-detached scopes\r\n * @internal\r\n */\r\n EffectScope.prototype.on = function () {\r\n activeEffectScope = this;\r\n };\r\n /**\r\n * This should only be called on non-detached scopes\r\n * @internal\r\n */\r\n EffectScope.prototype.off = function () {\r\n activeEffectScope = this.parent;\r\n };\r\n EffectScope.prototype.stop = function (fromParent) {\r\n if (this.active) {\r\n var i = void 0, l = void 0;\r\n for (i = 0, l = this.effects.length; i < l; i++) {\r\n this.effects[i].teardown();\r\n }\r\n for (i = 0, l = this.cleanups.length; i < l; i++) {\r\n this.cleanups[i]();\r\n }\r\n if (this.scopes) {\r\n for (i = 0, l = this.scopes.length; i < l; i++) {\r\n this.scopes[i].stop(true);\r\n }\r\n }\r\n // nested scope, dereference from parent to avoid memory leaks\r\n if (this.parent && !fromParent) {\r\n // optimized O(1) removal\r\n var last = this.parent.scopes.pop();\r\n if (last && last !== this) {\r\n this.parent.scopes[this.index] = last;\r\n last.index = this.index;\r\n }\r\n }\r\n this.active = false;\r\n }\r\n };\r\n return EffectScope;\r\n}());\r\nfunction effectScope(detached) {\r\n return new EffectScope(detached);\r\n}\r\n/**\r\n * @internal\r\n */\r\nfunction recordEffectScope(effect, scope) {\r\n if (scope === void 0) { scope = activeEffectScope; }\r\n if (scope && scope.active) {\r\n scope.effects.push(effect);\r\n }\r\n}\r\nfunction getCurrentScope() {\r\n return activeEffectScope;\r\n}\r\nfunction onScopeDispose(fn) {\r\n if (activeEffectScope) {\r\n activeEffectScope.cleanups.push(fn);\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"onScopeDispose() is called when there is no active effect scope\" +\r\n \" to be associated with.\");\r\n }\r\n}\n\nfunction provide(key, value) {\r\n if (!currentInstance) {\r\n if (process.env.NODE_ENV !== 'production') {\r\n warn(\"provide() can only be used inside setup().\");\r\n }\r\n }\r\n else {\r\n // TS doesn't allow symbol as index type\r\n resolveProvided(currentInstance)[key] = value;\r\n }\r\n}\r\nfunction resolveProvided(vm) {\r\n // by default an instance inherits its parent's provides object\r\n // but when it needs to provide values of its own, it creates its\r\n // own provides object using parent provides object as prototype.\r\n // this way in `inject` we can simply look up injections from direct\r\n // parent and let the prototype chain do the work.\r\n var existing = vm._provided;\r\n var parentProvides = vm.$parent && vm.$parent._provided;\r\n if (parentProvides === existing) {\r\n return (vm._provided = Object.create(parentProvides));\r\n }\r\n else {\r\n return existing;\r\n }\r\n}\r\nfunction inject(key, defaultValue, treatDefaultAsFactory) {\r\n if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }\r\n // fallback to `currentRenderingInstance` so that this can be called in\r\n // a functional component\r\n var instance = currentInstance;\r\n if (instance) {\r\n // #2400\r\n // to support `app.use` plugins,\r\n // fallback to appContext's `provides` if the instance is at root\r\n var provides = instance.$parent && instance.$parent._provided;\r\n if (provides && key in provides) {\r\n // TS doesn't allow symbol as index type\r\n return provides[key];\r\n }\r\n else if (arguments.length > 1) {\r\n return treatDefaultAsFactory && isFunction(defaultValue)\r\n ? defaultValue.call(instance)\r\n : defaultValue;\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"injection \\\"\".concat(String(key), \"\\\" not found.\"));\r\n }\r\n }\r\n else if (process.env.NODE_ENV !== 'production') {\r\n warn(\"inject() can only be used inside setup() or functional components.\");\r\n }\r\n}\n\nvar normalizeEvent = cached(function (name) {\r\n var passive = name.charAt(0) === '&';\r\n name = passive ? name.slice(1) : name;\r\n var once = name.charAt(0) === '~'; // Prefixed last, checked first\r\n name = once ? name.slice(1) : name;\r\n var capture = name.charAt(0) === '!';\r\n name = capture ? name.slice(1) : name;\r\n return {\r\n name: name,\r\n once: once,\r\n capture: capture,\r\n passive: passive\r\n };\r\n});\r\nfunction createFnInvoker(fns, vm) {\r\n function invoker() {\r\n var fns = invoker.fns;\r\n if (isArray(fns)) {\r\n var cloned = fns.slice();\r\n for (var i = 0; i < cloned.length; i++) {\r\n invokeWithErrorHandling(cloned[i], null, arguments, vm, \"v-on handler\");\r\n }\r\n }\r\n else {\r\n // return handler return value for single handlers\r\n return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\");\r\n }\r\n }\r\n invoker.fns = fns;\r\n return invoker;\r\n}\r\nfunction updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {\r\n var name, cur, old, event;\r\n for (name in on) {\r\n cur = on[name];\r\n old = oldOn[name];\r\n event = normalizeEvent(name);\r\n if (isUndef(cur)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn(\"Invalid handler for event \\\"\".concat(event.name, \"\\\": got \") + String(cur), vm);\r\n }\r\n else if (isUndef(old)) {\r\n if (isUndef(cur.fns)) {\r\n cur = on[name] = createFnInvoker(cur, vm);\r\n }\r\n if (isTrue(event.once)) {\r\n cur = on[name] = createOnceHandler(event.name, cur, event.capture);\r\n }\r\n add(event.name, cur, event.capture, event.passive, event.params);\r\n }\r\n else if (cur !== old) {\r\n old.fns = cur;\r\n on[name] = old;\r\n }\r\n }\r\n for (name in oldOn) {\r\n if (isUndef(on[name])) {\r\n event = normalizeEvent(name);\r\n remove(event.name, oldOn[name], event.capture);\r\n }\r\n }\r\n}\n\nfunction mergeVNodeHook(def, hookKey, hook) {\r\n if (def instanceof VNode) {\r\n def = def.data.hook || (def.data.hook = {});\r\n }\r\n var invoker;\r\n var oldHook = def[hookKey];\r\n function wrappedHook() {\r\n hook.apply(this, arguments);\r\n // important: remove merged hook to ensure it's called only once\r\n // and prevent memory leak\r\n remove$2(invoker.fns, wrappedHook);\r\n }\r\n if (isUndef(oldHook)) {\r\n // no existing hook\r\n invoker = createFnInvoker([wrappedHook]);\r\n }\r\n else {\r\n /* istanbul ignore if */\r\n if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\r\n // already a merged invoker\r\n invoker = oldHook;\r\n invoker.fns.push(wrappedHook);\r\n }\r\n else {\r\n // existing plain hook\r\n invoker = createFnInvoker([oldHook, wrappedHook]);\r\n }\r\n }\r\n invoker.merged = true;\r\n def[hookKey] = invoker;\r\n}\n\nfunction extractPropsFromVNodeData(data, Ctor, tag) {\r\n // we are only extracting raw values here.\r\n // validation and default values are handled in the child\r\n // component itself.\r\n var propOptions = Ctor.options.props;\r\n if (isUndef(propOptions)) {\r\n return;\r\n }\r\n var res = {};\r\n var attrs = data.attrs, props = data.props;\r\n if (isDef(attrs) || isDef(props)) {\r\n for (var key in propOptions) {\r\n var altKey = hyphenate(key);\r\n if (process.env.NODE_ENV !== 'production') {\r\n var keyInLowerCase = key.toLowerCase();\r\n if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {\r\n tip(\"Prop \\\"\".concat(keyInLowerCase, \"\\\" is passed to component \") +\r\n \"\".concat(formatComponentName(\r\n // @ts-expect-error tag is string\r\n tag || Ctor), \", but the declared prop name is\") +\r\n \" \\\"\".concat(key, \"\\\". \") +\r\n \"Note that HTML attributes are case-insensitive and camelCased \" +\r\n \"props need to use their kebab-case equivalents when using in-DOM \" +\r\n \"templates. You should probably use \\\"\".concat(altKey, \"\\\" instead of \\\"\").concat(key, \"\\\".\"));\r\n }\r\n }\r\n checkProp(res, props, key, altKey, true) ||\r\n checkProp(res, attrs, key, altKey, false);\r\n }\r\n }\r\n return res;\r\n}\r\nfunction checkProp(res, hash, key, altKey, preserve) {\r\n if (isDef(hash)) {\r\n if (hasOwn(hash, key)) {\r\n res[key] = hash[key];\r\n if (!preserve) {\r\n delete hash[key];\r\n }\r\n return true;\r\n }\r\n else if (hasOwn(hash, altKey)) {\r\n res[key] = hash[altKey];\r\n if (!preserve) {\r\n delete hash[altKey];\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\n\n// The template compiler attempts to minimize the need for normalization by\r\n// statically analyzing the template at compile time.\r\n//\r\n// For plain HTML markup, normalization can be completely skipped because the\r\n// generated render function is guaranteed to return Array. There are\r\n// two cases where extra normalization is needed:\r\n// 1. When the children contains components - because a functional component\r\n// may return an Array instead of a single root. In this case, just a simple\r\n// normalization is needed - if any child is an Array, we flatten the whole\r\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\r\n// because functional components already normalize their own children.\r\nfunction simpleNormalizeChildren(children) {\r\n for (var i = 0; i < children.length; i++) {\r\n if (isArray(children[i])) {\r\n return Array.prototype.concat.apply([], children);\r\n }\r\n }\r\n return children;\r\n}\r\n// 2. When the children contains constructs that always generated nested Arrays,\r\n// e.g. , , v-for, or when the children is provided by user\r\n// with hand-written render functions / JSX. In such cases a full normalization\r\n// is needed to cater to all possible types of children values.\r\nfunction normalizeChildren(children) {\r\n return isPrimitive(children)\r\n ? [createTextVNode(children)]\r\n : isArray(children)\r\n ? normalizeArrayChildren(children)\r\n : undefined;\r\n}\r\nfunction isTextNode(node) {\r\n return isDef(node) && isDef(node.text) && isFalse(node.isComment);\r\n}\r\nfunction normalizeArrayChildren(children, nestedIndex) {\r\n var res = [];\r\n var i, c, lastIndex, last;\r\n for (i = 0; i < children.length; i++) {\r\n c = children[i];\r\n if (isUndef(c) || typeof c === 'boolean')\r\n continue;\r\n lastIndex = res.length - 1;\r\n last = res[lastIndex];\r\n // nested\r\n if (isArray(c)) {\r\n if (c.length > 0) {\r\n c = normalizeArrayChildren(c, \"\".concat(nestedIndex || '', \"_\").concat(i));\r\n // merge adjacent text nodes\r\n if (isTextNode(c[0]) && isTextNode(last)) {\r\n res[lastIndex] = createTextVNode(last.text + c[0].text);\r\n c.shift();\r\n }\r\n res.push.apply(res, c);\r\n }\r\n }\r\n else if (isPrimitive(c)) {\r\n if (isTextNode(last)) {\r\n // merge adjacent text nodes\r\n // this is necessary for SSR hydration because text nodes are\r\n // essentially merged when rendered to HTML strings\r\n res[lastIndex] = createTextVNode(last.text + c);\r\n }\r\n else if (c !== '') {\r\n // convert primitive to vnode\r\n res.push(createTextVNode(c));\r\n }\r\n }\r\n else {\r\n if (isTextNode(c) && isTextNode(last)) {\r\n // merge adjacent text nodes\r\n res[lastIndex] = createTextVNode(last.text + c.text);\r\n }\r\n else {\r\n // default key for nested array children (likely generated by v-for)\r\n if (isTrue(children._isVList) &&\r\n isDef(c.tag) &&\r\n isUndef(c.key) &&\r\n isDef(nestedIndex)) {\r\n c.key = \"__vlist\".concat(nestedIndex, \"_\").concat(i, \"__\");\r\n }\r\n res.push(c);\r\n }\r\n }\r\n }\r\n return res;\r\n}\n\n/**\r\n * Runtime helper for rendering v-for lists.\r\n */\r\nfunction renderList(val, render) {\r\n var ret = null, i, l, keys, key;\r\n if (isArray(val) || typeof val === 'string') {\r\n ret = new Array(val.length);\r\n for (i = 0, l = val.length; i < l; i++) {\r\n ret[i] = render(val[i], i);\r\n }\r\n }\r\n else if (typeof val === 'number') {\r\n ret = new Array(val);\r\n for (i = 0; i < val; i++) {\r\n ret[i] = render(i + 1, i);\r\n }\r\n }\r\n else if (isObject(val)) {\r\n if (hasSymbol && val[Symbol.iterator]) {\r\n ret = [];\r\n var iterator = val[Symbol.iterator]();\r\n var result = iterator.next();\r\n while (!result.done) {\r\n ret.push(render(result.value, ret.length));\r\n result = iterator.next();\r\n }\r\n }\r\n else {\r\n keys = Object.keys(val);\r\n ret = new Array(keys.length);\r\n for (i = 0, l = keys.length; i < l; i++) {\r\n key = keys[i];\r\n ret[i] = render(val[key], key, i);\r\n }\r\n }\r\n }\r\n if (!isDef(ret)) {\r\n ret = [];\r\n }\r\n ret._isVList = true;\r\n return ret;\r\n}\n\n/**\r\n * Runtime helper for rendering \r\n */\r\nfunction renderSlot(name, fallbackRender, props, bindObject) {\r\n var scopedSlotFn = this.$scopedSlots[name];\r\n var nodes;\r\n if (scopedSlotFn) {\r\n // scoped slot\r\n props = props || {};\r\n if (bindObject) {\r\n if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {\r\n warn('slot v-bind without argument expects an Object', this);\r\n }\r\n props = extend(extend({}, bindObject), props);\r\n }\r\n nodes =\r\n scopedSlotFn(props) ||\r\n (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);\r\n }\r\n else {\r\n nodes =\r\n this.$slots[name] ||\r\n (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);\r\n }\r\n var target = props && props.slot;\r\n if (target) {\r\n return this.$createElement('template', { slot: target }, nodes);\r\n }\r\n else {\r\n return nodes;\r\n }\r\n}\n\n/**\r\n * Runtime helper for resolving filters\r\n */\r\nfunction resolveFilter(id) {\r\n return resolveAsset(this.$options, 'filters', id, true) || identity;\r\n}\n\nfunction isKeyNotMatch(expect, actual) {\r\n if (isArray(expect)) {\r\n return expect.indexOf(actual) === -1;\r\n }\r\n else {\r\n return expect !== actual;\r\n }\r\n}\r\n/**\r\n * Runtime helper for checking keyCodes from config.\r\n * exposed as Vue.prototype._k\r\n * passing in eventKeyName as last argument separately for backwards compat\r\n */\r\nfunction checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {\r\n var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;\r\n if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {\r\n return isKeyNotMatch(builtInKeyName, eventKeyName);\r\n }\r\n else if (mappedKeyCode) {\r\n return isKeyNotMatch(mappedKeyCode, eventKeyCode);\r\n }\r\n else if (eventKeyName) {\r\n return hyphenate(eventKeyName) !== key;\r\n }\r\n return eventKeyCode === undefined;\r\n}\n\n/**\r\n * Runtime helper for merging v-bind=\"object\" into a VNode's data.\r\n */\r\nfunction bindObjectProps(data, tag, value, asProp, isSync) {\r\n if (value) {\r\n if (!isObject(value)) {\r\n process.env.NODE_ENV !== 'production' &&\r\n warn('v-bind without argument expects an Object or Array value', this);\r\n }\r\n else {\r\n if (isArray(value)) {\r\n value = toObject(value);\r\n }\r\n var hash = void 0;\r\n var _loop_1 = function (key) {\r\n if (key === 'class' || key === 'style' || isReservedAttribute(key)) {\r\n hash = data;\r\n }\r\n else {\r\n var type = data.attrs && data.attrs.type;\r\n hash =\r\n asProp || config.mustUseProp(tag, type, key)\r\n ? data.domProps || (data.domProps = {})\r\n : data.attrs || (data.attrs = {});\r\n }\r\n var camelizedKey = camelize(key);\r\n var hyphenatedKey = hyphenate(key);\r\n if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {\r\n hash[key] = value[key];\r\n if (isSync) {\r\n var on = data.on || (data.on = {});\r\n on[\"update:\".concat(key)] = function ($event) {\r\n value[key] = $event;\r\n };\r\n }\r\n }\r\n };\r\n for (var key in value) {\r\n _loop_1(key);\r\n }\r\n }\r\n }\r\n return data;\r\n}\n\n/**\r\n * Runtime helper for rendering static trees.\r\n */\r\nfunction renderStatic(index, isInFor) {\r\n var cached = this._staticTrees || (this._staticTrees = []);\r\n var tree = cached[index];\r\n // if has already-rendered static tree and not inside v-for,\r\n // we can reuse the same tree.\r\n if (tree && !isInFor) {\r\n return tree;\r\n }\r\n // otherwise, render a fresh tree.\r\n tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates\r\n );\r\n markStatic(tree, \"__static__\".concat(index), false);\r\n return tree;\r\n}\r\n/**\r\n * Runtime helper for v-once.\r\n * Effectively it means marking the node as static with a unique key.\r\n */\r\nfunction markOnce(tree, index, key) {\r\n markStatic(tree, \"__once__\".concat(index).concat(key ? \"_\".concat(key) : \"\"), true);\r\n return tree;\r\n}\r\nfunction markStatic(tree, key, isOnce) {\r\n if (isArray(tree)) {\r\n for (var i = 0; i < tree.length; i++) {\r\n if (tree[i] && typeof tree[i] !== 'string') {\r\n markStaticNode(tree[i], \"\".concat(key, \"_\").concat(i), isOnce);\r\n }\r\n }\r\n }\r\n else {\r\n markStaticNode(tree, key, isOnce);\r\n }\r\n}\r\nfunction markStaticNode(node, key, isOnce) {\r\n node.isStatic = true;\r\n node.key = key;\r\n node.isOnce = isOnce;\r\n}\n\nfunction bindObjectListeners(data, value) {\r\n if (value) {\r\n if (!isPlainObject(value)) {\r\n process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);\r\n }\r\n else {\r\n var on = (data.on = data.on ? extend({}, data.on) : {});\r\n for (var key in value) {\r\n var existing = on[key];\r\n var ours = value[key];\r\n on[key] = existing ? [].concat(existing, ours) : ours;\r\n }\r\n }\r\n }\r\n return data;\r\n}\n\nfunction resolveScopedSlots(fns, res, \r\n// the following are added in 2.6\r\nhasDynamicKeys, contentHashKey) {\r\n res = res || { $stable: !hasDynamicKeys };\r\n for (var i = 0; i < fns.length; i++) {\r\n var slot = fns[i];\r\n if (isArray(slot)) {\r\n resolveScopedSlots(slot, res, hasDynamicKeys);\r\n }\r\n else if (slot) {\r\n // marker for reverse proxying v-slot without scope on this.$slots\r\n // @ts-expect-error\r\n if (slot.proxy) {\r\n // @ts-expect-error\r\n slot.fn.proxy = true;\r\n }\r\n res[slot.key] = slot.fn;\r\n }\r\n }\r\n if (contentHashKey) {\r\n res.$key = contentHashKey;\r\n }\r\n return res;\r\n}\n\n// helper to process dynamic keys for dynamic arguments in v-bind and v-on.\r\nfunction bindDynamicKeys(baseObj, values) {\r\n for (var i = 0; i < values.length; i += 2) {\r\n var key = values[i];\r\n if (typeof key === 'string' && key) {\r\n baseObj[values[i]] = values[i + 1];\r\n }\r\n else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {\r\n // null is a special value for explicitly removing a binding\r\n warn(\"Invalid value for dynamic directive argument (expected string or null): \".concat(key), this);\r\n }\r\n }\r\n return baseObj;\r\n}\r\n// helper to dynamically append modifier runtime markers to event names.\r\n// ensure only append when value is already string, otherwise it will be cast\r\n// to string and cause the type check to miss.\r\nfunction prependModifier(value, symbol) {\r\n return typeof value === 'string' ? symbol + value : value;\r\n}\n\nfunction installRenderHelpers(target) {\r\n target._o = markOnce;\r\n target._n = toNumber;\r\n target._s = toString;\r\n target._l = renderList;\r\n target._t = renderSlot;\r\n target._q = looseEqual;\r\n target._i = looseIndexOf;\r\n target._m = renderStatic;\r\n target._f = resolveFilter;\r\n target._k = checkKeyCodes;\r\n target._b = bindObjectProps;\r\n target._v = createTextVNode;\r\n target._e = createEmptyVNode;\r\n target._u = resolveScopedSlots;\r\n target._g = bindObjectListeners;\r\n target._d = bindDynamicKeys;\r\n target._p = prependModifier;\r\n}\n\n/**\r\n * Runtime helper for resolving raw children VNodes into a slot object.\r\n */\r\nfunction resolveSlots(children, context) {\r\n if (!children || !children.length) {\r\n return {};\r\n }\r\n var slots = {};\r\n for (var i = 0, l = children.length; i < l; i++) {\r\n var child = children[i];\r\n var data = child.data;\r\n // remove slot attribute if the node is resolved as a Vue slot node\r\n if (data && data.attrs && data.attrs.slot) {\r\n delete data.attrs.slot;\r\n }\r\n // named slots should only be respected if the vnode was rendered in the\r\n // same context.\r\n if ((child.context === context || child.fnContext === context) &&\r\n data &&\r\n data.slot != null) {\r\n var name_1 = data.slot;\r\n var slot = slots[name_1] || (slots[name_1] = []);\r\n if (child.tag === 'template') {\r\n slot.push.apply(slot, child.children || []);\r\n }\r\n else {\r\n slot.push(child);\r\n }\r\n }\r\n else {\r\n (slots.default || (slots.default = [])).push(child);\r\n }\r\n }\r\n // ignore slots that contains only whitespace\r\n for (var name_2 in slots) {\r\n if (slots[name_2].every(isWhitespace)) {\r\n delete slots[name_2];\r\n }\r\n }\r\n return slots;\r\n}\r\nfunction isWhitespace(node) {\r\n return (node.isComment && !node.asyncFactory) || node.text === ' ';\r\n}\n\nfunction isAsyncPlaceholder(node) {\r\n // @ts-expect-error not really boolean type\r\n return node.isComment && node.asyncFactory;\r\n}\n\nfunction normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {\r\n var res;\r\n var hasNormalSlots = Object.keys(normalSlots).length > 0;\r\n var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;\r\n var key = scopedSlots && scopedSlots.$key;\r\n if (!scopedSlots) {\r\n res = {};\r\n }\r\n else if (scopedSlots._normalized) {\r\n // fast path 1: child component re-render only, parent did not change\r\n return scopedSlots._normalized;\r\n }\r\n else if (isStable &&\r\n prevScopedSlots &&\r\n prevScopedSlots !== emptyObject &&\r\n key === prevScopedSlots.$key &&\r\n !hasNormalSlots &&\r\n !prevScopedSlots.$hasNormal) {\r\n // fast path 2: stable scoped slots w/ no normal slots to proxy,\r\n // only need to normalize once\r\n return prevScopedSlots;\r\n }\r\n else {\r\n res = {};\r\n for (var key_1 in scopedSlots) {\r\n if (scopedSlots[key_1] && key_1[0] !== '$') {\r\n res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);\r\n }\r\n }\r\n }\r\n // expose normal slots on scopedSlots\r\n for (var key_2 in normalSlots) {\r\n if (!(key_2 in res)) {\r\n res[key_2] = proxyNormalSlot(normalSlots, key_2);\r\n }\r\n }\r\n // avoriaz seems to mock a non-extensible $scopedSlots object\r\n // and when that is passed down this would cause an error\r\n if (scopedSlots && Object.isExtensible(scopedSlots)) {\r\n scopedSlots._normalized = res;\r\n }\r\n def(res, '$stable', isStable);\r\n def(res, '$key', key);\r\n def(res, '$hasNormal', hasNormalSlots);\r\n return res;\r\n}\r\nfunction normalizeScopedSlot(vm, normalSlots, key, fn) {\r\n var normalized = function () {\r\n var cur = currentInstance;\r\n setCurrentInstance(vm);\r\n var res = arguments.length ? fn.apply(null, arguments) : fn({});\r\n res =\r\n res && typeof res === 'object' && !isArray(res)\r\n ? [res] // single vnode\r\n : normalizeChildren(res);\r\n var vnode = res && res[0];\r\n setCurrentInstance(cur);\r\n return res &&\r\n (!vnode ||\r\n (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391\r\n ? undefined\r\n : res;\r\n };\r\n // this is a slot using the new v-slot syntax without scope. although it is\r\n // compiled as a scoped slot, render fn users would expect it to be present\r\n // on this.$slots because the usage is semantically a normal slot.\r\n if (fn.proxy) {\r\n Object.defineProperty(normalSlots, key, {\r\n get: normalized,\r\n enumerable: true,\r\n configurable: true\r\n });\r\n }\r\n return normalized;\r\n}\r\nfunction proxyNormalSlot(slots, key) {\r\n return function () { return slots[key]; };\r\n}\n\nfunction initSetup(vm) {\r\n var options = vm.$options;\r\n var setup = options.setup;\r\n if (setup) {\r\n var ctx = (vm._setupContext = createSetupContext(vm));\r\n setCurrentInstance(vm);\r\n pushTarget();\r\n var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, \"setup\");\r\n popTarget();\r\n setCurrentInstance();\r\n if (isFunction(setupResult)) {\r\n // render function\r\n // @ts-ignore\r\n options.render = setupResult;\r\n }\r\n else if (isObject(setupResult)) {\r\n // bindings\r\n if (process.env.NODE_ENV !== 'production' && setupResult instanceof VNode) {\r\n warn(\"setup() should not return VNodes directly - \" +\r\n \"return a render function instead.\");\r\n }\r\n vm._setupState = setupResult;\r\n // __sfc indicates compiled bindings from