UNPKG

sure-ui

Version:

A Component Library for Vue 3

978 lines (949 loc) 31.8 kB
/*! Sure UI v0.0.0-dev.1 */ const INSTALLED_KEY = Symbol("INSTALLED_KEY"); const version$1 = "0.0.0-dev.1"; const makeInstaller = (components = []) => { const install = (app) => { if (app[INSTALLED_KEY]) { return; } app[INSTALLED_KEY] = true; components.forEach((c) => app.use(c)); }; return { version: version$1, install }; }; function normalizeStyle(value) { if (isArray(value)) { const res = {}; for (let i = 0; i < value.length; i++) { const item = value[i]; const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item); if (normalized) { for (const key in normalized) { res[key] = normalized[key]; } } } return res; } else if (isString$1(value)) { return value; } else if (isObject(value)) { return value; } } const listDelimiterRE = /;(?![^(]*\))/g; const propertyDelimiterRE = /:(.+)/; function parseStringStyle(cssText) { const ret = {}; cssText.split(listDelimiterRE).forEach((item) => { if (item) { const tmp = item.split(propertyDelimiterRE); tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } }); return ret; } function normalizeClass(value) { let res = ""; if (isString$1(value)) { res = value; } else if (isArray(value)) { for (let i = 0; i < value.length; i++) { const normalized = normalizeClass(value[i]); if (normalized) { res += normalized + " "; } } } else if (isObject(value)) { for (const name in value) { if (value[name]) { res += name + " "; } } } return res.trim(); } const EMPTY_ARR = []; const NOOP = () => { }; const onRE = /^on[^a-z]/; const isOn = (key) => onRE.test(key); const extend = Object.assign; const isArray = Array.isArray; const isFunction = (val) => typeof val === "function"; const isString$1 = (val) => typeof val === "string"; const isObject = (val) => val !== null && typeof val === "object"; const withInstall = (main, extra) => { main.install = (app) => { for (const comp of [main, ...Object.values(extra != null ? extra : {})]) { app.component(comp.name, comp); } }; if (extra) { for (const [key, comp] of Object.entries(extra)) { main[key] = comp; } } return main; }; const definePropType = (val) => val; const isUndefined = (val) => val === void 0 || typeof val === "undefined"; const isString = (val) => typeof val === "string"; const isNumber = (val) => typeof val === "number"; const isElement = (el) => { if (isUndefined(Element)) { return false; } return el instanceof Element; }; window?.matchMedia("(prefers-color-scheme: dark)").matches; /Mac|iPhone|iPad|iPod/ig.test(navigator.userAgent); function addUnit(value, defaultUnit = "px") { if (!value) { return ""; } if (isString(value)) { return value; } else if (isNumber(value)) { return `${value}${defaultUnit}`; } } let activeEffectScope; function recordEffectScope(effect2, scope = activeEffectScope) { if (scope && scope.active) { scope.effects.push(effect2); } } const createDep = (effects) => { const dep = new Set(effects); dep.w = 0; dep.n = 0; return dep; }; const wasTracked = (dep) => (dep.w & trackOpBit) > 0; const newTracked = (dep) => (dep.n & trackOpBit) > 0; const initDepMarkers = ({ deps }) => { if (deps.length) { for (let i = 0; i < deps.length; i++) { deps[i].w |= trackOpBit; } } }; const finalizeDepMarkers = (effect2) => { const { deps } = effect2; if (deps.length) { let ptr = 0; for (let i = 0; i < deps.length; i++) { const dep = deps[i]; if (wasTracked(dep) && !newTracked(dep)) { dep.delete(effect2); } else { deps[ptr++] = dep; } dep.w &= ~trackOpBit; dep.n &= ~trackOpBit; } deps.length = ptr; } }; let effectTrackDepth = 0; let trackOpBit = 1; const maxMarkerBits = 30; let activeEffect; class ReactiveEffect { constructor(fn, scheduler2 = null, scope) { this.fn = fn; this.scheduler = scheduler2; this.active = true; this.deps = []; this.parent = void 0; recordEffectScope(this, scope); } run() { if (!this.active) { return this.fn(); } let parent = activeEffect; let lastShouldTrack = shouldTrack; while (parent) { if (parent === this) { return; } parent = parent.parent; } try { this.parent = activeEffect; activeEffect = this; shouldTrack = true; trackOpBit = 1 << ++effectTrackDepth; if (effectTrackDepth <= maxMarkerBits) { initDepMarkers(this); } else { cleanupEffect(this); } return this.fn(); } finally { if (effectTrackDepth <= maxMarkerBits) { finalizeDepMarkers(this); } trackOpBit = 1 << --effectTrackDepth; activeEffect = this.parent; shouldTrack = lastShouldTrack; this.parent = void 0; if (this.deferStop) { this.stop(); } } } stop() { if (activeEffect === this) { this.deferStop = true; } else if (this.active) { cleanupEffect(this); if (this.onStop) { this.onStop(); } this.active = false; } } } function cleanupEffect(effect2) { const { deps } = effect2; if (deps.length) { for (let i = 0; i < deps.length; i++) { deps[i].delete(effect2); } deps.length = 0; } } let shouldTrack = true; function trackEffects(dep, debuggerEventExtraInfo) { let shouldTrack2 = false; if (effectTrackDepth <= maxMarkerBits) { if (!newTracked(dep)) { dep.n |= trackOpBit; shouldTrack2 = !wasTracked(dep); } } else { shouldTrack2 = !dep.has(activeEffect); } if (shouldTrack2) { dep.add(activeEffect); activeEffect.deps.push(dep); } } function triggerEffects(dep, debuggerEventExtraInfo) { const effects = isArray(dep) ? dep : [...dep]; for (const effect2 of effects) { if (effect2.computed) { triggerEffect(effect2); } } for (const effect2 of effects) { if (!effect2.computed) { triggerEffect(effect2); } } } function triggerEffect(effect2, debuggerEventExtraInfo) { if (effect2 !== activeEffect || effect2.allowRecurse) { if (effect2.scheduler) { effect2.scheduler(); } else { effect2.run(); } } } function isReactive(value) { if (isReadonly(value)) { return isReactive(value["__v_raw"]); } return !!(value && value["__v_isReactive"]); } function isReadonly(value) { return !!(value && value["__v_isReadonly"]); } function isProxy(value) { return isReactive(value) || isReadonly(value); } function toRaw(observed) { const raw = observed && observed["__v_raw"]; return raw ? toRaw(raw) : observed; } function trackRefValue(ref2) { if (shouldTrack && activeEffect) { ref2 = toRaw(ref2); { trackEffects(ref2.dep || (ref2.dep = createDep())); } } } function triggerRefValue(ref2, newVal) { ref2 = toRaw(ref2); if (ref2.dep) { { triggerEffects(ref2.dep); } } } function isRef(r) { return !!(r && r.__v_isRef === true); } function unref(ref2) { return isRef(ref2) ? ref2.value : ref2; } class ComputedRefImpl { constructor(getter, _setter, isReadonly2, isSSR) { this._setter = _setter; this.dep = void 0; this.__v_isRef = true; this._dirty = true; this.effect = new ReactiveEffect(getter, () => { if (!this._dirty) { this._dirty = true; triggerRefValue(this); } }); this.effect.computed = this; this.effect.active = this._cacheable = !isSSR; this["__v_isReadonly"] = isReadonly2; } get value() { const self = toRaw(this); trackRefValue(self); if (self._dirty || !self._cacheable) { self._dirty = false; self._value = self.effect.run(); } return self._value; } set value(newValue) { this._setter(newValue); } } function computed$1(getterOrOptions, debugOptions, isSSR = false) { let getter; let setter; const onlyGetter = isFunction(getterOrOptions); if (onlyGetter) { getter = getterOrOptions; setter = NOOP; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); return cRef; } let currentRenderingInstance = null; let currentScopeId = null; const isSuspense = (type) => type.__isSuspense; function defineComponent(options) { return isFunction(options) ? { setup: options, name: options.name } : options; } const isAsyncWrapper = (i) => !!i.type.__asyncLoader; const NULL_DYNAMIC_COMPONENT = Symbol(); function renderSlot(slots, name, props = {}, fallback, noSlotted) { if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { return createVNode("slot", name === "default" ? null : { name }, fallback && fallback()); } let slot = slots[name]; if (slot && slot._c) { slot._d = false; } openBlock(); const validSlotContent = slot && ensureValidVNode(slot(props)); const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2); if (!noSlotted && rendered.scopeId) { rendered.slotScopeIds = [rendered.scopeId + "-s"]; } if (slot && slot._c) { slot._d = true; } return rendered; } function ensureValidVNode(vnodes) { return vnodes.some((child) => { if (!isVNode(child)) return true; if (child.type === Comment) return false; if (child.type === Fragment && !ensureValidVNode(child.children)) return false; return true; }) ? vnodes : null; } const isTeleport = (type) => type.__isTeleport; const Fragment = Symbol(void 0); const Text = Symbol(void 0); const Comment = Symbol(void 0); const blockStack = []; let currentBlock = null; function openBlock(disableTracking = false) { blockStack.push(currentBlock = disableTracking ? null : []); } function closeBlock() { blockStack.pop(); currentBlock = blockStack[blockStack.length - 1] || null; } function setupBlock(vnode) { vnode.dynamicChildren = currentBlock || EMPTY_ARR ; closeBlock(); if (currentBlock) { currentBlock.push(vnode); } return vnode; } function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true)); } function createBlock(type, props, children, patchFlag, dynamicProps) { return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true)); } function isVNode(value) { return value ? value.__v_isVNode === true : false; } const InternalObjectKey = `__vInternal`; const normalizeKey = ({ key }) => key != null ? key : null; const normalizeRef = ({ ref: ref3, ref_key, ref_for }) => { return ref3 != null ? isString$1(ref3) || isRef(ref3) || isFunction(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null; }; function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { const vnode = { __v_isVNode: true, __v_skip: true, type, props, key: props && normalizeKey(props), ref: props && normalizeRef(props), scopeId: currentScopeId, slotScopeIds: null, children, component: null, suspense: null, ssContent: null, ssFallback: null, dirs: null, transition: null, el: null, anchor: null, target: null, targetAnchor: null, staticCount: 0, shapeFlag, patchFlag, dynamicProps, dynamicChildren: null, appContext: null }; if (needFullChildrenNormalization) { normalizeChildren(vnode, children); if (shapeFlag & 128) { type.normalize(vnode); } } else if (children) { vnode.shapeFlag |= isString$1(children) ? 8 : 16; } if (!isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) { currentBlock.push(vnode); } return vnode; } const createVNode = _createVNode; function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { if (!type || type === NULL_DYNAMIC_COMPONENT) { type = Comment; } if (isVNode(type)) { const cloned = cloneVNode(type, props, true); if (children) { normalizeChildren(cloned, children); } if (!isBlockNode && currentBlock) { if (cloned.shapeFlag & 6) { currentBlock[currentBlock.indexOf(type)] = cloned; } else { currentBlock.push(cloned); } } cloned.patchFlag |= -2; return cloned; } if (isClassComponent(type)) { type = type.__vccOpts; } if (props) { props = guardReactiveProps(props); let { class: klass, style } = props; if (klass && !isString$1(klass)) { props.class = normalizeClass(klass); } if (isObject(style)) { if (isProxy(style) && !isArray(style)) { style = extend({}, style); } props.style = normalizeStyle(style); } } const shapeFlag = isString$1(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true); } function guardReactiveProps(props) { if (!props) return null; return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props; } function cloneVNode(vnode, extraProps, mergeRef = false) { const { props, ref: ref3, patchFlag, children } = vnode; const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; const cloned = { __v_isVNode: true, __v_skip: true, type: vnode.type, props: mergedProps, key: mergedProps && normalizeKey(mergedProps), ref: extraProps && extraProps.ref ? mergeRef && ref3 ? isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref3, scopeId: vnode.scopeId, slotScopeIds: vnode.slotScopeIds, children: children, target: vnode.target, targetAnchor: vnode.targetAnchor, staticCount: vnode.staticCount, shapeFlag: vnode.shapeFlag, patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, dynamicProps: vnode.dynamicProps, dynamicChildren: vnode.dynamicChildren, appContext: vnode.appContext, dirs: vnode.dirs, transition: vnode.transition, component: vnode.component, suspense: vnode.suspense, ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), el: vnode.el, anchor: vnode.anchor }; return cloned; } function createTextVNode(text = " ", flag = 0) { return createVNode(Text, null, text, flag); } function normalizeChildren(vnode, children) { let type = 0; const { shapeFlag } = vnode; if (children == null) { children = null; } else if (isArray(children)) { type = 16; } else if (typeof children === "object") { if (shapeFlag & (1 | 64)) { const slot = children.default; if (slot) { slot._c && (slot._d = false); normalizeChildren(vnode, slot()); slot._c && (slot._d = true); } return; } else { type = 32; const slotFlag = children._; if (!slotFlag && !(InternalObjectKey in children)) { children._ctx = currentRenderingInstance; } else if (slotFlag === 3 && currentRenderingInstance) { if (currentRenderingInstance.slots._ === 1) { children._ = 1; } else { children._ = 2; vnode.patchFlag |= 1024; } } } } else if (isFunction(children)) { children = { default: children, _ctx: currentRenderingInstance }; type = 32; } else { children = String(children); if (shapeFlag & 64) { type = 16; children = [createTextVNode(children)]; } else { type = 8; } } vnode.children = children; vnode.shapeFlag |= type; } function mergeProps(...args) { const ret = {}; for (let i = 0; i < args.length; i++) { const toMerge = args[i]; for (const key in toMerge) { if (key === "class") { if (ret.class !== toMerge.class) { ret.class = normalizeClass([ret.class, toMerge.class]); } } else if (key === "style") { ret.style = normalizeStyle([ret.style, toMerge.style]); } else if (isOn(key)) { const existing = ret[key]; const incoming = toMerge[key]; if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { ret[key] = existing ? [].concat(existing, incoming) : incoming; } } else if (key !== "") { ret[key] = toMerge[key]; } } } return ret; } let isInSSRComponentSetup = false; function isClassComponent(value) { return isFunction(value) && "__vccOpts" in value; } const computed = (getterOrOptions, debugOptions) => { return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); }; const iconProps = { size: { type: definePropType([Number, String]) }, color: { type: String }, loading: { type: Boolean } }; const __default__ = { name: "SureIcon", inheritAttrs: false }; var _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: iconProps, setup(__props) { const props = __props; const style = computed(() => { if (!props.size && !props.color) { return {}; } return { "fontSize": isUndefined(props.size) ? void 0 : addUnit(props.size), "--color": props.color }; }); const cls = props.loading ? "sure-icon sure-icon-loading" : "sure-icon"; return (_ctx, _cache) => { return openBlock(), createElementBlock("i", { class: normalizeClass(unref(cls)), style: normalizeStyle(unref(style)) }, [ renderSlot(_ctx.$slots, "default") ], 6); }; } }); var _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; var Icon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "icon.vue"]]); const SureIcon = withInstall(Icon); var Components = [ SureIcon ]; var installer = makeInstaller([...Components]); var _a; const isClient = typeof window !== "undefined"; isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); const nodeList = /* @__PURE__ */ new Map(); let startClick; if (isClient) { document.addEventListener("mousedown", (e) => startClick = e); document.addEventListener("mouseup", (e) => { for (const handlers of nodeList.values()) { for (const { documentHandler } of handlers) { documentHandler(e, startClick); } } }); } function createDocumentHandler(el, binding) { let excludes = []; if (Array.isArray(binding.arg)) { excludes = binding.arg; } else if (isElement(binding.arg)) { excludes.push(binding.arg); } return function(mouseup, mousedown) { const popperRef = binding.instance.popperRef; const mouseUpTarget = mouseup.target; const mouseDownTarget = mousedown == null ? void 0 : mousedown.target; const isBound = !binding || !binding.instance; const isTargetExists = !mouseUpTarget || !mouseDownTarget; const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget); const isSelf = el === mouseUpTarget; const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget); const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget)); if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) { return; } binding.value(mouseup, mousedown); }; } const ClickOutside = { beforeMount(el, binding) { if (!nodeList.has(el)) { nodeList.set(el, []); } nodeList.get(el).push({ documentHandler: createDocumentHandler(el, binding), bindingFn: binding.value }); }, updated(el, binding) { if (!nodeList.has(el)) { nodeList.set(el, []); } const handlers = nodeList.get(el); const oldHandlerIndex = handlers.findIndex( (item) => item.bindingFn === binding.oldValue ); const newHandler = { documentHandler: createDocumentHandler(el, binding), bindingFn: binding.value }; if (oldHandlerIndex >= 0) { handlers.splice(oldHandlerIndex, 1, newHandler); } else { handlers.push(newHandler); } }, unmounted(el) { nodeList.delete(el); } }; const useFocus = (el) => { return { focus: () => { var _a, _b; (_b = (_a = el.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a); } }; }; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var dayjs_min$1 = {exports: {}}; (function(module, exports) { !function(t, e) { module.exports = e() ; }(commonjsGlobal, function() { var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, m = function(t2, e2, n2) { var r2 = String(t2); return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2; }, g = { s: m, z: function(t2) { var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60; return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0"); }, m: function t2(e2, n2) { if (e2.date() < n2.date()) return -t2(n2, e2); var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f); return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0); }, a: function(t2) { return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2); }, p: function(t2) { return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, ""); }, u: function(t2) { return void 0 === t2; } }, v = "en", D = {}; D[v] = M; var p = function(t2) { return t2 instanceof _; }, S = function t2(e2, n2, r2) { var i2; if (!e2) return v; if ("string" == typeof e2) { var s2 = e2.toLowerCase(); D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2); var u2 = e2.split("-"); if (!i2 && u2.length > 1) return t2(u2[0]); } else { var a2 = e2.name; D[a2] = e2, i2 = a2; } return !r2 && i2 && (v = i2), i2 || !r2 && v; }, w = function(t2, e2) { if (p(t2)) return t2.clone(); var n2 = "object" == typeof e2 ? e2 : {}; return n2.date = t2, n2.args = arguments, new _(n2); }, O = g; O.l = S, O.i = p, O.w = function(t2, e2) { return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset }); }; var _ = function() { function M2(t2) { this.$L = S(t2.locale, null, true), this.parse(t2); } var m2 = M2.prototype; return m2.parse = function(t2) { this.$d = function(t3) { var e2 = t3.date, n2 = t3.utc; if (null === e2) return new Date(NaN); if (O.u(e2)) return new Date(); if (e2 instanceof Date) return new Date(e2); if ("string" == typeof e2 && !/Z$/i.test(e2)) { var r2 = e2.match(l); if (r2) { var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3); return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2); } } return new Date(e2); }(t2), this.$x = t2.x || {}, this.init(); }, m2.init = function() { var t2 = this.$d; this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds(); }, m2.$utils = function() { return O; }, m2.isValid = function() { return !(this.$d.toString() === $); }, m2.isSame = function(t2, e2) { var n2 = w(t2); return this.startOf(e2) <= n2 && n2 <= this.endOf(e2); }, m2.isAfter = function(t2, e2) { return w(t2) < this.startOf(e2); }, m2.isBefore = function(t2, e2) { return this.endOf(e2) < w(t2); }, m2.$g = function(t2, e2, n2) { return O.u(t2) ? this[e2] : this.set(n2, t2); }, m2.unix = function() { return Math.floor(this.valueOf() / 1e3); }, m2.valueOf = function() { return this.$d.getTime(); }, m2.startOf = function(t2, e2) { var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), $2 = function(t3, e3) { var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2); return r2 ? i2 : i2.endOf(a); }, l2 = function(t3, e3) { return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2); }, y2 = this.$W, M3 = this.$M, m3 = this.$D, g2 = "set" + (this.$u ? "UTC" : ""); switch (h2) { case c: return r2 ? $2(1, 0) : $2(31, 11); case f: return r2 ? $2(1, M3) : $2(0, M3 + 1); case o: var v2 = this.$locale().weekStart || 0, D2 = (y2 < v2 ? y2 + 7 : y2) - v2; return $2(r2 ? m3 - D2 : m3 + (6 - D2), M3); case a: case d: return l2(g2 + "Hours", 0); case u: return l2(g2 + "Minutes", 1); case s: return l2(g2 + "Seconds", 2); case i: return l2(g2 + "Milliseconds", 3); default: return this.clone(); } }, m2.endOf = function(t2) { return this.startOf(t2, false); }, m2.$set = function(t2, e2) { var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), $2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], l2 = o2 === a ? this.$D + (e2 - this.$W) : e2; if (o2 === f || o2 === c) { var y2 = this.clone().set(d, 1); y2.$d[$2](l2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d; } else $2 && this.$d[$2](l2); return this.init(), this; }, m2.set = function(t2, e2) { return this.clone().$set(t2, e2); }, m2.get = function(t2) { return this[O.p(t2)](); }, m2.add = function(r2, h2) { var d2, $2 = this; r2 = Number(r2); var l2 = O.p(h2), y2 = function(t2) { var e2 = w($2); return O.w(e2.date(e2.date() + Math.round(t2 * r2)), $2); }; if (l2 === f) return this.set(f, this.$M + r2); if (l2 === c) return this.set(c, this.$y + r2); if (l2 === a) return y2(1); if (l2 === o) return y2(7); var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[l2] || 1, m3 = this.$d.getTime() + r2 * M3; return O.w(m3, this); }, m2.subtract = function(t2, e2) { return this.add(-1 * t2, e2); }, m2.format = function(t2) { var e2 = this, n2 = this.$locale(); if (!this.isValid()) return n2.invalidDate || $; var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) { return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3); }, c2 = function(t3) { return O.s(s2 % 12 || 12, t3, "0"); }, d2 = n2.meridiem || function(t3, e3, n3) { var r3 = t3 < 12 ? "AM" : "PM"; return n3 ? r3.toLowerCase() : r3; }, l2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 }; return r2.replace(y, function(t3, e3) { return e3 || l2[t3] || i2.replace(":", ""); }); }, m2.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); }, m2.diff = function(r2, d2, $2) { var l2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, g2 = this - M3, v2 = O.m(this, M3); return v2 = (l2 = {}, l2[c] = v2 / 12, l2[f] = v2, l2[h] = v2 / 3, l2[o] = (g2 - m3) / 6048e5, l2[a] = (g2 - m3) / 864e5, l2[u] = g2 / n, l2[s] = g2 / e, l2[i] = g2 / t, l2)[y2] || g2, $2 ? v2 : O.a(v2); }, m2.daysInMonth = function() { return this.endOf(f).$D; }, m2.$locale = function() { return D[this.$L]; }, m2.locale = function(t2, e2) { if (!t2) return this.$L; var n2 = this.clone(), r2 = S(t2, e2, true); return r2 && (n2.$L = r2), n2; }, m2.clone = function() { return O.w(this.$d, this); }, m2.toDate = function() { return new Date(this.valueOf()); }, m2.toJSON = function() { return this.isValid() ? this.toISOString() : null; }, m2.toISOString = function() { return this.$d.toISOString(); }, m2.toString = function() { return this.$d.toUTCString(); }, M2; }(), T = _.prototype; return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) { T[t2[1]] = function(e2) { return this.$g(e2, t2[0], t2[1]); }; }), w.extend = function(t2, e2) { return t2.$i || (t2(e2, _, w), t2.$i = true), w; }, w.locale = S, w.isDayjs = p, w.unix = function(t2) { return w(1e3 * t2); }, w.en = D[v], w.Ls = D, w.p = {}, w; }); })(dayjs_min$1); var dayjs_min = dayjs_min$1.exports; const install = installer.install; const version = installer.version; export { ClickOutside, INSTALLED_KEY, SureIcon, dayjs_min as dayjs, installer as default, iconProps, install, makeInstaller, useFocus, version };