@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,425 lines • 245 kB
JavaScript
import { ref as G, computed as X, watch as Br, createVNode as P, createTextVNode as t0, resolveComponent as Kr, defineComponent as he, onMounted as gr, Fragment as et, inject as rt } from "vue";
import { useResizeObserver as tt } from "@vueuse/core";
import { cloneDeep as Te, isPlainObject as He } from "lodash-es";
import * as f0 from "echarts";
import nt from "../progress/index.esm.js";
import { getSchemaByTypeForDesigner as at } from "../dynamic-resolver/index.esm.js";
function yr(e, i) {
let a;
function t(f) {
const { properties: n, title: l, ignore: c } = f, u = c && Array.isArray(c), x = Object.keys(n).reduce((v, s) => ((!u || !c.find((d) => d === s)) && (v[s] = n[s].type === "object" && n[s].properties ? t(n[s]) : Te(n[s].default)), v), {});
if (l && (!u || !c.find((v) => v === "id"))) {
const v = l.toLowerCase().replace(/-/g, "_");
x.id = `${v}_${Math.random().toString().slice(2, 6)}`;
}
return x;
}
function h(f) {
const { properties: n, title: l, required: c } = f;
if (c && Array.isArray(c)) {
const u = c.reduce((x, v) => (x[v] = n[v].type === "object" && n[v].properties ? t(n[v]) : Te(n[v].default), x), {});
if (l && c.find((x) => x === "id")) {
const x = l.toLowerCase().replace(/-/g, "_");
u.id = `${x}_${Math.random().toString().slice(2, 6)}`;
}
return u;
}
return {
type: l
};
}
function g(f, n = {}, l) {
const c = e[f];
if (c) {
let u = h(c);
const x = i[f];
return u = x ? x({ getSchemaByType: g }, u, n, l) : u, a != null && a.appendIdentifyForNewControl && a.appendIdentifyForNewControl(u), u;
}
return null;
}
function F(f, n) {
const l = t(n);
return Object.keys(l).reduce((c, u) => (Object.prototype.hasOwnProperty.call(f, u) && (c[u] && He(c[u]) && He(f[u] || !f[u]) ? Object.assign(c[u], f[u] || {}) : c[u] = f[u]), c), l), l;
}
function B(f, n) {
return Object.keys(f).filter((c) => f[c] != null).reduce((c, u) => {
if (n.has(u)) {
const x = n.get(u);
if (typeof x == "string")
c[x] = f[u];
else {
const v = x(u, f[u], f);
Object.assign(c, v);
}
} else
c[u] = f[u];
return c;
}, {});
}
function m(f, n, l = /* @__PURE__ */ new Map()) {
const c = F(f, n);
return B(c, l);
}
function r(f) {
var l;
const n = f.type;
if (n) {
const c = e[n];
if (!c)
return f;
const u = F(f, c), x = ((l = f.editor) == null ? void 0 : l.type) || "";
if (x) {
const v = e[x], s = F(f.editor, v);
u.editor = s;
}
return u;
}
return f;
}
function o(f) {
a = f;
}
return { getSchemaByType: g, resolveSchemaWithDefaultValue: r, resolveSchemaToProps: m, mappingSchemaToProps: B, setDesignerContext: o };
}
const Cr = {}, Er = {}, { getSchemaByType: ya, resolveSchemaWithDefaultValue: ot, resolveSchemaToProps: it, mappingSchemaToProps: st, setDesignerContext: Ca } = yr(Cr, Er);
function ct(e = {}) {
function i(r, o, f, n) {
if (typeof f == "number")
return n[r].length === f;
if (typeof f == "object") {
const l = Object.keys(f)[0], c = f[l];
if (l === "not")
return Number(n[r].length) !== Number(c);
if (l === "moreThan")
return Number(n[r].length) >= Number(c);
if (l === "lessThan")
return Number(n[r].length) <= Number(c);
}
return !1;
}
function a(r, o, f, n) {
return n[r] && n[r].propertyValue && String(n[r].propertyValue.value) === String(f);
}
const t = /* @__PURE__ */ new Map([
["length", i],
["getProperty", a]
]);
Object.keys(e).reduce((r, o) => (r.set(o, e[o]), r), t);
function h(r, o) {
const f = r;
return typeof o == "number" ? [{ target: f, operator: "length", param: null, value: Number(o) }] : typeof o == "boolean" ? [{ target: f, operator: "getProperty", param: r, value: !!o }] : typeof o == "object" ? Object.keys(o).map((n) => {
if (n === "length")
return { target: f, operator: "length", param: null, value: o[n] };
const l = n, c = o[n];
return { target: f, operator: "getProperty", param: l, value: c };
}) : [];
}
function g(r) {
return Object.keys(r).reduce((f, n) => {
const l = h(n, r[n]);
return f.push(...l), f;
}, []);
}
function F(r, o) {
if (t.has(r.operator)) {
const f = t.get(r.operator);
return f && f(r.target, r.param, r.value, o) || !1;
}
return !1;
}
function B(r, o) {
return g(r).reduce((l, c) => l && F(c, o), !0);
}
function m(r, o) {
const f = Object.keys(r), n = f.includes("allOf"), l = f.includes("anyOf"), c = n || l, v = (c ? r[c ? n ? "allOf" : "anyOf" : "allOf"] : [r]).map((d) => B(d, o));
return n ? !v.includes(!1) : v.includes(!0);
}
return { parseValueSchema: m };
}
const xt = {
convertTo: (e, i, a, t) => {
e.appearance || (e.appearance = {}), e.appearance[i] = a;
},
convertFrom: (e, i, a) => e.appearance ? e.appearance[i] : e[i]
}, ut = {
convertFrom: (e, i, a) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
}, ft = {
convertTo: (e, i, a, t) => {
e.editor && (e.editor[i] = a);
},
convertFrom: (e, i, a) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, i) ? e.editor[i] : e[i]
}, Fr = {
button: { type: "button", name: "按钮" },
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
"content-container": { type: "content-container", name: "容器" },
"input-group": { type: "input-group", name: "文本" },
textarea: { type: "textarea", name: "多行文本" },
lookup: { type: "lookup", name: "帮助" },
"number-spinner": { type: "number-spinner", name: "数值" },
"date-picker": { type: "date-picker", name: "日期" },
switch: { type: "switch", name: "开关" },
"radio-group": { type: "radio-group", name: "单选组" },
"check-box": { type: "check-box", name: "复选框" },
"check-group": { type: "check-group", name: "复选框组" },
"combo-list": { type: "combo-list", name: "下拉列表" },
"response-form": { type: "response-form", name: "卡片面板" },
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
"tree-grid": { type: "tree-grid", name: "树表格" },
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
"data-grid": { type: "data-grid", name: "表格" },
"data-grid-column": { type: "data-grid-column", name: "表格列" },
module: { type: "Module", name: "模块" },
component: { type: "component", name: "组件" },
tabs: { type: "tabs", name: "标签页" },
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
"html-template": { type: "html-template", name: "模板容器" },
"time-picker": { type: "time-picker", name: "时间选择" },
section: { type: "section", name: "分组面板" },
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
splitter: { type: "splitter", name: "分栏面板" },
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
"component-ref": { type: "component-ref", name: "组件引用节点" },
uploader: { type: "uploader", name: "附件上传" },
"page-header": { type: "page-header", name: "页头" },
"page-footer": { type: "page-footer", name: "页脚" },
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
fieldset: { type: "fieldset", name: "分组" },
"query-solution": { type: "query-solution", name: "筛选方案" },
drawer: { type: "drawer", name: "抽屉" },
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
"list-nav": { type: "list-nav", name: "列表导航" },
"list-view": { type: "list-view", name: "列表" },
"filter-bar": { type: "filter-bar", name: "筛选条" },
"language-textbox": { type: "language-textbox", name: "多语输入框" }
}, lt = {
convertFrom: (e, i, a) => {
var h;
const t = e.editor && e.editor[i] ? e.editor[i] : e[i];
return ((h = Fr[t]) == null ? void 0 : h.name) || t;
}
}, dt = {
convertTo: (e, i, a, t) => {
e[i] = e[i];
},
convertFrom: (e, i, a) => e.editor ? a.getRealEditorType(e.editor.type) : ""
}, vt = {
convertTo: (e, i, a, t) => {
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[i] = a : e.formatter = {
[i]: a
});
},
convertFrom: (e, i, a) => {
if (e.formatter) {
if (i === "trueText")
return e.formatter.trueText;
if (i === "falseText")
return e.formatter.falseText;
if (i === "prefix")
return e.formatter.prefix;
if (i === "suffix")
return e.formatter.suffix;
if (i === "precision")
return e.formatter.precision;
if (i === "decimal")
return e.formatter.decimal;
if (i === "thousand")
return e.formatter.thousand;
if (i === "tempDateFormat")
return e.formatter.dateFormat === "yyyy年MM月dd日" ? "yearMonthDay" : e.formatter.dateFormat === "yyyy-MM-dd HH:mm:ss" ? "yyyy-MM-ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy/MM/dd HH:mm:ss" ? "yyyy/MM/ddTHH:mm:ss" : e.formatter.dateFormat === "yyyy年MM月dd日 HH时mm分ss秒" ? "yearMonthDayHourMinuteSecond" : e.formatter.tempDateFormat || e.formatter.dateFormat || "yyyy-MM-dd";
if (i === "customFormat")
return e.formatter.customFormat;
if (i === "type")
return e.formatter.type || "none";
}
return "none";
}
}, ht = {
convertTo: (e, i, a, t) => {
e.command ? e.command[i] = a : e.command = {
[i]: a
}, i === "enable" && a && (e.command.commands || (e.command.commands = [
{
text: "编辑",
type: "primary",
command: "edit"
},
{
text: "删除",
type: "danger",
command: "remove"
}
]));
},
convertFrom: (e, i, a) => e.command && i === "enable" ? e.command.enable : ""
}, pt = {
convertTo: (e, i, a, t) => {
e.column ? e.column[i] = a : e.column = {
[i]: a
}, i === "fitColumns" && a && (e.column.fitMode || (e.column.fitMode = "average"));
},
convertFrom: (e, i, a) => {
if (e.column) {
if (i === "fitColumns")
return e.column.fitColumns;
if (i === "fitMode")
return e.column.fitMode;
}
return "";
}
}, mt = {
convertTo: (e, i, a, t) => {
e.summary ? e.summary[i] = a : e.summary = {
[i]: a
}, i === "enable" && a && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
enable: a,
groupFields: []
});
},
convertFrom: (e, i, a) => e.summary && i === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
}, Bt = {
convertTo: (e, i, a, t) => {
e.group ? e.group[i] = a : e.group = {
[i]: a
}, i === "enable" && a && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
enable: a,
groupFields: [],
showSummary: !1
});
},
convertFrom: (e, i, a) => {
if (e.group) {
if (i === "enable")
return e.group.enable;
if (i === "showSummary")
return e.group.showSummary;
}
}
}, gt = {
convertFrom: (e, i) => e.binding ? e.binding.path : "",
convertTo: (e, i, a) => {
if (a && a.length > 0) {
const t = a[0];
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = t.bindingField, e.binding.field = t.id, e.binding.fullPath = t.path, e.path = t.bindingPath;
}
}
}, yt = {
convertTo: (e, i, a, t) => {
e.pagination || (e.pagination = {}), e.pagination[i] = a;
},
convertFrom: (e, i, a) => e.pagination ? e.pagination[i] : e[i]
}, Ct = {
convertTo: (e, i, a, t) => {
e.rowNumber || (e.rowNumber = {}), e.rowNumber[i] = a;
},
convertFrom: (e, i, a) => e.rowNumber ? e.rowNumber[i] : e[i]
}, Et = {
convertTo: (e, i, a, t) => {
e.selection || (e.selection = {}), e.selection[i] = a;
},
convertFrom: (e, i, a) => e.selection ? e.selection[i] : e[i]
}, Ft = {
convertFrom: (e, i, a) => e[i] && e[i].length ? `共 ${e[i].length} 项` : ""
}, At = {
convertFrom: (e, i) => e[i] || "",
convertTo: (e, i, a) => {
e[i] = a;
}
}, Dt = {
convertTo: (e, i, a, t) => {
e.size || (e.size = {}), e.size[i] = a;
},
convertFrom: (e, i, a) => e.size ? e.size[i] : e[i]
}, bt = {
convertFrom: (e, i, a) => {
var t, h;
return (t = e.formatter) != null && t.data && i === "formatterEnumData" && !e.formatterEnumData ? (h = e.formatter) == null ? void 0 : h.data : e.formatterEnumData;
}
}, wt = {
convertTo: (e, i, a, t) => {
e.sort || (e.sort = {}), e.sort[i] = a;
},
convertFrom: (e, i, a) => {
var t, h;
if (i === "mode")
return ((t = e.sort) == null ? void 0 : t.mode) || "client";
if (i === "multiSort")
return !!((h = e.sort) != null && h.multiSort);
}
}, _t = {
convertTo: (e, i, a, t) => {
e.filter || (e.filter = {}), e.filter[i] = a;
},
convertFrom: (e, i, a) => {
var t;
if (i === "mode")
return ((t = e.filter) == null ? void 0 : t.mode) || "client";
}
}, kt = {
convertTo: (e, i, a, t) => {
e.rowOption ? e.rowOption[i] = a : e.rowOption = {
[i]: a
};
},
convertFrom: (e, i, a) => {
if (e.rowOption) {
if (i === "customRowStyle")
return e.rowOption.customRowStyle;
if (i === "customCellStyle")
return e.rowOption.customCellStyle;
}
return "";
}
};
function Ar(e, i, a) {
const t = /* @__PURE__ */ new Map([
["/converter/appearance.converter", xt],
["/converter/buttons.converter", ut],
["/converter/property-editor.converter", ft],
["/converter/items-count.converter", Ft],
["/converter/type.converter", lt],
["/converter/change-editor.converter", dt],
["/converter/change-formatter.converter", vt],
["/converter/column-command.converter", ht],
["/converter/column-option.converter", pt],
["/converter/summary.converter", mt],
["/converter/group.converter", Bt],
["/converter/form-group-label.converter", At],
["/converter/field-selector.converter", gt],
["/converter/pagination.converter", yt],
["/converter/row-number.converter", Ct],
["/converter/grid-selection.converter", Et],
["/converter/size.converter", Dt],
["/converter/change-formatter-enum.converter", bt],
["/converter/grid-sort.converter", wt],
["/converter/grid-filter.converter", _t],
["/converter/row-option.converter", kt]
]), h = /* @__PURE__ */ new Map([
["string", { type: "input-group", enableClear: !1 }],
["boolean", {
type: "combo-list",
textField: "name",
valueField: "value",
idField: "value",
enableClear: !1,
editable: !1,
data: [
{
value: !0,
name: "是"
},
{
value: !1,
name: "否"
}
]
}],
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
["array", { type: "button-edit" }],
["number", { type: "number-spinner", placeholder: "" }],
["events-editor", { type: "events-editor", hide: !0 }]
]), g = ct();
function F(c, u) {
return () => g.parseValueSchema(c, u);
}
function B(c, u, x) {
return c.includes("visible") && u.visible !== void 0 ? typeof u.visible == "boolean" ? () => !!u.visible : u.visible === void 0 ? !0 : F(u.visible, x) : () => !0;
}
function m(c, u, x) {
return c.includes("readonly") && u.readonly !== void 0 ? typeof u.readonly == "boolean" ? () => !!u.readonly : F(u.readonly, x) : () => !1;
}
function r(c, u) {
const x = c.$converter || u;
return typeof x == "string" && x && t.has(x) ? t.get(x) || null : x || null;
}
function o(c, u, x, v, s, d = "", p = "") {
return Object.keys(c).map((C) => {
const A = G(1), _ = C, k = c[C], y = Object.keys(k), b = k.title, D = k.type, w = h.get(D) || { type: "input-group", enableClear: !1 }, z = k.editor ? Object.assign({}, w, k.editor) : Object.assign({}, w), W = B(y, k, u), O = m(y, k, u);
z.readonly = z.readonly === void 0 ? O() : z.readonly;
const $ = k.type === "cascade" ? o(k.properties, u, x, v, s, d, p) : [], N = !0;
let q = r(k, p);
const M = X({
get() {
if (A.value) {
if (["class", "style"].find((Q) => Q === _) && !q && (q = t.get("/converter/appearance.converter") || null), q && q.convertFrom)
return q.convertFrom(x, C, s, d);
const I = x[C];
return Object.prototype.hasOwnProperty.call(k, "defaultValue") && (I === void 0 || typeof I == "string" && I === "") ? k.type === "boolean" ? k.defaultValue : k.defaultValue || "" : I;
}
return null;
},
set(I) {
A.value += 1, q && q.convertTo ? (q.convertTo(v, C, I, s, d), q.convertTo(x, C, I, s, d)) : (v[C] = I, x[C] = I);
}
}), { refreshPanelAfterChanged: S, description: H, isExpand: R, parentPropertyID: T } = k, Z = { propertyID: _, propertyName: b, propertyType: D, propertyValue: M, editor: z, visible: W, readonly: O, cascadeConfig: $, hideCascadeTitle: N, refreshPanelAfterChanged: S, description: H, isExpand: R, parentPropertyID: T };
return u[_] = Z, Z;
});
}
function f(c, u, x = {}) {
const v = {}, s = e[c];
return s && s.categories ? Object.keys(s.categories).map((p) => {
const E = s.categories[p], C = E == null ? void 0 : E.title, A = o(E.properties || {}, v, {}, x, u);
return { categoryId: p, categoryName: C, properties: A };
}) : [];
}
function n(c, u, x, v, s = "") {
const d = u.$ref.schema, p = u.$ref.converter, E = x[d], C = E.type, A = a(E), _ = {}, k = e[C];
if (k && k.categories) {
const y = k.categories[c], b = y == null ? void 0 : y.title;
p && Object.keys(y.properties).forEach((z) => {
y.properties[z].$converter = p;
});
const D = (y == null ? void 0 : y.properties) || {}, w = o(D, _, A, E, v, s);
return { categoryId: c, categoryName: b, properties: w };
}
return { categoryId: c, categoryName: "", properties: [] };
}
function l(c, u, x, v, s) {
const d = c.type, p = a(c), E = {};
let C = s || e[d];
if (C && Object.keys(C).length === 0 && x && x.getPropConfig && (C = x.getPropConfig(v)), C && C.categories) {
const A = [];
return Object.keys(C.categories).map((_) => {
const k = C.categories[_];
if (k.$ref) {
A.push(n(_, k, c, u, v));
return;
}
const y = k == null ? void 0 : k.title, b = k == null ? void 0 : k.tabId, D = k == null ? void 0 : k.tabName, w = k == null ? void 0 : k.hide, z = k == null ? void 0 : k.hideTitle, W = o(k.properties || {}, E, p, c, u, v, k.$converter), { setPropertyRelates: O } = k, $ = k == null ? void 0 : k.parentPropertyID;
A.push({ categoryId: _, categoryName: y, tabId: b, tabName: D, hide: w, properties: W, hideTitle: z, setPropertyRelates: O, parentPropertyID: $ });
}), A;
}
return [];
}
return {
getPropertyConfigBySchema: l,
getPropertyConfigByType: f,
propertyConverterMap: t
};
}
const Dr = {}, br = {};
Ar(Dr, br, ot);
const wr = {}, _r = {}, { getSchemaByType: Ea, resolveSchemaWithDefaultValue: St, resolveSchemaToProps: Fa, mappingSchemaToProps: Aa, setDesignerContext: Da } = yr(wr, _r), kr = {}, Sr = {};
Ar(kr, Sr, St);
function Pr(e, i, a = /* @__PURE__ */ new Map(), t = (F, B, m, r) => B, h = {}, g = (F) => F) {
return Cr[i.title] = i, Er[i.title] = t, Dr[i.title] = h, br[i.title] = g, wr[i.title] = i, _r[i.title] = t, kr[i.title] = h, Sr[i.title] = g, (F = {}, B = !0) => {
if (!B)
return st(F, a);
const m = it(F, i, a), r = Object.keys(e).reduce((o, f) => (o[f] = e[f].default, o), {});
return Object.assign(r, m);
};
}
function Tr(e, i) {
return { customClass: i.class, customStyle: i.style };
}
const Pt = /* @__PURE__ */ new Map([
["appearance", Tr]
]);
function Tt(e, i, a) {
return i;
}
const Ht = "https://json-schema.org/draft/2020-12/schema", Rt = "https://farris-design.gitee.io/weather.schema.json", zt = "weather", Wt = "A Farris Input Component", Ot = "object", qt = {
id: {
description: "The unique identifier for a weather",
type: "string"
},
type: {
description: "The type string of weather component",
type: "string",
default: "weather"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
}
}, $t = [
"id",
"type"
], jt = {
$schema: Ht,
$id: Rt,
title: zt,
description: Wt,
type: Ot,
properties: qt,
required: $t
}, Nt = "weather", Mt = "A Farris Component", Lt = "object", It = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, Gt = {
title: Nt,
description: Mt,
type: Lt,
categories: It
}, Ut = {
/** 城市列表 */
cityItems: {
type: Array,
default: [
{ province: "北京", city: ["北京"] },
{ province: "山东", city: ["济南", "青岛"] },
{ province: "黑龙江", city: ["牡丹江", "齐齐哈尔"] }
]
},
/** 主题列表 */
themeItems: {
type: Array,
default: [
{ title: "school", adviceItems: ["clothes", "sports", "sunscreen"] },
{ title: "office", adviceItems: ["clothes", "traffic", "umbrella"] },
{ title: "construction", adviceItems: ["clothes", "chill", "heatstroke"] },
{ title: "tourism", adviceItems: ["clothes", "sunscreen", "tourism"] }
]
},
/** 天气数据 */
data: {
type: Object,
default: {
// 日出时间
sunriseTime: G(/* @__PURE__ */ new Date()),
// 日落时间
sunsetTime: G(/* @__PURE__ */ new Date()),
// 温度
temperature: G(0),
// 最高温
max: G(0),
// 最低温
min: G(0),
// 天气现象
weather: G("阴"),
// 空气质量
air: G(0),
// 建议
adviceItems: [
{ key: "clothes", value: { name: "穿衣", info: "毛衣", detail: "建议穿长袖毛衣等服装。" } },
{ key: "sports", value: { name: "运动", info: "适宜", detail: "各项气象条件都很好,很适合户外运动。" } },
{ key: "sunscreen", value: { name: "防晒", info: "强", detail: "建议涂抹SPF在15-20之间,PA++的防晒护肤品。" } },
{ key: "traffic", value: { name: "交通", info: "良好", detail: "天气较好,路面干燥,交通气象条件良好,车辆可以正常行驶。" } },
{ key: "umbrella", value: { name: "雨伞", info: "不带伞", detail: "天气较好,您在出门的时候无须带雨伞。" } },
{ key: "chill", value: { name: "风寒", info: "无", detail: "温度未达到风寒所需的低温,稍作防寒准备即可。" } },
{ key: "heatstroke", value: { name: "中暑", info: "无中暑风险", detail: "天气不热,在炎炎夏日中十分难得,可以告别暑气漫漫啦~" } },
{ key: "tourism", value: { name: "旅游", info: "适宜", detail: "天气较好,温度适宜,是个好天气哦。这样的天气适宜旅游,您可以尽情地享受大自然的风光。" } }
],
// 专业参数
proindexItemsSet: [[
{ title: "紫外线", icon: "UV", value: "中等", info: "16:00前注意防晒", explain: "紫外线指数(UVI)测量紫外线辐射。UVI越高,潜在伤害就越大,造成伤害的速度也越快。" },
{ title: "降水量", icon: "rainfall", value: "0mm", info: "过去24小时", explain: "降水量,是指12或24小时内降雨(雪)量的总和。" }
], [
{ title: "湿度", icon: "humidity", value: "31%", info: "露点温度为4°", explain: "空气中含水量与空气可容纳水量的比值。气温越高,空气可容纳的水量就越多。湿度高意味着可能结露或起雾。" },
{ title: "体感温度", icon: "apparentTemp", value: "14°", info: "风较大,体感更凉", explain: "体感温度传达身体感觉有多暖或多冷,可能与实际温度不同。体感温度受湿度和风影响。" }
], [
{ title: "气压", icon: "pressure", value: "1010mpa", info: "当前气压较稳定", explain: "气压的显著急剧变化用于预测天气变化。例如,气压降低表示雨雪即将来临,升高则表示天气将好转。" },
{ title: "能见度", icon: "visibility", value: "19km", info: "目前非常好", explain: "能见度会告诉你可以清晰地看到多远以外的物体。能见度测量大气透明度,不考虑光照强度或障碍物。" }
]],
// 每小时天气
dayItemsSet: [
[
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 16 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 22 },
{ icon: "sunny", temp: 24 },
{ icon: "cloudy", temp: 23 },
{ icon: "cloudy", temp: 20 },
{ icon: "cloudy", temp: 19 },
{ icon: "cloudy", temp: 19 },
{ icon: "cloudy", temp: 18 },
{ icon: "rainy1", temp: 18 },
{ icon: "rainy1", temp: 17 },
{ icon: "rainy1", temp: 15 },
{ icon: "rainy1", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 18 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 }
],
[
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 18 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 },
{ icon: "rainy2", temp: 21 },
{ icon: "rainy2", temp: 21 },
{ icon: "rainy2", temp: 21 },
{ icon: "sunny", temp: 21 },
{ icon: "sunny", temp: 22 },
{ icon: "sunny", temp: 24 },
{ icon: "sunny", temp: 24 },
{ icon: "sunny", temp: 23 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 }
]
// [
// { icon: "foggy", temp: 11 },
// { icon: "foggy", temp: 12 },
// { icon: "foggy", temp: 14 },
// { icon: "foggy", temp: 15 },
// { icon: "foggy", temp: 17 },
// { icon: "foggy", temp: 18 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 20 },
// { icon: "foggy", temp: 20 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "sunny", temp: 22 },
// { icon: "sunny", temp: 26 },
// { icon: "sunny", temp: 26 },
// { icon: "sunny", temp: 25 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 15 },
// { icon: "foggy", temp: 15 },
// ],[
// { icon: "cloudy", temp: 7 },
// { icon: "cloudy", temp: 8 },
// { icon: "cloudy", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 14 },
// { icon: "cloudy", temp: 18 },
// { icon: "cloudy", temp: 19 },
// { icon: "cloudy", temp: 19 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 22 },
// { icon: "cloudy", temp: 22 },
// { icon: "sunny", temp: 21 },
// { icon: "sunny", temp: 21 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// ],[
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 5 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 8 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 5 },
// ],[
// { icon: "sunny", temp: 5 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 16 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 18 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 16 },
// { icon: "sunny", temp: 10 },
// ],[
// { icon: "snowy2", temp: 4 },
// { icon: "snowy2", temp: 4 },
// { icon: "snowy2", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// ]
],
// 每日天气
weekItems: [
{ icon: "rainy1", max: 24, min: 15 },
{ icon: "rainy2", max: 24, min: 15 },
{ icon: "foggy", max: 26, min: 11 },
{ icon: "cloudy", max: 22, min: 7 },
{ icon: "snowy1", max: 10, min: 3 },
{ icon: "sunny", max: 19, min: 5 },
{ icon: "snowy2", max: 10, min: 4 }
]
}
}
}, pe = {
/** 默认数据 */
data: { type: Object, default: Ut },
/** 主题参数 */
theme: { type: Number, default: 1 }
}, Re = Pr(pe, jt, Pt, Tt, Gt);
function Hr(e, i) {
function a(t) {
return t < 10 ? "0" + t : t;
}
return {
addZero: a
};
}
function _0(e, i) {
const a = G(e.data.data);
return {
colorTheme: X(() => (/* @__PURE__ */ new Date()).getTime() - a.value.default.sunriseTime.getTime() < 0 || a.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 0 ? ["#151276", "#7939e0", "#332396", "#814ca7"] : (/* @__PURE__ */ new Date()).getTime() - a.value.default.sunriseTime.getTime() < 36e5 ? ["#49417b", "#f1b655", "#b1785b", "#d99877"] : a.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 36e5 ? ["#9e2e2e", "#f59b0b", "#c15334", "#ff7361"] : ["#0273D7", "#76BAFF", "#388FFF", "#75C6FE"])
};
}
function me(e, i) {
const a = G(e.data.data), t = _0(e);
function h() {
let r = f0.getInstanceByDom(document.getElementById("sunset"));
r || (r = f0.init(document.getElementById("sunset"), null, {
height: 170,
width: 380
})), r.setOption({
series: [{
data: [{
value: (/* @__PURE__ */ new Date()).getTime() - a.value.default.sunriseTime.getTime(),
itemStyle: {
borderRadius: 10,
color: {
type: "linear",
x: 1,
y: 0,
x2: 0,
y2: 0,
colorStops: [{
offset: 1,
color: t.colorTheme.value ? t.colorTheme.value[3] : "white"
}, {
offset: 0,
color: "white"
}]
}
}
}, {
value: a.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime(),
itemStyle: {
opacity: 0
}
}],
type: "pie",
center: ["50%", "100%"],
radius: ["200%", "190%"],
startAngle: 180,
endAngle: 360,
label: {
show: !1
},
emphasis: {
scale: !1
},
// 占位圆
emptyCircleStyle: {
borderType: "dashed"
}
}, {
type: "gauge",
center: ["50%", "100%"],
radius: "220%",
startAngle: 180,
endAngle: 360,
// x轴刻度
axisTick: {
show: !1
},
// x轴标签
axisLabel: {
show: !1
},
axisLine: {
show: !1
},
// 切分短线份数
splitNumber: 20,
// 单条短线
splitLine: {
length: 3,
lineStyle: {
width: 10,
color: "white"
}
}
}]
});
}
function g(r) {
let o = f0.getInstanceByDom(document.getElementById("chart24h"));
o || (o = f0.init(document.getElementById("chart24h"), null, {
width: 1885,
height: 75
})), o.setOption({
xAxis: {
type: "category",
show: !1
},
yAxis: {
type: "value",
show: !1
},
series: [{
data: a.value.default.dayItemsSet[r].map((f) => f.temp),
type: "line",
itemStyle: {
color: "white"
}
}]
});
}
function F() {
const r = document.getElementById("background");
if (r) {
const o = r.getBoundingClientRect().width, f = Math.max(o, 400) * 1.11;
let n = f0.getInstanceByDom(document.getElementById("chart7d"));
n ? n.resize({
width: f,
height: 90
}) : n = f0.init(document.getElementById("chart7d"), null, {
width: f,
height: 90
}), n.setOption({
grid: {
left: 0
},
xAxis: {
type: "category",
show: !1
},
yAxis: {
type: "value",
show: !1
},
series: [{
data: a.value.default.weekItems.map((l) => l.min),
type: "line",
itemStyle: {
color: "#5C90F9"
}
}, {
data: a.value.default.weekItems.map((l) => l.max),
type: "line",
itemStyle: {
color: "#FC9657"
}
}]
});
}
}
function B() {
const r = document.getElementById("airPoint"), o = document.getElementById("background");
r && o && (r.style.marginLeft = a.value.default.air / 500 * (o.getBoundingClientRect().width - 50) - 5 + "px");
}
function m(r) {
h(), g(r), F(), B();
}
return {
renderChart24h: g,
renderChart7d: F,
renderCharts: m
};
}
function Xt(e, i) {
const a = G(), t = G(e.data.data), h = G(0), g = Hr(), F = me(e);
function B(x) {
h.value = x;
}
function m(x) {
switch (x) {
case 0:
return "今天";
case 1:
return "明天";
default:
const v = new Date((/* @__PURE__ */ new Date()).getTime() + 24 * 60 * 60 * 1e3 * x).getDay(), s = "周";
switch (v) {
case 0:
return s + "日";
case 1:
return s + "一";
case 2:
return s + "二";
case 3:
return s + "三";
case 4:
return s + "四";
case 5:
return s + "五";
case 6:
return s + "六";
}
break;
}
}
function r(x) {
const v = new Date((/* @__PURE__ */ new Date()).getTime() + 864e5 * x);
return g.addZero(v.getMonth() + 1) + "/" + g.addZero(v.getDate());
}
function o() {
const v = a.value.getBoundingClientRect().width - 120, s = document.getElementById("f-weather-24h-content");
s && (s.offsetLeft + v > -32 ? s.style.marginLeft = "-32px" : s.style.marginLeft = s.offsetLeft + v + "px");
}
function f() {
const x = a.value.getBoundingClientRect().width, v = x - 120, s = document.getElementById("f-weather-24h-content");
if (s) {
const d = s.scrollWidth - x - 130;
s.offsetLeft - v < -d ? s.style.marginLeft = "-" + d + "px" : s.style.marginLeft = s.offsetLeft - v + "px";
}
}
function n(x, v) {
if (x === 0) {
const s = /* @__PURE__ */ new Date();
return v === 0 ? "现在" : g.addZero((s.getHours() + v) % 24);
} else
return g.addZero(v);
}
Br(h, () => {
const x = document.getElementById("f-weather-24h-content");
x.style.marginLeft = "-32px", F.renderChart24h(h.value);
});
function l() {
return P("div", {
class: "f-weather-24h-container"
}, [P("div", {
class: "f-weather-24h-title"
}, [t0("24小时天气预报")]), P("div", {
class: "f-weather-lrbutton-container"
}, [P("img", {
src: "/components/weather/src/image/arrow-left.png",
class: "f-weather-lrbutton-l",
onClick: o
}, null), P("img", {
src: "/components/weather/src/image/arrow-right.png",
class: "f-weather-lrbutton-r",
onClick: f
}, null)]), P("div", {
class: "f-weather-24h-content-scroll"
}, [P("div", {
id: "f-weather-24h-content"
}, [t.value.default.dayItemsSet.map((x, v) => v === h.value ? P("div", null, [P("tr", {
id: "report" + v,
class: "f-weather-24h-tr"
}, [x.map((s, d) => P("td", {
class: "f-weather-24h-td"
}, [P("div", null, [n(v, d)]), P("img", {
src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + s.icon + ".png",
class: "f-weather-24h-img"
}, null), P("div", null, [s.temp + "°"])]))])]) : ""), P("div", {
id: "chart24h",
class: "f-weather-chart24h"
}, null)])])]);
}
function c() {
return P("div", {
class: "f-weather-7d-container"
}, [P("div", {
class: "f-weather-7d-title"
}, [t0("七日天气预报")]), P("tr", {
class: "f-weather-7d-tr"
}, [t.value.default.weekItems.map((x, v) => P("td", {
id: "day" + v,
class: "f-weather-7d-td",
style: "background-color: " + (v === h.value ? "rgba(0, 0, 0, 0.05)" : "none"),
onClick: () => B(v)
}, [P("div", {
class: "f-weather-7d-td-title"
}, [m(v)]), P("div", {
class: "f-weather-7d-td-date"
}, [r(v)]), P("img", {
src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + x.icon + ".png",
class: "f-weather-7d-td-img"
}, null), P("div", {
class: "f-weather-7d-td-margin"
}, [x.max + "°"]), P("div", null, [x.min + "°"])]))]), P("div", {
id: "chart7d",
class: "f-weather-chart7d"
}, null)]);
}
function u() {
return P("div", {
ref: a
}, [l(), c()]);
}
return {
renderWeatherReport: u
};
}
function Zt(e, i) {
const a = G(e.data.data);
function t() {
return P("div", null, [a.value.default.proindexItemsSet.map((h) => P("tr", {
class: "f-weather-proindex-tr"
}, [h.map((g) => P("td", {
class: "f-weather-proindex-td"
}, [P("div", {
class: "f-weather-proindex-content-scroll"
}, [P("div", {
class: "f-weather-proindex-content"
}, [P("img", {
src: "/components/weather/src/image/proindexImage/" + g.icon + ".png",
class: "f-weather-proindex-icon"
}, null), P("div", {
class: "f-weather-proindex-text"
}, [P("div", {
class: "f-weather-proindex-title"
}, [g.title]), P("div", {
class: "f-weather-proindex-value"
}, [g.value])]), P("div", {
class: "f-weather-proindex-line"
}, null), P("br", null, null), P("div", {
class: "f-weather-proindex-info"
}, [g.info]), P("br", null, null), P("div", null, [g.explain])])])]))]))]);
}
return {
renderWeatherProindex: t
};
}
function Yt(e, i) {
const a = G(!0), t = _0(e), {
renderWeatherReport: h
} = Xt(e), {
renderWeatherProindex: g
} = Zt(e), F = X(() => ({
"background-color": a.value ? t.colorTheme.value[2] : "",
color: a.value ? "white" : ""
})), B = X(() => ({
"background-color": a.value ? "" : t.colorTheme.value[2],
color: a.value ? "" : "white"
})), m = X(() => ({
display: a.value ? "block" : "none"
})), r = X(() => ({
display: a.value ? "none" : "block"
}));
function o() {
a.value = !0;
}
function f() {
a.value = !1;
}
function n() {
return P("div", {
class: "f-weather-container f-weather-detail"
}, [P("div", {
style: "display:flex"
}, [P("button", {
class: "f-weather-button f-weather-button-report",
style: F.value,
onClick: o
}, [t0("天气预报")]), P("button", {
class: "f-weather-button f-weather-button-proindex",
style: B.value,
onClick: f
}, [t0("其它参数")])]), P("div", {
style: m.value
}, [h()]), P("div", {
style: r.value
}, [g()])]);
}
return {
renderWeatherDetail: n
};
}
var j = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Rr(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function Qt(e) {
if (e.__esModule) return e;
var i = e.default;
if (typeof i == "function") {
var a = function t() {
return this instanceof t ? Reflect.construct(i, arguments, this.constructor) : i.apply(this, arguments);
};
a.prototype = i.prototype;
} else a = {};
return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(e).forEach(function(t) {
var h = Object.getOwnPropertyDescriptor(e, t);
Object.defineProperty(a, t, h.get ? h : {
enumerable: !0,
get: function() {
return e[t];
}
});
}), a;
}
var de = { exports: {} }, ve = { exports: {} }, g0 = 1e3, y0 = g0 * 60, C0 = y0 * 60, E0 = C0 * 24, Vt = E0 * 365.25, Jt = function(e, i) {
i = i || {};
var a = typeof e;
if (a === "string" && e.length > 0)
return Kt(e);
if (a === "number" && isNaN(e) === !1)
return i.long ? rn(e) : en(e);
throw new Error(
"val is not a non-empty string or a valid number. val=" + JSON.stringify(e)
);
};
function Kt(e) {
if (e = String(e), !(e.length > 100)) {
var i = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
e
);
if (i) {
var a = parseFloat(i[1]), t = (i[2] || "ms").toLowerCase();
switch (t) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return a * Vt;
case "days":
case "day":
case "d":
return a * E0;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return a * C0;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return a * y0;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return a * g0;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return a;
default:
return;
}
}
}
}
function en(e) {
return e >= E0 ? Math.round(e / E0) + "d" : e >= C0 ? Math.round(e / C0) + "h" : e >= y0 ? Math.round(e / y0) + "m" : e >= g0 ? Math.round(e / g0) + "s" : e + "ms";
}
function rn(e) {
return b0(e, E0, "day") || b0(e, C0, "hour") || b0(e, y0, "minute") || b0(e, g0, "second") || e + " ms";
}
function b0(e, i, a) {
if (!(e < i))
return e < i * 1.5 ? Math.floor(e / i) + " " + a : Math.ceil(e / i) + " " + a + "s";
}
(function(e, i) {
i = e.exports = h.debug = h.default = h, i.coerce = m, i.disable = F, i.enable = g, i.enabled = B, i.humanize = Jt, i.names = [], i.skips = [], i.formatters = {};
var a;
function t(r) {
var o = 0, f;
for (f in r)
o = (o << 5) - o + r.charCodeAt(f), o |= 0;
return i.colors[Math.abs(o) % i.colors.length];
}
function h(r) {
function o() {
if (o.enabled) {
var f = o, n = +/* @__PURE__ */ new Date(), l = n - (a || n);
f.diff = l, f.prev = a, f.curr = n, a = n;
for (var c = new Array(arguments.length), u = 0; u < c.length; u++)
c[u] = arguments[u];
c[0] = i.coerce(c[0]), typeof c[0] != "string" && c.unshift("%O");
var x = 0;
c[0] = c[0].replace(/%([a-zA-Z%])/g, function(s, d) {
if (s === "%%") return s;
x++;
var p = i.formatters[d];
if (typeof p == "function") {
var E = c[x];
s = p.call(f, E), c.splice(x, 1), x--;
}
return s;
}), i.formatArgs.call(f, c);
var v = o.log || i.log || console.log.bind(console);
v.apply(f, c);
}
}
return o.namespace = r, o.enabled = i.enabled(r), o.useColors = i.useColors(), o.color = t(r), typeof i.init == "function" && i.init(o), o;
}
function g(r) {
i.save(r), i.names = [], i.skips = [];
for (var o = (typeof r == "string" ? r : "").split(/[\s,]+/), f = o.length, n = 0; n < f; n++)
o[n] && (r = o[n].replace(/\*/g, ".*?"), r[0] === "-" ? i.skips.push(new RegExp("^" + r.substr(1) + "$")) : i.names.push(new RegExp("^" + r + "$")));
}
function F() {
i.enable("");
}
function B(r) {
var o, f;
for (o = 0, f = i.skips.length; o < f; o++)
if (i.skips[o].test(r))
return !1;
for (o = 0, f = i.names.length; o < f; o++)
if (i.names[o].test(r))
return !0;
return !1;
}
function m(r) {
return r instanceof Error ? r.stack || r.message : r;
}
})(ve, ve.exports);
var tn = ve.exports;
(function(e, i) {
i = e.exports = tn, i.log = h, i.formatArgs = t, i.save = g, i.load = F, i.useColors = a, i.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : B(), i.colors = [
"lightseagreen",
"forestgreen",
"goldenrod",
"dodgerblue",
"darkorchid",
"crimson"
];
function a() {
return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
i.formatters.j = function(m) {
try {
return JSON.stringify(m);
} catch (r) {
return "[UnexpectedJSONParseError]: " + r.message;
}
};
function t(m) {
var r = this.useColors;
if (m[0] = (r ? "%c" : "") + this.namespace + (r ? " %c" : " ") + m[0] + (r ? "%c " : " ") + "+" + i.humanize(this.diff), !!r) {
var o = "color: " + this.color;
m.splice(1, 0, o, "color: inherit");
var f = 0, n = 0;
m[0].replace(/%[a-zA-Z%]/g, function(l) {
l !== "%%" && (f++, l === "%c" && (n = f));
}), m.splice(n, 0, o);
}
}
function h() {
return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments);
}
function g(m) {
try {
m == null ? i.storage.removeItem("debug") : i.storage.debug = m;
} catch {
}
}
function F() {
var m;
try {
m = i.storage.debug;
} catch {
}
return !m && typeof process < "u" && "env" in process && (m = process.env.DEBUG), m;
}
i.enable(F());
function B() {
try {
return window.localStorage;
} catch {
}
}
})(de, de.exports);
var nn = de.exports, ze = nn("jsonp"), an = cn, on = 0;
function sn() {
}
function cn(e, i, a) {
typeof i == "function" && (a = i, i = {}), i || (i = {});
var t = i.prefix || "__jp", h = i.name || t + on++, g =