UNPKG

dm-vue3-ui

Version:

This Components Library will help get you started developing in Vue 3.

1,500 lines 1.85 MB
import * as vue from "vue"; import { useSlots, reactive, computed, defineComponent, ref, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withKeys, withModifiers, withCtx, createElementBlock, createElementVNode, createCommentVNode, renderSlot, unref, nextTick, Fragment, isVNode as isVNode$1, Comment, Text, getCurrentInstance, onMounted, onUpdated, onUnmounted, watch, inject, createVNode, provide, Transition, Teleport, TransitionGroup, render, h as h$1, watchEffect, withDirectives, resolveDirective, onBeforeUnmount, cloneVNode, toRef, vShow, onBeforeMount, createTextVNode, isRef, toRefs, shallowRef, toRaw, useAttrs, onBeforeUpdate, getCurrentScope, onScopeDispose, camelize as camelize$1, effectScope, renderList, toDisplayString as toDisplayString$1, useCssVars, normalizeStyle, mergeProps, createSlots } from "vue"; import dayjs from "dayjs"; import { DownOutlined as DownOutlined$3, ClockCircleOutlined as ClockCircleOutlined$3, CloseCircleOutlined as CloseCircleOutlined$3, SearchOutlined as SearchOutlined$3, DeleteOutlined, LeftOutlined, CloseCircleFilled as CloseCircleFilled$3 } from "@ant-design/icons-vue"; import { useVModel } from "@vueuse/core"; const SEARCH_TEMPLATE_KEY = "di-alert-search-template"; const addTemplate = (moduleKey, value2) => { const templateInfo = store(SEARCH_TEMPLATE_KEY) && JSON.parse(store(SEARCH_TEMPLATE_KEY)) || {}; const currentModuleInfo = templateInfo[moduleKey] || []; const index2 = currentModuleInfo.findIndex((v2) => v2.name === value2.name); index2 === -1 || currentModuleInfo.splice(index2, 1); currentModuleInfo.push(value2); templateInfo[moduleKey] = currentModuleInfo; store(SEARCH_TEMPLATE_KEY, JSON.stringify(templateInfo)); }; const getTemplatesByModuleKey = (moduleKey) => { const templateInfo = store(SEARCH_TEMPLATE_KEY) && JSON.parse(store(SEARCH_TEMPLATE_KEY)) || {}; const currentModuleTemplates = templateInfo[moduleKey] || []; return currentModuleTemplates; }; const deleteTemplate1 = (moduleKey, templateName) => { const templateInfo = store(SEARCH_TEMPLATE_KEY) && JSON.parse(store(SEARCH_TEMPLATE_KEY)) || {}; const currentModuleInfo = templateInfo[moduleKey] || []; const index2 = currentModuleInfo.findIndex((v2) => v2.name === templateName); index2 === -1 || currentModuleInfo.splice(index2, 1); templateInfo[moduleKey] = currentModuleInfo; store(SEARCH_TEMPLATE_KEY, JSON.stringify(templateInfo)); }; const validateRangeDateValue = (value2) => { if (Array.isArray(value2) && value2.length === 2) { return value2.every((v2) => v2 && dayjs(v2).isValid()); } else { return false; } }; function store(key2, value2) { function _parse(a2) { try { return JSON.parse(a2); } catch (b2) { return a2; } } if (typeof window !== "undefined" && (window == null ? void 0 : window.localStorage)) { try { if (void 0 === value2) { value2 = localStorage.getItem(key2); return value2 && _parse(value2); } else { localStorage.setItem(key2, JSON.stringify(value2)); } } catch (e2) { console.log("not support localstorage"); } } } function useSlotsExist(slotsName = "default") { const slots = useSlots(); const checkSlotsExist = (slotsName2) => { var _a; const slotsContent = (_a = slots[slotsName2]) == null ? void 0 : _a.call(slots); const checkExist = (slotContent) => { if (typeof slotContent.children === "string") { if (slotContent.children === "v-if") { return false; } return slotContent.children.trim() !== ""; } else { if (slotContent.children === null) { if (slotContent.type === "img" || typeof slotContent.type !== "string") { return true; } } else { return Boolean(slotContent.children); } } }; if (slotsContent && (slotsContent == null ? void 0 : slotsContent.length)) { const result = slotsContent.some((slotContent) => { return checkExist(slotContent); }); return result; } return false; }; if (Array.isArray(slotsName)) { const slotsExist = reactive({}); slotsName.forEach((item) => { const exist = computed(() => checkSlotsExist(item)); slotsExist[item] = exist; }); return slotsExist; } else { return computed(() => checkSlotsExist(slotsName)); } } const _hoisted_1$j = { key: 0, class: "btn-loading" }; const _hoisted_2$e = { key: 0, class: "m-static-circle" }; const _hoisted_3$a = { key: 1, class: "m-dynamic-circle" }; const _hoisted_4$9 = { key: 1, class: "btn-icon" }; const _hoisted_5$6 = { key: 2, class: "btn-content" }; const _sfc_main$n = /* @__PURE__ */ defineComponent({ ...{ name: "dm-button" }, __name: "index", props: { type: { default: "default" }, shape: { default: "default" }, icon: { default: void 0 }, size: { default: "middle" }, ghost: { type: Boolean, default: false }, customClass: { default: void 0 }, href: { default: void 0 }, target: { default: "_self" }, keyboard: { type: Boolean, default: true }, disabled: { type: Boolean, default: false }, loading: { type: Boolean, default: false }, loadingType: { default: "dynamic" }, block: { type: Boolean, default: false } }, emits: ["click"], setup(__props, { emit: __emit2 }) { const props3 = __props; const wave = ref(false); const emit = __emit2; const slotsExist = useSlotsExist(["icon", "default"]); const showIcon = computed(() => { return slotsExist.icon || props3.icon; }); const showIconOnly = computed(() => { return showIcon.value && !slotsExist.default; }); function onClick2(e2) { if (wave.value) { wave.value = false; nextTick(() => { wave.value = true; }); } else { wave.value = true; } emit("click", e2); } function onKeyboard(e2) { onClick2(e2); } function onWaveEnd() { wave.value = false; } return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(_ctx.href ? "a" : "div"), { tabindex: "0", class: normalizeClass(["dm-button", [ `btn-${_ctx.type} btn-${_ctx.size}`, { [`loading-${_ctx.size}`]: !_ctx.href && _ctx.loading, "btn-icon-only": showIconOnly.value, "btn-circle": _ctx.shape === "circle", "btn-round": _ctx.shape === "round", "btn-loading-blur": !_ctx.href && _ctx.loading, "btn-ghost": _ctx.ghost, "btn-block": _ctx.block, "btn-disabled": _ctx.disabled }, _ctx.customClass ]]), href: _ctx.href, target: _ctx.target, onClick: _cache[0] || (_cache[0] = ($event) => _ctx.disabled || _ctx.loading ? () => false : onClick2($event)), onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => _ctx.keyboard && !_ctx.disabled && !_ctx.loading ? onKeyboard($event) : () => false, ["prevent"]), ["enter"])) }, { default: withCtx(() => [ _ctx.loading || !showIcon.value ? (openBlock(), createElementBlock("div", _hoisted_1$j, [ !_ctx.href && _ctx.loadingType === "static" ? (openBlock(), createElementBlock("div", _hoisted_2$e, _cache[2] || (_cache[2] = [ createElementVNode("svg", { class: "circle", width: "1em", height: "1em", fill: "currentColor", viewBox: "0 0 100 100" }, [ createElementVNode("path", { d: "M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90", "stroke-linecap": "round", class: "path", "fill-opacity": "0" }) ], -1) ]))) : createCommentVNode("", true), !_ctx.href && _ctx.loadingType === "dynamic" ? (openBlock(), createElementBlock("div", _hoisted_3$a, _cache[3] || (_cache[3] = [ createElementVNode("svg", { class: "circle", viewBox: "0 0 50 50", width: "1em", height: "1em", fill: "currentColor" }, [ createElementVNode("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ], -1) ]))) : createCommentVNode("", true) ])) : createCommentVNode("", true), !_ctx.loading && showIcon.value ? (openBlock(), createElementBlock("span", _hoisted_4$9, [ renderSlot(_ctx.$slots, "icon", {}, () => [ _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : createCommentVNode("", true) ], true) ])) : createCommentVNode("", true), unref(slotsExist).default ? (openBlock(), createElementBlock("span", _hoisted_5$6, [ renderSlot(_ctx.$slots, "default", {}, void 0, true) ])) : createCommentVNode("", true), !_ctx.disabled ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(["button-wave", { "wave-active": wave.value }]), onAnimationend: onWaveEnd }, null, 34)) : createCommentVNode("", true) ]), _: 3 }, 40, ["class", "href", "target"]); }; } }); const index_vue_vue_type_style_index_0_scoped_bdc2e67b_lang = ""; const _export_sfc = (sfc, props3) => { const target = sfc.__vccOpts || sfc; for (const [key2, val] of props3) { target[key2] = val; } return target; }; const Button$1 = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-bdc2e67b"]]); Button$1.install = (app) => { app.component(Button$1.name, Button$1); }; function _typeof$2(obj) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { return typeof obj2; } : function(obj2) { return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }, _typeof$2(obj); } function _toPrimitive(input, hint) { if (_typeof$2(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (_typeof$2(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _toPropertyKey(arg) { var key2 = _toPrimitive(arg, "string"); return _typeof$2(key2) === "symbol" ? key2 : String(key2); } function _defineProperty$q(obj, key2, value2) { key2 = _toPropertyKey(key2); if (key2 in obj) { Object.defineProperty(obj, key2, { value: value2, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value2; } return obj; } function ownKeys$1(object, enumerableOnly) { var keys2 = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys2.push.apply(keys2, symbols); } return keys2; } function _objectSpread2$1(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = null != arguments[i2] ? arguments[i2] : {}; i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key2) { _defineProperty$q(target, key2, source[key2]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key2) { Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); }); } return target; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key2 in source) { if (Object.prototype.hasOwnProperty.call(source, key2)) { target[key2] = source[key2]; } } } return target; }; return _extends.apply(this, arguments); } var isFunction$2 = function isFunction(val) { return typeof val === "function"; }; var isArray$3 = Array.isArray; var isString$3 = function isString(val) { return typeof val === "string"; }; var isObject$3 = function isObject(val) { return val !== null && _typeof$2(val) === "object"; }; var onRE = /^on[^a-z]/; var isOn = function isOn2(key2) { return onRE.test(key2); }; var cacheStringFunction = function cacheStringFunction2(fn) { var cache2 = /* @__PURE__ */ Object.create(null); return function(str) { var hit = cache2[str]; return hit || (cache2[str] = fn(str)); }; }; var camelizeRE = /-(\w)/g; var camelize = cacheStringFunction(function(str) { return str.replace(camelizeRE, function(_2, c2) { return c2 ? c2.toUpperCase() : ""; }); }); var hyphenateRE = /\B([A-Z])/g; var hyphenate = cacheStringFunction(function(str) { return str.replace(hyphenateRE, "-$1").toLowerCase(); }); var hasOwnProperty$d = Object.prototype.hasOwnProperty; var hasOwn$1 = function hasOwn(val, key2) { return hasOwnProperty$d.call(val, key2); }; function resolvePropValue(options, props3, key2, value2) { var opt = options[key2]; if (opt != null) { var hasDefault = hasOwn$1(opt, "default"); if (hasDefault && value2 === void 0) { var defaultValue = opt.default; value2 = opt.type !== Function && isFunction$2(defaultValue) ? defaultValue() : defaultValue; } if (opt.type === Boolean) { if (!hasOwn$1(props3, key2) && !hasDefault) { value2 = false; } else if (value2 === "") { value2 = true; } } } return value2; } function getDataAndAriaProps(props3) { return Object.keys(props3).reduce(function(memo, key2) { if (key2.substr(0, 5) === "data-" || key2.substr(0, 5) === "aria-") { memo[key2] = props3[key2]; } return memo; }, {}); } function toPx(val) { if (typeof val === "number") return "".concat(val, "px"); return val; } function renderHelper(v2) { var props3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var defaultV = arguments.length > 2 ? arguments[2] : void 0; if (typeof v2 === "function") { return v2(props3); } return v2 !== null && v2 !== void 0 ? v2 : defaultV; } function classNames() { var classes = []; for (var i2 = 0; i2 < arguments.length; i2++) { var value2 = i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2]; if (!value2) continue; if (isString$3(value2)) { classes.push(value2); } else if (isArray$3(value2)) { for (var _i = 0; _i < value2.length; _i++) { var inner = classNames(value2[_i]); if (inner) { classes.push(inner); } } } else if (isObject$3(value2)) { for (var name in value2) { if (value2[name]) { classes.push(name); } } } } return classes.join(" "); } var MapShim = function() { if (typeof Map !== "undefined") { return Map; } function getIndex(arr, key2) { var result = -1; arr.some(function(entry, index2) { if (entry[0] === key2) { result = index2; return true; } return false; }); return result; } return ( /** @class */ function() { function class_1() { this.__entries__ = []; } Object.defineProperty(class_1.prototype, "size", { /** * @returns {boolean} */ get: function() { return this.__entries__.length; }, enumerable: true, configurable: true }); class_1.prototype.get = function(key2) { var index2 = getIndex(this.__entries__, key2); var entry = this.__entries__[index2]; return entry && entry[1]; }; class_1.prototype.set = function(key2, value2) { var index2 = getIndex(this.__entries__, key2); if (~index2) { this.__entries__[index2][1] = value2; } else { this.__entries__.push([key2, value2]); } }; class_1.prototype.delete = function(key2) { var entries = this.__entries__; var index2 = getIndex(entries, key2); if (~index2) { entries.splice(index2, 1); } }; class_1.prototype.has = function(key2) { return !!~getIndex(this.__entries__, key2); }; class_1.prototype.clear = function() { this.__entries__.splice(0); }; class_1.prototype.forEach = function(callback, ctx) { if (ctx === void 0) { ctx = null; } for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { var entry = _a[_i]; callback.call(ctx, entry[1], entry[0]); } }; return class_1; }() ); }(); var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document; var global$1 = function() { if (typeof global !== "undefined" && global.Math === Math) { return global; } if (typeof self !== "undefined" && self.Math === Math) { return self; } if (typeof window !== "undefined" && window.Math === Math) { return window; } return Function("return this")(); }(); var requestAnimationFrame$1 = function() { if (typeof requestAnimationFrame === "function") { return requestAnimationFrame.bind(global$1); } return function(callback) { return setTimeout(function() { return callback(Date.now()); }, 1e3 / 60); }; }(); var trailingTimeout = 2; function throttle(callback, delay) { var leadingCall = false, trailingCall = false, lastCallTime = 0; function resolvePending() { if (leadingCall) { leadingCall = false; callback(); } if (trailingCall) { proxy(); } } function timeoutCallback() { requestAnimationFrame$1(resolvePending); } function proxy() { var timeStamp = Date.now(); if (leadingCall) { if (timeStamp - lastCallTime < trailingTimeout) { return; } trailingCall = true; } else { leadingCall = true; trailingCall = false; setTimeout(timeoutCallback, delay); } lastCallTime = timeStamp; } return proxy; } var REFRESH_DELAY = 20; var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"]; var mutationObserverSupported = typeof MutationObserver !== "undefined"; var ResizeObserverController = ( /** @class */ function() { function ResizeObserverController2() { this.connected_ = false; this.mutationEventsAdded_ = false; this.mutationsObserver_ = null; this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); } ResizeObserverController2.prototype.addObserver = function(observer) { if (!~this.observers_.indexOf(observer)) { this.observers_.push(observer); } if (!this.connected_) { this.connect_(); } }; ResizeObserverController2.prototype.removeObserver = function(observer) { var observers2 = this.observers_; var index2 = observers2.indexOf(observer); if (~index2) { observers2.splice(index2, 1); } if (!observers2.length && this.connected_) { this.disconnect_(); } }; ResizeObserverController2.prototype.refresh = function() { var changesDetected = this.updateObservers_(); if (changesDetected) { this.refresh(); } }; ResizeObserverController2.prototype.updateObservers_ = function() { var activeObservers = this.observers_.filter(function(observer) { return observer.gatherActive(), observer.hasActive(); }); activeObservers.forEach(function(observer) { return observer.broadcastActive(); }); return activeObservers.length > 0; }; ResizeObserverController2.prototype.connect_ = function() { if (!isBrowser || this.connected_) { return; } document.addEventListener("transitionend", this.onTransitionEnd_); window.addEventListener("resize", this.refresh); if (mutationObserverSupported) { this.mutationsObserver_ = new MutationObserver(this.refresh); this.mutationsObserver_.observe(document, { attributes: true, childList: true, characterData: true, subtree: true }); } else { document.addEventListener("DOMSubtreeModified", this.refresh); this.mutationEventsAdded_ = true; } this.connected_ = true; }; ResizeObserverController2.prototype.disconnect_ = function() { if (!isBrowser || !this.connected_) { return; } document.removeEventListener("transitionend", this.onTransitionEnd_); window.removeEventListener("resize", this.refresh); if (this.mutationsObserver_) { this.mutationsObserver_.disconnect(); } if (this.mutationEventsAdded_) { document.removeEventListener("DOMSubtreeModified", this.refresh); } this.mutationsObserver_ = null; this.mutationEventsAdded_ = false; this.connected_ = false; }; ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) { var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b; var isReflowProperty = transitionKeys.some(function(key2) { return !!~propertyName.indexOf(key2); }); if (isReflowProperty) { this.refresh(); } }; ResizeObserverController2.getInstance = function() { if (!this.instance_) { this.instance_ = new ResizeObserverController2(); } return this.instance_; }; ResizeObserverController2.instance_ = null; return ResizeObserverController2; }() ); var defineConfigurable = function(target, props3) { for (var _i = 0, _a = Object.keys(props3); _i < _a.length; _i++) { var key2 = _a[_i]; Object.defineProperty(target, key2, { value: props3[key2], enumerable: false, writable: false, configurable: true }); } return target; }; var getWindowOf = function(target) { var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; return ownerGlobal || global$1; }; var emptyRect = createRectInit(0, 0, 0, 0); function toFloat(value2) { return parseFloat(value2) || 0; } function getBordersSize(styles2) { var positions = []; for (var _i = 1; _i < arguments.length; _i++) { positions[_i - 1] = arguments[_i]; } return positions.reduce(function(size, position) { var value2 = styles2["border-" + position + "-width"]; return size + toFloat(value2); }, 0); } function getPaddings(styles2) { var positions = ["top", "right", "bottom", "left"]; var paddings = {}; for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { var position = positions_1[_i]; var value2 = styles2["padding-" + position]; paddings[position] = toFloat(value2); } return paddings; } function getSVGContentRect(target) { var bbox = target.getBBox(); return createRectInit(0, 0, bbox.width, bbox.height); } function getHTMLElementContentRect(target) { var clientWidth = target.clientWidth, clientHeight = target.clientHeight; if (!clientWidth && !clientHeight) { return emptyRect; } var styles2 = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles2); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; var width = toFloat(styles2.width), height = toFloat(styles2.height); if (styles2.boxSizing === "border-box") { if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles2, "left", "right") + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles2, "top", "bottom") + vertPad; } } if (!isDocumentElement(target)) { var vertScrollbar = Math.round(width + horizPad) - clientWidth; var horizScrollbar = Math.round(height + vertPad) - clientHeight; if (Math.abs(vertScrollbar) !== 1) { width -= vertScrollbar; } if (Math.abs(horizScrollbar) !== 1) { height -= horizScrollbar; } } return createRectInit(paddings.left, paddings.top, width, height); } var isSVGGraphicsElement = function() { if (typeof SVGGraphicsElement !== "undefined") { return function(target) { return target instanceof getWindowOf(target).SVGGraphicsElement; }; } return function(target) { return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function"; }; }(); function isDocumentElement(target) { return target === getWindowOf(target).document.documentElement; } function getContentRect(target) { if (!isBrowser) { return emptyRect; } if (isSVGGraphicsElement(target)) { return getSVGContentRect(target); } return getHTMLElementContentRect(target); } function createReadOnlyRect(_a) { var x2 = _a.x, y2 = _a.y, width = _a.width, height = _a.height; var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object; var rect = Object.create(Constr.prototype); defineConfigurable(rect, { x: x2, y: y2, width, height, top: y2, right: x2 + width, bottom: height + y2, left: x2 }); return rect; } function createRectInit(x2, y2, width, height) { return { x: x2, y: y2, width, height }; } var ResizeObservation = ( /** @class */ function() { function ResizeObservation2(target) { this.broadcastWidth = 0; this.broadcastHeight = 0; this.contentRect_ = createRectInit(0, 0, 0, 0); this.target = target; } ResizeObservation2.prototype.isActive = function() { var rect = getContentRect(this.target); this.contentRect_ = rect; return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight; }; ResizeObservation2.prototype.broadcastRect = function() { var rect = this.contentRect_; this.broadcastWidth = rect.width; this.broadcastHeight = rect.height; return rect; }; return ResizeObservation2; }() ); var ResizeObserverEntry = ( /** @class */ function() { function ResizeObserverEntry2(target, rectInit) { var contentRect = createReadOnlyRect(rectInit); defineConfigurable(this, { target, contentRect }); } return ResizeObserverEntry2; }() ); var ResizeObserverSPI = ( /** @class */ function() { function ResizeObserverSPI2(callback, controller, callbackCtx) { this.activeObservations_ = []; this.observations_ = new MapShim(); if (typeof callback !== "function") { throw new TypeError("The callback provided as parameter 1 is not a function."); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; } ResizeObserverSPI2.prototype.observe = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); this.controller_.refresh(); }; ResizeObserverSPI2.prototype.unobserve = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; ResizeObserverSPI2.prototype.disconnect = function() { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; ResizeObserverSPI2.prototype.gatherActive = function() { var _this = this; this.clearActive(); this.observations_.forEach(function(observation) { if (observation.isActive()) { _this.activeObservations_.push(observation); } }); }; ResizeObserverSPI2.prototype.broadcastActive = function() { if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; var entries = this.activeObservations_.map(function(observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; ResizeObserverSPI2.prototype.clearActive = function() { this.activeObservations_.splice(0); }; ResizeObserverSPI2.prototype.hasActive = function() { return this.activeObservations_.length > 0; }; return ResizeObserverSPI2; }() ); var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim(); var ResizeObserver$2 = ( /** @class */ function() { function ResizeObserver2(callback) { if (!(this instanceof ResizeObserver2)) { throw new TypeError("Cannot call a class as a function."); } if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); } return ResizeObserver2; }() ); [ "observe", "unobserve", "disconnect" ].forEach(function(method) { ResizeObserver$2.prototype[method] = function() { var _a; return (_a = observers.get(this))[method].apply(_a, arguments); }; }); var index$2 = function() { if (typeof global$1.ResizeObserver !== "undefined") { return global$1.ResizeObserver; } return ResizeObserver$2; }(); function _arrayWithHoles$2(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArrayLimit$2(arr, i2) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = true, _d = false; try { if (_x = (_i = _i.call(arr)).next, 0 === i2) { if (Object(_i) !== _i) return; _n = false; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i2); _n = true) ; } catch (err) { _d = true, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2]; return arr2; } function _unsupportedIterableToArray$2(o2, minLen) { if (!o2) return; if (typeof o2 === "string") return _arrayLikeToArray$2(o2, minLen); var n2 = Object.prototype.toString.call(o2).slice(8, -1); if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; if (n2 === "Map" || n2 === "Set") return Array.from(o2); if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$2(o2, minLen); } function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _slicedToArray$2(arr, i2) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i2) || _unsupportedIterableToArray$2(arr, i2) || _nonIterableRest$2(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$2(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread(); } var freeGlobal = typeof global == "object" && global && global.Object === Object && global; const freeGlobal$1 = freeGlobal; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal$1 || freeSelf || Function("return this")(); const root$1 = root; var Symbol$1 = root$1.Symbol; const Symbol$2 = Symbol$1; var objectProto$d = Object.prototype; var hasOwnProperty$c = objectProto$d.hasOwnProperty; var nativeObjectToString$1 = objectProto$d.toString; var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0; function getRawTag(value2) { var isOwn = hasOwnProperty$c.call(value2, symToStringTag$1), tag = value2[symToStringTag$1]; try { value2[symToStringTag$1] = void 0; var unmasked = true; } catch (e2) { } var result = nativeObjectToString$1.call(value2); if (unmasked) { if (isOwn) { value2[symToStringTag$1] = tag; } else { delete value2[symToStringTag$1]; } } return result; } var objectProto$c = Object.prototype; var nativeObjectToString = objectProto$c.toString; function objectToString$1(value2) { return nativeObjectToString.call(value2); } var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0; function baseGetTag(value2) { if (value2 == null) { return value2 === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value2) ? getRawTag(value2) : objectToString$1(value2); } function overArg(func, transform2) { return function(arg) { return func(transform2(arg)); }; } var getPrototype = overArg(Object.getPrototypeOf, Object); const getPrototype$1 = getPrototype; function isObjectLike(value2) { return value2 != null && typeof value2 == "object"; } var objectTag$3 = "[object Object]"; var funcProto$2 = Function.prototype, objectProto$b = Object.prototype; var funcToString$2 = funcProto$2.toString; var hasOwnProperty$b = objectProto$b.hasOwnProperty; var objectCtorString = funcToString$2.call(Object); function isPlainObject$1(value2) { if (!isObjectLike(value2) || baseGetTag(value2) != objectTag$3) { return false; } var proto = getPrototype$1(value2); if (proto === null) { return true; } var Ctor = hasOwnProperty$b.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString$2.call(Ctor) == objectCtorString; } var isValid$1 = function isValid(value2) { return value2 !== void 0 && value2 !== null && value2 !== ""; }; const isValid$2 = isValid$1; var initDefaultProps = function initDefaultProps2(types, defaultProps) { var propTypes = _objectSpread2$1({}, types); Object.keys(defaultProps).forEach(function(k2) { var prop = propTypes[k2]; if (prop) { if (prop.type || prop.default) { prop.default = defaultProps[k2]; } else if (prop.def) { prop.def(defaultProps[k2]); } else { propTypes[k2] = { type: prop, default: defaultProps[k2] }; } } else { throw new Error("not have ".concat(k2, " prop")); } }); return propTypes; }; const initDefaultProps$1 = initDefaultProps; var splitAttrs = function splitAttrs2(attrs) { var allAttrs = Object.keys(attrs); var eventAttrs = {}; var onEvents = {}; var extraAttrs = {}; for (var i2 = 0, l2 = allAttrs.length; i2 < l2; i2++) { var key2 = allAttrs[i2]; if (isOn(key2)) { eventAttrs[key2[2].toLowerCase() + key2.slice(3)] = attrs[key2]; onEvents[key2] = attrs[key2]; } else { extraAttrs[key2] = attrs[key2]; } } return { onEvents, events: eventAttrs, extraAttrs }; }; var parseStyleText = function parseStyleText2() { var cssText = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; var camel = arguments.length > 1 ? arguments[1] : void 0; var res = {}; var listDelimiter = /;(?![^(]*\))/g; var propertyDelimiter = /:(.+)/; if (_typeof$2(cssText) === "object") return cssText; cssText.split(listDelimiter).forEach(function(item) { if (item) { var tmp = item.split(propertyDelimiter); if (tmp.length > 1) { var k2 = camel ? camelize(tmp[0].trim()) : tmp[0].trim(); res[k2] = tmp[1].trim(); } } }); return res; }; var hasProp = function hasProp2(instance, prop) { return instance[prop] !== void 0; }; var flattenChildren = function flattenChildren2() { var children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var filterEmpty2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; var temp = Array.isArray(children) ? children : [children]; var res = []; temp.forEach(function(child) { if (Array.isArray(child)) { res.push.apply(res, _toConsumableArray(flattenChildren2(child, filterEmpty2))); } else if (child && child.type === Fragment) { res.push.apply(res, _toConsumableArray(flattenChildren2(child.children, filterEmpty2))); } else if (child && isVNode$1(child)) { if (filterEmpty2 && !isEmptyElement(child)) { res.push(child); } else if (!filterEmpty2) { res.push(child); } } else if (isValid$2(child)) { res.push(child); } }); return res; }; var getSlot = function getSlot2(self2) { var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; if (isVNode$1(self2)) { if (self2.type === Fragment) { return name === "default" ? flattenChildren(self2.children) : []; } else if (self2.children && self2.children[name]) { return flattenChildren(self2.children[name](options)); } else { return []; } } else { var res = self2.$slots[name] && self2.$slots[name](options); return flattenChildren(res); } }; var findDOMNode = function findDOMNode2(instance) { var _instance$vnode; var node = (instance === null || instance === void 0 ? void 0 : (_instance$vnode = instance.vnode) === null || _instance$vnode === void 0 ? void 0 : _instance$vnode.el) || instance && (instance.$el || instance); while (node && !node.tagName) { node = node.nextSibling; } return node; }; var getOptionProps = function getOptionProps2(instance) { var res = {}; if (instance.$ && instance.$.vnode) { var props3 = instance.$.vnode.props || {}; Object.keys(instance.$props).forEach(function(k2) { var v2 = instance.$props[k2]; var hyphenateKey = hyphenate(k2); if (v2 !== void 0 || hyphenateKey in props3) { res[k2] = v2; } }); } else if (isVNode$1(instance) && _typeof$2(instance.type) === "object") { var originProps = instance.props || {}; var _props = {}; Object.keys(originProps).forEach(function(key2) { _props[camelize(key2)] = originProps[key2]; }); var options = instance.type.props || {}; Object.keys(options).forEach(function(k2) { var v2 = resolvePropValue(options, _props, k2, _props[k2]); if (v2 !== void 0 || k2 in _props) { res[k2] = v2; } }); } return res; }; var getComponent = function getComponent2(instance) { var prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : instance; var execute = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; var com = void 0; if (instance.$) { var temp = instance[prop]; if (temp !== void 0) { return typeof temp === "function" && execute ? temp(options) : temp; } else { com = instance.$slots[prop]; com = execute && com ? com(options) : com; } } else if (isVNode$1(instance)) { var _temp = instance.props && instance.props[prop]; if (_temp !== void 0 && instance.props !== null) { return typeof _temp === "function" && execute ? _temp(options) : _temp; } else if (instance.type === Fragment) { com = instance.children; } else if (instance.children && instance.children[prop]) { com = instance.children[prop]; com = execute && com ? com(options) : com; } } if (Array.isArray(com)) { com = flattenChildren(com); com = com.length === 1 ? com[0] : com; com = com.length === 0 ? void 0 : com; } return com; }; function getEvents() { var ele = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; var on = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; var props3 = {}; if (ele.$) { props3 = _objectSpread2$1(_objectSpread2$1({}, props3), ele.$attrs); } else { props3 = _objectSpread2$1(_objectSpread2$1({}, props3), ele.props); } return splitAttrs(props3)[on ? "onEvents" : "events"]; } function getStyle(ele, camel) { var props3 = (isVNode$1(ele) ? ele.props : ele.$attrs) || {}; var style = props3.style || {}; if (typeof style === "string") { style = parseStyleText(style, camel); } else if (camel && style) { var res = {}; Object.keys(style).forEach(function(k2) { return res[camelize(k2)] = style[k2]; }); return res; } return style; } function isEmptyElement(c2) { return c2 && (c2.type === Comment || c2.type === Fragment && c2.children.length === 0 || c2.type === Text && c2.children.trim() === ""); } function filterEmpty() { var children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var res = []; children.forEach(function(child) { if (Array.isArray(child)) { res.push.apply(res, _toConsumableArray(child)); } else if ((child === null || child === void 0 ? void 0 : child.type) === Fragment) { res.push.apply(res, _toConsumableArray(filterEmpty(child.children))); } else { res.push(child); } }); return res.filter(function(c2) { return !isEmptyElement(c2); }); } function filterEmptyWithUndefined(children) { if (children) { var coms = filterEmpty(children); return coms.length ? coms : void 0; } else { return children; } } function isValidElement(element) { if (Array.isArray(element) && element.length === 1) { element = element[0]; } return element && element.__v_isVNode && _typeof$2(element.type) !== "symbol"; } function getPropsSlot(slots, props3) { var _props$prop, _slots$prop; var prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default"; return (_props$prop = props3[prop]) !== null && _props$prop !== void 0 ? _props$prop : (_slots$prop = slots[prop]) === null || _slots$prop === void 0 ? void 0 : _slots$prop.call(slots); } const ResizeObserver$1 = defineComponent({ compatConfig: { MODE: 3 }, name: "ResizeObserver", props: { disabled: Boolean, onResize: Function }, emits: ["resize"], setup: function setup(props3, _ref) { var slots = _ref.slots; var state = reactive({ width: 0, height: 0, offsetHeight: 0, offsetWidth: 0 }); var currentElement = null; var resizeObserver = null; var destroyObserver = function destroyObserver2() { if (resizeObserver) { resizeObserver.disconnect(); resizeObserver = null; } }; var onResize = function onResize2(entries) { var onResize3 = props3.onResize; var target = entries[0].target; var _target$getBoundingCl = target.getBoundingClientRect(), width = _target$getBoundingCl.width, height = _target$getBoundingCl.height; var offsetWidth = target.offsetWidth, offsetHeight = target.offsetHeight; var fixedWidth = Math.floor(width); var fixedHeight = Math.floor(height); if (state.width !== fixedWidth || state.height !== fixedHeight || state.offsetWidth !== offsetWidth || state.offsetHeight !== offsetHeight) { var size = { width: fixedWidth, height: fixedHeight, offsetWidth, offsetHeight }; _extends(state, size); if (onResize3) { Promise.resolve().then(function() { onResize3(_objectSpread2$1(_objectSpread2$1({}, size), {}, { offsetWidth, offsetHeight }), target); }); } } }; var instance = getCurrentInstance(); var registerObserver = function registerObserver2() { var disabled = props3.disabled; if (disabled) { destroyObserver(); return; } var element = findDOMNode(instance); var elementChanged = element !== currentElement; if (elementChanged) { destroyObserver(); currentElement = element; } if (!resizeObserver && element) { resizeObserver = new index$2(onResize); resizeObserver.observe(element); } }; onMounted(function() { registerObserver(); }); onUpdated(function() { registerObserver(); }); onUnmounted(function() { destroyObserver(); }); watch(function() { return props3.disabled; }, function() { registerObserver(); }, { flush: "post" }); return function() { var _slots$default; return (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)[0]; }; } }); var raf$1 = function raf(callback) { return setTimeout(callback, 16); }; var caf = function caf2(num) { return clearTimeout(num); }; if (typeof window !== "undefined" && "requestAnimationFrame" in window) { raf$1 = function raf3(callback) { return window.requestAnimationFrame(callback); }; caf = function caf3(handle) { return window.cancelAnimationFrame(handle); }; } var rafUUID = 0; var rafIds = /* @__PURE__ */ new Map(); function cleanup(id) { rafIds.delete(id); } function wrapperRaf(callback) { var times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; rafUUID += 1; var id = rafUUID; function callRef(leftTimes) { if (leftTimes === 0) { cleanup(id); callback(); } else { var realId = raf$1(function() { callRef(leftTimes - 1); }); rafIds.set(id, realId); } } callRef(times); return id; } wrapperRaf.cancel = function(id) { var realId = rafIds.get(id); cleanup(realId); return caf(realId); }; var tuple$1 = function tuple() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return args; }; var withInstall = function withInstall2(comp) { var c2 = comp; c2.install = function(app) { app.component(c2.displayName || c2.name, comp); }; return comp; }; var supportsPassive = false; try { var opts = Object.defineProperty({}, "passive", { get: function get() { supportsPassive = true; } }); window.addEventListener("testPassive", null, opts); window.removeEventListener("testPassive", null, opts); } catch (e2) { } const supportsPassive$1 = supportsPassive; function addEventListenerWrap(target, eventType, cb, option) { if (target && target.addEventListener) { var opt = option; if (opt === void 0 && supportsPassive$1 && (eventType === "touchstart" || eventType === "touchmove" || eventType === "wheel")) { opt = { passive: false }; } target.addEventListener(eventType, cb, opt); } return { remove: function remove() { if (target && target.removeEventListener) { target.removeEventListener(eventType, cb); } } }; } function _objectWithoutPropertiesLoose$2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key2, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key2 = sourceKeys[i2]; if (excluded.indexOf(key2) >= 0) continue; target[key2] = source[key2]; } return target; } function _objectWithoutProperties$2(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$2(source, excluded); var key2, i2; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) { key2 = sourceSymbolKeys[i2]; if (excluded.indexOf(key2) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key2)) continue; target[key2] = source[key2]; } } return target; } const enUS = { // O