您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
一款简单的网页小说阅读器,可以隐藏在网页中,自定义书籍,功能持续维护升级中。
// ==UserScript== // @name 上班摸鱼小说阅读器 // @namespace vite-plugin-monkey // @version 0.0.2 // @author 火铊 // @description 一款简单的网页小说阅读器,可以隐藏在网页中,自定义书籍,功能持续维护升级中。 // @license MIT // @icon https://vitejs.dev/logo.svg // @match https://element.eleme.cn/* // @match https://fanyi.baidu.com/* // @match https://www.antdv.com/* // @match https://1x.antdv.com/* // @grant GM_addStyle // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // ==/UserScript== (_=>{if(typeof GM_addStyle=="function"){GM_addStyle(_);return}const t=document.createElement("style");t.textContent=_,document.head.append(t)})(" .___read-box___{position:fixed;top:0;left:0;z-index:999999;box-sizing:border-box}.___read-box___ *,.___read-box___ *:before,.___read-box___ *:after{box-sizing:border-box}.___read-mask___{position:fixed;cursor:move;top:0;left:0;width:100%;height:100%;z-index:1000}.__user-none___{-webkit-user-select:none;user-select:none}.___wrap-modal___{z-index:1000}.___ReadStyleStep___[data-v-d37dbcd7]{position:absolute;top:0;width:100%;left:0;height:25px;display:flex;padding:0 15px;align-items:center;background-color:#ffffff80;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);opacity:0;transition:all .15s}.___ReadStyleStep___ .___left___[data-v-d37dbcd7]{display:flex;flex:1 1 auto;align-items:center;gap:5px}.___ReadStyleStep___ .___right___[data-v-d37dbcd7]{flex:0 0 auto}.___ReadStyleStep___ .___btn___[data-v-d37dbcd7]{position:relative;cursor:pointer;font-size:15px;color:#666;height:22px;width:22px;text-align:center;border-radius:50%;transition:all .1s ease}.___ReadStyleStep___ .___btn___[data-v-d37dbcd7]:active{background-color:#0f9bf833}.___ReadStyleStep___ .___btn___[data-v-d37dbcd7]:hover{color:#0f9bf8;outline:1px solid #0f9bf8}.___ReadStyleStep___ .___btn___ .ghost[data-v-d37dbcd7]{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}.___ReadStyleStep___ .___close___[data-v-d37dbcd7]{font-size:14px;cursor:pointer;color:#666}.___ReadStyleStep___ .___close___[data-v-d37dbcd7]:hover{color:red}.___Slider___[data-v-d37dbcd7]{position:absolute;top:25px;left:0;right:0;width:150px;margin:auto;box-shadow:3px 3px 6px #00000026;background:#fff;border-radius:4px;padding:0 5px}.___Slider___[data-v-d37dbcd7] .ant-slider .ant-slider-handle{top:4px}.___Slider___[data-v-d37dbcd7] .ant-slider .ant-slider-handle:hover:after,.___Slider___[data-v-d37dbcd7] .ant-slider .ant-slider-handle:active:after,.___Slider___[data-v-d37dbcd7] .ant-slider .ant-slider-handle:focus:after{box-shadow:0 0 0 3px #1677ff;width:8px;height:8px}.fade-up-enter-active[data-v-d37dbcd7],.fade-up-leave-active[data-v-d37dbcd7]{transition:all .5s ease}.fade-up-enter-from[data-v-d37dbcd7],.fade-up-leave-to[data-v-d37dbcd7]{opacity:0;transform:translateY(10px)}.___read-main___[data-v-0a1c32de]{position:absolute;top:15px;left:0;bottom:0;width:100%;display:flex;flex-direction:column}.___read-main___ .___main___[data-v-0a1c32de]{flex:1 1 auto;height:0;overflow:auto;padding:20px 15px 30px;line-height:2;color:#888;font-size:14px;text-indent:2em}.___read-main___ .___main___[data-v-0a1c32de] p{margin:0 0 5px}.___read-main___ .___main___ .___index___[data-v-0a1c32de]{text-indent:0em}.___read-main___ .___main___ .___index___[data-v-0a1c32de] .___book___index___{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}.___read-main___ .___main___ .___index___[data-v-0a1c32de] .___book___item___{display:inline-block;text-align:left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:5px;line-height:1.5;font-size:13px}.___read-main___ .___main___ .___index___[data-v-0a1c32de] .___book___item___[a-href]{cursor:pointer;color:#666}.___read-main___ .___main___ .___index___[data-v-0a1c32de] .___book___item___[a-href]:hover{color:#0f9bf8}h3[data-v-a668a0f3]{border-left:3px solid #1890ff;padding-left:5px;margin-bottom:10px;font-size:14px;line-height:1.25}.info[data-v-a668a0f3]{line-height:1.5;color:#666;font-size:13px;padding:5px}.___alert___[data-v-a668a0f3] .ant-alert-description{white-space:pre}.___book-list___[data-v-293136fa]{width:100%;padding:10px 0 16px;background:#f5f5f5;height:100%;display:flex;flex-direction:column;box-shadow:0 2px 8px #0000001a}.___book-list___ .___head___[data-v-293136fa]{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e8e8e8;overflow:hidden;padding:0 16px 8px}.___book-list___ .___head___ .___title___[data-v-293136fa]{font-size:14px;font-weight:500;color:#333}.___book-list___ .___head___ .___tools___[data-v-293136fa]{display:flex;gap:8px}.___book-list___ .___head___ .___tools___ .___line___[data-v-293136fa]{height:24px;width:1px;background-color:#a1a1a1}.___book-list___ .___list___[data-v-293136fa]{flex:1 1 auto;height:0;overflow:auto;padding:10px;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;grid-auto-rows:105px}.___book-list___ .___list___ .___item___[data-v-293136fa]{cursor:pointer;width:185px;height:105px;display:inline-flex;gap:10px;vertical-align:top;padding:10px;border-radius:5px;box-shadow:0 1px 4px #00000014;position:relative;transition:all .3s;background-color:#fff}.___book-list___ .___list___ .___item___[data-v-293136fa]:hover{transform:translateY(-3px);box-shadow:0 4px 12px #0000001f}.___book-list___ .___list___ .___item___:hover .___tools___[data-v-293136fa]{opacity:1}.___book-list___ .___list___ .___item___ .___tools___[data-v-293136fa]{position:absolute;top:-5px;left:-5px;right:-5px;display:flex;justify-content:space-between;padding:2px;opacity:0;transition:opacity .3s;z-index:1}.___book-list___ .___list___ .___item___ .___tools___ .___edit___[data-v-293136fa]{background-color:#1890ff}.___book-list___ .___list___ .___item___ .___tools___ .___close___[data-v-293136fa]{background-color:#ff4d4f}.___book-list___ .___list___ .___item___ .___tools___ .anticon[data-v-293136fa]{color:#fff;cursor:pointer;font-size:12px;transition:all .2s;padding:4px;border-radius:50%;box-shadow:0 4px 12px #0000001f}.___book-list___ .___list___ .___item___ .___tools___ .anticon[data-v-293136fa]:hover{transform:scale(1.1)}.___book-list___ .___list___ .___item___ .___cover___[data-v-293136fa],.___book-list___ .___list___ .___item___ .___cover___def___[data-v-293136fa]{flex:0 0 auto;position:relative;width:65px;height:100%;margin-bottom:12px;border-radius:4px;overflow:hidden;background:#f0f2f5;border:1px solid #ddd;display:flex;align-items:center;justify-content:center}.___book-list___ .___list___ .___item___ .___cover___:hover .___reCover___[data-v-293136fa],.___book-list___ .___list___ .___item___ .___cover___def___:hover .___reCover___[data-v-293136fa]{opacity:1}.___book-list___ .___list___ .___item___ .___cover___ .___reCover___[data-v-293136fa],.___book-list___ .___list___ .___item___ .___cover___def___ .___reCover___[data-v-293136fa]{position:absolute;left:0;right:0;bottom:4px;width:19px;height:19px;padding:3px;margin:auto;cursor:pointer;font-size:16px;color:#fff;transition:all .2s;background:#4caf50;border-radius:50%;box-shadow:0 4px 12px #0000001f;opacity:0}.___book-list___ .___list___ .___item___ .___cover___ .___reCover___[data-v-293136fa]:hover,.___book-list___ .___list___ .___item___ .___cover___def___ .___reCover___[data-v-293136fa]:hover{transform:scale(1.1)}.___book-list___ .___list___ .___item___ .___cover___ img[data-v-293136fa],.___book-list___ .___list___ .___item___ .___cover___def___ img[data-v-293136fa]{width:100%;height:100%;object-fit:cover}.___book-list___ .___list___ .___item___ .___cover___def___ span[data-v-293136fa]{color:#999;font-size:10px}.___book-list___ .___list___ .___item___ .___info___[data-v-293136fa]{display:flex;flex-direction:column;flex:1 1 auto;width:0}.___book-list___ .___list___ .___item___ .___info___ .___name___[data-v-293136fa]{display:block;font-size:13px;font-weight:500;color:#333;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.___book-list___ .___list___ .___item___ .___info___ .___author___[data-v-293136fa]{display:block;font-size:12px;color:#666;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.___errorMsg___[data-v-5c2f34e7]{width:100%;text-align:center;padding:50px 0;color:#666;font-size:16px}.___resize___[data-v-21c1a3cf]{position:absolute;bottom:0;right:0;width:20px;height:20px;z-index:1;cursor:nwse-resize}.___head___[data-v-02221de2]{cursor:move;position:absolute;top:0;left:0;width:100%;height:15px}.___head___ .bg[data-v-02221de2]{width:100%;height:3px;transition:background-color .15s}.___head___:hover .bg[data-v-02221de2],.___head___.___hover___ .bg[data-v-02221de2]{background-color:#2483ff}.box[data-v-dff95206]{padding:20px}.box[data-v-dff95206] .ant-form-item{margin-bottom:10px}.box[data-v-dff95206] .ant-slider-with-marks{margin-bottom:20px}.___replace-list___ ul[data-v-1c212655]{list-style:none;padding:0;margin:0}.___replace-list___ .___replace-item___[data-v-1c212655]{display:flex;gap:16px;padding:12px;border-bottom:1px dashed #ddd}.___replace-list___ .___replace-item-left___[data-v-1c212655],.___replace-list___ .___replace-item-right___[data-v-1c212655]{flex:1}.___replace-list___ .___replace-item-left-title___[data-v-1c212655],.___replace-list___ .___replace-item-right-title___[data-v-1c212655]{font-size:14px;font-weight:500;margin-bottom:8px;color:#495057}.___replace-list___ .___replace-item-left-content___[data-v-1c212655],.___replace-list___ .___replace-item-right-content___[data-v-1c212655]{display:flex;align-items:center}.___replace-list___ .___tools___[data-v-1c212655]{display:flex;align-items:end}.___replace-list___ .___add-btn___[data-v-1c212655]{text-align:center;display:flex;gap:20px;justify-content:space-between;padding:16px 0}.___svg-icon___[data-v-efadffbd]{display:inline-block;vertical-align:middle;width:1em;height:1em}.___svg-icon___ .___path___[data-v-efadffbd]{fill:currentColor}.___svg-icon___[data-v-320ee157]{display:inline-block;vertical-align:middle;width:1em;height:1em}.___svg-icon___ .___path___[data-v-320ee157]{fill:currentColor}.___svg-icon___[data-v-6f5f5641]{display:inline-block;vertical-align:middle;width:1em;height:1em}.___svg-icon___ .___path___[data-v-6f5f5641]{fill:currentColor}.___svg-icon___[data-v-ec40ad8f]{display:inline-block;vertical-align:middle;width:1em;height:1em}.___svg-icon___ .___path___[data-v-ec40ad8f]{fill:currentColor}.___svg-icon___[data-v-22ae5d75]{display:inline-block;vertical-align:middle;width:1em;height:1em}.___svg-icon___ .___path___[data-v-22ae5d75]{fill:currentColor}.___footer___[data-v-56b53ae7]{cursor:default;position:absolute;bottom:0;left:0;width:100%;height:30px;overflow:hidden}.___footer___:hover .___box___[data-v-56b53ae7]{opacity:1;visibility:visible;animation:show-56b53ae7 .3s ease}.___footer___ .___box___[data-v-56b53ae7]{width:100%;height:100%;border-top:1px solid #ddd;background-color:#fff;opacity:0;visibility:hidden;display:flex;justify-content:space-between;align-items:center}.___footer___ .___box___ .___operate___[data-v-56b53ae7]{padding-left:5px;flex:0 0 auto}.___footer___ .___box___ .___operate___ .___btn___[data-v-56b53ae7]{cursor:pointer;font-size:12px;display:inline-block;vertical-align:middle;margin:0 5px;color:#666;transition:all .15s ease}.___footer___ .___box___ .___operate___ .___btn___[data-v-56b53ae7]:hover{color:#0f9bf8}.___footer___ .___box___ .___info___[data-v-56b53ae7]{text-align:center;padding:0 10px;width:0;flex:1 1 auto;white-space:nowrap;overflow:hidden}.___footer___ .___box___ .___info___ .___name___[data-v-56b53ae7]{font-size:12px;color:#666}.___footer___ .___box___ .___tools___[data-v-56b53ae7]{flex:0 0 auto;height:100%;padding-right:15px;line-height:18px;text-align:right;flex-wrap:nowrap;display:flex;padding-left:10px}.___footer___ .___box___ .___tools___ .___icon___[data-v-56b53ae7]{cursor:pointer;font-size:18px;color:#999;display:flex;align-items:center;justify-content:end;height:100%;margin-left:5px;transition:all .15s ease}.___footer___ .___box___ .___tools___ .___icon___[data-v-56b53ae7]:first-child{margin-left:0}.___footer___ .___box___ .___tools___ .___icon___[data-v-56b53ae7]:hover{color:#0f9bf8}@keyframes show-56b53ae7{0%{opacity:0;transform:translateY(30px)}}.___read-wrap___[data-v-0096aa60]{position:absolute;border:1px solid transparent;min-height:50px;min-width:100px;transition:border-color .15s,box-shadow .15s}.___read-wrap___.___hover-resize___[data-v-0096aa60]{border-color:#2483ff}.___read-wrap___.___hover-move___[data-v-0096aa60]{box-shadow:3px 3px 12px #00000026}.___read-wrap___ .bg[data-v-0096aa60]{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid #ddd}.___loading___[data-v-0096aa60]{padding:50px;background-color:#fff;width:100%;position:absolute;z-index:1;top:5px;bottom:0;left:0}.fade-enter-active[data-v-0096aa60],.fade-leave-active[data-v-0096aa60]{transition:opacity .5s ease}.fade-enter-from[data-v-0096aa60],.fade-leave-to[data-v-0096aa60]{opacity:0}.___showBtn___[data-v-457c95a3]{cursor:pointer;position:fixed;bottom:50px;right:-22px;width:36px;height:36px;font-size:22px;color:#7a7a7a;background:#fff;border:1px solid #ddd;box-shadow:0 0 12px #0000004d;border-radius:50%;line-height:31px;text-align:center;transition:all .3s ease;opacity:.5;z-index:9999999}.___showBtn___[data-v-457c95a3]:hover{color:#248fe7;opacity:1;background-color:#fff;transform:translate(-25px)} "); (function () { 'use strict'; var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var require_main_001 = __commonJS({ "main-X4la0IsF.js"(exports, module) { /** * @vue/shared v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function makeMap(str) { const map = /* @__PURE__ */ Object.create(null); for (const key2 of str.split(",")) map[key2] = 1; return (val) => val in map; } const EMPTY_OBJ = {}; const EMPTY_ARR = []; const NOOP = () => { }; const NO = () => false; const isOn$1 = (key2) => key2.charCodeAt(0) === 111 && key2.charCodeAt(1) === 110 && // uppercase letter (key2.charCodeAt(2) > 122 || key2.charCodeAt(2) < 97); const isModelListener = (key2) => key2.startsWith("onUpdate:"); const extend = Object.assign; const remove = (arr, el) => { const i2 = arr.indexOf(el); if (i2 > -1) { arr.splice(i2, 1); } }; const hasOwnProperty$g = Object.prototype.hasOwnProperty; const hasOwn$1 = (val, key2) => hasOwnProperty$g.call(val, key2); const isArray$2 = Array.isArray; const isMap$1 = (val) => toTypeString(val) === "[object Map]"; const isSet$1 = (val) => toTypeString(val) === "[object Set]"; const isFunction$2 = (val) => typeof val === "function"; const isString$1 = (val) => typeof val === "string"; const isSymbol$1 = (val) => typeof val === "symbol"; const isObject$4 = (val) => val !== null && typeof val === "object"; const isPromise = (val) => { return (isObject$4(val) || isFunction$2(val)) && isFunction$2(val.then) && isFunction$2(val.catch); }; const objectToString$1 = Object.prototype.toString; const toTypeString = (value) => objectToString$1.call(value); const toRawType = (value) => { return toTypeString(value).slice(8, -1); }; const isPlainObject$2 = (val) => toTypeString(val) === "[object Object]"; const isIntegerKey = (key2) => isString$1(key2) && key2 !== "NaN" && key2[0] !== "-" && "" + parseInt(key2, 10) === key2; const isReservedProp = /* @__PURE__ */ makeMap( // the leading comma is intentional so empty string "" is also included ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" ); const cacheStringFunction$1 = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; const camelizeRE$1 = /-(\w)/g; const camelize$1 = cacheStringFunction$1( (str) => { return str.replace(camelizeRE$1, (_2, c2) => c2 ? c2.toUpperCase() : ""); } ); const hyphenateRE$1 = /\B([A-Z])/g; const hyphenate$1 = cacheStringFunction$1( (str) => str.replace(hyphenateRE$1, "-$1").toLowerCase() ); const capitalize = cacheStringFunction$1((str) => { return str.charAt(0).toUpperCase() + str.slice(1); }); const toHandlerKey = cacheStringFunction$1( (str) => { const s2 = str ? `on${capitalize(str)}` : ``; return s2; } ); const hasChanged = (value, oldValue) => !Object.is(value, oldValue); const invokeArrayFns = (fns, ...arg) => { for (let i2 = 0; i2 < fns.length; i2++) { fns[i2](...arg); } }; const def = (obj, key2, value, writable = false) => { Object.defineProperty(obj, key2, { configurable: true, enumerable: false, writable, value }); }; const looseToNumber = (val) => { const n2 = parseFloat(val); return isNaN(n2) ? val : n2; }; const toNumber$1 = (val) => { const n2 = isString$1(val) ? Number(val) : NaN; return isNaN(n2) ? val : n2; }; let _globalThis; const getGlobalThis = () => { return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); }; function normalizeStyle$1(value) { if (isArray$2(value)) { const res = {}; for (let i2 = 0; i2 < value.length; i2++) { const item = value[i2]; const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle$1(item); if (normalized) { for (const key2 in normalized) { res[key2] = normalized[key2]; } } } return res; } else if (isString$1(value) || isObject$4(value)) { return value; } } const listDelimiterRE = /;(?![^(]*\))/g; const propertyDelimiterRE = /:([^]+)/; const styleCommentRE = /\/\*[^]*?\*\//g; function parseStringStyle(cssText) { const ret = {}; cssText.replace(styleCommentRE, "").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$2(value)) { for (let i2 = 0; i2 < value.length; i2++) { const normalized = normalizeClass(value[i2]); if (normalized) { res += normalized + " "; } } } else if (isObject$4(value)) { for (const name in value) { if (value[name]) { res += name + " "; } } } return res.trim(); } const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); function includeBooleanAttr(value) { return !!value || value === ""; } const isRef$1 = (val) => { return !!(val && val["__v_isRef"] === true); }; const toDisplayString = (val) => { return isString$1(val) ? val : val == null ? "" : isArray$2(val) || isObject$4(val) && (val.toString === objectToString$1 || !isFunction$2(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); }; const replacer = (_key, val) => { if (isRef$1(val)) { return replacer(_key, val.value); } else if (isMap$1(val)) { return { [`Map(${val.size})`]: [...val.entries()].reduce( (entries, [key2, val2], i2) => { entries[stringifySymbol(key2, i2) + " =>"] = val2; return entries; }, {} ) }; } else if (isSet$1(val)) { return { [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2)) }; } else if (isSymbol$1(val)) { return stringifySymbol(val); } else if (isObject$4(val) && !isArray$2(val) && !isPlainObject$2(val)) { return String(val); } return val; }; const stringifySymbol = (v2, i2 = "") => { var _a; return ( // Symbol.description in es2019+ so we need to cast here to pass // the lib: es2016 check isSymbol$1(v2) ? `Symbol(${(_a = v2.description) != null ? _a : i2})` : v2 ); }; /** * @vue/reactivity v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ let activeEffectScope; class EffectScope { constructor(detached = false) { this.detached = detached; this._active = true; this._on = 0; this.effects = []; this.cleanups = []; this._isPaused = false; this.parent = activeEffectScope; if (!detached && activeEffectScope) { this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( this ) - 1; } } get active() { return this._active; } pause() { if (this._active) { this._isPaused = true; let i2, l2; if (this.scopes) { for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { this.scopes[i2].pause(); } } for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { this.effects[i2].pause(); } } } /** * Resumes the effect scope, including all child scopes and effects. */ resume() { if (this._active) { if (this._isPaused) { this._isPaused = false; let i2, l2; if (this.scopes) { for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { this.scopes[i2].resume(); } } for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { this.effects[i2].resume(); } } } } run(fn) { if (this._active) { const currentEffectScope = activeEffectScope; try { activeEffectScope = this; return fn(); } finally { activeEffectScope = currentEffectScope; } } } /** * This should only be called on non-detached scopes * @internal */ on() { if (++this._on === 1) { this.prevScope = activeEffectScope; activeEffectScope = this; } } /** * This should only be called on non-detached scopes * @internal */ off() { if (this._on > 0 && --this._on === 0) { activeEffectScope = this.prevScope; this.prevScope = void 0; } } stop(fromParent) { if (this._active) { this._active = false; let i2, l2; for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { this.effects[i2].stop(); } this.effects.length = 0; for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) { this.cleanups[i2](); } this.cleanups.length = 0; if (this.scopes) { for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { this.scopes[i2].stop(true); } this.scopes.length = 0; } if (!this.detached && this.parent && !fromParent) { const last2 = this.parent.scopes.pop(); if (last2 && last2 !== this) { this.parent.scopes[this.index] = last2; last2.index = this.index; } } this.parent = void 0; } } } function effectScope(detached) { return new EffectScope(detached); } function getCurrentScope() { return activeEffectScope; } function onScopeDispose(fn, failSilently = false) { if (activeEffectScope) { activeEffectScope.cleanups.push(fn); } } let activeSub; const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); class ReactiveEffect { constructor(fn) { this.fn = fn; this.deps = void 0; this.depsTail = void 0; this.flags = 1 | 4; this.next = void 0; this.cleanup = void 0; this.scheduler = void 0; if (activeEffectScope && activeEffectScope.active) { activeEffectScope.effects.push(this); } } pause() { this.flags |= 64; } resume() { if (this.flags & 64) { this.flags &= -65; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); } } } /** * @internal */ notify() { if (this.flags & 2 && !(this.flags & 32)) { return; } if (!(this.flags & 8)) { batch(this); } } run() { if (!(this.flags & 1)) { return this.fn(); } this.flags |= 2; cleanupEffect(this); prepareDeps(this); const prevEffect = activeSub; const prevShouldTrack = shouldTrack; activeSub = this; shouldTrack = true; try { return this.fn(); } finally { cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; this.flags &= -3; } } stop() { if (this.flags & 1) { for (let link = this.deps; link; link = link.nextDep) { removeSub(link); } this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); this.flags &= -2; } } trigger() { if (this.flags & 64) { pausedQueueEffects.add(this); } else if (this.scheduler) { this.scheduler(); } else { this.runIfDirty(); } } /** * @internal */ runIfDirty() { if (isDirty(this)) { this.run(); } } get dirty() { return isDirty(this); } } let batchDepth = 0; let batchedSub; let batchedComputed; function batch(sub, isComputed2 = false) { sub.flags |= 8; if (isComputed2) { sub.next = batchedComputed; batchedComputed = sub; return; } sub.next = batchedSub; batchedSub = sub; } function startBatch() { batchDepth++; } function endBatch() { if (--batchDepth > 0) { return; } if (batchedComputed) { let e2 = batchedComputed; batchedComputed = void 0; while (e2) { const next2 = e2.next; e2.next = void 0; e2.flags &= -9; e2 = next2; } } let error; while (batchedSub) { let e2 = batchedSub; batchedSub = void 0; while (e2) { const next2 = e2.next; e2.next = void 0; e2.flags &= -9; if (e2.flags & 1) { try { ; e2.trigger(); } catch (err) { if (!error) error = err; } } e2 = next2; } } if (error) throw error; } function prepareDeps(sub) { for (let link = sub.deps; link; link = link.nextDep) { link.version = -1; link.prevActiveLink = link.dep.activeLink; link.dep.activeLink = link; } } function cleanupDeps(sub) { let head; let tail = sub.depsTail; let link = tail; while (link) { const prev2 = link.prevDep; if (link.version === -1) { if (link === tail) tail = prev2; removeSub(link); removeDep(link); } else { head = link; } link.dep.activeLink = link.prevActiveLink; link.prevActiveLink = void 0; link = prev2; } sub.deps = head; sub.depsTail = tail; } function isDirty(sub) { for (let link = sub.deps; link; link = link.nextDep) { if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { return true; } } if (sub._dirty) { return true; } return false; } function refreshComputed(computed2) { if (computed2.flags & 4 && !(computed2.flags & 16)) { return; } computed2.flags &= -17; if (computed2.globalVersion === globalVersion) { return; } computed2.globalVersion = globalVersion; if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) { return; } computed2.flags |= 2; const dep = computed2.dep; const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed2; shouldTrack = true; try { prepareDeps(computed2); const value = computed2.fn(computed2._value); if (dep.version === 0 || hasChanged(value, computed2._value)) { computed2.flags |= 128; computed2._value = value; dep.version++; } } catch (err) { dep.version++; throw err; } finally { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed2); computed2.flags &= -3; } } function removeSub(link, soft = false) { const { dep, prevSub, nextSub } = link; if (prevSub) { prevSub.nextSub = nextSub; link.prevSub = void 0; } if (nextSub) { nextSub.prevSub = prevSub; link.nextSub = void 0; } if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { dep.computed.flags &= -5; for (let l2 = dep.computed.deps; l2; l2 = l2.nextDep) { removeSub(l2, true); } } } if (!soft && !--dep.sc && dep.map) { dep.map.delete(dep.key); } } function removeDep(link) { const { prevDep, nextDep } = link; if (prevDep) { prevDep.nextDep = nextDep; link.prevDep = void 0; } if (nextDep) { nextDep.prevDep = prevDep; link.nextDep = void 0; } } let shouldTrack = true; const trackStack = []; function pauseTracking() { trackStack.push(shouldTrack); shouldTrack = false; } function resetTracking() { const last2 = trackStack.pop(); shouldTrack = last2 === void 0 ? true : last2; } function cleanupEffect(e2) { const { cleanup: cleanup2 } = e2; e2.cleanup = void 0; if (cleanup2) { const prevSub = activeSub; activeSub = void 0; try { cleanup2(); } finally { activeSub = prevSub; } } } let globalVersion = 0; class Link { constructor(sub, dep) { this.sub = sub; this.dep = dep; this.version = dep.version; this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; } } class Dep { constructor(computed2) { this.computed = computed2; this.version = 0; this.activeLink = void 0; this.subs = void 0; this.map = void 0; this.key = void 0; this.sc = 0; } track(debugInfo) { if (!activeSub || !shouldTrack || activeSub === this.computed) { return; } let link = this.activeLink; if (link === void 0 || link.sub !== activeSub) { link = this.activeLink = new Link(activeSub, this); if (!activeSub.deps) { activeSub.deps = activeSub.depsTail = link; } else { link.prevDep = activeSub.depsTail; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; } addSub(link); } else if (link.version === -1) { link.version = this.version; if (link.nextDep) { const next2 = link.nextDep; next2.prevDep = link.prevDep; if (link.prevDep) { link.prevDep.nextDep = next2; } link.prevDep = activeSub.depsTail; link.nextDep = void 0; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; if (activeSub.deps === link) { activeSub.deps = next2; } } } return link; } trigger(debugInfo) { this.version++; globalVersion++; this.notify(debugInfo); } notify(debugInfo) { startBatch(); try { if (false) ; for (let link = this.subs; link; link = link.prevSub) { if (link.sub.notify()) { ; link.sub.dep.notify(); } } } finally { endBatch(); } } } function addSub(link) { link.dep.sc++; if (link.sub.flags & 4) { const computed2 = link.dep.computed; if (computed2 && !link.dep.subs) { computed2.flags |= 4 | 16; for (let l2 = computed2.deps; l2; l2 = l2.nextDep) { addSub(l2); } } const currentTail = link.dep.subs; if (currentTail !== link) { link.prevSub = currentTail; if (currentTail) currentTail.nextSub = link; } link.dep.subs = link; } } const targetMap = /* @__PURE__ */ new WeakMap(); const ITERATE_KEY = Symbol( "" ); const MAP_KEY_ITERATE_KEY = Symbol( "" ); const ARRAY_ITERATE_KEY = Symbol( "" ); function track(target, type, key2) { if (shouldTrack && activeSub) { let depsMap = targetMap.get(target); if (!depsMap) { targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); } let dep = depsMap.get(key2); if (!dep) { depsMap.set(key2, dep = new Dep()); dep.map = depsMap; dep.key = key2; } { dep.track(); } } } function trigger(target, type, key2, newValue, oldValue, oldTarget) { const depsMap = targetMap.get(target); if (!depsMap) { globalVersion++; return; } const run = (dep) => { if (dep) { { dep.trigger(); } } }; startBatch(); if (type === "clear") { depsMap.forEach(run); } else { const targetIsArray = isArray$2(target); const isArrayIndex = targetIsArray && isIntegerKey(key2); if (targetIsArray && key2 === "length") { const newLength = Number(newValue); depsMap.forEach((dep, key22) => { if (key22 === "length" || key22 === ARRAY_ITERATE_KEY || !isSymbol$1(key22) && key22 >= newLength) { run(dep); } }); } else { if (key2 !== void 0 || depsMap.has(void 0)) { run(depsMap.get(key2)); } if (isArrayIndex) { run(depsMap.get(ARRAY_ITERATE_KEY)); } switch (type) { case "add": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (isMap$1(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isArrayIndex) { run(depsMap.get("length")); } break; case "delete": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (isMap$1(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (isMap$1(target)) { run(depsMap.get(ITERATE_KEY)); } break; } } } endBatch(); } function getDepFromReactive(object, key2) { const depMap = targetMap.get(object); return depMap && depMap.get(key2); } function reactiveReadArray(array) { const raw = toRaw(array); if (raw === array) return raw; track(raw, "iterate", ARRAY_ITERATE_KEY); return isShallow(array) ? raw : raw.map(toReactive$1); } function shallowReadArray(arr) { track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); return arr; } const arrayInstrumentations = { __proto__: null, [Symbol.iterator]() { return iterator(this, Symbol.iterator, toReactive$1); }, concat(...args) { return reactiveReadArray(this).concat( ...args.map((x2) => isArray$2(x2) ? reactiveReadArray(x2) : x2) ); }, entries() { return iterator(this, "entries", (value) => { value[1] = toReactive$1(value[1]); return value; }); }, every(fn, thisArg) { return apply$1(this, "every", fn, thisArg, void 0, arguments); }, filter(fn, thisArg) { return apply$1(this, "filter", fn, thisArg, (v2) => v2.map(toReactive$1), arguments); }, find(fn, thisArg) { return apply$1(this, "find", fn, thisArg, toReactive$1, arguments); }, findIndex(fn, thisArg) { return apply$1(this, "findIndex", fn, thisArg, void 0, arguments); }, findLast(fn, thisArg) { return apply$1(this, "findLast", fn, thisArg, toReactive$1, arguments); }, findLastIndex(fn, thisArg) { return apply$1(this, "findLastIndex", fn, thisArg, void 0, arguments); }, // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement forEach(fn, thisArg) { return apply$1(this, "forEach", fn, thisArg, void 0, arguments); }, includes(...args) { return searchProxy(this, "includes", args); }, indexOf(...args) { return searchProxy(this, "indexOf", args); }, join(separator) { return reactiveReadArray(this).join(separator); }, // keys() iterator only reads `length`, no optimisation required lastIndexOf(...args) { return searchProxy(this, "lastIndexOf", args); }, map(fn, thisArg) { return apply$1(this, "map", fn, thisArg, void 0, arguments); }, pop() { return noTracking(this, "pop"); }, push(...args) { return noTracking(this, "push", args); }, reduce(fn, ...args) { return reduce(this, "reduce", fn, args); }, reduceRight(fn, ...args) { return reduce(this, "reduceRight", fn, args); }, shift() { return noTracking(this, "shift"); }, // slice could use ARRAY_ITERATE but also seems to beg for range tracking some(fn, thisArg) { return apply$1(this, "some", fn, thisArg, void 0, arguments); }, splice(...args) { return noTracking(this, "splice", args); }, toReversed() { return reactiveReadArray(this).toReversed(); }, toSorted(comparer) { return reactiveReadArray(this).toSorted(comparer); }, toSpliced(...args) { return reactiveReadArray(this).toSpliced(...args); }, unshift(...args) { return noTracking(this, "unshift", args); }, values() { return iterator(this, "values", toReactive$1); } }; function iterator(self2, method, wrapValue) { const arr = shallowReadArray(self2); const iter = arr[method](); if (arr !== self2 && !isShallow(self2)) { iter._next = iter.next; iter.next = () => { const result = iter._next(); if (result.value) { result.value = wrapValue(result.value); } return result; }; } return iter; } const arrayProto$1 = Array.prototype; function apply$1(self2, method, fn, thisArg, wrappedRetFn, args) { const arr = shallowReadArray(self2); const needsWrap = arr !== self2 && !isShallow(self2); const methodFn = arr[method]; if (methodFn !== arrayProto$1[method]) { const result2 = methodFn.apply(self2, args); return needsWrap ? toReactive$1(result2) : result2; } let wrappedFn = fn; if (arr !== self2) { if (needsWrap) { wrappedFn = function(item, index2) { return fn.call(this, toReactive$1(item), index2, self2); }; } else if (fn.length > 2) { wrappedFn = function(item, index2) { return fn.call(this, item, index2, self2); }; } } const result = methodFn.call(arr, wrappedFn, thisArg); return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; } function reduce(self2, method, fn, args) { const arr = shallowReadArray(self2); let wrappedFn = fn; if (arr !== self2) { if (!isShallow(self2)) { wrappedFn = function(acc, item, index2) { return fn.call(this, acc, toReactive$1(item), index2, self2); }; } else if (fn.length > 3) { wrappedFn = function(acc, item, index2) { return fn.call(this, acc, item, index2, self2); }; } } return arr[method](wrappedFn, ...args); } function searchProxy(self2, method, args) { const arr = toRaw(self2); track(arr, "iterate", ARRAY_ITERATE_KEY); const res = arr[method](...args); if ((res === -1 || res === false) && isProxy(args[0])) { args[0] = toRaw(args[0]); return arr[method](...args); } return res; } function noTracking(self2, method, args = []) { pauseTracking(); startBatch(); const res = toRaw(self2)[method].apply(self2, args); endBatch(); resetTracking(); return res; } const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); const builtInSymbols = new Set( /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key2) => key2 !== "arguments" && key2 !== "caller").map((key2) => Symbol[key2]).filter(isSymbol$1) ); function hasOwnProperty$f(key2) { if (!isSymbol$1(key2)) key2 = String(key2); const obj = toRaw(this); track(obj, "has", key2); return obj.hasOwnProperty(key2); } class BaseReactiveHandler { constructor(_isReadonly = false, _isShallow = false) { this._isReadonly = _isReadonly; this._isShallow = _isShallow; } get(target, key2, receiver) { if (key2 === "__v_skip") return target["__v_skip"]; const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; if (key2 === "__v_isReactive") { return !isReadonly2; } else if (key2 === "__v_isReadonly") { return isReadonly2; } else if (key2 === "__v_isShallow") { return isShallow2; } else if (key2 === "__v_raw") { if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype // this means the receiver is a user proxy of the reactive proxy Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { return target; } return; } const targetIsArray = isArray$2(target); if (!isReadonly2) { let fn; if (targetIsArray && (fn = arrayInstrumentations[key2])) { return fn; } if (key2 === "hasOwnProperty") { return hasOwnProperty$f; } } const res = Reflect.get( target, key2, // if this is a proxy wrapping a ref, return methods using the raw ref // as receiver so that we don't have to call `toRaw` on the ref in all // its class methods isRef(target) ? target : receiver ); if (isSymbol$1(key2) ? builtInSymbols.has(key2) : isNonTrackableKeys(key2)) { return res; } if (!isReadonly2) { track(target, "get", key2); } if (isShallow2) { return res; } if (isRef(res)) { return targetIsArray && isIntegerKey(key2) ? res : res.value; } if (isObject$4(res)) { return isReadonly2 ? readonly(res) : reactive(res); } return res; } } class MutableReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(false, isShallow2); } set(target, key2, value, receiver) { let oldValue = target[key2]; if (!this._isShallow) { const isOldValueReadonly = isReadonly(oldValue); if (!isShallow(value) && !isReadonly(value)) { oldValue = toRaw(oldValue); value = toRaw(value); } if (!isArray$2(target) && isRef(oldValue) && !isRef(value)) { if (isOldValueReadonly) { return false; } else { oldValue.value = value; return true; } } } const hadKey = isArray$2(target) && isIntegerKey(key2) ? Number(key2) < target.length : hasOwn$1(target, key2); const result = Reflect.set( target, key2, value, isRef(target) ? target : receiver ); if (target === toRaw(receiver)) { if (!hadKey) { trigger(target, "add", key2, value); } else if (hasChanged(value, oldValue)) { trigger(target, "set", key2, value); } } return result; } deleteProperty(target, key2) { const hadKey = hasOwn$1(target, key2); target[key2]; const result = Reflect.deleteProperty(target, key2); if (result && hadKey) { trigger(target, "delete", key2, void 0); } return result; } has(target, key2) { const result = Reflect.has(target, key2); if (!isSymbol$1(key2) || !builtInSymbols.has(key2)) { track(target, "has", key2); } return result; } ownKeys(target) { track( target, "iterate", isArray$2(target) ? "length" : ITERATE_KEY ); return Reflect.ownKeys(target); } } class ReadonlyReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(true, isShallow2); } set(target, key2) { return true; } deleteProperty(target, key2) { return true; } } const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); const toShallow = (value) => value; const getProto = (v2) => Reflect.getPrototypeOf(v2); function createIterableMethod(method, isReadonly2, isShallow2) { return function(...args) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const targetIsMap = isMap$1(rawTarget); const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target[method](...args); const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1; !isReadonly2 && track( rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY ); return { // iterator protocol next() { const { value, done } = innerIterator.next(); return done ? { value, done } : { value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), done }; }, // iterable protocol [Symbol.iterator]() { return this; } }; }; } function createReadonlyMethod(type) { return function(...args) { return type === "delete" ? false : type === "clear" ? void 0 : this; }; } function createInstrumentations(readonly2, shallow) { const instrumentations = { get(key2) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key2); if (!readonly2) { if (hasChanged(key2, rawKey)) { track(rawTarget, "get", key2); } track(rawTarget, "get", rawKey); } const { has } = getProto(rawTarget); const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive$1; if (has.call(rawTarget, key2)) { return wrap(target.get(key2)); } else if (has.call(rawTarget, rawKey)) { return wrap(target.get(rawKey)); } else if (target !== rawTarget) { target.get(key2); } }, get size() { const target = this["__v_raw"]; !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY); return Reflect.get(target, "size", target); }, has(key2) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key2); if (!readonly2) { if (hasChanged(key2, rawKey)) { track(rawTarget, "has", key2); } track(rawTarget, "has", rawKey); } return key2 === rawKey ? target.has(key2) : target.has(key2) || target.has(rawKey); }, forEach(callback, thisArg) { const observed = this; const target = observed["__v_raw"]; const rawTarget = toRaw(target); const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive$1; !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); return target.forEach((value, key2) => { return callback.call(thisArg, wrap(value), wrap(key2), observed); }); } }; extend( instrumentations, readonly2 ? { add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear") } : { add(value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const proto = getProto(target); const hadKey = proto.has.call(target, value); if (!hadKey) { target.add(value); trigger(target, "add", value, value); } return this; }, set(key2, value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const { has, get: get2 } = getProto(target); let hadKey = has.call(target, key2); if (!hadKey) { key2 = toRaw(key2); hadKey = has.call(target, key2); } const oldValue = get2.call(target, key2); target.set(key2, value); if (!hadKey) { trigger(target, "add", key2, value); } else if (hasChanged(value, oldValue)) { trigger(target, "set", key2, value); } return this; }, delete(key2) { const target = toRaw(this); const { has, get: get2 } = getProto(target); let hadKey = has.call(target, key2); if (!hadKey) { key2 = toRaw(key2); hadKey = has.call(target, key2); } get2 ? get2.call(target, key2) : void 0; const result = target.delete(key2); if (hadKey) { trigger(target, "delete", key2, void 0); } return result; }, clear() { const target = toRaw(this); const hadItems = target.size !== 0; const result = target.clear(); if (hadItems) { trigger( target, "clear", void 0, void 0 ); } return result; } } ); const iteratorMethods = [ "keys", "values", "entries", Symbol.iterator ]; iteratorMethods.forEach((method) => { instrumentations[method] = createIterableMethod(method, readonly2, shallow); }); return instrumentations; } function createInstrumentationGetter(isReadonly2, shallow) { const instrumentations = createInstrumentations(isReadonly2, shallow); return (target, key2, receiver) => { if (key2 === "__v_isReactive") { return !isReadonly2; } else if (key2 === "__v_isReadonly") { return isReadonly2; } else if (key2 === "__v_raw") { return target; } return Reflect.get( hasOwn$1(instrumentations, key2) && key2 in target ? instrumentations : target, key2, receiver ); }; } const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) }; const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) }; const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) }; const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) }; const reactiveMap = /* @__PURE__ */ new WeakMap(); const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); const readonlyMap = /* @__PURE__ */ new WeakMap(); const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); function targetTypeMap(rawType) { switch (rawType) { case "Object": case "Array": return 1; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2; default: return 0; } } function getTargetType(value) { return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); } function reactive(target) { if (isReadonly(target)) { return target; } return createReactiveObject( target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap ); } function shallowReactive(target) { return createReactiveObject( target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap ); } function readonly(target) { return createReactiveObject( target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap ); } function shallowReadonly(target) { return createReactiveObject( target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap ); } function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { if (!isObject$4(target)) { return target; } if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } const targetType = getTargetType(target); if (targetType === 0) { return target; } const existingProxy = proxyMap.get(target); if (existingProxy) { return existingProxy; } const proxy = new Proxy( target, targetType === 2 ? collectionHandlers : baseHandlers ); proxyMap.set(target, proxy); return proxy; } 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 isShallow(value) { return !!(value && value["__v_isShallow"]); } function isProxy(value) { return value ? !!value["__v_raw"] : false; } function toRaw(observed) { const raw = observed && observed["__v_raw"]; return raw ? toRaw(raw) : observed; } function markRaw(value) { if (!hasOwn$1(value, "__v_skip") && Object.isExtensible(value)) { def(value, "__v_skip", true); } return value; } const toReactive$1 = (value) => isObject$4(value) ? reactive(value) : value; const toReadonly = (value) => isObject$4(value) ? readonly(value) : value; function isRef(r2) { return r2 ? r2["__v_isRef"] === true : false; } function ref(value) { return createRef$1(value, false); } function shallowRef(value) { return createRef$1(value, true); } function createRef$1(rawValue, shallow) { if (isRef(rawValue)) { return rawValue; } return new RefImpl(rawValue, shallow); } class RefImpl { constructor(value, isShallow2) { this.dep = new Dep(); this["__v_isRef"] = true; this["__v_isShallow"] = false; this._rawValue = isShallow2 ? value : toRaw(value); this._value = isShallow2 ? value : toReactive$1(value); this["__v_isShallow"] = isShallow2; } get value() { { this.dep.track(); } return this._value; } set value(newValue) { const oldValue = this._rawValue; const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); newValue = useDirectValue ? newValue : toRaw(newValue); if (hasChanged(newValue, oldValue)) { this._rawValue = newValue; this._value = useDirectValue ? newValue : toReactive$1(newValue); { this.dep.trigger(); } } } } function triggerRef(ref2) { if (ref2.dep) { { ref2.dep.trigger(); } } } function unref(ref2) { return isRef(ref2) ? ref2.value : ref2; } const shallowUnwrapHandlers = { get: (target, key2, receiver) => key2 === "__v_raw" ? target : unref(Reflect.get(target, key2, receiver)), set: (target, key2, value, receiver) => { const oldValue = target[key2]; if (isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } else { return Reflect.set(target, key2, value, receiver); } } }; function proxyRefs(objectWithRefs) { return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); } function toRefs(object) { const ret = isArray$2(object) ? new Array(object.length) : {}; for (const key2 in object) { ret[key2] = propertyToRef(object, key2); } return ret; } class ObjectRefImpl { constructor(_object, _key, _defaultValue) { this._object = _object; this._key = _key; this._defaultValue = _defaultValue; this["__v_isRef"] = true; this._value = void 0; } get value() { const val = this._object[this._key]; return this._value = val === void 0 ? this._defaultValue : val; } set value(newVal) { this._object[this._key] = newVal; } get dep() { return getDepFromReactive(toRaw(this._object), this._key); } } class GetterRefImpl { constructor(_getter) { this._getter = _getter; this["__v_isRef"] = true; this["__v_isReadonly"] = true; this._value = void 0; } get value() { return this._value = this._getter(); } } function toRef(source, key2, defaultValue) { if (isRef(source)) { return source; } else if (isFunction$2(source)) { return new GetterRefImpl(source); } else if (isObject$4(source) && arguments.length > 1) { return propertyToRef(source, key2, defaultValue); } else { return ref(source); } } function propertyToRef(source, key2, defaultValue) { const val = source[key2]; return isRef(val) ? val : new ObjectRefImpl(source, key2, defaultValue); } class ComputedRefImpl { constructor(fn, setter, isSSR) { this.fn = fn; this.setter = setter; this._value = void 0; this.dep = new Dep(this); this.__v_isRef = true; this.deps = void 0; this.depsTail = void 0; this.flags = 16; this.globalVersion = globalVersion - 1; this.next = void 0; this.effect = this; this["__v_isReadonly"] = !setter; this.isSSR = isSSR; } /** * @internal */ notify() { this.flags |= 16; if (!(this.flags & 8) && // avoid infinite self recursion activeSub !== this) { batch(this, true); return true; } } get value() { const link = this.dep.track(); refreshComputed(this); if (link) { link.version = this.dep.version; } return this._value; } set value(newValue) { if (this.setter) { this.setter(newValue); } } } function computed$1(getterOrOptions, debugOptions, isSSR = false) { let getter; let setter; if (isFunction$2(getterOrOptions)) { getter = getterOrOptions; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } const cRef = new ComputedRefImpl(getter, setter, isSSR); return cRef; } const INITIAL_WATCHER_VALUE = {}; const cleanupMap = /* @__PURE__ */ new WeakMap(); let activeWatcher = void 0; function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { if (owner) { let cleanups = cleanupMap.get(owner); if (!cleanups) cleanupMap.set(owner, cleanups = []); cleanups.push(cleanupFn); } } function watch$1(source, cb, options = EMPTY_OBJ) { const { immediate, deep, once, scheduler, augmentJob, call: call2 } = options; const reactiveGetter = (source2) => { if (deep) return source2; if (isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1); return traverse(source2); }; let effect2; let getter; let cleanup2; let boundCleanup; let forceTrigger = false; let isMultiSource = false; if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { getter = () => reactiveGetter(source); forceTrigger = true; } else if (isArray$2(source)) { isMultiSource = true; forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2)); getter = () => source.map((s2) => { if (isRef(s2)) { return s2.value; } else if (isReactive(s2)) { return reactiveGetter(s2); } else if (isFunction$2(s2)) { return call2 ? call2(s2, 2) : s2(); } else ; }); } else if (isFunction$2(source)) { if (cb) { getter = call2 ? () => call2(source, 2) : source; } else { getter = () => { if (cleanup2) { pauseTracking(); try { cleanup2(); } finally { resetTracking(); } } const currentEffect = activeWatcher; activeWatcher = effect2; try { return call2 ? call2(source, 3, [boundCleanup]) : source(boundCleanup); } finally { activeWatcher = currentEffect; } }; } } else { getter = NOOP; } if (cb && deep) { const baseGetter = getter; const depth = deep === true ? Infinity : deep; getter = () => traverse(baseGetter(), depth); } const scope = getCurrentScope(); const watchHandle = () => { effect2.stop(); if (scope && scope.active) { remove(scope.effects, effect2); } }; if (once && cb) { const _cb = cb; cb = (...args) => { _cb(...args); watchHandle(); }; } let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; const job = (immediateFirstRun) => { if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { return; } if (cb) { const newValue = effect2.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue, oldValue))) { if (cleanup2) { cleanup2(); } const currentWatcher = activeWatcher; activeWatcher = effect2; try { const args = [ newValue, // pass undefined as the old value when it's changed for the first time oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; oldValue = newValue; call2 ? call2(cb, 3, args) : ( // @ts-expect-error cb(...args) ); } finally { activeWatcher = currentWatcher; } } } else { effect2.run(); } }; if (augmentJob) { augmentJob(job); } effect2 = new ReactiveEffect(getter); effect2.scheduler = scheduler ? () => scheduler(job, false) : job; boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2); cleanup2 = effect2.onStop = () => { const cleanups = cleanupMap.get(effect2); if (cleanups) { if (call2) { call2(cleanups, 4); } else { for (const cleanup22 of cleanups) cleanup22(); } cleanupMap.delete(effect2); } }; if (cb) { if (immediate) { job(true); } else { oldValue = effect2.run(); } } else if (scheduler) { scheduler(job.bind(null, true), true); } else { effect2.run(); } watchHandle.pause = effect2.pause.bind(effect2); watchHandle.resume = effect2.resume.bind(effect2); watchHandle.stop = watchHandle; return watchHandle; } function traverse(value, depth = Infinity, seen) { if (depth <= 0 || !isObject$4(value) || value["__v_skip"]) { return value; } seen = seen || /* @__PURE__ */ new Set(); if (seen.has(value)) { return value; } seen.add(value); depth--; if (isRef(value)) { traverse(value.value, depth, seen); } else if (isArray$2(value)) { for (let i2 = 0; i2 < value.length; i2++) { traverse(value[i2], depth, seen); } } else if (isSet$1(value) || isMap$1(value)) { value.forEach((v2) => { traverse(v2, depth, seen); }); } else if (isPlainObject$2(value)) { for (const key2 in value) { traverse(value[key2], depth, seen); } for (const key2 of Object.getOwnPropertySymbols(value)) { if (Object.prototype.propertyIsEnumerable.call(value, key2)) { traverse(value[key2], depth, seen); } } } return value; } /** * @vue/runtime-core v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ const stack = []; let isWarning = false; function warn$1(msg, ...args) { if (isWarning) return; isWarning = true; pauseTracking(); const instance = stack.length ? stack[stack.length - 1].component : null; const appWarnHandler = instance && instance.appContext.config.warnHandler; const trace = getComponentTrace(); if (appWarnHandler) { callWithErrorHandling( appWarnHandler, instance, 11, [ // eslint-disable-next-line no-restricted-syntax msg + args.map((a2) => { var _a, _b; return (_b = (_a = a2.toString) == null ? void 0 : _a.call(a2)) != null ? _b : JSON.stringify(a2); }).join(""), instance && instance.proxy, trace.map( ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` ).join("\n"), trace ] ); } else { const warnArgs = [`[Vue warn]: ${msg}`, ...args]; if (trace.length && // avoid spamming console during tests true) { warnArgs.push(` `, ...formatTrace(trace)); } console.warn(...warnArgs); } resetTracking(); isWarning = false; } function getComponentTrace() { let currentVNode = stack[stack.length - 1]; if (!currentVNode) { return []; } const normalizedStack = []; while (currentVNode) { const last2 = normalizedStack[0]; if (last2 && last2.vnode === currentVNode) { last2.recurseCount++; } else { normalizedStack.push({ vnode: currentVNode, recurseCount: 0 }); } const parentInstance = currentVNode.component && currentVNode.component.parent; currentVNode = parentInstance && parentInstance.vnode; } return normalizedStack; } function formatTrace(trace) { const logs = []; trace.forEach((entry, i2) => { logs.push(...i2 === 0 ? [] : [` `], ...formatTraceEntry(entry)); }); return logs; } function formatTraceEntry({ vnode, recurseCount }) { const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; const isRoot = vnode.component ? vnode.component.parent == null : false; const open2 = ` at <${formatComponentName( vnode.component, vnode.type, isRoot )}`; const close = `>` + postfix; return vnode.props ? [open2, ...formatProps(vnode.props), close] : [open2 + close]; } function formatProps(props2) { const res = []; const keys2 = Object.keys(props2); keys2.slice(0, 3).forEach((key2) => { res.push(...formatProp(key2, props2[key2])); }); if (keys2.length > 3) { res.push(` ...`); } return res; } function formatProp(key2, value, raw) { if (isString$1(value)) { value = JSON.stringify(value); return raw ? value : [`${key2}=${value}`]; } else if (typeof value === "number" || typeof value === "boolean" || value == null) { return raw ? value : [`${key2}=${value}`]; } else if (isRef(value)) { value = formatProp(key2, toRaw(value.value), true); return raw ? value : [`${key2}=Ref<`, value, `>`]; } else if (isFunction$2(value)) { return [`${key2}=fn${value.name ? `<${value.name}>` : ``}`]; } else { value = toRaw(value); return raw ? value : [`${key2}=`, value]; } } function callWithErrorHandling(fn, instance, type, args) { try { return args ? fn(...args) : fn(); } catch (err) { handleError(err, instance, type); } } function callWithAsyncErrorHandling(fn, instance, type, args) { if (isFunction$2(fn)) { const res = callWithErrorHandling(fn, instance, type, args); if (res && isPromise(res)) { res.catch((err) => { handleError(err, instance, type); }); } return res; } if (isArray$2(fn)) { const values = []; for (let i2 = 0; i2 < fn.length; i2++) { values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args)); } return values; } } function handleError(err, instance, type, throwInDev = true) { const contextVNode = instance ? instance.vnode : null; const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; if (instance) { let cur = instance.parent; const exposedInstance = instance.proxy; const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`; while (cur) { const errorCapturedHooks = cur.ec; if (errorCapturedHooks) { for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) { if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) { return; } } } cur = cur.parent; } if (errorHandler) { pauseTracking(); callWithErrorHandling(errorHandler, null, 10, [ err, exposedInstance, errorInfo ]); resetTracking(); return; } } logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); } function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { if (throwInProd) { throw err; } else { console.error(err); } } const queue = []; let flushIndex = -1; const pendingPostFlushCbs = []; let activePostFlushCbs = null; let postFlushIndex = 0; const resolvedPromise = /* @__PURE__ */ Promise.resolve(); let currentFlushPromise = null; function nextTick(fn) { const p2 = currentFlushPromise || resolvedPromise; return fn ? p2.then(this ? fn.bind(this) : fn) : p2; } function findInsertionIndex(id) { let start = flushIndex + 1; let end = queue.length; while (start < end) { const middle = start + end >>> 1; const middleJob = queue[middle]; const middleJobId = getId(middleJob); if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { start = middle + 1; } else { end = middle; } } return start; } function queueJob(job) { if (!(job.flags & 1)) { const jobId = getId(job); const lastJob = queue[queue.length - 1]; if (!lastJob || // fast path when the job id is larger than the tail !(job.flags & 2) && jobId >= getId(lastJob)) { queue.push(job); } else { queue.splice(findInsertionIndex(jobId), 0, job); } job.flags |= 1; queueFlush(); } } function queueFlush() { if (!currentFlushPromise) { currentFlushPromise = resolvedPromise.then(flushJobs); } } function queuePostFlushCb(cb) { if (!isArray$2(cb)) { if (activePostFlushCbs && cb.id === -1) { activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); } else if (!(cb.flags & 1)) { pendingPostFlushCbs.push(cb); cb.flags |= 1; } } else { pendingPostFlushCbs.push(...cb); } queueFlush(); } function flushPreFlushCbs(instance, seen, i2 = flushIndex + 1) { for (; i2 < queue.length; i2++) { const cb = queue[i2]; if (cb && cb.flags & 2) { if (instance && cb.id !== instance.uid) { continue; } queue.splice(i2, 1); i2--; if (cb.flags & 4) { cb.flags &= -2; } cb(); if (!(cb.flags & 4)) { cb.flags &= -2; } } } } function flushPostFlushCbs(seen) { if (pendingPostFlushCbs.length) { const deduped = [...new Set(pendingPostFlushCbs)].sort( (a2, b2) => getId(a2) - getId(b2) ); pendingPostFlushCbs.length = 0; if (activePostFlushCbs) { activePostFlushCbs.push(...deduped); return; } activePostFlushCbs = deduped; for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { const cb = activePostFlushCbs[postFlushIndex]; if (cb.flags & 4) { cb.flags &= -2; } if (!(cb.flags & 8)) cb(); cb.flags &= -2; } activePostFlushCbs = null; postFlushIndex = 0; } } const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; function flushJobs(seen) { try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job && !(job.flags & 8)) { if (false) ; if (job.flags & 4) { job.flags &= ~1; } callWithErrorHandling( job, job.i, job.i ? 15 : 14 ); if (!(job.flags & 4)) { job.flags &= ~1; } } } } finally { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { job.flags &= -2; } } flushIndex = -1; queue.length = 0; flushPostFlushCbs(); currentFlushPromise = null; if (queue.length || pendingPostFlushCbs.length) { flushJobs(); } } } let currentRenderingInstance = null; let currentScopeId = null; function setCurrentRenderingInstance(instance) { const prev2 = currentRenderingInstance; currentRenderingInstance = instance; currentScopeId = instance && instance.type.__scopeId || null; return prev2; } function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { if (!ctx) return fn; if (fn._n) { return fn; } const renderFnWithContext = (...args) => { if (renderFnWithContext._d) { setBlockTracking(-1); } const prevInstance = setCurrentRenderingInstance(ctx); let res; try { res = fn(...args); } finally { setCurrentRenderingInstance(prevInstance); if (renderFnWithContext._d) { setBlockTracking(1); } } return res; }; renderFnWithContext._n = true; renderFnWithContext._c = true; renderFnWithContext._d = true; return renderFnWithContext; } function withDirectives(vnode, directives) { if (currentRenderingInstance === null) { return vnode; } const instance = getComponentPublicInstance(currentRenderingInstance); const bindings = vnode.dirs || (vnode.dirs = []); for (let i2 = 0; i2 < directives.length; i2++) { let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i2]; if (dir) { if (isFunction$2(dir)) { dir = { mounted: dir, updated: dir }; } if (dir.deep) { traverse(value); } bindings.push({ dir, instance, value, oldValue: void 0, arg, modifiers }); } } return vnode; } function invokeDirectiveHook(vnode, prevVNode, instance, name) { const bindings = vnode.dirs; const oldBindings = prevVNode && prevVNode.dirs; for (let i2 = 0; i2 < bindings.length; i2++) { const binding = bindings[i2]; if (oldBindings) { binding.oldValue = oldBindings[i2].value; } let hook = binding.dir[name]; if (hook) { pauseTracking(); callWithAsyncErrorHandling(hook, instance, 8, [ vnode.el, binding, vnode, prevVNode ]); resetTracking(); } } } const TeleportEndKey = Symbol("_vte"); const isTeleport = (type) => type.__isTeleport; const isTeleportDisabled = (props2) => props2 && (props2.disabled || props2.disabled === ""); const isTeleportDeferred = (props2) => props2 && (props2.defer || props2.defer === ""); const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; const resolveTarget = (props2, select) => { const targetSelector = props2 && props2.to; if (isString$1(targetSelector)) { if (!select) { return null; } else { const target = select(targetSelector); return target; } } else { return targetSelector; } }; const TeleportImpl = { name: "Teleport", __isTeleport: true, process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals; const disabled = isTeleportDisabled(n2.props); let { shapeFlag, children, dynamicChildren } = n2; if (n1 == null) { const placeholder = n2.el = createText(""); const mainAnchor = n2.anchor = createText(""); insert(placeholder, container, anchor); insert(mainAnchor, container, anchor); const mount = (container2, anchor2) => { if (shapeFlag & 16) { if (parentComponent && parentComponent.isCE) { parentComponent.ce._teleportTarget = container2; } mountChildren( children, container2, anchor2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const mountToTarget = () => { const target = n2.target = resolveTarget(n2.props, querySelector); const targetAnchor = prepareAnchor(target, n2, createText, insert); if (target) { if (namespace !== "svg" && isTargetSVG(target)) { namespace = "svg"; } else if (namespace !== "mathml" && isTargetMathML(target)) { namespace = "mathml"; } if (!disabled) { mount(target, targetAnchor); updateCssVars(n2, false); } } }; if (disabled) { mount(container, mainAnchor); updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { n2.el.__isMounted = false; queuePostRenderEffect(() => { mountToTarget(); delete n2.el.__isMounted; }, parentSuspense); } else { mountToTarget(); } } else { if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) { queuePostRenderEffect(() => { TeleportImpl.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); }, parentSuspense); return; } n2.el = n1.el; n2.targetStart = n1.targetStart; const mainAnchor = n2.anchor = n1.anchor; const target = n2.target = n1.target; const targetAnchor = n2.targetAnchor = n1.targetAnchor; const wasDisabled = isTeleportDisabled(n1.props); const currentContainer = wasDisabled ? container : target; const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; if (namespace === "svg" || isTargetSVG(target)) { namespace = "svg"; } else if (namespace === "mathml" || isTargetMathML(target)) { namespace = "mathml"; } if (dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, namespace, slotScopeIds ); traverseStaticChildren(n1, n2, true); } else if (!optimized) { patchChildren( n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, false ); } if (disabled) { if (!wasDisabled) { moveTeleport( n2, container, mainAnchor, internals, 1 ); } else { if (n2.props && n1.props && n2.props.to !== n1.props.to) { n2.props.to = n1.props.to; } } } else { if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { const nextTarget = n2.target = resolveTarget( n2.props, querySelector ); if (nextTarget) { moveTeleport( n2, nextTarget, null, internals, 0 ); } } else if (wasDisabled) { moveTeleport( n2, target, targetAnchor, internals, 1 ); } } updateCssVars(n2, disabled); } }, remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props: props2 } = vnode; if (target) { hostRemove(targetStart); hostRemove(targetAnchor); } doRemove && hostRemove(anchor); if (shapeFlag & 16) { const shouldRemove = doRemove || !isTeleportDisabled(props2); for (let i2 = 0; i2 < children.length; i2++) { const child = children[i2]; unmount( child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren ); } } }, move: moveTeleport, hydrate: hydrateTeleport }; function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { if (moveType === 0) { insert(vnode.targetAnchor, container, parentAnchor); } const { el, anchor, shapeFlag, children, props: props2 } = vnode; const isReorder = moveType === 2; if (isReorder) { insert(el, container, parentAnchor); } if (!isReorder || isTeleportDisabled(props2)) { if (shapeFlag & 16) { for (let i2 = 0; i2 < children.length; i2++) { move( children[i2], container, parentAnchor, 2 ); } } } if (isReorder) { insert(anchor, container, parentAnchor); } } function hydrateTeleport(node2, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector, insert, createText } }, hydrateChildren) { const target = vnode.target = resolveTarget( vnode.props, querySelector ); if (target) { const disabled = isTeleportDisabled(vnode.props); const targetNode = target._lpa || target.firstChild; if (vnode.shapeFlag & 16) { if (disabled) { vnode.anchor = hydrateChildren( nextSibling(node2), vnode, parentNode(node2), parentComponent, parentSuspense, slotScopeIds, optimized ); vnode.targetStart = targetNode; vnode.targetAnchor = targetNode && nextSibling(targetNode); } else { vnode.anchor = nextSibling(node2); let targetAnchor = targetNode; while (targetAnchor) { if (targetAnchor && targetAnchor.nodeType === 8) { if (targetAnchor.data === "teleport start anchor") { vnode.targetStart = targetAnchor; } else if (targetAnchor.data === "teleport anchor") { vnode.targetAnchor = targetAnchor; target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); break; } } targetAnchor = nextSibling(targetAnchor); } if (!vnode.targetAnchor) { prepareAnchor(target, vnode, createText, insert); } hydrateChildren( targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized ); } } updateCssVars(vnode, disabled); } return vnode.anchor && nextSibling(vnode.anchor); } const Teleport = TeleportImpl; function updateCssVars(vnode, isDisabled) { const ctx = vnode.ctx; if (ctx && ctx.ut) { let node2, anchor; if (isDisabled) { node2 = vnode.el; anchor = vnode.anchor; } else { node2 = vnode.targetStart; anchor = vnode.targetAnchor; } while (node2 && node2 !== anchor) { if (node2.nodeType === 1) node2.setAttribute("data-v-owner", ctx.uid); node2 = node2.nextSibling; } ctx.ut(); } } function prepareAnchor(target, vnode, createText, insert) { const targetStart = vnode.targetStart = createText(""); const targetAnchor = vnode.targetAnchor = createText(""); targetStart[TeleportEndKey] = targetAnchor; if (target) { insert(targetStart, target); insert(targetAnchor, target); } return targetAnchor; } const leaveCbKey = Symbol("_leaveCb"); const enterCbKey$1 = Symbol("_enterCb"); function useTransitionState() { const state = { isMounted: false, isLeaving: false, isUnmounting: false, leavingVNodes: /* @__PURE__ */ new Map() }; onMounted(() => { state.isMounted = true; }); onBeforeUnmount(() => { state.isUnmounting = true; }); return state; } const TransitionHookValidator = [Function, Array]; const BaseTransitionPropsValidators = { mode: String, appear: Boolean, persisted: Boolean, // enter onBeforeEnter: TransitionHookValidator, onEnter: TransitionHookValidator, onAfterEnter: TransitionHookValidator, onEnterCancelled: TransitionHookValidator, // leave onBeforeLeave: TransitionHookValidator, onLeave: TransitionHookValidator, onAfterLeave: TransitionHookValidator, onLeaveCancelled: TransitionHookValidator, // appear onBeforeAppear: TransitionHookValidator, onAppear: TransitionHookValidator, onAfterAppear: TransitionHookValidator, onAppearCancelled: TransitionHookValidator }; const recursiveGetSubtree = (instance) => { const subTree = instance.subTree; return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; }; const BaseTransitionImpl = { name: `BaseTransition`, props: BaseTransitionPropsValidators, setup(props2, { slots }) { const instance = getCurrentInstance(); const state = useTransitionState(); return () => { const children = slots.default && getTransitionRawChildren(slots.default(), true); if (!children || !children.length) { return; } const child = findNonCommentChild(children); const rawProps = toRaw(props2); const { mode } = rawProps; if (state.isLeaving) { return emptyPlaceholder(child); } const innerChild = getInnerChild$1(child); if (!innerChild) { return emptyPlaceholder(child); } let enterHooks = resolveTransitionHooks( innerChild, rawProps, state, instance, // #11061, ensure enterHooks is fresh after clone (hooks) => enterHooks = hooks ); if (innerChild.type !== Comment) { setTransitionHooks(innerChild, enterHooks); } let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { let leavingHooks = resolveTransitionHooks( oldInnerChild, rawProps, state, instance ); setTransitionHooks(oldInnerChild, leavingHooks); if (mode === "out-in" && innerChild.type !== Comment) { state.isLeaving = true; leavingHooks.afterLeave = () => { state.isLeaving = false; if (!(instance.job.flags & 8)) { instance.update(); } delete leavingHooks.afterLeave; oldInnerChild = void 0; }; return emptyPlaceholder(child); } else if (mode === "in-out" && innerChild.type !== Comment) { leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { const leavingVNodesCache = getLeavingNodesForType( state, oldInnerChild ); leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; el[leaveCbKey] = () => { earlyRemove(); el[leaveCbKey] = void 0; delete enterHooks.delayedLeave; oldInnerChild = void 0; }; enterHooks.delayedLeave = () => { delayedLeave(); delete enterHooks.delayedLeave; oldInnerChild = void 0; }; }; } else { oldInnerChild = void 0; } } else if (oldInnerChild) { oldInnerChild = void 0; } return child; }; } }; function findNonCommentChild(children) { let child = children[0]; if (children.length > 1) { for (const c2 of children) { if (c2.type !== Comment) { child = c2; break; } } } return child; } const BaseTransition = BaseTransitionImpl; function getLeavingNodesForType(state, vnode) { const { leavingVNodes } = state; let leavingVNodesCache = leavingVNodes.get(vnode.type); if (!leavingVNodesCache) { leavingVNodesCache = /* @__PURE__ */ Object.create(null); leavingVNodes.set(vnode.type, leavingVNodesCache); } return leavingVNodesCache; } function resolveTransitionHooks(vnode, props2, state, instance, postClone) { const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props2; const key2 = String(vnode.key); const leavingVNodesCache = getLeavingNodesForType(state, vnode); const callHook2 = (hook, args) => { hook && callWithAsyncErrorHandling( hook, instance, 9, args ); }; const callAsyncHook = (hook, args) => { const done = args[1]; callHook2(hook, args); if (isArray$2(hook)) { if (hook.every((hook2) => hook2.length <= 1)) done(); } else if (hook.length <= 1) { done(); } }; const hooks = { mode, persisted, beforeEnter(el) { let hook = onBeforeEnter; if (!state.isMounted) { if (appear) { hook = onBeforeAppear || onBeforeEnter; } else { return; } } if (el[leaveCbKey]) { el[leaveCbKey]( true /* cancelled */ ); } const leavingVNode = leavingVNodesCache[key2]; if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { leavingVNode.el[leaveCbKey](); } callHook2(hook, [el]); }, enter(el) { let hook = onEnter; let afterHook = onAfterEnter; let cancelHook = onEnterCancelled; if (!state.isMounted) { if (appear) { hook = onAppear || onEnter; afterHook = onAfterAppear || onAfterEnter; cancelHook = onAppearCancelled || onEnterCancelled; } else { return; } } let called = false; const done = el[enterCbKey$1] = (cancelled) => { if (called) return; called = true; if (cancelled) { callHook2(cancelHook, [el]); } else { callHook2(afterHook, [el]); } if (hooks.delayedLeave) { hooks.delayedLeave(); } el[enterCbKey$1] = void 0; }; if (hook) { callAsyncHook(hook, [el, done]); } else { done(); } }, leave(el, remove2) { const key22 = String(vnode.key); if (el[enterCbKey$1]) { el[enterCbKey$1]( true /* cancelled */ ); } if (state.isUnmounting) { return remove2(); } callHook2(onBeforeLeave, [el]); let called = false; const done = el[leaveCbKey] = (cancelled) => { if (called) return; called = true; remove2(); if (cancelled) { callHook2(onLeaveCancelled, [el]); } else { callHook2(onAfterLeave, [el]); } el[leaveCbKey] = void 0; if (leavingVNodesCache[key22] === vnode) { delete leavingVNodesCache[key22]; } }; leavingVNodesCache[key22] = vnode; if (onLeave) { callAsyncHook(onLeave, [el, done]); } else { done(); } }, clone(vnode2) { const hooks2 = resolveTransitionHooks( vnode2, props2, state, instance, postClone ); if (postClone) postClone(hooks2); return hooks2; } }; return hooks; } function emptyPlaceholder(vnode) { if (isKeepAlive(vnode)) { vnode = cloneVNode(vnode); vnode.children = null; return vnode; } } function getInnerChild$1(vnode) { if (!isKeepAlive(vnode)) { if (isTeleport(vnode.type) && vnode.children) { return findNonCommentChild(vnode.children); } return vnode; } if (vnode.component) { return vnode.component.subTree; } const { shapeFlag, children } = vnode; if (children) { if (shapeFlag & 16) { return children[0]; } if (shapeFlag & 32 && isFunction$2(children.default)) { return children.default(); } } } function setTransitionHooks(vnode, hooks) { if (vnode.shapeFlag & 6 && vnode.component) { vnode.transition = hooks; setTransitionHooks(vnode.component.subTree, hooks); } else if (vnode.shapeFlag & 128) { vnode.ssContent.transition = hooks.clone(vnode.ssContent); vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); } else { vnode.transition = hooks; } } function getTransitionRawChildren(children, keepComment = false, parentKey) { let ret = []; let keyedFragmentCount = 0; for (let i2 = 0; i2 < children.length; i2++) { let child = children[i2]; const key2 = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i2); if (child.type === Fragment) { if (child.patchFlag & 128) keyedFragmentCount++; ret = ret.concat( getTransitionRawChildren(child.children, keepComment, key2) ); } else if (keepComment || child.type !== Comment) { ret.push(key2 != null ? cloneVNode(child, { key: key2 }) : child); } } if (keyedFragmentCount > 1) { for (let i2 = 0; i2 < ret.length; i2++) { ret[i2].patchFlag = -2; } } return ret; } /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineComponent(options, extraOptions) { return isFunction$2(options) ? ( // #8236: extend call and options.name access are considered side-effects // by Rollup, so we have to wrap it in a pure-annotated IIFE. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() ) : options; } function markAsyncBoundary(instance) { instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; } function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { if (isArray$2(rawRef)) { rawRef.forEach( (r2, i2) => setRef( r2, oldRawRef && (isArray$2(oldRawRef) ? oldRawRef[i2] : oldRawRef), parentSuspense, vnode, isUnmount ) ); return; } if (isAsyncWrapper(vnode) && !isUnmount) { if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); } return; } const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; const value = isUnmount ? null : refValue; const { i: owner, r: ref3 } = rawRef; const oldRef = oldRawRef && oldRawRef.r; const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; const setupState = owner.setupState; const rawSetupState = toRaw(setupState); const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key2) => { return hasOwn$1(rawSetupState, key2); }; if (oldRef != null && oldRef !== ref3) { if (isString$1(oldRef)) { refs[oldRef] = null; if (canSetSetupRef(oldRef)) { setupState[oldRef] = null; } } else if (isRef(oldRef)) { oldRef.value = null; } } if (isFunction$2(ref3)) { callWithErrorHandling(ref3, owner, 12, [value, refs]); } else { const _isString = isString$1(ref3); const _isRef = isRef(ref3); if (_isString || _isRef) { const doSet = () => { if (rawRef.f) { const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : ref3.value; if (isUnmount) { isArray$2(existing) && remove(existing, refValue); } else { if (!isArray$2(existing)) { if (_isString) { refs[ref3] = [refValue]; if (canSetSetupRef(ref3)) { setupState[ref3] = refs[ref3]; } } else { ref3.value = [refValue]; if (rawRef.k) refs[rawRef.k] = ref3.value; } } else if (!existing.includes(refValue)) { existing.push(refValue); } } } else if (_isString) { refs[ref3] = value; if (canSetSetupRef(ref3)) { setupState[ref3] = value; } } else if (_isRef) { ref3.value = value; if (rawRef.k) refs[rawRef.k] = value; } else ; }; if (value) { doSet.id = -1; queuePostRenderEffect(doSet, parentSuspense); } else { doSet(); } } } } getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); const isAsyncWrapper = (i2) => !!i2.type.__asyncLoader; const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; function onActivated(hook, target) { registerKeepAliveHook(hook, "a", target); } function onDeactivated(hook, target) { registerKeepAliveHook(hook, "da", target); } function registerKeepAliveHook(hook, type, target = currentInstance) { const wrappedHook = hook.__wdc || (hook.__wdc = () => { let current = target; while (current) { if (current.isDeactivated) { return; } current = current.parent; } return hook(); }); injectHook(type, wrappedHook, target); if (target) { let current = target.parent; while (current && current.parent) { if (isKeepAlive(current.parent.vnode)) { injectToKeepAliveRoot(wrappedHook, type, target, current); } current = current.parent; } } } function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { const injected = injectHook( type, hook, keepAliveRoot, true /* prepend */ ); onUnmounted(() => { remove(keepAliveRoot[type], injected); }, target); } function injectHook(type, hook, target = currentInstance, prepend = false) { if (target) { const hooks = target[type] || (target[type] = []); const wrappedHook = hook.__weh || (hook.__weh = (...args) => { pauseTracking(); const reset = setCurrentInstance(target); const res = callWithAsyncErrorHandling(hook, target, type, args); reset(); resetTracking(); return res; }); if (prepend) { hooks.unshift(wrappedHook); } else { hooks.push(wrappedHook); } return wrappedHook; } } const createHook = (lifecycle) => (hook, target = currentInstance) => { if (!isInSSRComponentSetup || lifecycle === "sp") { injectHook(lifecycle, (...args) => hook(...args), target); } }; const onBeforeMount = createHook("bm"); const onMounted = createHook("m"); const onBeforeUpdate = createHook( "bu" ); const onUpdated = createHook("u"); const onBeforeUnmount = createHook( "bum" ); const onUnmounted = createHook("um"); const onServerPrefetch = createHook( "sp" ); const onRenderTriggered = createHook("rtg"); const onRenderTracked = createHook("rtc"); function onErrorCaptured(hook, target = currentInstance) { injectHook("ec", hook, target); } const DIRECTIVES = "directives"; const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); function resolveDirective(name) { return resolveAsset(DIRECTIVES, name); } function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { const instance = currentRenderingInstance || currentInstance; if (instance) { const Component = instance.type; const res = ( // local registration // check instance[type] first which is resolved for options API resolve(instance[type] || Component[type], name) || // global registration resolve(instance.appContext[type], name) ); if (!res && maybeSelfReference) { return Component; } return res; } } function resolve(registry, name) { return registry && (registry[name] || registry[camelize$1(name)] || registry[capitalize(camelize$1(name))]); } function renderList(source, renderItem, cache, index2) { let ret; const cached2 = cache; const sourceIsArray = isArray$2(source); if (sourceIsArray || isString$1(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; let isReadonlySource = false; if (sourceIsReactiveArray) { needsWrap = !isShallow(source); isReadonlySource = isReadonly(source); source = shallowReadArray(source); } ret = new Array(source.length); for (let i2 = 0, l2 = source.length; i2 < l2; i2++) { ret[i2] = renderItem( needsWrap ? isReadonlySource ? toReadonly(toReactive$1(source[i2])) : toReactive$1(source[i2]) : source[i2], i2, void 0, cached2 ); } } else if (typeof source === "number") { ret = new Array(source); for (let i2 = 0; i2 < source; i2++) { ret[i2] = renderItem(i2 + 1, i2, void 0, cached2); } } else if (isObject$4(source)) { if (source[Symbol.iterator]) { ret = Array.from( source, (item, i2) => renderItem(item, i2, void 0, cached2) ); } else { const keys2 = Object.keys(source); ret = new Array(keys2.length); for (let i2 = 0, l2 = keys2.length; i2 < l2; i2++) { const key2 = keys2[i2]; ret[i2] = renderItem(source[key2], key2, i2, cached2); } } } else { ret = []; } return ret; } const getPublicInstance = (i2) => { if (!i2) return null; if (isStatefulComponent(i2)) return getComponentPublicInstance(i2); return getPublicInstance(i2.parent); }; const publicPropertiesMap = ( // Move PURE marker to new line to workaround compiler discarding it // due to type annotation /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { $: (i2) => i2, $el: (i2) => i2.vnode.el, $data: (i2) => i2.data, $props: (i2) => i2.props, $attrs: (i2) => i2.attrs, $slots: (i2) => i2.slots, $refs: (i2) => i2.refs, $parent: (i2) => getPublicInstance(i2.parent), $root: (i2) => getPublicInstance(i2.root), $host: (i2) => i2.ce, $emit: (i2) => i2.emit, $options: (i2) => resolveMergedOptions(i2), $forceUpdate: (i2) => i2.f || (i2.f = () => { queueJob(i2.update); }), $nextTick: (i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), $watch: (i2) => instanceWatch.bind(i2) }) ); const hasSetupBinding = (state, key2) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key2); const PublicInstanceProxyHandlers = { get({ _: instance }, key2) { if (key2 === "__v_skip") { return true; } const { ctx, setupState, data, props: props2, accessCache, type, appContext } = instance; let normalizedProps; if (key2[0] !== "$") { const n2 = accessCache[key2]; if (n2 !== void 0) { switch (n2) { case 1: return setupState[key2]; case 2: return data[key2]; case 4: return ctx[key2]; case 3: return props2[key2]; } } else if (hasSetupBinding(setupState, key2)) { accessCache[key2] = 1; return setupState[key2]; } else if (data !== EMPTY_OBJ && hasOwn$1(data, key2)) { accessCache[key2] = 2; return data[key2]; } else if ( // only cache other properties when instance has declared (thus stable) // props (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key2) ) { accessCache[key2] = 3; return props2[key2]; } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key2)) { accessCache[key2] = 4; return ctx[key2]; } else if (shouldCacheAccess) { accessCache[key2] = 0; } } const publicGetter = publicPropertiesMap[key2]; let cssModule, globalProperties; if (publicGetter) { if (key2 === "$attrs") { track(instance.attrs, "get", ""); } return publicGetter(instance); } else if ( // css module (injected by vue-loader) (cssModule = type.__cssModules) && (cssModule = cssModule[key2]) ) { return cssModule; } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key2)) { accessCache[key2] = 4; return ctx[key2]; } else if ( // global properties globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key2) ) { { return globalProperties[key2]; } } else ; }, set({ _: instance }, key2, value) { const { data, setupState, ctx } = instance; if (hasSetupBinding(setupState, key2)) { setupState[key2] = value; return true; } else if (data !== EMPTY_OBJ && hasOwn$1(data, key2)) { data[key2] = value; return true; } else if (hasOwn$1(instance.props, key2)) { return false; } if (key2[0] === "$" && key2.slice(1) in instance) { return false; } else { { ctx[key2] = value; } } return true; }, has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key2) { let normalizedProps; return !!accessCache[key2] || data !== EMPTY_OBJ && hasOwn$1(data, key2) || hasSetupBinding(setupState, key2) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key2) || hasOwn$1(ctx, key2) || hasOwn$1(publicPropertiesMap, key2) || hasOwn$1(appContext.config.globalProperties, key2); }, defineProperty(target, key2, descriptor) { if (descriptor.get != null) { target._.accessCache[key2] = 0; } else if (hasOwn$1(descriptor, "value")) { this.set(target, key2, descriptor.value, null); } return Reflect.defineProperty(target, key2, descriptor); } }; function normalizePropsOrEmits(props2) { return isArray$2(props2) ? props2.reduce( (normalized, p2) => (normalized[p2] = null, normalized), {} ) : props2; } let shouldCacheAccess = true; function applyOptions(instance) { const options = resolveMergedOptions(instance); const publicThis = instance.proxy; const ctx = instance.ctx; shouldCacheAccess = false; if (options.beforeCreate) { callHook$1(options.beforeCreate, instance, "bc"); } const { // state data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, // lifecycle created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render: render2, renderTracked, renderTriggered, errorCaptured, serverPrefetch, // public API expose, inheritAttrs, // assets components, directives, filters } = options; const checkDuplicateProperties = null; if (injectOptions) { resolveInjections(injectOptions, ctx, checkDuplicateProperties); } if (methods) { for (const key2 in methods) { const methodHandler = methods[key2]; if (isFunction$2(methodHandler)) { { ctx[key2] = methodHandler.bind(publicThis); } } } } if (dataOptions) { const data = dataOptions.call(publicThis, publicThis); if (!isObject$4(data)) ; else { instance.data = reactive(data); } } shouldCacheAccess = true; if (computedOptions) { for (const key2 in computedOptions) { const opt = computedOptions[key2]; const get2 = isFunction$2(opt) ? opt.bind(publicThis, publicThis) : isFunction$2(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; const set2 = !isFunction$2(opt) && isFunction$2(opt.set) ? opt.set.bind(publicThis) : NOOP; const c2 = computed({ get: get2, set: set2 }); Object.defineProperty(ctx, key2, { enumerable: true, configurable: true, get: () => c2.value, set: (v2) => c2.value = v2 }); } } if (watchOptions) { for (const key2 in watchOptions) { createWatcher(watchOptions[key2], ctx, publicThis, key2); } } if (provideOptions) { const provides = isFunction$2(provideOptions) ? provideOptions.call(publicThis) : provideOptions; Reflect.ownKeys(provides).forEach((key2) => { provide(key2, provides[key2]); }); } if (created) { callHook$1(created, instance, "c"); } function registerLifecycleHook(register, hook) { if (isArray$2(hook)) { hook.forEach((_hook) => register(_hook.bind(publicThis))); } else if (hook) { register(hook.bind(publicThis)); } } registerLifecycleHook(onBeforeMount, beforeMount); registerLifecycleHook(onMounted, mounted); registerLifecycleHook(onBeforeUpdate, beforeUpdate); registerLifecycleHook(onUpdated, updated); registerLifecycleHook(onActivated, activated); registerLifecycleHook(onDeactivated, deactivated); registerLifecycleHook(onErrorCaptured, errorCaptured); registerLifecycleHook(onRenderTracked, renderTracked); registerLifecycleHook(onRenderTriggered, renderTriggered); registerLifecycleHook(onBeforeUnmount, beforeUnmount); registerLifecycleHook(onUnmounted, unmounted); registerLifecycleHook(onServerPrefetch, serverPrefetch); if (isArray$2(expose)) { if (expose.length) { const exposed = instance.exposed || (instance.exposed = {}); expose.forEach((key2) => { Object.defineProperty(exposed, key2, { get: () => publicThis[key2], set: (val) => publicThis[key2] = val }); }); } else if (!instance.exposed) { instance.exposed = {}; } } if (render2 && instance.render === NOOP) { instance.render = render2; } if (inheritAttrs != null) { instance.inheritAttrs = inheritAttrs; } if (components) instance.components = components; if (directives) instance.directives = directives; if (serverPrefetch) { markAsyncBoundary(instance); } } function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { if (isArray$2(injectOptions)) { injectOptions = normalizeInject(injectOptions); } for (const key2 in injectOptions) { const opt = injectOptions[key2]; let injected; if (isObject$4(opt)) { if ("default" in opt) { injected = inject( opt.from || key2, opt.default, true ); } else { injected = inject(opt.from || key2); } } else { injected = inject(opt); } if (isRef(injected)) { Object.defineProperty(ctx, key2, { enumerable: true, configurable: true, get: () => injected.value, set: (v2) => injected.value = v2 }); } else { ctx[key2] = injected; } } } function callHook$1(hook, instance, type) { callWithAsyncErrorHandling( isArray$2(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type ); } function createWatcher(raw, ctx, publicThis, key2) { let getter = key2.includes(".") ? createPathGetter(publicThis, key2) : () => publicThis[key2]; if (isString$1(raw)) { const handler = ctx[raw]; if (isFunction$2(handler)) { { watch(getter, handler); } } } else if (isFunction$2(raw)) { { watch(getter, raw.bind(publicThis)); } } else if (isObject$4(raw)) { if (isArray$2(raw)) { raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key2)); } else { const handler = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; if (isFunction$2(handler)) { watch(getter, handler, raw); } } } else ; } function resolveMergedOptions(instance) { const base = instance.type; const { mixins, extends: extendsOptions } = base; const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext; const cached2 = cache.get(base); let resolved; if (cached2) { resolved = cached2; } else if (!globalMixins.length && !mixins && !extendsOptions) { { resolved = base; } } else { resolved = {}; if (globalMixins.length) { globalMixins.forEach( (m2) => mergeOptions(resolved, m2, optionMergeStrategies, true) ); } mergeOptions(resolved, base, optionMergeStrategies); } if (isObject$4(base)) { cache.set(base, resolved); } return resolved; } function mergeOptions(to, from2, strats, asMixin = false) { const { mixins, extends: extendsOptions } = from2; if (extendsOptions) { mergeOptions(to, extendsOptions, strats, true); } if (mixins) { mixins.forEach( (m2) => mergeOptions(to, m2, strats, true) ); } for (const key2 in from2) { if (asMixin && key2 === "expose") ; else { const strat = internalOptionMergeStrats[key2] || strats && strats[key2]; to[key2] = strat ? strat(to[key2], from2[key2]) : from2[key2]; } } return to; } const internalOptionMergeStrats = { data: mergeDataFn, props: mergeEmitsOrPropsOptions, emits: mergeEmitsOrPropsOptions, // objects methods: mergeObjectOptions, computed: mergeObjectOptions, // lifecycle beforeCreate: mergeAsArray, created: mergeAsArray, beforeMount: mergeAsArray, mounted: mergeAsArray, beforeUpdate: mergeAsArray, updated: mergeAsArray, beforeDestroy: mergeAsArray, beforeUnmount: mergeAsArray, destroyed: mergeAsArray, unmounted: mergeAsArray, activated: mergeAsArray, deactivated: mergeAsArray, errorCaptured: mergeAsArray, serverPrefetch: mergeAsArray, // assets components: mergeObjectOptions, directives: mergeObjectOptions, // watch watch: mergeWatchOptions, // provide / inject provide: mergeDataFn, inject: mergeInject }; function mergeDataFn(to, from2) { if (!from2) { return to; } if (!to) { return from2; } return function mergedDataFn() { return extend( isFunction$2(to) ? to.call(this, this) : to, isFunction$2(from2) ? from2.call(this, this) : from2 ); }; } function mergeInject(to, from2) { return mergeObjectOptions(normalizeInject(to), normalizeInject(from2)); } function normalizeInject(raw) { if (isArray$2(raw)) { const res = {}; for (let i2 = 0; i2 < raw.length; i2++) { res[raw[i2]] = raw[i2]; } return res; } return raw; } function mergeAsArray(to, from2) { return to ? [...new Set([].concat(to, from2))] : from2; } function mergeObjectOptions(to, from2) { return to ? extend(/* @__PURE__ */ Object.create(null), to, from2) : from2; } function mergeEmitsOrPropsOptions(to, from2) { if (to) { if (isArray$2(to) && isArray$2(from2)) { return [.../* @__PURE__ */ new Set([...to, ...from2])]; } return extend( /* @__PURE__ */ Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from2 != null ? from2 : {}) ); } else { return from2; } } function mergeWatchOptions(to, from2) { if (!to) return from2; if (!from2) return to; const merged = extend(/* @__PURE__ */ Object.create(null), to); for (const key2 in from2) { merged[key2] = mergeAsArray(to[key2], from2[key2]); } return merged; } function createAppContext() { return { app: null, config: { isNativeTag: NO, performance: false, globalProperties: {}, optionMergeStrategies: {}, errorHandler: void 0, warnHandler: void 0, compilerOptions: {} }, mixins: [], components: {}, directives: {}, provides: /* @__PURE__ */ Object.create(null), optionsCache: /* @__PURE__ */ new WeakMap(), propsCache: /* @__PURE__ */ new WeakMap(), emitsCache: /* @__PURE__ */ new WeakMap() }; } let uid$1 = 0; function createAppAPI(render2, hydrate) { return function createApp2(rootComponent, rootProps = null) { if (!isFunction$2(rootComponent)) { rootComponent = extend({}, rootComponent); } if (rootProps != null && !isObject$4(rootProps)) { rootProps = null; } const context2 = createAppContext(); const installedPlugins = /* @__PURE__ */ new WeakSet(); const pluginCleanupFns = []; let isMounted = false; const app = context2.app = { _uid: uid$1++, _component: rootComponent, _props: rootProps, _container: null, _context: context2, _instance: null, version: version$1, get config() { return context2.config; }, set config(v2) { }, use(plugin, ...options) { if (installedPlugins.has(plugin)) ; else if (plugin && isFunction$2(plugin.install)) { installedPlugins.add(plugin); plugin.install(app, ...options); } else if (isFunction$2(plugin)) { installedPlugins.add(plugin); plugin(app, ...options); } else ; return app; }, mixin(mixin) { { if (!context2.mixins.includes(mixin)) { context2.mixins.push(mixin); } } return app; }, component(name, component) { if (!component) { return context2.components[name]; } context2.components[name] = component; return app; }, directive(name, directive) { if (!directive) { return context2.directives[name]; } context2.directives[name] = directive; return app; }, mount(rootContainer, isHydrate, namespace) { if (!isMounted) { const vnode = app._ceVNode || createVNode(rootComponent, rootProps); vnode.appContext = context2; if (namespace === true) { namespace = "svg"; } else if (namespace === false) { namespace = void 0; } { render2(vnode, rootContainer, namespace); } isMounted = true; app._container = rootContainer; rootContainer.__vue_app__ = app; return getComponentPublicInstance(vnode.component); } }, onUnmount(cleanupFn) { pluginCleanupFns.push(cleanupFn); }, unmount() { if (isMounted) { callWithAsyncErrorHandling( pluginCleanupFns, app._instance, 16 ); render2(null, app._container); delete app._container.__vue_app__; } }, provide(key2, value) { context2.provides[key2] = value; return app; }, runWithContext(fn) { const lastApp = currentApp; currentApp = app; try { return fn(); } finally { currentApp = lastApp; } } }; return app; }; } let currentApp = null; function provide(key2, value) { if (!currentInstance) ; else { let provides = currentInstance.provides; const parentProvides = currentInstance.parent && currentInstance.parent.provides; if (parentProvides === provides) { provides = currentInstance.provides = Object.create(parentProvides); } provides[key2] = value; } } function inject(key2, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key2 in provides) { return provides[key2]; } else if (arguments.length > 1) { return treatDefaultAsFactory && isFunction$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; } else ; } } function hasInjectionContext() { return !!(currentInstance || currentRenderingInstance || currentApp); } const internalObjectProto = {}; const createInternalObject = () => Object.create(internalObjectProto); const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; function initProps(instance, rawProps, isStateful, isSSR = false) { const props2 = {}; const attrs = createInternalObject(); instance.propsDefaults = /* @__PURE__ */ Object.create(null); setFullProps(instance, rawProps, props2, attrs); for (const key2 in instance.propsOptions[0]) { if (!(key2 in props2)) { props2[key2] = void 0; } } if (isStateful) { instance.props = isSSR ? props2 : shallowReactive(props2); } else { if (!instance.type.props) { instance.props = attrs; } else { instance.props = props2; } } instance.attrs = attrs; } function updateProps(instance, rawProps, rawPrevProps, optimized) { const { props: props2, attrs, vnode: { patchFlag } } = instance; const rawCurrentProps = toRaw(props2); const [options] = instance.propsOptions; let hasAttrsChanged = false; if ( // always force full diff in dev // - #1942 if hmr is enabled with sfc component // - vite#872 non-sfc component used by sfc component (optimized || patchFlag > 0) && !(patchFlag & 16) ) { if (patchFlag & 8) { const propsToUpdate = instance.vnode.dynamicProps; for (let i2 = 0; i2 < propsToUpdate.length; i2++) { let key2 = propsToUpdate[i2]; if (isEmitListener(instance.emitsOptions, key2)) { continue; } const value = rawProps[key2]; if (options) { if (hasOwn$1(attrs, key2)) { if (value !== attrs[key2]) { attrs[key2] = value; hasAttrsChanged = true; } } else { const camelizedKey = camelize$1(key2); props2[camelizedKey] = resolvePropValue$1( options, rawCurrentProps, camelizedKey, value, instance, false ); } } else { if (value !== attrs[key2]) { attrs[key2] = value; hasAttrsChanged = true; } } } } } else { if (setFullProps(instance, rawProps, props2, attrs)) { hasAttrsChanged = true; } let kebabKey; for (const key2 in rawCurrentProps) { if (!rawProps || // for camelCase !hasOwn$1(rawProps, key2) && // it's possible the original props was passed in as kebab-case // and converted to camelCase (#955) ((kebabKey = hyphenate$1(key2)) === key2 || !hasOwn$1(rawProps, kebabKey))) { if (options) { if (rawPrevProps && // for camelCase (rawPrevProps[key2] !== void 0 || // for kebab-case rawPrevProps[kebabKey] !== void 0)) { props2[key2] = resolvePropValue$1( options, rawCurrentProps, key2, void 0, instance, true ); } } else { delete props2[key2]; } } } if (attrs !== rawCurrentProps) { for (const key2 in attrs) { if (!rawProps || !hasOwn$1(rawProps, key2) && true) { delete attrs[key2]; hasAttrsChanged = true; } } } } if (hasAttrsChanged) { trigger(instance.attrs, "set", ""); } } function setFullProps(instance, rawProps, props2, attrs) { const [options, needCastKeys] = instance.propsOptions; let hasAttrsChanged = false; let rawCastValues; if (rawProps) { for (let key2 in rawProps) { if (isReservedProp(key2)) { continue; } const value = rawProps[key2]; let camelKey; if (options && hasOwn$1(options, camelKey = camelize$1(key2))) { if (!needCastKeys || !needCastKeys.includes(camelKey)) { props2[camelKey] = value; } else { (rawCastValues || (rawCastValues = {}))[camelKey] = value; } } else if (!isEmitListener(instance.emitsOptions, key2)) { if (!(key2 in attrs) || value !== attrs[key2]) { attrs[key2] = value; hasAttrsChanged = true; } } } } if (needCastKeys) { const rawCurrentProps = toRaw(props2); const castValues = rawCastValues || EMPTY_OBJ; for (let i2 = 0; i2 < needCastKeys.length; i2++) { const key2 = needCastKeys[i2]; props2[key2] = resolvePropValue$1( options, rawCurrentProps, key2, castValues[key2], instance, !hasOwn$1(castValues, key2) ); } } return hasAttrsChanged; } function resolvePropValue$1(options, props2, key2, value, instance, isAbsent) { const opt = options[key2]; if (opt != null) { const hasDefault = hasOwn$1(opt, "default"); if (hasDefault && value === void 0) { const defaultValue = opt.default; if (opt.type !== Function && !opt.skipFactory && isFunction$2(defaultValue)) { const { propsDefaults } = instance; if (key2 in propsDefaults) { value = propsDefaults[key2]; } else { const reset = setCurrentInstance(instance); value = propsDefaults[key2] = defaultValue.call( null, props2 ); reset(); } } else { value = defaultValue; } if (instance.ce) { instance.ce._setProp(key2, value); } } if (opt[ 0 /* shouldCast */ ]) { if (isAbsent && !hasDefault) { value = false; } else if (opt[ 1 /* shouldCastTrue */ ] && (value === "" || value === hyphenate$1(key2))) { value = true; } } } return value; } const mixinPropsCache = /* @__PURE__ */ new WeakMap(); function normalizePropsOptions(comp, appContext, asMixin = false) { const cache = asMixin ? mixinPropsCache : appContext.propsCache; const cached2 = cache.get(comp); if (cached2) { return cached2; } const raw = comp.props; const normalized = {}; const needCastKeys = []; let hasExtends = false; if (!isFunction$2(comp)) { const extendProps = (raw2) => { hasExtends = true; const [props2, keys2] = normalizePropsOptions(raw2, appContext, true); extend(normalized, props2); if (keys2) needCastKeys.push(...keys2); }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendProps); } if (comp.extends) { extendProps(comp.extends); } if (comp.mixins) { comp.mixins.forEach(extendProps); } } if (!raw && !hasExtends) { if (isObject$4(comp)) { cache.set(comp, EMPTY_ARR); } return EMPTY_ARR; } if (isArray$2(raw)) { for (let i2 = 0; i2 < raw.length; i2++) { const normalizedKey = camelize$1(raw[i2]); if (validatePropName(normalizedKey)) { normalized[normalizedKey] = EMPTY_OBJ; } } } else if (raw) { for (const key2 in raw) { const normalizedKey = camelize$1(key2); if (validatePropName(normalizedKey)) { const opt = raw[key2]; const prop = normalized[normalizedKey] = isArray$2(opt) || isFunction$2(opt) ? { type: opt } : extend({}, opt); const propType = prop.type; let shouldCast = false; let shouldCastTrue = true; if (isArray$2(propType)) { for (let index2 = 0; index2 < propType.length; ++index2) { const type = propType[index2]; const typeName = isFunction$2(type) && type.name; if (typeName === "Boolean") { shouldCast = true; break; } else if (typeName === "String") { shouldCastTrue = false; } } } else { shouldCast = isFunction$2(propType) && propType.name === "Boolean"; } prop[ 0 /* shouldCast */ ] = shouldCast; prop[ 1 /* shouldCastTrue */ ] = shouldCastTrue; if (shouldCast || hasOwn$1(prop, "default")) { needCastKeys.push(normalizedKey); } } } } const res = [normalized, needCastKeys]; if (isObject$4(comp)) { cache.set(comp, res); } return res; } function validatePropName(key2) { if (key2[0] !== "$" && !isReservedProp(key2)) { return true; } return false; } const isInternalKey = (key2) => key2[0] === "_" || key2 === "$stable"; const normalizeSlotValue = (value) => isArray$2(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; const normalizeSlot = (key2, rawSlot, ctx) => { if (rawSlot._n) { return rawSlot; } const normalized = withCtx((...args) => { if (false) ; return normalizeSlotValue(rawSlot(...args)); }, ctx); normalized._c = false; return normalized; }; const normalizeObjectSlots = (rawSlots, slots, instance) => { const ctx = rawSlots._ctx; for (const key2 in rawSlots) { if (isInternalKey(key2)) continue; const value = rawSlots[key2]; if (isFunction$2(value)) { slots[key2] = normalizeSlot(key2, value, ctx); } else if (value != null) { const normalized = normalizeSlotValue(value); slots[key2] = () => normalized; } } }; const normalizeVNodeSlots = (instance, children) => { const normalized = normalizeSlotValue(children); instance.slots.default = () => normalized; }; const assignSlots = (slots, children, optimized) => { for (const key2 in children) { if (optimized || !isInternalKey(key2)) { slots[key2] = children[key2]; } } }; const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { const type = children._; if (type) { assignSlots(slots, children, optimized); if (optimized) { def(slots, "_", type, true); } } else { normalizeObjectSlots(children, slots); } } else if (children) { normalizeVNodeSlots(instance, children); } }; const updateSlots = (instance, children, optimized) => { const { vnode, slots } = instance; let needDeletionCheck = true; let deletionComparisonTarget = EMPTY_OBJ; if (vnode.shapeFlag & 32) { const type = children._; if (type) { if (optimized && type === 1) { needDeletionCheck = false; } else { assignSlots(slots, children, optimized); } } else { needDeletionCheck = !children.$stable; normalizeObjectSlots(children, slots); } deletionComparisonTarget = children; } else if (children) { normalizeVNodeSlots(instance, children); deletionComparisonTarget = { default: 1 }; } if (needDeletionCheck) { for (const key2 in slots) { if (!isInternalKey(key2) && deletionComparisonTarget[key2] == null) { delete slots[key2]; } } } }; const queuePostRenderEffect = queueEffectWithSuspense; function createRenderer(options) { return baseCreateRenderer(options); } function baseCreateRenderer(options, createHydrationFns) { const target = getGlobalThis(); target.__VUE__ = true; const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options; const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => { if (n1 === n2) { return; } if (n1 && !isSameVNodeType(n1, n2)) { anchor = getNextHostNode(n1); unmount(n1, parentComponent, parentSuspense, true); n1 = null; } if (n2.patchFlag === -2) { optimized = false; n2.dynamicChildren = null; } const { type, ref: ref3, shapeFlag } = n2; switch (type) { case Text: processText(n1, n2, container, anchor); break; case Comment: processCommentNode(n1, n2, container, anchor); break; case Static: if (n1 == null) { mountStaticNode(n2, container, anchor, namespace); } break; case Fragment: processFragment( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); break; default: if (shapeFlag & 1) { processElement( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (shapeFlag & 6) { processComponent( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (shapeFlag & 64) { type.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); } else if (shapeFlag & 128) { type.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); } else ; } if (ref3 != null && parentComponent) { setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2); } }; const processText = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert( n2.el = hostCreateText(n2.children), container, anchor ); } else { const el = n2.el = n1.el; if (n2.children !== n1.children) { hostSetText(el, n2.children); } } }; const processCommentNode = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert( n2.el = hostCreateComment(n2.children || ""), container, anchor ); } else { n2.el = n1.el; } }; const mountStaticNode = (n2, container, anchor, namespace) => { [n2.el, n2.anchor] = hostInsertStaticContent( n2.children, container, anchor, namespace, n2.el, n2.anchor ); }; const moveStaticNode = ({ el, anchor }, container, nextSibling) => { let next2; while (el && el !== anchor) { next2 = hostNextSibling(el); hostInsert(el, container, nextSibling); el = next2; } hostInsert(anchor, container, nextSibling); }; const removeStaticNode = ({ el, anchor }) => { let next2; while (el && el !== anchor) { next2 = hostNextSibling(el); hostRemove(el); el = next2; } hostRemove(anchor); }; const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { if (n2.type === "svg") { namespace = "svg"; } else if (n2.type === "math") { namespace = "mathml"; } if (n1 == null) { mountElement( n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { patchElement( n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { let el; let vnodeHook; const { props: props2, shapeFlag, transition, dirs } = vnode; el = vnode.el = hostCreateElement( vnode.type, namespace, props2 && props2.is, props2 ); if (shapeFlag & 8) { hostSetElementText(el, vnode.children); } else if (shapeFlag & 16) { mountChildren( vnode.children, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(vnode, namespace), slotScopeIds, optimized ); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "created"); } setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); if (props2) { for (const key2 in props2) { if (key2 !== "value" && !isReservedProp(key2)) { hostPatchProp(el, key2, null, props2[key2], namespace, parentComponent); } } if ("value" in props2) { hostPatchProp(el, "value", null, props2.value, namespace); } if (vnodeHook = props2.onVnodeBeforeMount) { invokeVNodeHook(vnodeHook, parentComponent, vnode); } } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } const needCallTransitionHooks = needTransition(parentSuspense, transition); if (needCallTransitionHooks) { transition.beforeEnter(el); } hostInsert(el, container, anchor); if ((vnodeHook = props2 && props2.onVnodeMounted) || needCallTransitionHooks || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); needCallTransitionHooks && transition.enter(el); dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); }, parentSuspense); } }; const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { if (scopeId) { hostSetScopeId(el, scopeId); } if (slotScopeIds) { for (let i2 = 0; i2 < slotScopeIds.length; i2++) { hostSetScopeId(el, slotScopeIds[i2]); } } if (parentComponent) { let subTree = parentComponent.subTree; if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { const parentVNode = parentComponent.vnode; setScopeId( el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent ); } } }; const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { for (let i2 = start; i2 < children.length; i2++) { const child = children[i2] = optimized ? cloneIfMounted(children[i2]) : normalizeVNode(children[i2]); patch( null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { const el = n2.el = n1.el; let { patchFlag, dynamicChildren, dirs } = n2; patchFlag |= n1.patchFlag & 16; const oldProps = n1.props || EMPTY_OBJ; const newProps = n2.props || EMPTY_OBJ; let vnodeHook; parentComponent && toggleRecurse(parentComponent, false); if (vnodeHook = newProps.onVnodeBeforeUpdate) { invokeVNodeHook(vnodeHook, parentComponent, n2, n1); } if (dirs) { invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); } parentComponent && toggleRecurse(parentComponent, true); if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { hostSetElementText(el, ""); } if (dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds ); } else if (!optimized) { patchChildren( n1, n2, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds, false ); } if (patchFlag > 0) { if (patchFlag & 16) { patchProps(el, oldProps, newProps, parentComponent, namespace); } else { if (patchFlag & 2) { if (oldProps.class !== newProps.class) { hostPatchProp(el, "class", null, newProps.class, namespace); } } if (patchFlag & 4) { hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); } if (patchFlag & 8) { const propsToUpdate = n2.dynamicProps; for (let i2 = 0; i2 < propsToUpdate.length; i2++) { const key2 = propsToUpdate[i2]; const prev2 = oldProps[key2]; const next2 = newProps[key2]; if (next2 !== prev2 || key2 === "value") { hostPatchProp(el, key2, prev2, next2, namespace, parentComponent); } } } } if (patchFlag & 1) { if (n1.children !== n2.children) { hostSetElementText(el, n2.children); } } } else if (!optimized && dynamicChildren == null) { patchProps(el, oldProps, newProps, parentComponent, namespace); } if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); }, parentSuspense); } }; const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { for (let i2 = 0; i2 < newChildren.length; i2++) { const oldVNode = oldChildren[i2]; const newVNode = newChildren[i2]; const container = ( // oldVNode may be an errored async setup() component inside Suspense // which will not have a mounted element oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent // of the Fragment itself so it can move its children. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer ) ); patch( oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true ); } }; const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { if (oldProps !== newProps) { if (oldProps !== EMPTY_OBJ) { for (const key2 in oldProps) { if (!isReservedProp(key2) && !(key2 in newProps)) { hostPatchProp( el, key2, oldProps[key2], null, namespace, parentComponent ); } } } for (const key2 in newProps) { if (isReservedProp(key2)) continue; const next2 = newProps[key2]; const prev2 = oldProps[key2]; if (next2 !== prev2 && key2 !== "value") { hostPatchProp(el, key2, prev2, next2, namespace, parentComponent); } } if ("value" in newProps) { hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); } } }; const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; if (fragmentSlotScopeIds) { slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } if (n1 == null) { hostInsert(fragmentStartAnchor, container, anchor); hostInsert(fragmentEndAnchor, container, anchor); mountChildren( // #10007 // such fragment like `<></>` will be compiled into // a fragment which doesn't have a children. // In this case fallback to an empty array n2.children || [], container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result // of renderSlot() with no valid children n1.dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, namespace, slotScopeIds ); if ( // #2080 if the stable fragment has a key, it's a <template v-for> that may // get moved around. Make sure all root level vnodes inherit el. // #2134 or if it's a component root, it may also get moved around // as the component is being moved. n2.key != null || parentComponent && n2 === parentComponent.subTree ) { traverseStaticChildren( n1, n2, true /* shallow */ ); } } else { patchChildren( n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } } }; const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { n2.slotScopeIds = slotScopeIds; if (n1 == null) { if (n2.shapeFlag & 512) { parentComponent.ctx.activate( n2, container, anchor, namespace, optimized ); } else { mountComponent( n2, container, anchor, parentComponent, parentSuspense, namespace, optimized ); } } else { updateComponent(n1, n2, optimized); } }; const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { const instance = initialVNode.component = createComponentInstance( initialVNode, parentComponent, parentSuspense ); if (isKeepAlive(initialVNode)) { instance.ctx.renderer = internals; } { setupComponent(instance, false, optimized); } if (instance.asyncDep) { parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); processCommentNode(null, placeholder, container, anchor); } } else { setupRenderEffect( instance, initialVNode, container, anchor, parentSuspense, namespace, optimized ); } }; const updateComponent = (n1, n2, optimized) => { const instance = n2.component = n1.component; if (shouldUpdateComponent(n1, n2, optimized)) { if (instance.asyncDep && !instance.asyncResolved) { updateComponentPreRender(instance, n2, optimized); return; } else { instance.next = n2; instance.update(); } } else { n2.el = n1.el; instance.vnode = n2; } }; const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { const componentUpdateFn = () => { if (!instance.isMounted) { let vnodeHook; const { el, props: props2 } = initialVNode; const { bm, m: m2, parent: parent2, root: root2, type } = instance; const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); toggleRecurse(instance, false); if (bm) { invokeArrayFns(bm); } if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeBeforeMount)) { invokeVNodeHook(vnodeHook, parent2, initialVNode); } toggleRecurse(instance, true); { if (root2.ce) { root2.ce._injectChildStyle(type); } const subTree = instance.subTree = renderComponentRoot(instance); patch( null, subTree, container, anchor, instance, parentSuspense, namespace ); initialVNode.el = subTree.el; } if (m2) { queuePostRenderEffect(m2, parentSuspense); } if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeMounted)) { const scopedInitialVNode = initialVNode; queuePostRenderEffect( () => invokeVNodeHook(vnodeHook, parent2, scopedInitialVNode), parentSuspense ); } if (initialVNode.shapeFlag & 256 || parent2 && isAsyncWrapper(parent2.vnode) && parent2.vnode.shapeFlag & 256) { instance.a && queuePostRenderEffect(instance.a, parentSuspense); } instance.isMounted = true; initialVNode = container = anchor = null; } else { let { next: next2, bu, u: u2, parent: parent2, vnode } = instance; { const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); if (nonHydratedAsyncRoot) { if (next2) { next2.el = vnode.el; updateComponentPreRender(instance, next2, optimized); } nonHydratedAsyncRoot.asyncDep.then(() => { if (!instance.isUnmounted) { componentUpdateFn(); } }); return; } } let originNext = next2; let vnodeHook; toggleRecurse(instance, false); if (next2) { next2.el = vnode.el; updateComponentPreRender(instance, next2, optimized); } else { next2 = vnode; } if (bu) { invokeArrayFns(bu); } if (vnodeHook = next2.props && next2.props.onVnodeBeforeUpdate) { invokeVNodeHook(vnodeHook, parent2, next2, vnode); } toggleRecurse(instance, true); const nextTree = renderComponentRoot(instance); const prevTree = instance.subTree; instance.subTree = nextTree; patch( prevTree, nextTree, // parent may have changed if it's in a teleport hostParentNode(prevTree.el), // anchor may have changed if it's in a fragment getNextHostNode(prevTree), instance, parentSuspense, namespace ); next2.el = nextTree.el; if (originNext === null) { updateHOCHostEl(instance, nextTree.el); } if (u2) { queuePostRenderEffect(u2, parentSuspense); } if (vnodeHook = next2.props && next2.props.onVnodeUpdated) { queuePostRenderEffect( () => invokeVNodeHook(vnodeHook, parent2, next2, vnode), parentSuspense ); } } }; instance.scope.on(); const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn); instance.scope.off(); const update = instance.update = effect2.run.bind(effect2); const job = instance.job = effect2.runIfDirty.bind(effect2); job.i = instance; job.id = instance.uid; effect2.scheduler = () => queueJob(job); toggleRecurse(instance, true); update(); }; const updateComponentPreRender = (instance, nextVNode, optimized) => { nextVNode.component = instance; const prevProps = instance.vnode.props; instance.vnode = nextVNode; instance.next = null; updateProps(instance, nextVNode.props, prevProps, optimized); updateSlots(instance, nextVNode.children, optimized); pauseTracking(); flushPreFlushCbs(instance); resetTracking(); }; const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { const c1 = n1 && n1.children; const prevShapeFlag = n1 ? n1.shapeFlag : 0; const c2 = n2.children; const { patchFlag, shapeFlag } = n2; if (patchFlag > 0) { if (patchFlag & 128) { patchKeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); return; } else if (patchFlag & 256) { patchUnkeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); return; } } if (shapeFlag & 8) { if (prevShapeFlag & 16) { unmountChildren(c1, parentComponent, parentSuspense); } if (c2 !== c1) { hostSetElementText(container, c2); } } else { if (prevShapeFlag & 16) { if (shapeFlag & 16) { patchKeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { unmountChildren(c1, parentComponent, parentSuspense, true); } } else { if (prevShapeFlag & 8) { hostSetElementText(container, ""); } if (shapeFlag & 16) { mountChildren( c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } } } }; const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { c1 = c1 || EMPTY_ARR; c2 = c2 || EMPTY_ARR; const oldLength = c1.length; const newLength = c2.length; const commonLength = Math.min(oldLength, newLength); let i2; for (i2 = 0; i2 < commonLength; i2++) { const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]); patch( c1[i2], nextChild, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } if (oldLength > newLength) { unmountChildren( c1, parentComponent, parentSuspense, true, false, commonLength ); } else { mountChildren( c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, commonLength ); } }; const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { let i2 = 0; const l2 = c2.length; let e1 = c1.length - 1; let e2 = l2 - 1; while (i2 <= e1 && i2 <= e2) { const n1 = c1[i2]; const n2 = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]); if (isSameVNodeType(n1, n2)) { patch( n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { break; } i2++; } while (i2 <= e1 && i2 <= e2) { const n1 = c1[e1]; const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); if (isSameVNodeType(n1, n2)) { patch( n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { break; } e1--; e2--; } if (i2 > e1) { if (i2 <= e2) { const nextPos = e2 + 1; const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; while (i2 <= e2) { patch( null, c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); i2++; } } } else if (i2 > e2) { while (i2 <= e1) { unmount(c1[i2], parentComponent, parentSuspense, true); i2++; } } else { const s1 = i2; const s2 = i2; const keyToNewIndexMap = /* @__PURE__ */ new Map(); for (i2 = s2; i2 <= e2; i2++) { const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]); if (nextChild.key != null) { keyToNewIndexMap.set(nextChild.key, i2); } } let j2; let patched = 0; const toBePatched = e2 - s2 + 1; let moved = false; let maxNewIndexSoFar = 0; const newIndexToOldIndexMap = new Array(toBePatched); for (i2 = 0; i2 < toBePatched; i2++) newIndexToOldIndexMap[i2] = 0; for (i2 = s1; i2 <= e1; i2++) { const prevChild = c1[i2]; if (patched >= toBePatched) { unmount(prevChild, parentComponent, parentSuspense, true); continue; } let newIndex; if (prevChild.key != null) { newIndex = keyToNewIndexMap.get(prevChild.key); } else { for (j2 = s2; j2 <= e2; j2++) { if (newIndexToOldIndexMap[j2 - s2] === 0 && isSameVNodeType(prevChild, c2[j2])) { newIndex = j2; break; } } } if (newIndex === void 0) { unmount(prevChild, parentComponent, parentSuspense, true); } else { newIndexToOldIndexMap[newIndex - s2] = i2 + 1; if (newIndex >= maxNewIndexSoFar) { maxNewIndexSoFar = newIndex; } else { moved = true; } patch( prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); patched++; } } const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; j2 = increasingNewIndexSequence.length - 1; for (i2 = toBePatched - 1; i2 >= 0; i2--) { const nextIndex = s2 + i2; const nextChild = c2[nextIndex]; const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; if (newIndexToOldIndexMap[i2] === 0) { patch( null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (moved) { if (j2 < 0 || i2 !== increasingNewIndexSequence[j2]) { move(nextChild, container, anchor, 2); } else { j2--; } } } } }; const move = (vnode, container, anchor, moveType, parentSuspense = null) => { const { el, type, transition, children, shapeFlag } = vnode; if (shapeFlag & 6) { move(vnode.component.subTree, container, anchor, moveType); return; } if (shapeFlag & 128) { vnode.suspense.move(container, anchor, moveType); return; } if (shapeFlag & 64) { type.move(vnode, container, anchor, internals); return; } if (type === Fragment) { hostInsert(el, container, anchor); for (let i2 = 0; i2 < children.length; i2++) { move(children[i2], container, anchor, moveType); } hostInsert(vnode.anchor, container, anchor); return; } if (type === Static) { moveStaticNode(vnode, container, anchor); return; } const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; if (needTransition2) { if (moveType === 0) { transition.beforeEnter(el); hostInsert(el, container, anchor); queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; const remove22 = () => { if (vnode.ctx.isUnmounted) { hostRemove(el); } else { hostInsert(el, container, anchor); } }; const performLeave = () => { leave(el, () => { remove22(); afterLeave && afterLeave(); }); }; if (delayLeave) { delayLeave(el, remove22, performLeave); } else { performLeave(); } } } else { hostInsert(el, container, anchor); } }; const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { const { type, props: props2, ref: ref3, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode; if (patchFlag === -2) { optimized = false; } if (ref3 != null) { pauseTracking(); setRef(ref3, null, parentSuspense, vnode, true); resetTracking(); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; } if (shapeFlag & 256) { parentComponent.ctx.deactivate(vnode); return; } const shouldInvokeDirs = shapeFlag & 1 && dirs; const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); let vnodeHook; if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeBeforeUnmount)) { invokeVNodeHook(vnodeHook, parentComponent, vnode); } if (shapeFlag & 6) { unmountComponent(vnode.component, parentSuspense, doRemove); } else { if (shapeFlag & 128) { vnode.suspense.unmount(parentSuspense, doRemove); return; } if (shouldInvokeDirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); } if (shapeFlag & 64) { vnode.type.remove( vnode, parentComponent, parentSuspense, internals, doRemove ); } else if (dynamicChildren && // #5154 // when v-once is used inside a block, setBlockTracking(-1) marks the // parent block with hasOnce: true // so that it doesn't take the fast path during unmount - otherwise // components nested in v-once are never unmounted. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { unmountChildren( dynamicChildren, parentComponent, parentSuspense, false, true ); } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { unmountChildren(children, parentComponent, parentSuspense); } if (doRemove) { remove2(vnode); } } if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeUnmounted) || shouldInvokeDirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); }, parentSuspense); } }; const remove2 = (vnode) => { const { type, el, anchor, transition } = vnode; if (type === Fragment) { { removeFragment(el, anchor); } return; } if (type === Static) { removeStaticNode(vnode); return; } const performRemove = () => { hostRemove(el); if (transition && !transition.persisted && transition.afterLeave) { transition.afterLeave(); } }; if (vnode.shapeFlag & 1 && transition && !transition.persisted) { const { leave, delayLeave } = transition; const performLeave = () => leave(el, performRemove); if (delayLeave) { delayLeave(vnode.el, performRemove, performLeave); } else { performLeave(); } } else { performRemove(); } }; const removeFragment = (cur, end) => { let next2; while (cur !== end) { next2 = hostNextSibling(cur); hostRemove(cur); cur = next2; } hostRemove(end); }; const unmountComponent = (instance, parentSuspense, doRemove) => { const { bum, scope, job, subTree, um, m: m2, a: a2, parent: parent2, slots: { __: slotCacheKeys } } = instance; invalidateMount(m2); invalidateMount(a2); if (bum) { invokeArrayFns(bum); } if (parent2 && isArray$2(slotCacheKeys)) { slotCacheKeys.forEach((v2) => { parent2.renderCache[v2] = void 0; }); } scope.stop(); if (job) { job.flags |= 8; unmount(subTree, instance, parentSuspense, doRemove); } if (um) { queuePostRenderEffect(um, parentSuspense); } queuePostRenderEffect(() => { instance.isUnmounted = true; }, parentSuspense); if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { parentSuspense.deps--; if (parentSuspense.deps === 0) { parentSuspense.resolve(); } } }; const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { for (let i2 = start; i2 < children.length; i2++) { unmount(children[i2], parentComponent, parentSuspense, doRemove, optimized); } }; const getNextHostNode = (vnode) => { if (vnode.shapeFlag & 6) { return getNextHostNode(vnode.component.subTree); } if (vnode.shapeFlag & 128) { return vnode.suspense.next(); } const el = hostNextSibling(vnode.anchor || vnode.el); const teleportEnd = el && el[TeleportEndKey]; return teleportEnd ? hostNextSibling(teleportEnd) : el; }; let isFlushing = false; const render2 = (vnode, container, namespace) => { if (vnode == null) { if (container._vnode) { unmount(container._vnode, null, null, true); } } else { patch( container._vnode || null, vnode, container, null, null, null, namespace ); } container._vnode = vnode; if (!isFlushing) { isFlushing = true; flushPreFlushCbs(); flushPostFlushCbs(); isFlushing = false; } }; const internals = { p: patch, um: unmount, m: move, r: remove2, mt: mountComponent, mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, n: getNextHostNode, o: options }; let hydrate; return { render: render2, hydrate, createApp: createAppAPI(render2) }; } function resolveChildrenNamespace({ type, props: props2 }, currentNamespace) { return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props2 && props2.encoding && props2.encoding.includes("html") ? void 0 : currentNamespace; } function toggleRecurse({ effect: effect2, job }, allowed) { if (allowed) { effect2.flags |= 32; job.flags |= 4; } else { effect2.flags &= -33; job.flags &= -5; } } function needTransition(parentSuspense, transition) { return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; } function traverseStaticChildren(n1, n2, shallow = false) { const ch1 = n1.children; const ch2 = n2.children; if (isArray$2(ch1) && isArray$2(ch2)) { for (let i2 = 0; i2 < ch1.length; i2++) { const c1 = ch1[i2]; let c2 = ch2[i2]; if (c2.shapeFlag & 1 && !c2.dynamicChildren) { if (c2.patchFlag <= 0 || c2.patchFlag === 32) { c2 = ch2[i2] = cloneIfMounted(ch2[i2]); c2.el = c1.el; } if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2); } if (c2.type === Text) { c2.el = c1.el; } if (c2.type === Comment && !c2.el) { c2.el = c1.el; } } } } function getSequence(arr) { const p2 = arr.slice(); const result = [0]; let i2, j2, u2, v2, c2; const len = arr.length; for (i2 = 0; i2 < len; i2++) { const arrI = arr[i2]; if (arrI !== 0) { j2 = result[result.length - 1]; if (arr[j2] < arrI) { p2[i2] = j2; result.push(i2); continue; } u2 = 0; v2 = result.length - 1; while (u2 < v2) { c2 = u2 + v2 >> 1; if (arr[result[c2]] < arrI) { u2 = c2 + 1; } else { v2 = c2; } } if (arrI < arr[result[u2]]) { if (u2 > 0) { p2[i2] = result[u2 - 1]; } result[u2] = i2; } } } u2 = result.length; v2 = result[u2 - 1]; while (u2-- > 0) { result[u2] = v2; v2 = p2[v2]; } return result; } function locateNonHydratedAsyncRoot(instance) { const subComponent = instance.subTree.component; if (subComponent) { if (subComponent.asyncDep && !subComponent.asyncResolved) { return subComponent; } else { return locateNonHydratedAsyncRoot(subComponent); } } } function invalidateMount(hooks) { if (hooks) { for (let i2 = 0; i2 < hooks.length; i2++) hooks[i2].flags |= 8; } } const ssrContextKey = Symbol.for("v-scx"); const useSSRContext = () => { { const ctx = inject(ssrContextKey); return ctx; } }; function watchEffect(effect2, options) { return doWatch(effect2, null, options); } function watch(source, cb, options) { return doWatch(source, cb, options); } function doWatch(source, cb, options = EMPTY_OBJ) { const { immediate, deep, flush, once } = options; const baseWatchOptions = extend({}, options); const runsImmediately = cb && immediate || !cb && flush !== "post"; let ssrCleanup; if (isInSSRComponentSetup) { if (flush === "sync") { const ctx = useSSRContext(); ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); } else if (!runsImmediately) { const watchStopHandle = () => { }; watchStopHandle.stop = NOOP; watchStopHandle.resume = NOOP; watchStopHandle.pause = NOOP; return watchStopHandle; } } const instance = currentInstance; baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); let isPre = false; if (flush === "post") { baseWatchOptions.scheduler = (job) => { queuePostRenderEffect(job, instance && instance.suspense); }; } else if (flush !== "sync") { isPre = true; baseWatchOptions.scheduler = (job, isFirstRun) => { if (isFirstRun) { job(); } else { queueJob(job); } }; } baseWatchOptions.augmentJob = (job) => { if (cb) { job.flags |= 4; } if (isPre) { job.flags |= 2; if (instance) { job.id = instance.uid; job.i = instance; } } }; const watchHandle = watch$1(source, cb, baseWatchOptions); if (isInSSRComponentSetup) { if (ssrCleanup) { ssrCleanup.push(watchHandle); } else if (runsImmediately) { watchHandle(); } } return watchHandle; } function instanceWatch(source, value, options) { const publicThis = this.proxy; const getter = isString$1(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); let cb; if (isFunction$2(value)) { cb = value; } else { cb = value.handler; options = value; } const reset = setCurrentInstance(this); const res = doWatch(getter, cb.bind(publicThis), options); reset(); return res; } function createPathGetter(ctx, path2) { const segments = path2.split("."); return () => { let cur = ctx; for (let i2 = 0; i2 < segments.length && cur; i2++) { cur = cur[segments[i2]]; } return cur; }; } const getModelModifiers = (props2, modelName) => { return modelName === "modelValue" || modelName === "model-value" ? props2.modelModifiers : props2[`${modelName}Modifiers`] || props2[`${camelize$1(modelName)}Modifiers`] || props2[`${hyphenate$1(modelName)}Modifiers`]; }; function emit(instance, event, ...rawArgs) { if (instance.isUnmounted) return; const props2 = instance.vnode.props || EMPTY_OBJ; let args = rawArgs; const isModelListener2 = event.startsWith("update:"); const modifiers = isModelListener2 && getModelModifiers(props2, event.slice(7)); if (modifiers) { if (modifiers.trim) { args = rawArgs.map((a2) => isString$1(a2) ? a2.trim() : a2); } if (modifiers.number) { args = rawArgs.map(looseToNumber); } } let handlerName; let handler = props2[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) props2[handlerName = toHandlerKey(camelize$1(event))]; if (!handler && isModelListener2) { handler = props2[handlerName = toHandlerKey(hyphenate$1(event))]; } if (handler) { callWithAsyncErrorHandling( handler, instance, 6, args ); } const onceHandler = props2[handlerName + `Once`]; if (onceHandler) { if (!instance.emitted) { instance.emitted = {}; } else if (instance.emitted[handlerName]) { return; } instance.emitted[handlerName] = true; callWithAsyncErrorHandling( onceHandler, instance, 6, args ); } } function normalizeEmitsOptions(comp, appContext, asMixin = false) { const cache = appContext.emitsCache; const cached2 = cache.get(comp); if (cached2 !== void 0) { return cached2; } const raw = comp.emits; let normalized = {}; let hasExtends = false; if (!isFunction$2(comp)) { const extendEmits = (raw2) => { const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); if (normalizedFromExtend) { hasExtends = true; extend(normalized, normalizedFromExtend); } }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendEmits); } if (comp.extends) { extendEmits(comp.extends); } if (comp.mixins) { comp.mixins.forEach(extendEmits); } } if (!raw && !hasExtends) { if (isObject$4(comp)) { cache.set(comp, null); } return null; } if (isArray$2(raw)) { raw.forEach((key2) => normalized[key2] = null); } else { extend(normalized, raw); } if (isObject$4(comp)) { cache.set(comp, normalized); } return normalized; } function isEmitListener(options, key2) { if (!options || !isOn$1(key2)) { return false; } key2 = key2.slice(2).replace(/Once$/, ""); return hasOwn$1(options, key2[0].toLowerCase() + key2.slice(1)) || hasOwn$1(options, hyphenate$1(key2)) || hasOwn$1(options, key2); } function markAttrsAccessed() { } function renderComponentRoot(instance) { const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit: emit2, render: render2, renderCache, props: props2, data, setupState, ctx, inheritAttrs } = instance; const prev2 = setCurrentRenderingInstance(instance); let result; let fallthroughAttrs; try { if (vnode.shapeFlag & 4) { const proxyToUse = withProxy || proxy; const thisProxy = false ? new Proxy(proxyToUse, { get(target, key2, receiver) { warn$1( `Property '${String( key2 )}' was accessed via 'this'. Avoid using 'this' in templates.` ); return Reflect.get(target, key2, receiver); } }) : proxyToUse; result = normalizeVNode( render2.call( thisProxy, proxyToUse, renderCache, false ? shallowReadonly(props2) : props2, setupState, data, ctx ) ); fallthroughAttrs = attrs; } else { const render22 = Component; if (false) ; result = normalizeVNode( render22.length > 1 ? render22( false ? shallowReadonly(props2) : props2, false ? { get attrs() { markAttrsAccessed(); return shallowReadonly(attrs); }, slots, emit: emit2 } : { attrs, slots, emit: emit2 } ) : render22( false ? shallowReadonly(props2) : props2, null ) ); fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } } catch (err) { blockStack.length = 0; handleError(err, instance, 1); result = createVNode(Comment); } let root2 = result; if (fallthroughAttrs && inheritAttrs !== false) { const keys2 = Object.keys(fallthroughAttrs); const { shapeFlag } = root2; if (keys2.length) { if (shapeFlag & (1 | 6)) { if (propsOptions && keys2.some(isModelListener)) { fallthroughAttrs = filterModelListeners( fallthroughAttrs, propsOptions ); } root2 = cloneVNode(root2, fallthroughAttrs, false, true); } } } if (vnode.dirs) { root2 = cloneVNode(root2, null, false, true); root2.dirs = root2.dirs ? root2.dirs.concat(vnode.dirs) : vnode.dirs; } if (vnode.transition) { setTransitionHooks(root2, vnode.transition); } { result = root2; } setCurrentRenderingInstance(prev2); return result; } const getFunctionalFallthrough = (attrs) => { let res; for (const key2 in attrs) { if (key2 === "class" || key2 === "style" || isOn$1(key2)) { (res || (res = {}))[key2] = attrs[key2]; } } return res; }; const filterModelListeners = (attrs, props2) => { const res = {}; for (const key2 in attrs) { if (!isModelListener(key2) || !(key2.slice(9) in props2)) { res[key2] = attrs[key2]; } } return res; }; function shouldUpdateComponent(prevVNode, nextVNode, optimized) { const { props: prevProps, children: prevChildren, component } = prevVNode; const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; const emits = component.emitsOptions; if (nextVNode.dirs || nextVNode.transition) { return true; } if (optimized && patchFlag >= 0) { if (patchFlag & 1024) { return true; } if (patchFlag & 16) { if (!prevProps) { return !!nextProps; } return hasPropsChanged(prevProps, nextProps, emits); } else if (patchFlag & 8) { const dynamicProps = nextVNode.dynamicProps; for (let i2 = 0; i2 < dynamicProps.length; i2++) { const key2 = dynamicProps[i2]; if (nextProps[key2] !== prevProps[key2] && !isEmitListener(emits, key2)) { return true; } } } } else { if (prevChildren || nextChildren) { if (!nextChildren || !nextChildren.$stable) { return true; } } if (prevProps === nextProps) { return false; } if (!prevProps) { return !!nextProps; } if (!nextProps) { return true; } return hasPropsChanged(prevProps, nextProps, emits); } return false; } function hasPropsChanged(prevProps, nextProps, emitsOptions) { const nextKeys = Object.keys(nextProps); if (nextKeys.length !== Object.keys(prevProps).length) { return true; } for (let i2 = 0; i2 < nextKeys.length; i2++) { const key2 = nextKeys[i2]; if (nextProps[key2] !== prevProps[key2] && !isEmitListener(emitsOptions, key2)) { return true; } } return false; } function updateHOCHostEl({ vnode, parent: parent2 }, el) { while (parent2) { const root2 = parent2.subTree; if (root2.suspense && root2.suspense.activeBranch === vnode) { root2.el = vnode.el; } if (root2 === vnode) { (vnode = parent2.vnode).el = el; parent2 = parent2.parent; } else { break; } } } const isSuspense = (type) => type.__isSuspense; function queueEffectWithSuspense(fn, suspense) { if (suspense && suspense.pendingBranch) { if (isArray$2(fn)) { suspense.effects.push(...fn); } else { suspense.effects.push(fn); } } else { queuePostFlushCb(fn); } } const Fragment = Symbol.for("v-fgt"); const Text = Symbol.for("v-txt"); const Comment = Symbol.for("v-cmt"); const Static = Symbol.for("v-stc"); const blockStack = []; let currentBlock = null; function openBlock(disableTracking = false) { blockStack.push(currentBlock = disableTracking ? null : []); } function closeBlock() { blockStack.pop(); currentBlock = blockStack[blockStack.length - 1] || null; } let isBlockTreeEnabled = 1; function setBlockTracking(value, inVOnce = false) { isBlockTreeEnabled += value; if (value < 0 && currentBlock && inVOnce) { currentBlock.hasOnce = true; } } function setupBlock(vnode) { vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; closeBlock(); if (isBlockTreeEnabled > 0 && currentBlock) { currentBlock.push(vnode); } return vnode; } function createElementBlock(type, props2, children, patchFlag, dynamicProps, shapeFlag) { return setupBlock( createBaseVNode( type, props2, children, patchFlag, dynamicProps, shapeFlag, true ) ); } function createBlock(type, props2, children, patchFlag, dynamicProps) { return setupBlock( createVNode( type, props2, children, patchFlag, dynamicProps, true ) ); } function isVNode(value) { return value ? value.__v_isVNode === true : false; } function isSameVNodeType(n1, n2) { return n1.type === n2.type && n1.key === n2.key; } const normalizeKey = ({ key: key2 }) => key2 != null ? key2 : null; const normalizeRef = ({ ref: ref3, ref_key, ref_for }) => { if (typeof ref3 === "number") { ref3 = "" + ref3; } return ref3 != null ? isString$1(ref3) || isRef(ref3) || isFunction$2(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null; }; function createBaseVNode(type, props2 = 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: props2, key: props2 && normalizeKey(props2), ref: props2 && normalizeRef(props2), scopeId: currentScopeId, slotScopeIds: null, children, component: null, suspense: null, ssContent: null, ssFallback: null, dirs: null, transition: null, el: null, anchor: null, target: null, targetStart: null, targetAnchor: null, staticCount: 0, shapeFlag, patchFlag, dynamicProps, dynamicChildren: null, appContext: null, ctx: currentRenderingInstance }; if (needFullChildrenNormalization) { normalizeChildren(vnode, children); if (shapeFlag & 128) { type.normalize(vnode); } } else if (children) { vnode.shapeFlag |= isString$1(children) ? 8 : 16; } if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself !isBlockNode && // has current parent block currentBlock && // presence of a patch flag indicates this node needs patching on updates. // component nodes also should always be patched, because even if the // component doesn't need to update, it needs to persist the instance on to // the next vnode so that it can be properly unmounted later. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the // vnode should not be considered dynamic due to handler caching. vnode.patchFlag !== 32) { currentBlock.push(vnode); } return vnode; } const createVNode = _createVNode; function _createVNode(type, props2 = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { if (!type || type === NULL_DYNAMIC_COMPONENT) { type = Comment; } if (isVNode(type)) { const cloned = cloneVNode( type, props2, true /* mergeRef: true */ ); if (children) { normalizeChildren(cloned, children); } if (isBlockTreeEnabled > 0 && !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 (props2) { props2 = guardReactiveProps(props2); let { class: klass, style } = props2; if (klass && !isString$1(klass)) { props2.class = normalizeClass(klass); } if (isObject$4(style)) { if (isProxy(style) && !isArray$2(style)) { style = extend({}, style); } props2.style = normalizeStyle$1(style); } } const shapeFlag = isString$1(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$4(type) ? 4 : isFunction$2(type) ? 2 : 0; return createBaseVNode( type, props2, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true ); } function guardReactiveProps(props2) { if (!props2) return null; return isProxy(props2) || isInternalObject(props2) ? extend({}, props2) : props2; } function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { const { props: props2, ref: ref3, patchFlag, children, transition } = vnode; const mergedProps = extraProps ? mergeProps(props2 || {}, extraProps) : props2; const cloned = { __v_isVNode: true, __v_skip: true, type: vnode.type, props: mergedProps, key: mergedProps && normalizeKey(mergedProps), ref: extraProps && extraProps.ref ? ( // #2078 in the case of <component :is="vnode" ref="extra"/> // if the vnode itself already has a ref, cloneVNode will need to merge // the refs so the single vnode can be set on multiple refs mergeRef && ref3 ? isArray$2(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) ) : ref3, scopeId: vnode.scopeId, slotScopeIds: vnode.slotScopeIds, children, target: vnode.target, targetStart: vnode.targetStart, targetAnchor: vnode.targetAnchor, staticCount: vnode.staticCount, shapeFlag: vnode.shapeFlag, // if the vnode is cloned with extra props, we can no longer assume its // existing patch flag to be reliable and need to add the FULL_PROPS flag. // note: preserve flag for fragments since they use the flag for children // fast paths only. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, dynamicProps: vnode.dynamicProps, dynamicChildren: vnode.dynamicChildren, appContext: vnode.appContext, dirs: vnode.dirs, transition, // These should technically only be non-null on mounted VNodes. However, // they *should* be copied for kept-alive vnodes. So we just always copy // them since them being non-null during a mount doesn't affect the logic as // they will simply be overwritten. component: vnode.component, suspense: vnode.suspense, ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), el: vnode.el, anchor: vnode.anchor, ctx: vnode.ctx, ce: vnode.ce }; if (transition && cloneTransition) { setTransitionHooks( cloned, transition.clone(cloned) ); } return cloned; } function createTextVNode(text = " ", flag = 0) { return createVNode(Text, null, text, flag); } function createStaticVNode(content, numberOfNodes) { const vnode = createVNode(Static, null, content); vnode.staticCount = numberOfNodes; return vnode; } function createCommentVNode(text = "", asBlock = false) { return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); } function normalizeVNode(child) { if (child == null || typeof child === "boolean") { return createVNode(Comment); } else if (isArray$2(child)) { return createVNode( Fragment, null, // #3666, avoid reference pollution when reusing vnode child.slice() ); } else if (isVNode(child)) { return cloneIfMounted(child); } else { return createVNode(Text, null, String(child)); } } function cloneIfMounted(child) { return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); } function normalizeChildren(vnode, children) { let type = 0; const { shapeFlag } = vnode; if (children == null) { children = null; } else if (isArray$2(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 && !isInternalObject(children)) { children._ctx = currentRenderingInstance; } else if (slotFlag === 3 && currentRenderingInstance) { if (currentRenderingInstance.slots._ === 1) { children._ = 1; } else { children._ = 2; vnode.patchFlag |= 1024; } } } } else if (isFunction$2(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 i2 = 0; i2 < args.length; i2++) { const toMerge = args[i2]; for (const key2 in toMerge) { if (key2 === "class") { if (ret.class !== toMerge.class) { ret.class = normalizeClass([ret.class, toMerge.class]); } } else if (key2 === "style") { ret.style = normalizeStyle$1([ret.style, toMerge.style]); } else if (isOn$1(key2)) { const existing = ret[key2]; const incoming = toMerge[key2]; if (incoming && existing !== incoming && !(isArray$2(existing) && existing.includes(incoming))) { ret[key2] = existing ? [].concat(existing, incoming) : incoming; } } else if (key2 !== "") { ret[key2] = toMerge[key2]; } } } return ret; } function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { callWithAsyncErrorHandling(hook, instance, 7, [ vnode, prevVNode ]); } const emptyAppContext = createAppContext(); let uid = 0; function createComponentInstance(vnode, parent2, suspense) { const type = vnode.type; const appContext = (parent2 ? parent2.appContext : vnode.appContext) || emptyAppContext; const instance = { uid: uid++, vnode, type, parent: parent2, appContext, root: null, // to be immediately set next: null, subTree: null, // will be set synchronously right after creation effect: null, update: null, // will be set synchronously right after creation job: null, scope: new EffectScope( true /* detached */ ), render: null, proxy: null, exposed: null, exposeProxy: null, withProxy: null, provides: parent2 ? parent2.provides : Object.create(appContext.provides), ids: parent2 ? parent2.ids : ["", 0, 0], accessCache: null, renderCache: [], // local resolved assets components: null, directives: null, // resolved props and emits options propsOptions: normalizePropsOptions(type, appContext), emitsOptions: normalizeEmitsOptions(type, appContext), // emit emit: null, // to be set immediately emitted: null, // props default value propsDefaults: EMPTY_OBJ, // inheritAttrs inheritAttrs: type.inheritAttrs, // state ctx: EMPTY_OBJ, data: EMPTY_OBJ, props: EMPTY_OBJ, attrs: EMPTY_OBJ, slots: EMPTY_OBJ, refs: EMPTY_OBJ, setupState: EMPTY_OBJ, setupContext: null, // suspense related suspense, suspenseId: suspense ? suspense.pendingId : 0, asyncDep: null, asyncResolved: false, // lifecycle hooks // not using enums here because it results in computed properties isMounted: false, isUnmounted: false, isDeactivated: false, bc: null, c: null, bm: null, m: null, bu: null, u: null, um: null, bum: null, da: null, a: null, rtg: null, rtc: null, ec: null, sp: null }; { instance.ctx = { _: instance }; } instance.root = parent2 ? parent2.root : instance; instance.emit = emit.bind(null, instance); if (vnode.ce) { vnode.ce(instance); } return instance; } let currentInstance = null; const getCurrentInstance = () => currentInstance || currentRenderingInstance; let internalSetCurrentInstance; let setInSSRSetupState; { const g2 = getGlobalThis(); const registerGlobalSetter = (key2, setter) => { let setters; if (!(setters = g2[key2])) setters = g2[key2] = []; setters.push(setter); return (v2) => { if (setters.length > 1) setters.forEach((set2) => set2(v2)); else setters[0](v2); }; }; internalSetCurrentInstance = registerGlobalSetter( `__VUE_INSTANCE_SETTERS__`, (v2) => currentInstance = v2 ); setInSSRSetupState = registerGlobalSetter( `__VUE_SSR_SETTERS__`, (v2) => isInSSRComponentSetup = v2 ); } const setCurrentInstance = (instance) => { const prev2 = currentInstance; internalSetCurrentInstance(instance); instance.scope.on(); return () => { instance.scope.off(); internalSetCurrentInstance(prev2); }; }; const unsetCurrentInstance = () => { currentInstance && currentInstance.scope.off(); internalSetCurrentInstance(null); }; function isStatefulComponent(instance) { return instance.vnode.shapeFlag & 4; } let isInSSRComponentSetup = false; function setupComponent(instance, isSSR = false, optimized = false) { isSSR && setInSSRSetupState(isSSR); const { props: props2, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props2, isStateful, isSSR); initSlots(instance, children, optimized || isSSR); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; } function setupStatefulComponent(instance, isSSR) { const Component = instance.type; instance.accessCache = /* @__PURE__ */ Object.create(null); instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); const { setup } = Component; if (setup) { pauseTracking(); const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; const reset = setCurrentInstance(instance); const setupResult = callWithErrorHandling( setup, instance, 0, [ instance.props, setupContext ] ); const isAsyncSetup = isPromise(setupResult); resetTracking(); reset(); if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { markAsyncBoundary(instance); } if (isAsyncSetup) { setupResult.then(unsetCurrentInstance, unsetCurrentInstance); if (isSSR) { return setupResult.then((resolvedResult) => { handleSetupResult(instance, resolvedResult); }).catch((e2) => { handleError(e2, instance, 0); }); } else { instance.asyncDep = setupResult; } } else { handleSetupResult(instance, setupResult); } } else { finishComponentSetup(instance); } } function handleSetupResult(instance, setupResult, isSSR) { if (isFunction$2(setupResult)) { if (instance.type.__ssrInlineRender) { instance.ssrRender = setupResult; } else { instance.render = setupResult; } } else if (isObject$4(setupResult)) { instance.setupState = proxyRefs(setupResult); } else ; finishComponentSetup(instance); } function finishComponentSetup(instance, isSSR, skipOptions) { const Component = instance.type; if (!instance.render) { instance.render = Component.render || NOOP; } { const reset = setCurrentInstance(instance); pauseTracking(); try { applyOptions(instance); } finally { resetTracking(); reset(); } } } const attrsProxyHandlers = { get(target, key2) { track(target, "get", ""); return target[key2]; } }; function createSetupContext(instance) { const expose = (exposed) => { instance.exposed = exposed || {}; }; { return { attrs: new Proxy(instance.attrs, attrsProxyHandlers), slots: instance.slots, emit: instance.emit, expose }; } } function getComponentPublicInstance(instance) { if (instance.exposed) { return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { get(target, key2) { if (key2 in target) { return target[key2]; } else if (key2 in publicPropertiesMap) { return publicPropertiesMap[key2](instance); } }, has(target, key2) { return key2 in target || key2 in publicPropertiesMap; } })); } else { return instance.proxy; } } const classifyRE = /(?:^|[-_])(\w)/g; const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, ""); function getComponentName(Component, includeInferred = true) { return isFunction$2(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; } function formatComponentName(instance, Component, isRoot = false) { let name = getComponentName(Component); if (!name && Component.__file) { const match2 = Component.__file.match(/([^/\\]+)\.\w+$/); if (match2) { name = match2[1]; } } if (!name && instance && instance.parent) { const inferFromRegistry = (registry) => { for (const key2 in registry) { if (registry[key2] === Component) { return key2; } } }; name = inferFromRegistry( instance.components || instance.parent.type.components ) || inferFromRegistry(instance.appContext.components); } return name ? classify(name) : isRoot ? `App` : `Anonymous`; } function isClassComponent(value) { return isFunction$2(value) && "__vccOpts" in value; } const computed = (getterOrOptions, debugOptions) => { const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); return c2; }; function h$1(type, propsOrChildren, children) { const l2 = arguments.length; if (l2 === 2) { if (isObject$4(propsOrChildren) && !isArray$2(propsOrChildren)) { if (isVNode(propsOrChildren)) { return createVNode(type, null, [propsOrChildren]); } return createVNode(type, propsOrChildren); } else { return createVNode(type, null, propsOrChildren); } } else { if (l2 > 3) { children = Array.prototype.slice.call(arguments, 2); } else if (l2 === 3 && isVNode(children)) { children = [children]; } return createVNode(type, propsOrChildren, children); } } const version$1 = "3.5.16"; /** * @vue/runtime-dom v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ let policy = void 0; const tt = typeof window !== "undefined" && window.trustedTypes; if (tt) { try { policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val }); } catch (e2) { } } const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; const svgNS = "http://www.w3.org/2000/svg"; const mathmlNS = "http://www.w3.org/1998/Math/MathML"; const doc = typeof document !== "undefined" ? document : null; const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); const nodeOps = { insert: (child, parent2, anchor) => { parent2.insertBefore(child, anchor || null); }, remove: (child) => { const parent2 = child.parentNode; if (parent2) { parent2.removeChild(child); } }, createElement: (tag, namespace, is, props2) => { const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); if (tag === "select" && props2 && props2.multiple != null) { el.setAttribute("multiple", props2.multiple); } return el; }, createText: (text) => doc.createTextNode(text), createComment: (text) => doc.createComment(text), setText: (node2, text) => { node2.nodeValue = text; }, setElementText: (el, text) => { el.textContent = text; }, parentNode: (node2) => node2.parentNode, nextSibling: (node2) => node2.nextSibling, querySelector: (selector) => doc.querySelector(selector), setScopeId(el, id) { el.setAttribute(id, ""); }, // __UNSAFE__ // Reason: innerHTML. // Static content here can only come from compiled templates. // As long as the user only uses trusted templates, this is safe. insertStaticContent(content, parent2, anchor, namespace, start, end) { const before = anchor ? anchor.previousSibling : parent2.lastChild; if (start && (start === end || start.nextSibling)) { while (true) { parent2.insertBefore(start.cloneNode(true), anchor); if (start === end || !(start = start.nextSibling)) break; } } else { templateContainer.innerHTML = unsafeToTrustedHTML( namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content ); const template = templateContainer.content; if (namespace === "svg" || namespace === "mathml") { const wrapper = template.firstChild; while (wrapper.firstChild) { template.appendChild(wrapper.firstChild); } template.removeChild(wrapper); } parent2.insertBefore(template, anchor); } return [ // first before ? before.nextSibling : parent2.firstChild, // last anchor ? anchor.previousSibling : parent2.lastChild ]; } }; const TRANSITION = "transition"; const ANIMATION = "animation"; const vtcKey = Symbol("_vtc"); const DOMTransitionPropsValidators = { name: String, type: String, css: { type: Boolean, default: true }, duration: [String, Number, Object], enterFromClass: String, enterActiveClass: String, enterToClass: String, appearFromClass: String, appearActiveClass: String, appearToClass: String, leaveFromClass: String, leaveActiveClass: String, leaveToClass: String }; const TransitionPropsValidators = /* @__PURE__ */ extend( {}, BaseTransitionPropsValidators, DOMTransitionPropsValidators ); const decorate$1 = (t2) => { t2.displayName = "Transition"; t2.props = TransitionPropsValidators; return t2; }; const Transition = /* @__PURE__ */ decorate$1( (props2, { slots }) => h$1(BaseTransition, resolveTransitionProps(props2), slots) ); const callHook = (hook, args = []) => { if (isArray$2(hook)) { hook.forEach((h2) => h2(...args)); } else if (hook) { hook(...args); } }; const hasExplicitCallback = (hook) => { return hook ? isArray$2(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; }; function resolveTransitionProps(rawProps) { const baseProps = {}; for (const key2 in rawProps) { if (!(key2 in DOMTransitionPropsValidators)) { baseProps[key2] = rawProps[key2]; } } if (rawProps.css === false) { return baseProps; } const { name = "v", type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps; const durations = normalizeDuration(duration); const enterDuration = durations && durations[0]; const leaveDuration = durations && durations[1]; const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps; const finishEnter = (el, isAppear, done, isCancelled) => { el._enterCancelled = isCancelled; removeTransitionClass(el, isAppear ? appearToClass : enterToClass); removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); done && done(); }; const finishLeave = (el, done) => { el._isLeaving = false; removeTransitionClass(el, leaveFromClass); removeTransitionClass(el, leaveToClass); removeTransitionClass(el, leaveActiveClass); done && done(); }; const makeEnterHook = (isAppear) => { return (el, done) => { const hook = isAppear ? onAppear : onEnter; const resolve2 = () => finishEnter(el, isAppear, done); callHook(hook, [el, resolve2]); nextFrame(() => { removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); addTransitionClass(el, isAppear ? appearToClass : enterToClass); if (!hasExplicitCallback(hook)) { whenTransitionEnds(el, type, enterDuration, resolve2); } }); }; }; return extend(baseProps, { onBeforeEnter(el) { callHook(onBeforeEnter, [el]); addTransitionClass(el, enterFromClass); addTransitionClass(el, enterActiveClass); }, onBeforeAppear(el) { callHook(onBeforeAppear, [el]); addTransitionClass(el, appearFromClass); addTransitionClass(el, appearActiveClass); }, onEnter: makeEnterHook(false), onAppear: makeEnterHook(true), onLeave(el, done) { el._isLeaving = true; const resolve2 = () => finishLeave(el, done); addTransitionClass(el, leaveFromClass); if (!el._enterCancelled) { forceReflow(); addTransitionClass(el, leaveActiveClass); } else { addTransitionClass(el, leaveActiveClass); forceReflow(); } nextFrame(() => { if (!el._isLeaving) { return; } removeTransitionClass(el, leaveFromClass); addTransitionClass(el, leaveToClass); if (!hasExplicitCallback(onLeave)) { whenTransitionEnds(el, type, leaveDuration, resolve2); } }); callHook(onLeave, [el, resolve2]); }, onEnterCancelled(el) { finishEnter(el, false, void 0, true); callHook(onEnterCancelled, [el]); }, onAppearCancelled(el) { finishEnter(el, true, void 0, true); callHook(onAppearCancelled, [el]); }, onLeaveCancelled(el) { finishLeave(el); callHook(onLeaveCancelled, [el]); } }); } function normalizeDuration(duration) { if (duration == null) { return null; } else if (isObject$4(duration)) { return [NumberOf(duration.enter), NumberOf(duration.leave)]; } else { const n2 = NumberOf(duration); return [n2, n2]; } } function NumberOf(val) { const res = toNumber$1(val); return res; } function addTransitionClass(el, cls) { cls.split(/\s+/).forEach((c2) => c2 && el.classList.add(c2)); (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); } function removeTransitionClass(el, cls) { cls.split(/\s+/).forEach((c2) => c2 && el.classList.remove(c2)); const _vtc = el[vtcKey]; if (_vtc) { _vtc.delete(cls); if (!_vtc.size) { el[vtcKey] = void 0; } } } function nextFrame(cb) { requestAnimationFrame(() => { requestAnimationFrame(cb); }); } let endId = 0; function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) { const id = el._endId = ++endId; const resolveIfNotStale = () => { if (id === el._endId) { resolve2(); } }; if (explicitTimeout != null) { return setTimeout(resolveIfNotStale, explicitTimeout); } const { type, timeout, propCount } = getTransitionInfo(el, expectedType); if (!type) { return resolve2(); } const endEvent = type + "end"; let ended = 0; const end = () => { el.removeEventListener(endEvent, onEnd); resolveIfNotStale(); }; const onEnd = (e2) => { if (e2.target === el && ++ended >= propCount) { end(); } }; setTimeout(() => { if (ended < propCount) { end(); } }, timeout + 1); el.addEventListener(endEvent, onEnd); } function getTransitionInfo(el, expectedType) { const styles = window.getComputedStyle(el); const getStyleProperties = (key2) => (styles[key2] || "").split(", "); const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); const transitionTimeout = getTimeout(transitionDelays, transitionDurations); const animationDelays = getStyleProperties(`${ANIMATION}Delay`); const animationDurations = getStyleProperties(`${ANIMATION}Duration`); const animationTimeout = getTimeout(animationDelays, animationDurations); let type = null; let timeout = 0; let propCount = 0; if (expectedType === TRANSITION) { if (transitionTimeout > 0) { type = TRANSITION; timeout = transitionTimeout; propCount = transitionDurations.length; } } else if (expectedType === ANIMATION) { if (animationTimeout > 0) { type = ANIMATION; timeout = animationTimeout; propCount = animationDurations.length; } } else { timeout = Math.max(transitionTimeout, animationTimeout); type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; } const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( getStyleProperties(`${TRANSITION}Property`).toString() ); return { type, timeout, propCount, hasTransform }; } function getTimeout(delays, durations) { while (delays.length < durations.length) { delays = delays.concat(delays); } return Math.max(...durations.map((d2, i2) => toMs(d2) + toMs(delays[i2]))); } function toMs(s2) { if (s2 === "auto") return 0; return Number(s2.slice(0, -1).replace(",", ".")) * 1e3; } function forceReflow() { return document.body.offsetHeight; } function patchClass(el, value, isSVG) { const transitionClasses = el[vtcKey]; if (transitionClasses) { value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); } if (value == null) { el.removeAttribute("class"); } else if (isSVG) { el.setAttribute("class", value); } else { el.className = value; } } const vShowOriginalDisplay = Symbol("_vod"); const vShowHidden = Symbol("_vsh"); const vShow = { beforeMount(el, { value }, { transition }) { el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; if (transition && value) { transition.beforeEnter(el); } else { setDisplay(el, value); } }, mounted(el, { value }, { transition }) { if (transition && value) { transition.enter(el); } }, updated(el, { value, oldValue }, { transition }) { if (!value === !oldValue) return; if (transition) { if (value) { transition.beforeEnter(el); setDisplay(el, true); transition.enter(el); } else { transition.leave(el, () => { setDisplay(el, false); }); } } else { setDisplay(el, value); } }, beforeUnmount(el, { value }) { setDisplay(el, value); } }; function setDisplay(el, value) { el.style.display = value ? el[vShowOriginalDisplay] : "none"; el[vShowHidden] = !value; } const CSS_VAR_TEXT = Symbol(""); const displayRE = /(^|;)\s*display\s*:/; function patchStyle(el, prev2, next2) { const style = el.style; const isCssString = isString$1(next2); let hasControlledDisplay = false; if (next2 && !isCssString) { if (prev2) { if (!isString$1(prev2)) { for (const key2 in prev2) { if (next2[key2] == null) { setStyle(style, key2, ""); } } } else { for (const prevStyle of prev2.split(";")) { const key2 = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); if (next2[key2] == null) { setStyle(style, key2, ""); } } } } for (const key2 in next2) { if (key2 === "display") { hasControlledDisplay = true; } setStyle(style, key2, next2[key2]); } } else { if (isCssString) { if (prev2 !== next2) { const cssVarText = style[CSS_VAR_TEXT]; if (cssVarText) { next2 += ";" + cssVarText; } style.cssText = next2; hasControlledDisplay = displayRE.test(next2); } } else if (prev2) { el.removeAttribute("style"); } } if (vShowOriginalDisplay in el) { el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; if (el[vShowHidden]) { style.display = "none"; } } } const importantRE = /\s*!important$/; function setStyle(style, name, val) { if (isArray$2(val)) { val.forEach((v2) => setStyle(style, name, v2)); } else { if (val == null) val = ""; if (name.startsWith("--")) { style.setProperty(name, val); } else { const prefixed = autoPrefix(style, name); if (importantRE.test(val)) { style.setProperty( hyphenate$1(prefixed), val.replace(importantRE, ""), "important" ); } else { style[prefixed] = val; } } } } const prefixes = ["Webkit", "Moz", "ms"]; const prefixCache = {}; function autoPrefix(style, rawName) { const cached2 = prefixCache[rawName]; if (cached2) { return cached2; } let name = camelize$1(rawName); if (name !== "filter" && name in style) { return prefixCache[rawName] = name; } name = capitalize(name); for (let i2 = 0; i2 < prefixes.length; i2++) { const prefixed = prefixes[i2] + name; if (prefixed in style) { return prefixCache[rawName] = prefixed; } } return rawName; } const xlinkNS = "http://www.w3.org/1999/xlink"; function patchAttr(el, key2, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key2)) { if (isSVG && key2.startsWith("xlink:")) { if (value == null) { el.removeAttributeNS(xlinkNS, key2.slice(6, key2.length)); } else { el.setAttributeNS(xlinkNS, key2, value); } } else { if (value == null || isBoolean && !includeBooleanAttr(value)) { el.removeAttribute(key2); } else { el.setAttribute( key2, isBoolean ? "" : isSymbol$1(value) ? String(value) : value ); } } } function patchDOMProp(el, key2, value, parentComponent, attrName) { if (key2 === "innerHTML" || key2 === "textContent") { if (value != null) { el[key2] = key2 === "innerHTML" ? unsafeToTrustedHTML(value) : value; } return; } const tag = el.tagName; if (key2 === "value" && tag !== "PROGRESS" && // custom elements may use _value internally !tag.includes("-")) { const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; const newValue = value == null ? ( // #11647: value should be set as empty string for null and undefined, // but <input type="checkbox"> should be set as 'on'. el.type === "checkbox" ? "on" : "" ) : String(value); if (oldValue !== newValue || !("_value" in el)) { el.value = newValue; } if (value == null) { el.removeAttribute(key2); } el._value = value; return; } let needRemove = false; if (value === "" || value == null) { const type = typeof el[key2]; if (type === "boolean") { value = includeBooleanAttr(value); } else if (value == null && type === "string") { value = ""; needRemove = true; } else if (type === "number") { value = 0; needRemove = true; } } try { el[key2] = value; } catch (e2) { } needRemove && el.removeAttribute(attrName || key2); } function addEventListener(el, event, handler, options) { el.addEventListener(event, handler, options); } function removeEventListener(el, event, handler, options) { el.removeEventListener(event, handler, options); } const veiKey = Symbol("_vei"); function patchEvent(el, rawName, prevValue, nextValue, instance = null) { const invokers = el[veiKey] || (el[veiKey] = {}); const existingInvoker = invokers[rawName]; if (nextValue && existingInvoker) { existingInvoker.value = nextValue; } else { const [name, options] = parseName(rawName); if (nextValue) { const invoker = invokers[rawName] = createInvoker( nextValue, instance ); addEventListener(el, name, invoker, options); } else if (existingInvoker) { removeEventListener(el, name, existingInvoker, options); invokers[rawName] = void 0; } } } const optionsModifierRE = /(?:Once|Passive|Capture)$/; function parseName(name) { let options; if (optionsModifierRE.test(name)) { options = {}; let m2; while (m2 = name.match(optionsModifierRE)) { name = name.slice(0, name.length - m2[0].length); options[m2[0].toLowerCase()] = true; } } const event = name[2] === ":" ? name.slice(3) : hyphenate$1(name.slice(2)); return [event, options]; } let cachedNow = 0; const p = /* @__PURE__ */ Promise.resolve(); const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); function createInvoker(initialValue, instance) { const invoker = (e2) => { if (!e2._vts) { e2._vts = Date.now(); } else if (e2._vts <= invoker.attached) { return; } callWithAsyncErrorHandling( patchStopImmediatePropagation(e2, invoker.value), instance, 5, [e2] ); }; invoker.value = initialValue; invoker.attached = getNow(); return invoker; } function patchStopImmediatePropagation(e2, value) { if (isArray$2(value)) { const originalStop = e2.stopImmediatePropagation; e2.stopImmediatePropagation = () => { originalStop.call(e2); e2._stopped = true; }; return value.map( (fn) => (e22) => !e22._stopped && fn && fn(e22) ); } else { return value; } } const isNativeOn = (key2) => key2.charCodeAt(0) === 111 && key2.charCodeAt(1) === 110 && // lowercase letter key2.charCodeAt(2) > 96 && key2.charCodeAt(2) < 123; const patchProp = (el, key2, prevValue, nextValue, namespace, parentComponent) => { const isSVG = namespace === "svg"; if (key2 === "class") { patchClass(el, nextValue, isSVG); } else if (key2 === "style") { patchStyle(el, prevValue, nextValue); } else if (isOn$1(key2)) { if (!isModelListener(key2)) { patchEvent(el, key2, prevValue, nextValue, parentComponent); } } else if (key2[0] === "." ? (key2 = key2.slice(1), true) : key2[0] === "^" ? (key2 = key2.slice(1), false) : shouldSetAsProp(el, key2, nextValue, isSVG)) { patchDOMProp(el, key2, nextValue); if (!el.tagName.includes("-") && (key2 === "value" || key2 === "checked" || key2 === "selected")) { patchAttr(el, key2, nextValue, isSVG, parentComponent, key2 !== "value"); } } else if ( // #11081 force set props for possible async custom element el._isVueCE && (/[A-Z]/.test(key2) || !isString$1(nextValue)) ) { patchDOMProp(el, camelize$1(key2), nextValue, parentComponent, key2); } else { if (key2 === "true-value") { el._trueValue = nextValue; } else if (key2 === "false-value") { el._falseValue = nextValue; } patchAttr(el, key2, nextValue, isSVG); } }; function shouldSetAsProp(el, key2, value, isSVG) { if (isSVG) { if (key2 === "innerHTML" || key2 === "textContent") { return true; } if (key2 in el && isNativeOn(key2) && isFunction$2(value)) { return true; } return false; } if (key2 === "spellcheck" || key2 === "draggable" || key2 === "translate" || key2 === "autocorrect") { return false; } if (key2 === "form") { return false; } if (key2 === "list" && el.tagName === "INPUT") { return false; } if (key2 === "type" && el.tagName === "TEXTAREA") { return false; } if (key2 === "width" || key2 === "height") { const tag = el.tagName; if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { return false; } } if (isNativeOn(key2) && isString$1(value)) { return false; } return key2 in el; } const positionMap = /* @__PURE__ */ new WeakMap(); const newPositionMap = /* @__PURE__ */ new WeakMap(); const moveCbKey = Symbol("_moveCb"); const enterCbKey = Symbol("_enterCb"); const decorate = (t2) => { delete t2.props.mode; return t2; }; const TransitionGroupImpl = /* @__PURE__ */ decorate({ name: "TransitionGroup", props: /* @__PURE__ */ extend({}, TransitionPropsValidators, { tag: String, moveClass: String }), setup(props2, { slots }) { const instance = getCurrentInstance(); const state = useTransitionState(); let prevChildren; let children; onUpdated(() => { if (!prevChildren.length) { return; } const moveClass = props2.moveClass || `${props2.name || "v"}-move`; if (!hasCSSTransform( prevChildren[0].el, instance.vnode.el, moveClass )) { prevChildren = []; return; } prevChildren.forEach(callPendingCbs); prevChildren.forEach(recordPosition); const movedChildren = prevChildren.filter(applyTranslation); forceReflow(); movedChildren.forEach((c2) => { const el = c2.el; const style = el.style; addTransitionClass(el, moveClass); style.transform = style.webkitTransform = style.transitionDuration = ""; const cb = el[moveCbKey] = (e2) => { if (e2 && e2.target !== el) { return; } if (!e2 || /transform$/.test(e2.propertyName)) { el.removeEventListener("transitionend", cb); el[moveCbKey] = null; removeTransitionClass(el, moveClass); } }; el.addEventListener("transitionend", cb); }); prevChildren = []; }); return () => { const rawProps = toRaw(props2); const cssTransitionProps = resolveTransitionProps(rawProps); let tag = rawProps.tag || Fragment; prevChildren = []; if (children) { for (let i2 = 0; i2 < children.length; i2++) { const child = children[i2]; if (child.el && child.el instanceof Element) { prevChildren.push(child); setTransitionHooks( child, resolveTransitionHooks( child, cssTransitionProps, state, instance ) ); positionMap.set( child, child.el.getBoundingClientRect() ); } } } children = slots.default ? getTransitionRawChildren(slots.default()) : []; for (let i2 = 0; i2 < children.length; i2++) { const child = children[i2]; if (child.key != null) { setTransitionHooks( child, resolveTransitionHooks(child, cssTransitionProps, state, instance) ); } } return createVNode(tag, null, children); }; } }); const TransitionGroup = TransitionGroupImpl; function callPendingCbs(c2) { const el = c2.el; if (el[moveCbKey]) { el[moveCbKey](); } if (el[enterCbKey]) { el[enterCbKey](); } } function recordPosition(c2) { newPositionMap.set(c2, c2.el.getBoundingClientRect()); } function applyTranslation(c2) { const oldPos = positionMap.get(c2); const newPos = newPositionMap.get(c2); const dx = oldPos.left - newPos.left; const dy = oldPos.top - newPos.top; if (dx || dy) { const s2 = c2.el.style; s2.transform = s2.webkitTransform = `translate(${dx}px,${dy}px)`; s2.transitionDuration = "0s"; return c2; } } function hasCSSTransform(el, root2, moveClass) { const clone = el.cloneNode(); const _vtc = el[vtcKey]; if (_vtc) { _vtc.forEach((cls) => { cls.split(/\s+/).forEach((c2) => c2 && clone.classList.remove(c2)); }); } moveClass.split(/\s+/).forEach((c2) => c2 && clone.classList.add(c2)); clone.style.display = "none"; const container = root2.nodeType === 1 ? root2 : root2.parentNode; container.appendChild(clone); const { hasTransform } = getTransitionInfo(clone); container.removeChild(clone); return hasTransform; } const systemModifiers = ["ctrl", "shift", "alt", "meta"]; const modifierGuards = { stop: (e2) => e2.stopPropagation(), prevent: (e2) => e2.preventDefault(), self: (e2) => e2.target !== e2.currentTarget, ctrl: (e2) => !e2.ctrlKey, shift: (e2) => !e2.shiftKey, alt: (e2) => !e2.altKey, meta: (e2) => !e2.metaKey, left: (e2) => "button" in e2 && e2.button !== 0, middle: (e2) => "button" in e2 && e2.button !== 1, right: (e2) => "button" in e2 && e2.button !== 2, exact: (e2, modifiers) => systemModifiers.some((m2) => e2[`${m2}Key`] && !modifiers.includes(m2)) }; const withModifiers = (fn, modifiers) => { const cache = fn._withMods || (fn._withMods = {}); const cacheKey = modifiers.join("."); return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { for (let i2 = 0; i2 < modifiers.length; i2++) { const guard = modifierGuards[modifiers[i2]]; if (guard && guard(event, modifiers)) return; } return fn(event, ...args); }); }; const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); let renderer; function ensureRenderer() { return renderer || (renderer = createRenderer(rendererOptions)); } const render = (...args) => { ensureRenderer().render(...args); }; const createApp = (...args) => { const app = ensureRenderer().createApp(...args); const { mount } = app; app.mount = (containerOrSelector) => { const container = normalizeContainer(containerOrSelector); if (!container) return; const component = app._component; if (!isFunction$2(component) && !component.render && !component.template) { component.template = container.innerHTML; } if (container.nodeType === 1) { container.textContent = ""; } const proxy = mount(container, false, resolveRootNamespace(container)); if (container instanceof Element) { container.removeAttribute("v-cloak"); container.setAttribute("data-v-app", ""); } return proxy; }; return app; }; function resolveRootNamespace(container) { if (container instanceof SVGElement) { return "svg"; } if (typeof MathMLElement === "function" && container instanceof MathMLElement) { return "mathml"; } } function normalizeContainer(container) { if (isString$1(container)) { const res = document.querySelector(container); return res; } return container; } /*! * pinia v3.0.3 * (c) 2025 Eduardo San Martin Morote * @license MIT */ let activePinia; const setActivePinia = (pinia2) => activePinia = pinia2; const piniaSymbol = ( /* istanbul ignore next */ Symbol() ); function isPlainObject$1(o2) { return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function"; } var MutationType; (function(MutationType2) { MutationType2["direct"] = "direct"; MutationType2["patchObject"] = "patch object"; MutationType2["patchFunction"] = "patch function"; })(MutationType || (MutationType = {})); function createPinia() { const scope = effectScope(true); const state = scope.run(() => ref({})); let _p = []; let toBeInstalled = []; const pinia2 = markRaw({ install(app) { setActivePinia(pinia2); pinia2._a = app; app.provide(piniaSymbol, pinia2); app.config.globalProperties.$pinia = pinia2; toBeInstalled.forEach((plugin) => _p.push(plugin)); toBeInstalled = []; }, use(plugin) { if (!this._a) { toBeInstalled.push(plugin); } else { _p.push(plugin); } return this; }, _p, // it's actually undefined here // @ts-expect-error _a: null, _e: scope, _s: /* @__PURE__ */ new Map(), state }); return pinia2; } const noop$6 = () => { }; function addSubscription(subscriptions, callback, detached, onCleanup = noop$6) { subscriptions.push(callback); const removeSubscription = () => { const idx = subscriptions.indexOf(callback); if (idx > -1) { subscriptions.splice(idx, 1); onCleanup(); } }; if (!detached && getCurrentScope()) { onScopeDispose(removeSubscription); } return removeSubscription; } function triggerSubscriptions(subscriptions, ...args) { subscriptions.slice().forEach((callback) => { callback(...args); }); } const fallbackRunWithContext = (fn) => fn(); const ACTION_MARKER = Symbol(); const ACTION_NAME = Symbol(); function mergeReactiveObjects(target, patchToApply) { if (target instanceof Map && patchToApply instanceof Map) { patchToApply.forEach((value, key2) => target.set(key2, value)); } else if (target instanceof Set && patchToApply instanceof Set) { patchToApply.forEach(target.add, target); } for (const key2 in patchToApply) { if (!patchToApply.hasOwnProperty(key2)) continue; const subPatch = patchToApply[key2]; const targetValue = target[key2]; if (isPlainObject$1(targetValue) && isPlainObject$1(subPatch) && target.hasOwnProperty(key2) && !isRef(subPatch) && !isReactive(subPatch)) { target[key2] = mergeReactiveObjects(targetValue, subPatch); } else { target[key2] = subPatch; } } return target; } const skipHydrateSymbol = ( /* istanbul ignore next */ Symbol() ); function shouldHydrate(obj) { return !isPlainObject$1(obj) || !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol); } const { assign } = Object; function isComputed(o2) { return !!(isRef(o2) && o2.effect); } function createOptionsStore(id, options, pinia2, hot) { const { state, actions, getters } = options; const initialState = pinia2.state.value[id]; let store; function setup() { if (!initialState && true) { pinia2.state.value[id] = state ? state() : {}; } const localState = toRefs(pinia2.state.value[id]); return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { computedGetters[name] = markRaw(computed(() => { setActivePinia(pinia2); const store2 = pinia2._s.get(id); return getters[name].call(store2, store2); })); return computedGetters; }, {})); } store = createSetupStore(id, setup, options, pinia2, hot, true); return store; } function createSetupStore($id, setup, options = {}, pinia2, hot, isOptionsStore) { let scope; const optionsForPlugin = assign({ actions: {} }, options); const $subscribeOptions = { deep: true }; let isListening; let isSyncListening; let subscriptions = []; let actionSubscriptions = []; let debuggerEvents; const initialState = pinia2.state.value[$id]; if (!isOptionsStore && !initialState && true) { pinia2.state.value[$id] = {}; } ref({}); let activeListener; function $patch(partialStateOrMutator) { let subscriptionMutation; isListening = isSyncListening = false; if (typeof partialStateOrMutator === "function") { partialStateOrMutator(pinia2.state.value[$id]); subscriptionMutation = { type: MutationType.patchFunction, storeId: $id, events: debuggerEvents }; } else { mergeReactiveObjects(pinia2.state.value[$id], partialStateOrMutator); subscriptionMutation = { type: MutationType.patchObject, payload: partialStateOrMutator, storeId: $id, events: debuggerEvents }; } const myListenerId = activeListener = Symbol(); nextTick().then(() => { if (activeListener === myListenerId) { isListening = true; } }); isSyncListening = true; triggerSubscriptions(subscriptions, subscriptionMutation, pinia2.state.value[$id]); } const $reset = isOptionsStore ? function $reset2() { const { state } = options; const newState = state ? state() : {}; this.$patch(($state) => { assign($state, newState); }); } : ( /* istanbul ignore next */ noop$6 ); function $dispose() { scope.stop(); subscriptions = []; actionSubscriptions = []; pinia2._s.delete($id); } const action = (fn, name = "") => { if (ACTION_MARKER in fn) { fn[ACTION_NAME] = name; return fn; } const wrappedAction = function() { setActivePinia(pinia2); const args = Array.from(arguments); const afterCallbackList = []; const onErrorCallbackList = []; function after(callback) { afterCallbackList.push(callback); } function onError(callback) { onErrorCallbackList.push(callback); } triggerSubscriptions(actionSubscriptions, { args, name: wrappedAction[ACTION_NAME], store, after, onError }); let ret; try { ret = fn.apply(this && this.$id === $id ? this : store, args); } catch (error) { triggerSubscriptions(onErrorCallbackList, error); throw error; } if (ret instanceof Promise) { return ret.then((value) => { triggerSubscriptions(afterCallbackList, value); return value; }).catch((error) => { triggerSubscriptions(onErrorCallbackList, error); return Promise.reject(error); }); } triggerSubscriptions(afterCallbackList, ret); return ret; }; wrappedAction[ACTION_MARKER] = true; wrappedAction[ACTION_NAME] = name; return wrappedAction; }; const partialStore = { _p: pinia2, // _s: scope, $id, $onAction: addSubscription.bind(null, actionSubscriptions), $patch, $reset, $subscribe(callback, options2 = {}) { const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher()); const stopWatcher = scope.run(() => watch(() => pinia2.state.value[$id], (state) => { if (options2.flush === "sync" ? isSyncListening : isListening) { callback({ storeId: $id, type: MutationType.direct, events: debuggerEvents }, state); } }, assign({}, $subscribeOptions, options2))); return removeSubscription; }, $dispose }; const store = reactive(partialStore); pinia2._s.set($id, store); const runWithContext = pinia2._a && pinia2._a.runWithContext || fallbackRunWithContext; const setupStore = runWithContext(() => pinia2._e.run(() => (scope = effectScope()).run(() => setup({ action })))); for (const key2 in setupStore) { const prop = setupStore[key2]; if (isRef(prop) && !isComputed(prop) || isReactive(prop)) { if (!isOptionsStore) { if (initialState && shouldHydrate(prop)) { if (isRef(prop)) { prop.value = initialState[key2]; } else { mergeReactiveObjects(prop, initialState[key2]); } } pinia2.state.value[$id][key2] = prop; } } else if (typeof prop === "function") { const actionValue = action(prop, key2); setupStore[key2] = actionValue; optionsForPlugin.actions[key2] = prop; } else ; } assign(store, setupStore); assign(toRaw(store), setupStore); Object.defineProperty(store, "$state", { get: () => pinia2.state.value[$id], set: (state) => { $patch(($state) => { assign($state, state); }); } }); pinia2._p.forEach((extender) => { { assign(store, scope.run(() => extender({ store, app: pinia2._a, pinia: pinia2, options: optionsForPlugin }))); } }); if (initialState && isOptionsStore && options.hydrate) { options.hydrate(store.$state, initialState); } isListening = true; isSyncListening = true; return store; } /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineStore(id, setup, setupOptions) { let options; const isSetupStore = typeof setup === "function"; options = isSetupStore ? setupOptions : setup; function useStore2(pinia2, hot) { const hasContext = hasInjectionContext(); pinia2 = // in test mode, ignore the argument provided as we can always retrieve a // pinia instance with getActivePinia() pinia2 || (hasContext ? inject(piniaSymbol, null) : null); if (pinia2) setActivePinia(pinia2); pinia2 = activePinia; if (!pinia2._s.has(id)) { if (isSetupStore) { createSetupStore(id, setup, options, pinia2); } else { createOptionsStore(id, options, pinia2); } } const store = pinia2._s.get(id); return store; } useStore2.$id = id; return useStore2; } function _typeof$1(o2) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { return typeof o3; } : function(o3) { return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; }, _typeof$1(o2); } function toPrimitive(t2, r2) { if ("object" != _typeof$1(t2) || !t2) return t2; var e2 = t2[Symbol.toPrimitive]; if (void 0 !== e2) { var i2 = e2.call(t2, r2); if ("object" != _typeof$1(i2)) return i2; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r2 ? String : Number)(t2); } function toPropertyKey(t2) { var i2 = toPrimitive(t2, "string"); return "symbol" == _typeof$1(i2) ? i2 : i2 + ""; } function _defineProperty$A(e2, r2, t2) { return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2; } function ownKeys$1(e2, r2) { var t2 = Object.keys(e2); if (Object.getOwnPropertySymbols) { var o2 = Object.getOwnPropertySymbols(e2); r2 && (o2 = o2.filter(function(r3) { return Object.getOwnPropertyDescriptor(e2, r3).enumerable; })), t2.push.apply(t2, o2); } return t2; } function _objectSpread2$1(e2) { for (var r2 = 1; r2 < arguments.length; r2++) { var t2 = null != arguments[r2] ? arguments[r2] : {}; r2 % 2 ? ownKeys$1(Object(t2), true).forEach(function(r3) { _defineProperty$A(e2, r3, t2[r3]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) { Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3)); }); } return e2; } function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function(n2) { for (var e2 = 1; e2 < arguments.length; e2++) { var t2 = arguments[e2]; for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]); } return n2; }, _extends$1.apply(null, arguments); } const isFunction$1 = (val) => typeof val === "function"; const isArray$1 = Array.isArray; const isString = (val) => typeof val === "string"; const isObject$3 = (val) => val !== null && typeof val === "object"; const onRE = /^on[^a-z]/; const isOn = (key2) => onRE.test(key2); const cacheStringFunction = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; const camelizeRE = /-(\w)/g; const camelize = cacheStringFunction((str) => { return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : ""); }); const hyphenateRE = /\B([A-Z])/g; const hyphenate = cacheStringFunction((str) => { return str.replace(hyphenateRE, "-$1").toLowerCase(); }); const hasOwnProperty$e = Object.prototype.hasOwnProperty; const hasOwn = (val, key2) => hasOwnProperty$e.call(val, key2); function resolvePropValue(options, props2, key2, value) { const opt = options[key2]; if (opt != null) { const hasDefault = hasOwn(opt, "default"); if (hasDefault && value === void 0) { const defaultValue = opt.default; value = opt.type !== Function && isFunction$1(defaultValue) ? defaultValue() : defaultValue; } if (opt.type === Boolean) { if (!hasOwn(props2, key2) && !hasDefault) { value = false; } else if (value === "") { value = true; } } } return value; } function toPx(val) { if (typeof val === "number") return `${val}px`; return val; } function renderHelper(v2) { let props2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let defaultV = arguments.length > 2 ? arguments[2] : void 0; if (typeof v2 === "function") { return v2(props2); } return v2 !== null && v2 !== void 0 ? v2 : defaultV; } function wrapPromiseFn(openFn) { let closeFn; const closePromise = new Promise((resolve2) => { closeFn = openFn(() => { resolve2(true); }); }); const result = () => { closeFn === null || closeFn === void 0 ? void 0 : closeFn(); }; result.then = (filled, rejected) => closePromise.then(filled, rejected); result.promise = closePromise; return result; } function classNames() { const classes = []; for (let i2 = 0; i2 < arguments.length; i2++) { const value = i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2]; if (!value) continue; if (isString(value)) { classes.push(value); } else if (isArray$1(value)) { for (let i3 = 0; i3 < value.length; i3++) { const inner = classNames(value[i3]); if (inner) { classes.push(inner); } } } else if (isObject$3(value)) { for (const name in value) { if (value[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, value) { var index2 = getIndex(this.__entries__, key2); if (~index2) { this.__entries__[index2][1] = value; } else { this.__entries__.push([key2, value]); } }; 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, props2) { for (var _i = 0, _a = Object.keys(props2); _i < _a.length; _i++) { var key2 = _a[_i]; Object.defineProperty(target, key2, { value: props2[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(value) { return parseFloat(value) || 0; } function getBordersSize(styles) { var positions = []; for (var _i = 1; _i < arguments.length; _i++) { positions[_i - 1] = arguments[_i]; } return positions.reduce(function(size, position2) { var value = styles["border-" + position2 + "-width"]; return size + toFloat(value); }, 0); } function getPaddings(styles) { var positions = ["top", "right", "bottom", "left"]; var paddings = {}; for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { var position2 = positions_1[_i]; var value = styles["padding-" + position2]; paddings[position2] = toFloat(value); } 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 styles = getWindowOf(target).getComputedStyle(target); var paddings = getPaddings(styles); var horizPad = paddings.left + paddings.right; var vertPad = paddings.top + paddings.bottom; var width = toFloat(styles.width), height = toFloat(styles.height); if (styles.boxSizing === "border-box") { if (Math.round(width + horizPad) !== clientWidth) { width -= getBordersSize(styles, "left", "right") + horizPad; } if (Math.round(height + vertPad) !== clientHeight) { height -= getBordersSize(styles, "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 */ /* @__PURE__ */ 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 */ /* @__PURE__ */ 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 = function() { if (typeof global$1.ResizeObserver !== "undefined") { return global$1.ResizeObserver; } return ResizeObserver$2; }(); const isValid$2 = (value) => { return value !== void 0 && value !== null && value !== ""; }; const initDefaultProps = (types2, defaultProps) => { const propTypes = _extends$1({}, types2); Object.keys(defaultProps).forEach((k2) => { const 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 ${k2} prop`); } }); return propTypes; }; const splitAttrs = (attrs) => { const allAttrs = Object.keys(attrs); const eventAttrs = {}; const onEvents = {}; const extraAttrs = {}; for (let i2 = 0, l2 = allAttrs.length; i2 < l2; i2++) { const 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 }; }; const parseStyleText = function() { let cssText = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; let camel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; const res = {}; const listDelimiter = /;(?![^(]*\))/g; const propertyDelimiter = /:(.+)/; if (typeof cssText === "object") return cssText; cssText.split(listDelimiter).forEach(function(item) { if (item) { const tmp = item.split(propertyDelimiter); if (tmp.length > 1) { const k2 = camel ? camelize(tmp[0].trim()) : tmp[0].trim(); res[k2] = tmp[1].trim(); } } }); return res; }; const hasProp = (instance, prop) => { return instance[prop] !== void 0; }; const skipFlattenKey = Symbol("skipFlatten"); const flattenChildren = function() { let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; let filterEmpty2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; const temp = Array.isArray(children) ? children : [children]; const res = []; temp.forEach((child) => { if (Array.isArray(child)) { res.push(...flattenChildren(child, filterEmpty2)); } else if (child && child.type === Fragment) { if (child.key === skipFlattenKey) { res.push(child); } else { res.push(...flattenChildren(child.children, filterEmpty2)); } } else if (child && isVNode(child)) { if (filterEmpty2 && !isEmptyElement(child)) { res.push(child); } else if (!filterEmpty2) { res.push(child); } } else if (isValid$2(child)) { res.push(child); } }); return res; }; const getSlot = function(self2) { let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; if (isVNode(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 { const res = self2.$slots[name] && self2.$slots[name](options); return flattenChildren(res); } }; const findDOMNode = (instance) => { var _a; let node2 = ((_a = instance === null || instance === void 0 ? void 0 : instance.vnode) === null || _a === void 0 ? void 0 : _a.el) || instance && (instance.$el || instance); while (node2 && !node2.tagName) { node2 = node2.nextSibling; } return node2; }; const getOptionProps = (instance) => { const res = {}; if (instance.$ && instance.$.vnode) { const props2 = instance.$.vnode.props || {}; Object.keys(instance.$props).forEach((k2) => { const v2 = instance.$props[k2]; const hyphenateKey = hyphenate(k2); if (v2 !== void 0 || hyphenateKey in props2) { res[k2] = v2; } }); } else if (isVNode(instance) && typeof instance.type === "object") { const originProps = instance.props || {}; const props2 = {}; Object.keys(originProps).forEach((key2) => { props2[camelize(key2)] = originProps[key2]; }); const options = instance.type.props || {}; Object.keys(options).forEach((k2) => { const v2 = resolvePropValue(options, props2, k2, props2[k2]); if (v2 !== void 0 || k2 in props2) { res[k2] = v2; } }); } return res; }; const getComponent = function(instance) { let prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default"; let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : instance; let execute = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; let com = void 0; if (instance.$) { const 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(instance)) { const 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() { let ele = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; let on = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; let props2 = {}; if (ele.$) { props2 = _extends$1(_extends$1({}, props2), ele.$attrs); } else { props2 = _extends$1(_extends$1({}, props2), ele.props); } return splitAttrs(props2)[on ? "onEvents" : "events"]; } function getStyle$1(ele, camel) { const props2 = (isVNode(ele) ? ele.props : ele.$attrs) || {}; let style = props2.style || {}; if (typeof style === "string") { style = parseStyleText(style, camel); } return style; } function isFragment(c2) { return c2.length === 1 && c2[0].type === Fragment; } function isEmptyElement(c2) { return c2 && (c2.type === Comment || c2.type === Fragment && c2.children.length === 0 || c2.type === Text && c2.children.trim() === ""); } function filterEmpty() { let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; const res = []; children.forEach((child) => { if (Array.isArray(child)) { res.push(...child); } else if ((child === null || child === void 0 ? void 0 : child.type) === Fragment) { res.push(...filterEmpty(child.children)); } else { res.push(child); } }); return res.filter((c2) => !isEmptyElement(c2)); } function isValidElement(element) { if (Array.isArray(element) && element.length === 1) { element = element[0]; } return element && element.__v_isVNode && typeof element.type !== "symbol"; } function getPropsSlot(slots, props2) { let prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default"; var _a, _b; return (_a = props2[prop]) !== null && _a !== void 0 ? _a : (_b = slots[prop]) === null || _b === void 0 ? void 0 : _b.call(slots); } const ResizeObserver$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ResizeObserver", props: { disabled: Boolean, onResize: Function }, emits: ["resize"], setup(props2, _ref) { let { slots } = _ref; const state = reactive({ width: 0, height: 0, offsetHeight: 0, offsetWidth: 0 }); let currentElement = null; let resizeObserver = null; const destroyObserver = () => { if (resizeObserver) { resizeObserver.disconnect(); resizeObserver = null; } }; const onResize = (entries) => { const { onResize: onResize2 } = props2; const target = entries[0].target; const { width, height } = target.getBoundingClientRect(); const { offsetWidth, offsetHeight } = target; const fixedWidth = Math.floor(width); const fixedHeight = Math.floor(height); if (state.width !== fixedWidth || state.height !== fixedHeight || state.offsetWidth !== offsetWidth || state.offsetHeight !== offsetHeight) { const size = { width: fixedWidth, height: fixedHeight, offsetWidth, offsetHeight }; _extends$1(state, size); if (onResize2) { Promise.resolve().then(() => { onResize2(_extends$1(_extends$1({}, size), { offsetWidth, offsetHeight }), target); }); } } }; const instance = getCurrentInstance(); const registerObserver = () => { const { disabled } = props2; if (disabled) { destroyObserver(); return; } const element = findDOMNode(instance); const elementChanged = element !== currentElement; if (elementChanged) { destroyObserver(); currentElement = element; } if (!resizeObserver && element) { resizeObserver = new index(onResize); resizeObserver.observe(element); } }; onMounted(() => { registerObserver(); }); onUpdated(() => { registerObserver(); }); onUnmounted(() => { destroyObserver(); }); watch(() => props2.disabled, () => { registerObserver(); }, { flush: "post" }); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; }; } }); let raf = (callback) => setTimeout(callback, 16); let caf = (num) => clearTimeout(num); if (typeof window !== "undefined" && "requestAnimationFrame" in window) { raf = (callback) => window.requestAnimationFrame(callback); caf = (handle) => window.cancelAnimationFrame(handle); } let rafUUID = 0; const rafIds = /* @__PURE__ */ new Map(); function cleanup(id) { rafIds.delete(id); } function wrapperRaf(callback) { let times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; rafUUID += 1; const id = rafUUID; function callRef(leftTimes) { if (leftTimes === 0) { cleanup(id); callback(); } else { const realId = raf(() => { callRef(leftTimes - 1); }); rafIds.set(id, realId); } } callRef(times); return id; } wrapperRaf.cancel = (id) => { const realId = rafIds.get(id); cleanup(realId); return caf(realId); }; const tuple = function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return args; }; const withInstall = (comp) => { const c2 = comp; c2.install = function(app) { app.component(c2.displayName || c2.name, comp); }; return comp; }; function eventType() { return { type: [Function, Array] }; } function objectType(defaultVal) { return { type: Object, default: defaultVal }; } function booleanType(defaultVal) { return { type: Boolean, default: defaultVal }; } function functionType(defaultVal) { return { type: Function, default: defaultVal }; } function anyType(defaultVal, required) { const type = { validator: () => true, default: defaultVal }; return type; } function arrayType(defaultVal) { return { type: Array, default: defaultVal }; } function stringType(defaultVal) { return { type: String, default: defaultVal }; } function someType(types2, defaultVal) { return types2 ? { type: types2, default: defaultVal } : anyType(defaultVal); } let supportsPassive = false; try { const opts = Object.defineProperty({}, "passive", { get() { supportsPassive = true; } }); window.addEventListener("testPassive", null, opts); window.removeEventListener("testPassive", null, opts); } catch (e2) { } function addEventListenerWrap(target, eventType2, cb, option) { if (target && target.addEventListener) { let opt = option; if (opt === void 0 && supportsPassive && (eventType2 === "touchstart" || eventType2 === "touchmove" || eventType2 === "wheel")) { opt = { passive: false }; } target.addEventListener(eventType2, cb, opt); } return { remove: () => { if (target && target.removeEventListener) { target.removeEventListener(eventType2, cb); } } }; } const defaultIconPrefixCls = "anticon"; const GlobalFormContextKey = Symbol("GlobalFormContextKey"); const useProvideGlobalForm = (state) => { provide(GlobalFormContextKey, state); }; const useInjectGlobalForm = () => { return inject(GlobalFormContextKey, { validateMessages: computed(() => void 0) }); }; const configProviderProps = () => ({ iconPrefixCls: String, getTargetContainer: { type: Function }, getPopupContainer: { type: Function }, prefixCls: String, getPrefixCls: { type: Function }, renderEmpty: { type: Function }, transformCellText: { type: Function }, csp: objectType(), input: objectType(), autoInsertSpaceInButton: { type: Boolean, default: void 0 }, locale: objectType(), pageHeader: objectType(), componentSize: { type: String }, componentDisabled: { type: Boolean, default: void 0 }, direction: { type: String, default: "ltr" }, space: objectType(), virtual: { type: Boolean, default: void 0 }, dropdownMatchSelectWidth: { type: [Number, Boolean], default: true }, form: objectType(), pagination: objectType(), theme: objectType(), select: objectType(), wave: objectType() }); const configProviderKey = Symbol("configProvider"); const defaultConfigProvider = { getPrefixCls: (suffixCls, customizePrefixCls) => { if (customizePrefixCls) return customizePrefixCls; return suffixCls ? `ant-${suffixCls}` : "ant"; }, iconPrefixCls: computed(() => defaultIconPrefixCls), getPopupContainer: computed(() => () => document.body), direction: computed(() => "ltr") }; const useConfigContextInject = () => { return inject(configProviderKey, defaultConfigProvider); }; const useConfigContextProvider = (props2) => { return provide(configProviderKey, props2); }; const DisabledContextKey = Symbol("DisabledContextKey"); const useInjectDisabled = () => { return inject(DisabledContextKey, ref(void 0)); }; const useProviderDisabled = (disabled) => { const parentDisabled = useInjectDisabled(); provide(DisabledContextKey, computed(() => { var _a; return (_a = disabled.value) !== null && _a !== void 0 ? _a : parentDisabled.value; })); return disabled; }; const enUS = { // Options.jsx items_per_page: "/ page", jump_to: "Go to", jump_to_confirm: "confirm", page: "", // Pagination.jsx prev_page: "Previous Page", next_page: "Next Page", prev_5: "Previous 5 Pages", next_5: "Next 5 Pages", prev_3: "Previous 3 Pages", next_3: "Next 3 Pages" }; const locale$6 = { locale: "en_US", today: "Today", now: "Now", backToToday: "Back to today", ok: "Ok", clear: "Clear", month: "Month", year: "Year", timeSelect: "select time", dateSelect: "select date", weekSelect: "Choose a week", monthSelect: "Choose a month", yearSelect: "Choose a year", decadeSelect: "Choose a decade", yearFormat: "YYYY", dateFormat: "M/D/YYYY", dayFormat: "D", dateTimeFormat: "M/D/YYYY HH:mm:ss", monthBeforeYear: true, previousMonth: "Previous month (PageUp)", nextMonth: "Next month (PageDown)", previousYear: "Last year (Control + left)", nextYear: "Next year (Control + right)", previousDecade: "Last decade", nextDecade: "Next decade", previousCentury: "Last century", nextCentury: "Next century" }; const locale$5 = { placeholder: "Select time", rangePlaceholder: ["Start time", "End time"] }; const locale$4 = { lang: _extends$1({ placeholder: "Select date", yearPlaceholder: "Select year", quarterPlaceholder: "Select quarter", monthPlaceholder: "Select month", weekPlaceholder: "Select week", rangePlaceholder: ["Start date", "End date"], rangeYearPlaceholder: ["Start year", "End year"], rangeQuarterPlaceholder: ["Start quarter", "End quarter"], rangeMonthPlaceholder: ["Start month", "End month"], rangeWeekPlaceholder: ["Start week", "End week"] }, locale$6), timePickerLocale: _extends$1({}, locale$5) }; const typeTemplate$2 = "${label} is not a valid ${type}"; const localeValues$1 = { locale: "en", Pagination: enUS, DatePicker: locale$4, TimePicker: locale$5, Calendar: locale$4, global: { placeholder: "Please select" }, Table: { filterTitle: "Filter menu", filterConfirm: "OK", filterReset: "Reset", filterEmptyText: "No filters", filterCheckall: "Select all items", filterSearchPlaceholder: "Search in filters", emptyText: "No data", selectAll: "Select current page", selectInvert: "Invert current page", selectNone: "Clear all data", selectionAll: "Select all data", sortTitle: "Sort", expand: "Expand row", collapse: "Collapse row", triggerDesc: "Click to sort descending", triggerAsc: "Click to sort ascending", cancelSort: "Click to cancel sorting" }, Tour: { Next: "Next", Previous: "Previous", Finish: "Finish" }, Modal: { okText: "OK", cancelText: "Cancel", justOkText: "OK" }, Popconfirm: { okText: "OK", cancelText: "Cancel" }, Transfer: { titles: ["", ""], searchPlaceholder: "Search here", itemUnit: "item", itemsUnit: "items", remove: "Remove", selectCurrent: "Select current page", removeCurrent: "Remove current page", selectAll: "Select all data", removeAll: "Remove all data", selectInvert: "Invert current page" }, Upload: { uploading: "Uploading...", removeFile: "Remove file", uploadError: "Upload error", previewFile: "Preview file", downloadFile: "Download file" }, Empty: { description: "No data" }, Icon: { icon: "icon" }, Text: { edit: "Edit", copy: "Copy", copied: "Copied", expand: "Expand" }, PageHeader: { back: "Back" }, Form: { optional: "(optional)", defaultValidateMessages: { default: "Field validation error for ${label}", required: "Please enter ${label}", enum: "${label} must be one of [${enum}]", whitespace: "${label} cannot be a blank character", date: { format: "${label} date format is invalid", parse: "${label} cannot be converted to a date", invalid: "${label} is an invalid date" }, types: { string: typeTemplate$2, method: typeTemplate$2, array: typeTemplate$2, object: typeTemplate$2, number: typeTemplate$2, date: typeTemplate$2, boolean: typeTemplate$2, integer: typeTemplate$2, float: typeTemplate$2, regexp: typeTemplate$2, email: typeTemplate$2, url: typeTemplate$2, hex: typeTemplate$2 }, string: { len: "${label} must be ${len} characters", min: "${label} must be at least ${min} characters", max: "${label} must be up to ${max} characters", range: "${label} must be between ${min}-${max} characters" }, number: { len: "${label} must be equal to ${len}", min: "${label} must be minimum ${min}", max: "${label} must be maximum ${max}", range: "${label} must be between ${min}-${max}" }, array: { len: "Must be ${len} ${label}", min: "At least ${min} ${label}", max: "At most ${max} ${label}", range: "The amount of ${label} must be between ${min}-${max}" }, pattern: { mismatch: "${label} does not match the pattern ${pattern}" } } }, Image: { preview: "Preview" }, QRCode: { expired: "QR code expired", refresh: "Refresh", scanned: "Scanned" } }; const LocaleReceiver = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "LocaleReceiver", props: { componentName: String, defaultLocale: { type: [Object, Function] }, children: { type: Function } }, setup(props2, _ref) { let { slots } = _ref; const localeData = inject("localeData", {}); const locale2 = computed(() => { const { componentName = "global", defaultLocale } = props2; const locale3 = defaultLocale || localeValues$1[componentName || "global"]; const { antLocale } = localeData; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; return _extends$1(_extends$1({}, typeof locale3 === "function" ? locale3() : locale3), localeFromContext || {}); }); const localeCode = computed(() => { const { antLocale } = localeData; const localeCode2 = antLocale && antLocale.locale; if (antLocale && antLocale.exist && !localeCode2) { return localeValues$1.locale; } return localeCode2; }); return () => { const children = props2.children || slots.default; const { antLocale } = localeData; return children === null || children === void 0 ? void 0 : children(locale2.value, localeCode.value, antLocale); }; } }); function useLocaleReceiver(componentName, defaultLocale, propsLocale) { const localeData = inject("localeData", {}); const componentLocale = computed(() => { const { antLocale } = localeData; const locale2 = unref(defaultLocale) || localeValues$1[componentName || "global"]; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; return _extends$1(_extends$1(_extends$1({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {}), unref(propsLocale) || {}); }); return [componentLocale]; } function murmur2(str) { var h2 = 0; var k2, i2 = 0, len = str.length; for (; len >= 4; ++i2, len -= 4) { k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24; k2 = /* Math.imul(k, m): */ (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16); k2 ^= /* k >>> r: */ k2 >>> 24; h2 = /* Math.imul(k, m): */ (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16); } switch (len) { case 3: h2 ^= (str.charCodeAt(i2 + 2) & 255) << 16; case 2: h2 ^= (str.charCodeAt(i2 + 1) & 255) << 8; case 1: h2 ^= str.charCodeAt(i2) & 255; h2 = /* Math.imul(h, m): */ (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16); } h2 ^= h2 >>> 13; h2 = /* Math.imul(h, m): */ (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16); return ((h2 ^ h2 >>> 15) >>> 0).toString(36); } const SPLIT = "%"; class Entity { constructor(instanceId) { this.cache = /* @__PURE__ */ new Map(); this.instanceId = instanceId; } get(keys2) { return this.cache.get(Array.isArray(keys2) ? keys2.join(SPLIT) : keys2) || null; } update(keys2, valueFn) { const path2 = Array.isArray(keys2) ? keys2.join(SPLIT) : keys2; const prevValue = this.cache.get(path2); const nextValue = valueFn(prevValue); if (nextValue === null) { this.cache.delete(path2); } else { this.cache.set(path2, nextValue); } } } const ATTR_TOKEN = "data-token-hash"; const ATTR_MARK = "data-css-hash"; const CSS_IN_JS_INSTANCE = "__cssinjs_instance__"; function createCache() { const cssinjsInstanceId = Math.random().toString(12).slice(2); if (typeof document !== "undefined" && document.head && document.body) { const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || []; const { firstChild } = document.head; Array.from(styles).forEach((style) => { style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || cssinjsInstanceId; if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) { document.head.insertBefore(style, firstChild); } }); const styleHash = {}; Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach((style) => { var _a; const hash = style.getAttribute(ATTR_MARK); if (styleHash[hash]) { if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) { (_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style); } } else { styleHash[hash] = true; } }); } return new Entity(cssinjsInstanceId); } const StyleContextKey = Symbol("StyleContextKey"); const getCache = () => { var _a, _b, _c; const instance = getCurrentInstance(); let cache; if (instance && instance.appContext) { const globalCache = (_c = (_b = (_a = instance.appContext) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.globalProperties) === null || _c === void 0 ? void 0 : _c.__ANTDV_CSSINJS_CACHE__; if (globalCache) { cache = globalCache; } else { cache = createCache(); if (instance.appContext.config.globalProperties) { instance.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = cache; } } } else { cache = createCache(); } return cache; }; const defaultStyleContext = { cache: createCache(), defaultCache: true, hashPriority: "low" }; const useStyleInject = () => { const cache = getCache(); return inject(StyleContextKey, shallowRef(_extends$1(_extends$1({}, defaultStyleContext), { cache }))); }; const useStyleProvider = (props2) => { const parentContext = useStyleInject(); const context2 = shallowRef(_extends$1(_extends$1({}, defaultStyleContext), { cache: createCache() })); watch([() => unref(props2), parentContext], () => { const mergedContext = _extends$1({}, parentContext.value); const propsValue = unref(props2); Object.keys(propsValue).forEach((key2) => { const value = propsValue[key2]; if (propsValue[key2] !== void 0) { mergedContext[key2] = value; } }); const { cache } = propsValue; mergedContext.cache = mergedContext.cache || createCache(); mergedContext.defaultCache = !cache && parentContext.value.defaultCache; context2.value = mergedContext; }, { immediate: true }); provide(StyleContextKey, context2); return context2; }; const styleProviderProps = () => ({ autoClear: booleanType(), /** @private Test only. Not work in production. */ mock: stringType(), /** * Only set when you need ssr to extract style on you own. * If not provided, it will auto create <style /> on the end of Provider in server side. */ cache: objectType(), /** Tell children that this context is default generated context */ defaultCache: booleanType(), /** Use `:where` selector to reduce hashId css selector priority */ hashPriority: stringType(), /** Tell cssinjs where to inject style in */ container: someType(), /** Component wil render inline `<style />` for fallback in SSR. Not recommend. */ ssrInline: booleanType(), /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */ transformers: arrayType(), /** * Linters to lint css before inject in document. * Styles will be linted after transforming. * Please note that `linters` do not support dynamic update. */ linters: arrayType() }); withInstall(/* @__PURE__ */ defineComponent({ name: "AStyleProvider", inheritAttrs: false, props: styleProviderProps(), setup(props2, _ref) { let { slots } = _ref; useStyleProvider(props2); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } })); function useClientCache(prefix, keyPath, cacheFn, onCacheRemove) { const styleContext = useStyleInject(); const fullPathStr = shallowRef(""); const res = shallowRef(); watchEffect(() => { fullPathStr.value = [prefix, ...keyPath.value].join("%"); }); const clearCache = (pathStr) => { styleContext.value.cache.update(pathStr, (prevCache) => { const [times = 0, cache] = prevCache || []; const nextCount = times - 1; if (nextCount === 0) { onCacheRemove === null || onCacheRemove === void 0 ? void 0 : onCacheRemove(cache, false); return null; } return [times - 1, cache]; }); }; watch(fullPathStr, (newStr, oldStr) => { if (oldStr) clearCache(oldStr); styleContext.value.cache.update(newStr, (prevCache) => { const [times = 0, cache] = prevCache || []; let tmpCache = cache; const mergedCache = tmpCache || cacheFn(); return [times + 1, mergedCache]; }); res.value = styleContext.value.cache.get(fullPathStr.value)[1]; }, { immediate: true }); onBeforeUnmount(() => { clearCache(fullPathStr.value); }); return res; } function canUseDom$1() { return !!(typeof window !== "undefined" && window.document && window.document.createElement); } function contains$1(root2, n2) { if (!root2) { return false; } if (root2.contains) { return root2.contains(n2); } return false; } const APPEND_ORDER$1 = "data-vc-order"; const MARK_KEY$1 = `vc-util-key`; const containerCache$1 = /* @__PURE__ */ new Map(); function getMark$1() { let { mark } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; if (mark) { return mark.startsWith("data-") ? mark : `data-${mark}`; } return MARK_KEY$1; } function getContainer$2(option) { if (option.attachTo) { return option.attachTo; } const head = document.querySelector("head"); return head || document.body; } function getOrder$1(prepend) { if (prepend === "queue") { return "prependQueue"; } return prepend ? "prepend" : "append"; } function findStyles$1(container) { return Array.from((containerCache$1.get(container) || container).children).filter((node2) => node2.tagName === "STYLE"); } function injectCSS$1(css2) { let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (!canUseDom$1()) { return null; } const { csp, prepend } = option; const styleNode = document.createElement("style"); styleNode.setAttribute(APPEND_ORDER$1, getOrder$1(prepend)); if (csp === null || csp === void 0 ? void 0 : csp.nonce) { styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce; } styleNode.innerHTML = css2; const container = getContainer$2(option); const { firstChild } = container; if (prepend) { if (prepend === "queue") { const existStyle = findStyles$1(container).filter((node2) => ["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER$1))); if (existStyle.length) { container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling); return styleNode; } } container.insertBefore(styleNode, firstChild); } else { container.appendChild(styleNode); } return styleNode; } function findExistNode$1(key2) { let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const container = getContainer$2(option); return findStyles$1(container).find((node2) => node2.getAttribute(getMark$1(option)) === key2); } function removeCSS(key2) { let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const existNode = findExistNode$1(key2, option); if (existNode) { const container = getContainer$2(option); container.removeChild(existNode); } } function syncRealContainer$1(container, option) { const cachedRealContainer = containerCache$1.get(container); if (!cachedRealContainer || !contains$1(document, cachedRealContainer)) { const placeholderStyle = injectCSS$1("", option); const { parentNode } = placeholderStyle; containerCache$1.set(container, parentNode); container.removeChild(placeholderStyle); } } function updateCSS$1(css2, key2) { let option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var _a, _b, _c; const container = getContainer$2(option); syncRealContainer$1(container, option); const existNode = findExistNode$1(key2, option); if (existNode) { if (((_a = option.csp) === null || _a === void 0 ? void 0 : _a.nonce) && existNode.nonce !== ((_b = option.csp) === null || _b === void 0 ? void 0 : _b.nonce)) { existNode.nonce = (_c = option.csp) === null || _c === void 0 ? void 0 : _c.nonce; } if (existNode.innerHTML !== css2) { existNode.innerHTML = css2; } return existNode; } const newNode = injectCSS$1(css2, option); newNode.setAttribute(getMark$1(option), key2); return newNode; } function sameDerivativeOption(left, right) { if (left.length !== right.length) { return false; } for (let i2 = 0; i2 < left.length; i2++) { if (left[i2] !== right[i2]) { return false; } } return true; } class ThemeCache { constructor() { this.cache = /* @__PURE__ */ new Map(); this.keys = []; this.cacheCallTimes = 0; } size() { return this.keys.length; } internalGet(derivativeOption) { let updateCallTimes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; let cache = { map: this.cache }; derivativeOption.forEach((derivative2) => { var _a; if (!cache) { cache = void 0; } else { cache = (_a = cache === null || cache === void 0 ? void 0 : cache.map) === null || _a === void 0 ? void 0 : _a.get(derivative2); } }); if ((cache === null || cache === void 0 ? void 0 : cache.value) && updateCallTimes) { cache.value[1] = this.cacheCallTimes++; } return cache === null || cache === void 0 ? void 0 : cache.value; } get(derivativeOption) { var _a; return (_a = this.internalGet(derivativeOption, true)) === null || _a === void 0 ? void 0 : _a[0]; } has(derivativeOption) { return !!this.internalGet(derivativeOption); } set(derivativeOption, value) { if (!this.has(derivativeOption)) { if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) { const [targetKey] = this.keys.reduce((result, key2) => { const [, callTimes] = result; if (this.internalGet(key2)[1] < callTimes) { return [key2, this.internalGet(key2)[1]]; } return result; }, [this.keys[0], this.cacheCallTimes]); this.delete(targetKey); } this.keys.push(derivativeOption); } let cache = this.cache; derivativeOption.forEach((derivative2, index2) => { if (index2 === derivativeOption.length - 1) { cache.set(derivative2, { value: [value, this.cacheCallTimes++] }); } else { const cacheValue = cache.get(derivative2); if (!cacheValue) { cache.set(derivative2, { map: /* @__PURE__ */ new Map() }); } else if (!cacheValue.map) { cacheValue.map = /* @__PURE__ */ new Map(); } cache = cache.get(derivative2).map; } }); } deleteByPath(currentCache, derivatives) { var _a; const cache = currentCache.get(derivatives[0]); if (derivatives.length === 1) { if (!cache.map) { currentCache.delete(derivatives[0]); } else { currentCache.set(derivatives[0], { map: cache.map }); } return (_a = cache.value) === null || _a === void 0 ? void 0 : _a[0]; } const result = this.deleteByPath(cache.map, derivatives.slice(1)); if ((!cache.map || cache.map.size === 0) && !cache.value) { currentCache.delete(derivatives[0]); } return result; } delete(derivativeOption) { if (this.has(derivativeOption)) { this.keys = this.keys.filter((item) => !sameDerivativeOption(item, derivativeOption)); return this.deleteByPath(this.cache, derivativeOption); } return void 0; } } ThemeCache.MAX_CACHE_SIZE = 20; ThemeCache.MAX_CACHE_OFFSET = 5; let warned = {}; function warning$3(valid, message) { } function call(method, valid, message) { if (!valid && !warned[message]) { warned[message] = true; } } function warningOnce(valid, message) { call(warning$3, valid, message); } function noop$5() { } let warning$2 = noop$5; let uuid$7 = 0; class Theme { constructor(derivatives) { this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives]; this.id = uuid$7; if (derivatives.length === 0) { warning$2(derivatives.length > 0); } uuid$7 += 1; } getDerivativeToken(token2) { return this.derivatives.reduce((result, derivative2) => derivative2(token2, result), void 0); } } const cacheThemes = new ThemeCache(); function createTheme(derivatives) { const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives]; if (!cacheThemes.has(derivativeArr)) { cacheThemes.set(derivativeArr, new Theme(derivativeArr)); } return cacheThemes.get(derivativeArr); } const flattenTokenCache = /* @__PURE__ */ new WeakMap(); function flattenToken(token2) { let str = flattenTokenCache.get(token2) || ""; if (!str) { Object.keys(token2).forEach((key2) => { const value = token2[key2]; str += key2; if (value instanceof Theme) { str += value.id; } else if (value && typeof value === "object") { str += flattenToken(value); } else { str += value; } }); flattenTokenCache.set(token2, str); } return str; } function token2key(token2, salt) { return murmur2(`${salt}_${flattenToken(token2)}`); } const randomSelectorKey = `random-${Date.now()}-${Math.random()}`.replace(/\./g, ""); const checkContent = "_bAmBoO_"; function supportSelector(styleStr, handleElement, supportCheck) { var _a, _b; if (canUseDom$1()) { updateCSS$1(styleStr, randomSelectorKey); const ele = document.createElement("div"); ele.style.position = "fixed"; ele.style.left = "0"; ele.style.top = "0"; handleElement === null || handleElement === void 0 ? void 0 : handleElement(ele); document.body.appendChild(ele); const support = supportCheck ? supportCheck(ele) : (_a = getComputedStyle(ele).content) === null || _a === void 0 ? void 0 : _a.includes(checkContent); (_b = ele.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(ele); removeCSS(randomSelectorKey); return support; } return false; } let canLayer = void 0; function supportLayer() { if (canLayer === void 0) { canLayer = supportSelector(`@layer ${randomSelectorKey} { .${randomSelectorKey} { content: "${checkContent}"!important; } }`, (ele) => { ele.className = randomSelectorKey; }); } return canLayer; } const EMPTY_OVERRIDE = {}; const hashPrefix = "css"; const tokenKeys = /* @__PURE__ */ new Map(); function recordCleanToken(tokenKey) { tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1); } function removeStyleTags(key2, instanceId) { if (typeof document !== "undefined") { const styles = document.querySelectorAll(`style[${ATTR_TOKEN}="${key2}"]`); styles.forEach((style) => { var _a; if (style[CSS_IN_JS_INSTANCE] === instanceId) { (_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style); } }); } } const TOKEN_THRESHOLD = 0; function cleanTokenStyle(tokenKey, instanceId) { tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1); const tokenKeyList = Array.from(tokenKeys.keys()); const cleanableKeyList = tokenKeyList.filter((key2) => { const count = tokenKeys.get(key2) || 0; return count <= 0; }); if (tokenKeyList.length - cleanableKeyList.length > TOKEN_THRESHOLD) { cleanableKeyList.forEach((key2) => { removeStyleTags(key2, instanceId); tokenKeys.delete(key2); }); } } const getComputedToken = (originToken, overrideToken, theme, format2) => { const derivativeToken = theme.getDerivativeToken(originToken); let mergedDerivativeToken = _extends$1(_extends$1({}, derivativeToken), overrideToken); if (format2) { mergedDerivativeToken = format2(mergedDerivativeToken); } return mergedDerivativeToken; }; function useCacheToken(theme, tokens) { let option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ref({}); const style = useStyleInject(); const mergedToken = computed(() => _extends$1({}, ...tokens.value)); const tokenStr = computed(() => flattenToken(mergedToken.value)); const overrideTokenStr = computed(() => flattenToken(option.value.override || EMPTY_OVERRIDE)); const cachedToken = useClientCache("token", computed(() => [option.value.salt || "", theme.value.id, tokenStr.value, overrideTokenStr.value]), () => { const { salt = "", override = EMPTY_OVERRIDE, formatToken: formatToken2, getComputedToken: compute } = option.value; const mergedDerivativeToken = compute ? compute(mergedToken.value, override, theme.value) : getComputedToken(mergedToken.value, override, theme.value, formatToken2); const tokenKey = token2key(mergedDerivativeToken, salt); mergedDerivativeToken._tokenKey = tokenKey; recordCleanToken(tokenKey); const hashId = `${hashPrefix}-${murmur2(tokenKey)}`; mergedDerivativeToken._hashId = hashId; return [mergedDerivativeToken, hashId]; }, (cache) => { var _a; cleanTokenStyle(cache[0]._tokenKey, (_a = style.value) === null || _a === void 0 ? void 0 : _a.cache.instanceId); }); return cachedToken; } var unitlessKeys = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; var COMMENT = "comm"; var RULESET = "rule"; var DECLARATION = "decl"; var IMPORT = "@import"; var NAMESPACE = "@namespace"; var KEYFRAMES = "@keyframes"; var LAYER = "@layer"; var abs = Math.abs; var from = String.fromCharCode; function trim(value) { return value.trim(); } function replace(value, pattern, replacement) { return value.replace(pattern, replacement); } function indexof(value, search, position2) { return value.indexOf(search, position2); } function charat(value, index2) { return value.charCodeAt(index2) | 0; } function substr(value, begin, end) { return value.slice(begin, end); } function strlen(value) { return value.length; } function sizeof(value) { return value.length; } function append(value, array) { return array.push(value), value; } var line = 1; var column = 1; var length = 0; var position = 0; var character = 0; var characters = ""; function node(value, root2, parent2, type, props2, children, length2, siblings) { return { value, root: root2, parent: parent2, type, props: props2, children, line, column, length: length2, return: "", siblings }; } function char() { return character; } function prev() { character = position > 0 ? charat(characters, --position) : 0; if (column--, character === 10) column = 1, line--; return character; } function next() { character = position < length ? charat(characters, position++) : 0; if (column++, character === 10) column = 1, line++; return character; } function peek() { return charat(characters, position); } function caret() { return position; } function slice(begin, end) { return substr(characters, begin, end); } function token(type) { switch (type) { case 0: case 9: case 10: case 13: case 32: return 5; case 33: case 43: case 44: case 47: case 62: case 64: case 126: case 59: case 123: case 125: return 4; case 58: return 3; case 34: case 39: case 40: case 91: return 2; case 41: case 93: return 1; } return 0; } function alloc(value) { return line = column = 1, length = strlen(characters = value), position = 0, []; } function dealloc(value) { return characters = "", value; } function delimit(type) { return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))); } function whitespace$1(type) { while (character = peek()) if (character < 33) next(); else break; return token(type) > 2 || token(character) > 3 ? "" : " "; } function escaping(index2, count) { while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break; return slice(index2, caret() + (count < 6 && peek() == 32 && next() == 32)); } function delimiter(type) { while (next()) switch (character) { case type: return position; case 34: case 39: if (type !== 34 && type !== 39) delimiter(character); break; case 40: if (type === 41) delimiter(type); break; case 92: next(); break; } return position; } function commenter(type, index2) { while (next()) if (type + character === 47 + 10) break; else if (type + character === 42 + 42 && peek() === 47) break; return "/*" + slice(index2, position - 1) + "*" + from(type === 47 ? type : next()); } function identifier(index2) { while (!token(peek())) next(); return slice(index2, position); } function compile(value) { return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value)); } function parse(value, root2, parent2, rule, rules2, rulesets, pseudo, points, declarations) { var index2 = 0; var offset2 = 0; var length2 = pseudo; var atrule = 0; var property2 = 0; var previous = 0; var variable = 1; var scanning = 1; var ampersand = 1; var character2 = 0; var type = ""; var props2 = rules2; var children = rulesets; var reference = rule; var characters2 = type; while (scanning) switch (previous = character2, character2 = next()) { case 40: if (previous != 108 && charat(characters2, length2 - 1) == 58) { if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index2 ? points[index2 - 1] : 0)) != -1) ampersand = -1; break; } case 34: case 39: case 91: characters2 += delimit(character2); break; case 9: case 10: case 13: case 32: characters2 += whitespace$1(previous); break; case 92: characters2 += escaping(caret() - 1, 7); continue; case 47: switch (peek()) { case 42: case 47: append(comment(commenter(next(), caret()), root2, parent2, declarations), declarations); if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " "; break; default: characters2 += "/"; } break; case 123 * variable: points[index2++] = strlen(characters2) * ampersand; case 125 * variable: case 59: case 0: switch (character2) { case 0: case 125: scanning = 0; case 59 + offset2: if (ampersand == -1) characters2 = replace(characters2, /\f/g, ""); if (property2 > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47)) append(property2 > 32 ? declaration(characters2 + ";", rule, parent2, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent2, length2 - 2, declarations), declarations); break; case 59: characters2 += ";"; default: append(reference = ruleset(characters2, root2, parent2, index2, offset2, rules2, points, type, props2 = [], children = [], length2, rulesets), rulesets); if (character2 === 123) if (offset2 === 0) parse(characters2, root2, reference, reference, props2, rulesets, length2, points, children); else { switch (atrule) { case 99: if (charat(characters2, 3) === 110) break; case 108: if (charat(characters2, 2) === 97) break; default: offset2 = 0; case 100: case 109: case 115: } if (offset2) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules2, points, type, rules2, props2 = [], length2, children), children), rules2, children, length2, points, rule ? props2 : children); else parse(characters2, reference, reference, reference, [""], children, 0, points, children); } } index2 = offset2 = property2 = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo; break; case 58: length2 = 1 + strlen(characters2), property2 = previous; default: if (variable < 1) { if (character2 == 123) --variable; else if (character2 == 125 && variable++ == 0 && prev() == 125) continue; } switch (characters2 += from(character2), character2 * variable) { case 38: ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1); break; case 44: points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1; break; case 64: if (peek() === 45) characters2 += delimit(next()); atrule = peek(), offset2 = length2 = strlen(type = characters2 += identifier(caret())), character2++; break; case 45: if (previous === 45 && strlen(characters2) == 2) variable = 0; } } return rulesets; } function ruleset(value, root2, parent2, index2, offset2, rules2, points, type, props2, children, length2, siblings) { var post = offset2 - 1; var rule = offset2 === 0 ? rules2 : [""]; var size = sizeof(rule); for (var i2 = 0, j2 = 0, k2 = 0; i2 < index2; ++i2) for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i2])), z2 = value; x2 < size; ++x2) if (z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) props2[k2++] = z2; return node(value, root2, parent2, offset2 === 0 ? RULESET : type, props2, children, length2, siblings); } function comment(value, root2, parent2, siblings) { return node(value, root2, parent2, COMMENT, from(char()), substr(value, 2, -2), 0, siblings); } function declaration(value, root2, parent2, length2, siblings) { return node(value, root2, parent2, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings); } function serialize(children, callback) { var output = ""; for (var i2 = 0; i2 < children.length; i2++) output += callback(children[i2], i2, children, callback) || ""; return output; } function stringify(element, index2, children, callback) { switch (element.type) { case LAYER: if (element.children.length) break; case IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value; case COMMENT: return ""; case KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}"; case RULESET: if (!strlen(element.value = element.props.join(","))) return ""; } return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : ""; } const ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path"; const CSS_FILE_STYLE = "_FILE_STYLE__"; let cachePathMap; let fromCSSFile = true; function prepare() { var _a; if (!cachePathMap) { cachePathMap = {}; if (canUseDom$1()) { const div = document.createElement("div"); div.className = ATTR_CACHE_MAP; div.style.position = "fixed"; div.style.visibility = "hidden"; div.style.top = "-9999px"; document.body.appendChild(div); let content = getComputedStyle(div).content || ""; content = content.replace(/^"/, "").replace(/"$/, ""); content.split(";").forEach((item) => { const [path2, hash] = item.split(":"); cachePathMap[path2] = hash; }); const inlineMapStyle = document.querySelector(`style[${ATTR_CACHE_MAP}]`); if (inlineMapStyle) { fromCSSFile = false; (_a = inlineMapStyle.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(inlineMapStyle); } document.body.removeChild(div); } } } function existPath(path2) { prepare(); return !!cachePathMap[path2]; } function getStyleAndHash(path2) { const hash = cachePathMap[path2]; let styleStr = null; if (hash && canUseDom$1()) { if (fromCSSFile) { styleStr = CSS_FILE_STYLE; } else { const style = document.querySelector(`style[${ATTR_MARK}="${cachePathMap[path2]}"]`); if (style) { styleStr = style.innerHTML; } else { delete cachePathMap[path2]; } } } return [styleStr, hash]; } const isClientSide = canUseDom$1(); const SKIP_CHECK = "_skip_check_"; const MULTI_VALUE = "_multi_value_"; function normalizeStyle(styleStr) { const serialized = serialize(compile(styleStr), stringify); return serialized.replace(/\{%%%\:[^;];}/g, ";"); } function isCompoundCSSProperty(value) { return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value); } function injectSelectorHash(key2, hashId, hashPriority) { if (!hashId) { return key2; } const hashClassName = `.${hashId}`; const hashSelector = hashPriority === "low" ? `:where(${hashClassName})` : hashClassName; const keys2 = key2.split(",").map((k2) => { var _a; const fullPath = k2.trim().split(/\s+/); let firstPath = fullPath[0] || ""; const htmlElement = ((_a = firstPath.match(/^\w+/)) === null || _a === void 0 ? void 0 : _a[0]) || ""; firstPath = `${htmlElement}${hashSelector}${firstPath.slice(htmlElement.length)}`; return [firstPath, ...fullPath.slice(1)].join(" "); }); return keys2.join(","); } const globalEffectStyleKeys = /* @__PURE__ */ new Set(); const parseStyle = function(interpolation) { let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let { root: root2, injectHash, parentSelectors } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { root: true, parentSelectors: [] }; const { hashId, layer, path: path2, hashPriority, transformers = [], linters = [] } = config; let styleStr = ""; let effectStyle = {}; function parseKeyframes(keyframes) { const animationName = keyframes.getName(hashId); if (!effectStyle[animationName]) { const [parsedStr] = parseStyle(keyframes.style, config, { root: false, parentSelectors }); effectStyle[animationName] = `@keyframes ${keyframes.getName(hashId)}${parsedStr}`; } } function flattenList(list) { let fullList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; list.forEach((item) => { if (Array.isArray(item)) { flattenList(item, fullList); } else if (item) { fullList.push(item); } }); return fullList; } const flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]); flattenStyleList.forEach((originStyle) => { const style = typeof originStyle === "string" && !root2 ? {} : originStyle; if (typeof style === "string") { styleStr += `${style} `; } else if (style._keyframe) { parseKeyframes(style); } else { const mergedStyle = transformers.reduce((prev2, trans) => { var _a; return ((_a = trans === null || trans === void 0 ? void 0 : trans.visit) === null || _a === void 0 ? void 0 : _a.call(trans, prev2)) || prev2; }, style); Object.keys(mergedStyle).forEach((key2) => { var _a; const value = mergedStyle[key2]; if (typeof value === "object" && value && (key2 !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) { let subInjectHash = false; let mergedKey = key2.trim(); let nextRoot = false; if ((root2 || injectHash) && hashId) { if (mergedKey.startsWith("@")) { subInjectHash = true; } else { mergedKey = injectSelectorHash(key2, hashId, hashPriority); } } else if (root2 && !hashId && (mergedKey === "&" || mergedKey === "")) { mergedKey = ""; nextRoot = true; } const [parsedStr, childEffectStyle] = parseStyle(value, config, { root: nextRoot, injectHash: subInjectHash, parentSelectors: [...parentSelectors, mergedKey] }); effectStyle = _extends$1(_extends$1({}, effectStyle), childEffectStyle); styleStr += `${mergedKey}${parsedStr}`; } else { let appendStyle = function(cssKey, cssValue) { const styleName = cssKey.replace(/[A-Z]/g, (match2) => `-${match2.toLowerCase()}`); let formatValue = cssValue; if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) { formatValue = `${formatValue}px`; } if (cssKey === "animationName" && (cssValue === null || cssValue === void 0 ? void 0 : cssValue._keyframe)) { parseKeyframes(cssValue); formatValue = cssValue.getName(hashId); } styleStr += `${styleName}:${formatValue};`; }; const actualValue = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : value; if (typeof value === "object" && (value === null || value === void 0 ? void 0 : value[MULTI_VALUE]) && Array.isArray(actualValue)) { actualValue.forEach((item) => { appendStyle(key2, item); }); } else { appendStyle(key2, actualValue); } } }); } }); if (!root2) { styleStr = `{${styleStr}}`; } else if (layer && supportLayer()) { const layerCells = layer.split(","); const layerName = layerCells[layerCells.length - 1].trim(); styleStr = `@layer ${layerName} {${styleStr}}`; if (layerCells.length > 1) { styleStr = `@layer ${layer}{%%%:%}${styleStr}`; } } return [styleStr, effectStyle]; }; function uniqueHash(path2, styleStr) { return murmur2(`${path2.join("%")}${styleStr}`); } function useStyleRegister(info, styleFn) { const styleContext = useStyleInject(); const tokenKey = computed(() => info.value.token._tokenKey); const fullPath = computed(() => [tokenKey.value, ...info.value.path]); let isMergedClientSide = isClientSide; useClientCache( "style", fullPath, // Create cache if needed () => { const { path: path2, hashId, layer, nonce, clientOnly, order = 0 } = info.value; const cachePath = fullPath.value.join("|"); if (existPath(cachePath)) { const [inlineCacheStyleStr, styleHash] = getStyleAndHash(cachePath); if (inlineCacheStyleStr) { return [inlineCacheStyleStr, tokenKey.value, styleHash, {}, clientOnly, order]; } } const styleObj = styleFn(); const { hashPriority, container, transformers, linters, cache } = styleContext.value; const [parsedStyle, effectStyle] = parseStyle(styleObj, { hashId, hashPriority, layer, path: path2.join("-"), transformers, linters }); const styleStr = normalizeStyle(parsedStyle); const styleId = uniqueHash(fullPath.value, styleStr); if (isMergedClientSide) { const mergedCSSConfig = { mark: ATTR_MARK, prepend: "queue", attachTo: container, priority: order }; const nonceStr = typeof nonce === "function" ? nonce() : nonce; if (nonceStr) { mergedCSSConfig.csp = { nonce: nonceStr }; } const style = updateCSS$1(styleStr, styleId, mergedCSSConfig); style[CSS_IN_JS_INSTANCE] = cache.instanceId; style.setAttribute(ATTR_TOKEN, tokenKey.value); Object.keys(effectStyle).forEach((effectKey) => { if (!globalEffectStyleKeys.has(effectKey)) { globalEffectStyleKeys.add(effectKey); updateCSS$1(normalizeStyle(effectStyle[effectKey]), `_effect-${effectKey}`, { mark: ATTR_MARK, prepend: "queue", attachTo: container }); } }); } return [styleStr, tokenKey.value, styleId, effectStyle, clientOnly, order]; }, // Remove cache if no need (_ref, fromHMR) => { let [, , styleId] = _ref; if ((fromHMR || styleContext.value.autoClear) && isClientSide) { removeCSS(styleId, { mark: ATTR_MARK }); } } ); return (node2) => { return node2; }; } class Keyframe { constructor(name, style) { this._keyframe = true; this.name = name; this.style = style; } getName() { let hashId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; return hashId ? `${hashId}-${this.name}` : this.name; } } const version = "4.2.6"; const PresetColors = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"]; function bound01(n2, max) { if (isOnePointZero(n2)) { n2 = "100%"; } var isPercent = isPercentage(n2); n2 = max === 360 ? n2 : Math.min(max, Math.max(0, parseFloat(n2))); if (isPercent) { n2 = parseInt(String(n2 * max), 10) / 100; } if (Math.abs(n2 - max) < 1e-6) { return 1; } if (max === 360) { n2 = (n2 < 0 ? n2 % max + max : n2 % max) / parseFloat(String(max)); } else { n2 = n2 % max / parseFloat(String(max)); } return n2; } function clamp01(val) { return Math.min(1, Math.max(0, val)); } function isOnePointZero(n2) { return typeof n2 === "string" && n2.indexOf(".") !== -1 && parseFloat(n2) === 1; } function isPercentage(n2) { return typeof n2 === "string" && n2.indexOf("%") !== -1; } function boundAlpha(a2) { a2 = parseFloat(a2); if (isNaN(a2) || a2 < 0 || a2 > 1) { a2 = 1; } return a2; } function convertToPercentage(n2) { if (n2 <= 1) { return "".concat(Number(n2) * 100, "%"); } return n2; } function pad2(c2) { return c2.length === 1 ? "0" + c2 : String(c2); } function rgbToRgb(r2, g2, b2) { return { r: bound01(r2, 255) * 255, g: bound01(g2, 255) * 255, b: bound01(b2, 255) * 255 }; } function rgbToHsl(r2, g2, b2) { r2 = bound01(r2, 255); g2 = bound01(g2, 255); b2 = bound01(b2, 255); var max = Math.max(r2, g2, b2); var min = Math.min(r2, g2, b2); var h2 = 0; var s2 = 0; var l2 = (max + min) / 2; if (max === min) { s2 = 0; h2 = 0; } else { var d2 = max - min; s2 = l2 > 0.5 ? d2 / (2 - max - min) : d2 / (max + min); switch (max) { case r2: h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0); break; case g2: h2 = (b2 - r2) / d2 + 2; break; case b2: h2 = (r2 - g2) / d2 + 4; break; } h2 /= 6; } return { h: h2, s: s2, l: l2 }; } function hue2rgb(p2, q2, t2) { if (t2 < 0) { t2 += 1; } if (t2 > 1) { t2 -= 1; } if (t2 < 1 / 6) { return p2 + (q2 - p2) * (6 * t2); } if (t2 < 1 / 2) { return q2; } if (t2 < 2 / 3) { return p2 + (q2 - p2) * (2 / 3 - t2) * 6; } return p2; } function hslToRgb(h2, s2, l2) { var r2; var g2; var b2; h2 = bound01(h2, 360); s2 = bound01(s2, 100); l2 = bound01(l2, 100); if (s2 === 0) { g2 = l2; b2 = l2; r2 = l2; } else { var q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; var p2 = 2 * l2 - q2; r2 = hue2rgb(p2, q2, h2 + 1 / 3); g2 = hue2rgb(p2, q2, h2); b2 = hue2rgb(p2, q2, h2 - 1 / 3); } return { r: r2 * 255, g: g2 * 255, b: b2 * 255 }; } function rgbToHsv(r2, g2, b2) { r2 = bound01(r2, 255); g2 = bound01(g2, 255); b2 = bound01(b2, 255); var max = Math.max(r2, g2, b2); var min = Math.min(r2, g2, b2); var h2 = 0; var v2 = max; var d2 = max - min; var s2 = max === 0 ? 0 : d2 / max; if (max === min) { h2 = 0; } else { switch (max) { case r2: h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0); break; case g2: h2 = (b2 - r2) / d2 + 2; break; case b2: h2 = (r2 - g2) / d2 + 4; break; } h2 /= 6; } return { h: h2, s: s2, v: v2 }; } function hsvToRgb(h2, s2, v2) { h2 = bound01(h2, 360) * 6; s2 = bound01(s2, 100); v2 = bound01(v2, 100); var i2 = Math.floor(h2); var f2 = h2 - i2; var p2 = v2 * (1 - s2); var q2 = v2 * (1 - f2 * s2); var t2 = v2 * (1 - (1 - f2) * s2); var mod = i2 % 6; var r2 = [v2, q2, p2, p2, t2, v2][mod]; var g2 = [t2, v2, v2, q2, p2, p2][mod]; var b2 = [p2, p2, t2, v2, v2, q2][mod]; return { r: r2 * 255, g: g2 * 255, b: b2 * 255 }; } function rgbToHex(r2, g2, b2, allow3Char) { var hex = [ pad2(Math.round(r2).toString(16)), pad2(Math.round(g2).toString(16)), pad2(Math.round(b2).toString(16)) ]; if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); } return hex.join(""); } function rgbaToHex(r2, g2, b2, a2, allow4Char) { var hex = [ pad2(Math.round(r2).toString(16)), pad2(Math.round(g2).toString(16)), pad2(Math.round(b2).toString(16)), pad2(convertDecimalToHex(a2)) ]; if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); } return hex.join(""); } function convertDecimalToHex(d2) { return Math.round(parseFloat(d2) * 255).toString(16); } function convertHexToDecimal(h2) { return parseIntFromHex(h2) / 255; } function parseIntFromHex(val) { return parseInt(val, 16); } function numberInputToObject(color) { return { r: color >> 16, g: (color & 65280) >> 8, b: color & 255 }; } var names = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }; function inputToRGB(color) { var rgb = { r: 0, g: 0, b: 0 }; var a2 = 1; var s2 = null; var v2 = null; var l2 = null; var ok = false; var format2 = false; if (typeof color === "string") { color = stringInputToObject(color); } if (typeof color === "object") { if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { rgb = rgbToRgb(color.r, color.g, color.b); ok = true; format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { s2 = convertToPercentage(color.s); v2 = convertToPercentage(color.v); rgb = hsvToRgb(color.h, s2, v2); ok = true; format2 = "hsv"; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { s2 = convertToPercentage(color.s); l2 = convertToPercentage(color.l); rgb = hslToRgb(color.h, s2, l2); ok = true; format2 = "hsl"; } if (Object.prototype.hasOwnProperty.call(color, "a")) { a2 = color.a; } } a2 = boundAlpha(a2); return { ok, format: color.format || format2, r: Math.min(255, Math.max(rgb.r, 0)), g: Math.min(255, Math.max(rgb.g, 0)), b: Math.min(255, Math.max(rgb.b, 0)), a: a2 }; } var CSS_INTEGER = "[-\\+]?\\d+%?"; var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")"); var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"); var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"); var matchers = { CSS_UNIT: new RegExp(CSS_UNIT), rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; function stringInputToObject(color) { color = color.trim().toLowerCase(); if (color.length === 0) { return false; } var named = false; if (names[color]) { color = names[color]; named = true; } else if (color === "transparent") { return { r: 0, g: 0, b: 0, a: 0, format: "name" }; } var match2 = matchers.rgb.exec(color); if (match2) { return { r: match2[1], g: match2[2], b: match2[3] }; } match2 = matchers.rgba.exec(color); if (match2) { return { r: match2[1], g: match2[2], b: match2[3], a: match2[4] }; } match2 = matchers.hsl.exec(color); if (match2) { return { h: match2[1], s: match2[2], l: match2[3] }; } match2 = matchers.hsla.exec(color); if (match2) { return { h: match2[1], s: match2[2], l: match2[3], a: match2[4] }; } match2 = matchers.hsv.exec(color); if (match2) { return { h: match2[1], s: match2[2], v: match2[3] }; } match2 = matchers.hsva.exec(color); if (match2) { return { h: match2[1], s: match2[2], v: match2[3], a: match2[4] }; } match2 = matchers.hex8.exec(color); if (match2) { return { r: parseIntFromHex(match2[1]), g: parseIntFromHex(match2[2]), b: parseIntFromHex(match2[3]), a: convertHexToDecimal(match2[4]), format: named ? "name" : "hex8" }; } match2 = matchers.hex6.exec(color); if (match2) { return { r: parseIntFromHex(match2[1]), g: parseIntFromHex(match2[2]), b: parseIntFromHex(match2[3]), format: named ? "name" : "hex" }; } match2 = matchers.hex4.exec(color); if (match2) { return { r: parseIntFromHex(match2[1] + match2[1]), g: parseIntFromHex(match2[2] + match2[2]), b: parseIntFromHex(match2[3] + match2[3]), a: convertHexToDecimal(match2[4] + match2[4]), format: named ? "name" : "hex8" }; } match2 = matchers.hex3.exec(color); if (match2) { return { r: parseIntFromHex(match2[1] + match2[1]), g: parseIntFromHex(match2[2] + match2[2]), b: parseIntFromHex(match2[3] + match2[3]), format: named ? "name" : "hex" }; } return false; } function isValidCSSUnit(color) { return Boolean(matchers.CSS_UNIT.exec(String(color))); } var TinyColor = ( /** @class */ function() { function TinyColor2(color, opts) { if (color === void 0) { color = ""; } if (opts === void 0) { opts = {}; } var _a; if (color instanceof TinyColor2) { return color; } if (typeof color === "number") { color = numberInputToObject(color); } this.originalInput = color; var rgb = inputToRGB(color); this.originalInput = color; this.r = rgb.r; this.g = rgb.g; this.b = rgb.b; this.a = rgb.a; this.roundA = Math.round(100 * this.a) / 100; this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format; this.gradientType = opts.gradientType; if (this.r < 1) { this.r = Math.round(this.r); } if (this.g < 1) { this.g = Math.round(this.g); } if (this.b < 1) { this.b = Math.round(this.b); } this.isValid = rgb.ok; } TinyColor2.prototype.isDark = function() { return this.getBrightness() < 128; }; TinyColor2.prototype.isLight = function() { return !this.isDark(); }; TinyColor2.prototype.getBrightness = function() { var rgb = this.toRgb(); return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3; }; TinyColor2.prototype.getLuminance = function() { var rgb = this.toRgb(); var R2; var G; var B2; var RsRGB = rgb.r / 255; var GsRGB = rgb.g / 255; var BsRGB = rgb.b / 255; if (RsRGB <= 0.03928) { R2 = RsRGB / 12.92; } else { R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4); } if (GsRGB <= 0.03928) { G = GsRGB / 12.92; } else { G = Math.pow((GsRGB + 0.055) / 1.055, 2.4); } if (BsRGB <= 0.03928) { B2 = BsRGB / 12.92; } else { B2 = Math.pow((BsRGB + 0.055) / 1.055, 2.4); } return 0.2126 * R2 + 0.7152 * G + 0.0722 * B2; }; TinyColor2.prototype.getAlpha = function() { return this.a; }; TinyColor2.prototype.setAlpha = function(alpha) { this.a = boundAlpha(alpha); this.roundA = Math.round(100 * this.a) / 100; return this; }; TinyColor2.prototype.isMonochrome = function() { var s2 = this.toHsl().s; return s2 === 0; }; TinyColor2.prototype.toHsv = function() { var hsv = rgbToHsv(this.r, this.g, this.b); return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a }; }; TinyColor2.prototype.toHsvString = function() { var hsv = rgbToHsv(this.r, this.g, this.b); var h2 = Math.round(hsv.h * 360); var s2 = Math.round(hsv.s * 100); var v2 = Math.round(hsv.v * 100); return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s2, "%, ").concat(v2, "%)") : "hsva(".concat(h2, ", ").concat(s2, "%, ").concat(v2, "%, ").concat(this.roundA, ")"); }; TinyColor2.prototype.toHsl = function() { var hsl = rgbToHsl(this.r, this.g, this.b); return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a }; }; TinyColor2.prototype.toHslString = function() { var hsl = rgbToHsl(this.r, this.g, this.b); var h2 = Math.round(hsl.h * 360); var s2 = Math.round(hsl.s * 100); var l2 = Math.round(hsl.l * 100); return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%)") : "hsla(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%, ").concat(this.roundA, ")"); }; TinyColor2.prototype.toHex = function(allow3Char) { if (allow3Char === void 0) { allow3Char = false; } return rgbToHex(this.r, this.g, this.b, allow3Char); }; TinyColor2.prototype.toHexString = function(allow3Char) { if (allow3Char === void 0) { allow3Char = false; } return "#" + this.toHex(allow3Char); }; TinyColor2.prototype.toHex8 = function(allow4Char) { if (allow4Char === void 0) { allow4Char = false; } return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char); }; TinyColor2.prototype.toHex8String = function(allow4Char) { if (allow4Char === void 0) { allow4Char = false; } return "#" + this.toHex8(allow4Char); }; TinyColor2.prototype.toHexShortString = function(allowShortChar) { if (allowShortChar === void 0) { allowShortChar = false; } return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar); }; TinyColor2.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }; TinyColor2.prototype.toRgbString = function() { var r2 = Math.round(this.r); var g2 = Math.round(this.g); var b2 = Math.round(this.b); return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g2, ", ").concat(b2, ")") : "rgba(".concat(r2, ", ").concat(g2, ", ").concat(b2, ", ").concat(this.roundA, ")"); }; TinyColor2.prototype.toPercentageRgb = function() { var fmt = function(x2) { return "".concat(Math.round(bound01(x2, 255) * 100), "%"); }; return { r: fmt(this.r), g: fmt(this.g), b: fmt(this.b), a: this.a }; }; TinyColor2.prototype.toPercentageRgbString = function() { var rnd = function(x2) { return Math.round(bound01(x2, 255) * 100); }; return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")"); }; TinyColor2.prototype.toName = function() { if (this.a === 0) { return "transparent"; } if (this.a < 1) { return false; } var hex = "#" + rgbToHex(this.r, this.g, this.b, false); for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) { var _b = _a[_i], key2 = _b[0], value = _b[1]; if (hex === value) { return key2; } } return false; }; TinyColor2.prototype.toString = function(format2) { var formatSet = Boolean(format2); format2 = format2 !== null && format2 !== void 0 ? format2 : this.format; var formattedString = false; var hasAlpha = this.a < 1 && this.a >= 0; var needsAlphaFormat = !formatSet && hasAlpha && (format2.startsWith("hex") || format2 === "name"); if (needsAlphaFormat) { if (format2 === "name" && this.a === 0) { return this.toName(); } return this.toRgbString(); } if (format2 === "rgb") { formattedString = this.toRgbString(); } if (format2 === "prgb") { formattedString = this.toPercentageRgbString(); } if (format2 === "hex" || format2 === "hex6") { formattedString = this.toHexString(); } if (format2 === "hex3") { formattedString = this.toHexString(true); } if (format2 === "hex4") { formattedString = this.toHex8String(true); } if (format2 === "hex8") { formattedString = this.toHex8String(); } if (format2 === "name") { formattedString = this.toName(); } if (format2 === "hsl") { formattedString = this.toHslString(); } if (format2 === "hsv") { formattedString = this.toHsvString(); } return formattedString || this.toHexString(); }; TinyColor2.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }; TinyColor2.prototype.clone = function() { return new TinyColor2(this.toString()); }; TinyColor2.prototype.lighten = function(amount) { if (amount === void 0) { amount = 10; } var hsl = this.toHsl(); hsl.l += amount / 100; hsl.l = clamp01(hsl.l); return new TinyColor2(hsl); }; TinyColor2.prototype.brighten = function(amount) { if (amount === void 0) { amount = 10; } var rgb = this.toRgb(); rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100)))); rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100)))); rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100)))); return new TinyColor2(rgb); }; TinyColor2.prototype.darken = function(amount) { if (amount === void 0) { amount = 10; } var hsl = this.toHsl(); hsl.l -= amount / 100; hsl.l = clamp01(hsl.l); return new TinyColor2(hsl); }; TinyColor2.prototype.tint = function(amount) { if (amount === void 0) { amount = 10; } return this.mix("white", amount); }; TinyColor2.prototype.shade = function(amount) { if (amount === void 0) { amount = 10; } return this.mix("black", amount); }; TinyColor2.prototype.desaturate = function(amount) { if (amount === void 0) { amount = 10; } var hsl = this.toHsl(); hsl.s -= amount / 100; hsl.s = clamp01(hsl.s); return new TinyColor2(hsl); }; TinyColor2.prototype.saturate = function(amount) { if (amount === void 0) { amount = 10; } var hsl = this.toHsl(); hsl.s += amount / 100; hsl.s = clamp01(hsl.s); return new TinyColor2(hsl); }; TinyColor2.prototype.greyscale = function() { return this.desaturate(100); }; TinyColor2.prototype.spin = function(amount) { var hsl = this.toHsl(); var hue = (hsl.h + amount) % 360; hsl.h = hue < 0 ? 360 + hue : hue; return new TinyColor2(hsl); }; TinyColor2.prototype.mix = function(color, amount) { if (amount === void 0) { amount = 50; } var rgb1 = this.toRgb(); var rgb2 = new TinyColor2(color).toRgb(); var p2 = amount / 100; var rgba = { r: (rgb2.r - rgb1.r) * p2 + rgb1.r, g: (rgb2.g - rgb1.g) * p2 + rgb1.g, b: (rgb2.b - rgb1.b) * p2 + rgb1.b, a: (rgb2.a - rgb1.a) * p2 + rgb1.a }; return new TinyColor2(rgba); }; TinyColor2.prototype.analogous = function(results, slices) { if (results === void 0) { results = 6; } if (slices === void 0) { slices = 30; } var hsl = this.toHsl(); var part = 360 / slices; var ret = [this]; for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) { hsl.h = (hsl.h + part) % 360; ret.push(new TinyColor2(hsl)); } return ret; }; TinyColor2.prototype.complement = function() { var hsl = this.toHsl(); hsl.h = (hsl.h + 180) % 360; return new TinyColor2(hsl); }; TinyColor2.prototype.monochromatic = function(results) { if (results === void 0) { results = 6; } var hsv = this.toHsv(); var h2 = hsv.h; var s2 = hsv.s; var v2 = hsv.v; var res = []; var modification = 1 / results; while (results--) { res.push(new TinyColor2({ h: h2, s: s2, v: v2 })); v2 = (v2 + modification) % 1; } return res; }; TinyColor2.prototype.splitcomplement = function() { var hsl = this.toHsl(); var h2 = hsl.h; return [ this, new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }), new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l }) ]; }; TinyColor2.prototype.onBackground = function(background) { var fg = this.toRgb(); var bg = new TinyColor2(background).toRgb(); var alpha = fg.a + bg.a * (1 - fg.a); return new TinyColor2({ r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha, g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha, b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha, a: alpha }); }; TinyColor2.prototype.triad = function() { return this.polyad(3); }; TinyColor2.prototype.tetrad = function() { return this.polyad(4); }; TinyColor2.prototype.polyad = function(n2) { var hsl = this.toHsl(); var h2 = hsl.h; var result = [this]; var increment = 360 / n2; for (var i2 = 1; i2 < n2; i2++) { result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl.s, l: hsl.l })); } return result; }; TinyColor2.prototype.equals = function(color) { return this.toRgbString() === new TinyColor2(color).toRgbString(); }; return TinyColor2; }() ); var hueStep = 2; var saturationStep = 0.16; var saturationStep2 = 0.05; var brightnessStep1 = 0.05; var brightnessStep2 = 0.15; var lightColorCount = 5; var darkColorCount = 4; var darkColorMap = [{ index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }]; function toHsv(_ref) { var r2 = _ref.r, g2 = _ref.g, b2 = _ref.b; var hsv = rgbToHsv(r2, g2, b2); return { h: hsv.h * 360, s: hsv.s, v: hsv.v }; } function toHex(_ref2) { var r2 = _ref2.r, g2 = _ref2.g, b2 = _ref2.b; return "#".concat(rgbToHex(r2, g2, b2, false)); } function mix$1(rgb1, rgb2, amount) { var p2 = amount / 100; var rgb = { r: (rgb2.r - rgb1.r) * p2 + rgb1.r, g: (rgb2.g - rgb1.g) * p2 + rgb1.g, b: (rgb2.b - rgb1.b) * p2 + rgb1.b }; return rgb; } function getHue(hsv, i2, light) { var hue; if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) { hue = light ? Math.round(hsv.h) - hueStep * i2 : Math.round(hsv.h) + hueStep * i2; } else { hue = light ? Math.round(hsv.h) + hueStep * i2 : Math.round(hsv.h) - hueStep * i2; } if (hue < 0) { hue += 360; } else if (hue >= 360) { hue -= 360; } return hue; } function getSaturation(hsv, i2, light) { if (hsv.h === 0 && hsv.s === 0) { return hsv.s; } var saturation; if (light) { saturation = hsv.s - saturationStep * i2; } else if (i2 === darkColorCount) { saturation = hsv.s + saturationStep; } else { saturation = hsv.s + saturationStep2 * i2; } if (saturation > 1) { saturation = 1; } if (light && i2 === lightColorCount && saturation > 0.1) { saturation = 0.1; } if (saturation < 0.06) { saturation = 0.06; } return Number(saturation.toFixed(2)); } function getValue$3(hsv, i2, light) { var value; if (light) { value = hsv.v + brightnessStep1 * i2; } else { value = hsv.v - brightnessStep2 * i2; } if (value > 1) { value = 1; } return Number(value.toFixed(2)); } function generate$1(color) { var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var patterns = []; var pColor = inputToRGB(color); for (var i2 = lightColorCount; i2 > 0; i2 -= 1) { var hsv = toHsv(pColor); var colorString = toHex(inputToRGB({ h: getHue(hsv, i2, true), s: getSaturation(hsv, i2, true), v: getValue$3(hsv, i2, true) })); patterns.push(colorString); } patterns.push(toHex(pColor)); for (var _i = 1; _i <= darkColorCount; _i += 1) { var _hsv = toHsv(pColor); var _colorString = toHex(inputToRGB({ h: getHue(_hsv, _i), s: getSaturation(_hsv, _i), v: getValue$3(_hsv, _i) })); patterns.push(_colorString); } if (opts.theme === "dark") { return darkColorMap.map(function(_ref3) { var index2 = _ref3.index, opacity = _ref3.opacity; var darkColorString = toHex(mix$1(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index2]), opacity * 100)); return darkColorString; }); } return patterns; } var presetPrimaryColors = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1890FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666" }; var presetPalettes = {}; var presetDarkPalettes = {}; Object.keys(presetPrimaryColors).forEach(function(key2) { presetPalettes[key2] = generate$1(presetPrimaryColors[key2]); presetPalettes[key2].primary = presetPalettes[key2][5]; presetDarkPalettes[key2] = generate$1(presetPrimaryColors[key2], { theme: "dark", backgroundColor: "#141414" }); presetDarkPalettes[key2].primary = presetDarkPalettes[key2][5]; }); var blue = presetPalettes.blue; const genControlHeight = (token2) => { const { controlHeight } = token2; return { controlHeightSM: controlHeight * 0.75, controlHeightXS: controlHeight * 0.5, controlHeightLG: controlHeight * 1.25 }; }; function genSizeMapToken(token2) { const { sizeUnit, sizeStep } = token2; return { sizeXXL: sizeUnit * (sizeStep + 8), sizeXL: sizeUnit * (sizeStep + 4), sizeLG: sizeUnit * (sizeStep + 2), sizeMD: sizeUnit * (sizeStep + 1), sizeMS: sizeUnit * sizeStep, size: sizeUnit * sizeStep, sizeSM: sizeUnit * (sizeStep - 1), sizeXS: sizeUnit * (sizeStep - 2), sizeXXS: sizeUnit * (sizeStep - 3) // 4 }; } const defaultPresetColors = { blue: "#1677ff", purple: "#722ED1", cyan: "#13C2C2", green: "#52C41A", magenta: "#EB2F96", pink: "#eb2f96", red: "#F5222D", orange: "#FA8C16", yellow: "#FADB14", volcano: "#FA541C", geekblue: "#2F54EB", gold: "#FAAD14", lime: "#A0D911" }; const seedToken = _extends$1(_extends$1({}, defaultPresetColors), { // Color colorPrimary: "#1677ff", colorSuccess: "#52c41a", colorWarning: "#faad14", colorError: "#ff4d4f", colorInfo: "#1677ff", colorTextBase: "", colorBgBase: "", // Font fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`, fontSize: 14, // Line lineWidth: 1, lineType: "solid", // Motion motionUnit: 0.1, motionBase: 0, motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)", motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)", motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)", motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)", motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)", motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)", motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)", motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)", // Radius borderRadius: 6, // Size sizeUnit: 4, sizeStep: 4, sizePopupArrow: 16, // Control Base controlHeight: 32, // zIndex zIndexBase: 0, zIndexPopupBase: 1e3, // Image opacityImage: 1, // Wireframe wireframe: false }); function genColorMapToken(seed2, _ref) { let { generateColorPalettes: generateColorPalettes2, generateNeutralColorPalettes: generateNeutralColorPalettes2 } = _ref; const { colorSuccess: colorSuccessBase, colorWarning: colorWarningBase, colorError: colorErrorBase, colorInfo: colorInfoBase, colorPrimary: colorPrimaryBase, colorBgBase, colorTextBase } = seed2; const primaryColors = generateColorPalettes2(colorPrimaryBase); const successColors = generateColorPalettes2(colorSuccessBase); const warningColors = generateColorPalettes2(colorWarningBase); const errorColors = generateColorPalettes2(colorErrorBase); const infoColors = generateColorPalettes2(colorInfoBase); const neutralColors = generateNeutralColorPalettes2(colorBgBase, colorTextBase); return _extends$1(_extends$1({}, neutralColors), { colorPrimaryBg: primaryColors[1], colorPrimaryBgHover: primaryColors[2], colorPrimaryBorder: primaryColors[3], colorPrimaryBorderHover: primaryColors[4], colorPrimaryHover: primaryColors[5], colorPrimary: primaryColors[6], colorPrimaryActive: primaryColors[7], colorPrimaryTextHover: primaryColors[8], colorPrimaryText: primaryColors[9], colorPrimaryTextActive: primaryColors[10], colorSuccessBg: successColors[1], colorSuccessBgHover: successColors[2], colorSuccessBorder: successColors[3], colorSuccessBorderHover: successColors[4], colorSuccessHover: successColors[4], colorSuccess: successColors[6], colorSuccessActive: successColors[7], colorSuccessTextHover: successColors[8], colorSuccessText: successColors[9], colorSuccessTextActive: successColors[10], colorErrorBg: errorColors[1], colorErrorBgHover: errorColors[2], colorErrorBorder: errorColors[3], colorErrorBorderHover: errorColors[4], colorErrorHover: errorColors[5], colorError: errorColors[6], colorErrorActive: errorColors[7], colorErrorTextHover: errorColors[8], colorErrorText: errorColors[9], colorErrorTextActive: errorColors[10], colorWarningBg: warningColors[1], colorWarningBgHover: warningColors[2], colorWarningBorder: warningColors[3], colorWarningBorderHover: warningColors[4], colorWarningHover: warningColors[4], colorWarning: warningColors[6], colorWarningActive: warningColors[7], colorWarningTextHover: warningColors[8], colorWarningText: warningColors[9], colorWarningTextActive: warningColors[10], colorInfoBg: infoColors[1], colorInfoBgHover: infoColors[2], colorInfoBorder: infoColors[3], colorInfoBorderHover: infoColors[4], colorInfoHover: infoColors[4], colorInfo: infoColors[6], colorInfoActive: infoColors[7], colorInfoTextHover: infoColors[8], colorInfoText: infoColors[9], colorInfoTextActive: infoColors[10], colorBgMask: new TinyColor("#000").setAlpha(0.45).toRgbString(), colorWhite: "#fff" }); } const genRadius = (radiusBase) => { let radiusLG = radiusBase; let radiusSM = radiusBase; let radiusXS = radiusBase; let radiusOuter = radiusBase; if (radiusBase < 6 && radiusBase >= 5) { radiusLG = radiusBase + 1; } else if (radiusBase < 16 && radiusBase >= 6) { radiusLG = radiusBase + 2; } else if (radiusBase >= 16) { radiusLG = 16; } if (radiusBase < 7 && radiusBase >= 5) { radiusSM = 4; } else if (radiusBase < 8 && radiusBase >= 7) { radiusSM = 5; } else if (radiusBase < 14 && radiusBase >= 8) { radiusSM = 6; } else if (radiusBase < 16 && radiusBase >= 14) { radiusSM = 7; } else if (radiusBase >= 16) { radiusSM = 8; } if (radiusBase < 6 && radiusBase >= 2) { radiusXS = 1; } else if (radiusBase >= 6) { radiusXS = 2; } if (radiusBase > 4 && radiusBase < 8) { radiusOuter = 4; } else if (radiusBase >= 8) { radiusOuter = 6; } return { borderRadius: radiusBase > 16 ? 16 : radiusBase, borderRadiusXS: radiusXS, borderRadiusSM: radiusSM, borderRadiusLG: radiusLG, borderRadiusOuter: radiusOuter }; }; function genCommonMapToken(token2) { const { motionUnit, motionBase, borderRadius, lineWidth } = token2; return _extends$1({ // motion motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`, motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`, motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`, // line lineWidthBold: lineWidth + 1 }, genRadius(borderRadius)); } const getAlphaColor$1 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString(); const getSolidColor = (baseColor, brightness) => { const instance = new TinyColor(baseColor); return instance.darken(brightness).toHexString(); }; const generateColorPalettes = (baseColor) => { const colors = generate$1(baseColor); return { 1: colors[0], 2: colors[1], 3: colors[2], 4: colors[3], 5: colors[4], 6: colors[5], 7: colors[6], 8: colors[4], 9: colors[5], 10: colors[6] // 8: colors[7], // 9: colors[8], // 10: colors[9], }; }; const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => { const colorBgBase = bgBaseColor || "#fff"; const colorTextBase = textBaseColor || "#000"; return { colorBgBase, colorTextBase, colorText: getAlphaColor$1(colorTextBase, 0.88), colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65), colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45), colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25), colorFill: getAlphaColor$1(colorTextBase, 0.15), colorFillSecondary: getAlphaColor$1(colorTextBase, 0.06), colorFillTertiary: getAlphaColor$1(colorTextBase, 0.04), colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.02), colorBgLayout: getSolidColor(colorBgBase, 4), colorBgContainer: getSolidColor(colorBgBase, 0), colorBgElevated: getSolidColor(colorBgBase, 0), colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.85), colorBorder: getSolidColor(colorBgBase, 15), colorBorderSecondary: getSolidColor(colorBgBase, 6) }; }; function getFontSizes(base) { const fontSizes = new Array(10).fill(null).map((_2, index2) => { const i2 = index2 - 1; const baseSize = base * Math.pow(2.71828, i2 / 5); const intSize = index2 > 1 ? Math.floor(baseSize) : Math.ceil(baseSize); return Math.floor(intSize / 2) * 2; }); fontSizes[1] = base; return fontSizes.map((size) => { const height = size + 8; return { size, lineHeight: height / size }; }); } const genFontMapToken = (fontSize) => { const fontSizePairs = getFontSizes(fontSize); const fontSizes = fontSizePairs.map((pair) => pair.size); const lineHeights = fontSizePairs.map((pair) => pair.lineHeight); return { fontSizeSM: fontSizes[0], fontSize: fontSizes[1], fontSizeLG: fontSizes[2], fontSizeXL: fontSizes[3], fontSizeHeading1: fontSizes[6], fontSizeHeading2: fontSizes[5], fontSizeHeading3: fontSizes[4], fontSizeHeading4: fontSizes[3], fontSizeHeading5: fontSizes[2], lineHeight: lineHeights[1], lineHeightLG: lineHeights[2], lineHeightSM: lineHeights[0], lineHeightHeading1: lineHeights[6], lineHeightHeading2: lineHeights[5], lineHeightHeading3: lineHeights[4], lineHeightHeading4: lineHeights[3], lineHeightHeading5: lineHeights[2] }; }; function derivative(token2) { const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => { const colors = generate$1(token2[colorKey]); return new Array(10).fill(1).reduce((prev2, _2, i2) => { prev2[`${colorKey}-${i2 + 1}`] = colors[i2]; return prev2; }, {}); }).reduce((prev2, cur) => { prev2 = _extends$1(_extends$1({}, prev2), cur); return prev2; }, {}); return _extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, token2), colorPalettes), genColorMapToken(token2, { generateColorPalettes, generateNeutralColorPalettes })), genFontMapToken(token2.fontSize)), genSizeMapToken(token2)), genControlHeight(token2)), genCommonMapToken(token2)); } function isStableColor(color) { return color >= 0 && color <= 255; } function getAlphaColor(frontColor, backgroundColor) { const { r: fR, g: fG, b: fB, a: originAlpha } = new TinyColor(frontColor).toRgb(); if (originAlpha < 1) { return frontColor; } const { r: bR, g: bG, b: bB } = new TinyColor(backgroundColor).toRgb(); for (let fA = 0.01; fA <= 1; fA += 0.01) { const r2 = Math.round((fR - bR * (1 - fA)) / fA); const g2 = Math.round((fG - bG * (1 - fA)) / fA); const b2 = Math.round((fB - bB * (1 - fA)) / fA); if (isStableColor(r2) && isStableColor(g2) && isStableColor(b2)) { return new TinyColor({ r: r2, g: g2, b: b2, a: Math.round(fA * 100) / 100 }).toRgbString(); } } return new TinyColor({ r: fR, g: fG, b: fB, a: 1 }).toRgbString(); } var __rest$u = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function formatToken(derivativeToken) { const { override } = derivativeToken, restToken = __rest$u(derivativeToken, ["override"]); const overrideTokens = _extends$1({}, override); Object.keys(seedToken).forEach((token2) => { delete overrideTokens[token2]; }); const mergedToken = _extends$1(_extends$1({}, restToken), overrideTokens); const screenXS = 480; const screenSM = 576; const screenMD = 768; const screenLG = 992; const screenXL = 1200; const screenXXL = 1600; const screenXXXL = 2e3; const aliasToken = _extends$1(_extends$1(_extends$1({}, mergedToken), { colorLink: mergedToken.colorInfoText, colorLinkHover: mergedToken.colorInfoHover, colorLinkActive: mergedToken.colorInfoActive, // ============== Background ============== // colorFillContent: mergedToken.colorFillSecondary, colorFillContentHover: mergedToken.colorFill, colorFillAlter: mergedToken.colorFillQuaternary, colorBgContainerDisabled: mergedToken.colorFillTertiary, // ============== Split ============== // colorBorderBg: mergedToken.colorBgContainer, colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer), // ============== Text ============== // colorTextPlaceholder: mergedToken.colorTextQuaternary, colorTextDisabled: mergedToken.colorTextQuaternary, colorTextHeading: mergedToken.colorText, colorTextLabel: mergedToken.colorTextSecondary, colorTextDescription: mergedToken.colorTextTertiary, colorTextLightSolid: mergedToken.colorWhite, colorHighlight: mergedToken.colorError, colorBgTextHover: mergedToken.colorFillSecondary, colorBgTextActive: mergedToken.colorFill, colorIcon: mergedToken.colorTextTertiary, colorIconHover: mergedToken.colorText, colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer), colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer), // Font fontSizeIcon: mergedToken.fontSizeSM, // Control lineWidth: mergedToken.lineWidth, controlOutlineWidth: mergedToken.lineWidth * 2, // Checkbox size and expand icon size controlInteractiveSize: mergedToken.controlHeight / 2, controlItemBgHover: mergedToken.colorFillTertiary, controlItemBgActive: mergedToken.colorPrimaryBg, controlItemBgActiveHover: mergedToken.colorPrimaryBgHover, controlItemBgActiveDisabled: mergedToken.colorFill, controlTmpOutline: mergedToken.colorFillQuaternary, controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer), lineType: mergedToken.lineType, borderRadius: mergedToken.borderRadius, borderRadiusXS: mergedToken.borderRadiusXS, borderRadiusSM: mergedToken.borderRadiusSM, borderRadiusLG: mergedToken.borderRadiusLG, fontWeightStrong: 600, opacityLoading: 0.65, linkDecoration: "none", linkHoverDecoration: "none", linkFocusDecoration: "none", controlPaddingHorizontal: 12, controlPaddingHorizontalSM: 8, paddingXXS: mergedToken.sizeXXS, paddingXS: mergedToken.sizeXS, paddingSM: mergedToken.sizeSM, padding: mergedToken.size, paddingMD: mergedToken.sizeMD, paddingLG: mergedToken.sizeLG, paddingXL: mergedToken.sizeXL, paddingContentHorizontalLG: mergedToken.sizeLG, paddingContentVerticalLG: mergedToken.sizeMS, paddingContentHorizontal: mergedToken.sizeMS, paddingContentVertical: mergedToken.sizeSM, paddingContentHorizontalSM: mergedToken.size, paddingContentVerticalSM: mergedToken.sizeXS, marginXXS: mergedToken.sizeXXS, marginXS: mergedToken.sizeXS, marginSM: mergedToken.sizeSM, margin: mergedToken.size, marginMD: mergedToken.sizeMD, marginLG: mergedToken.sizeLG, marginXL: mergedToken.sizeXL, marginXXL: mergedToken.sizeXXL, boxShadow: ` 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `, boxShadowSecondary: ` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `, boxShadowTertiary: ` 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `, screenXS, screenXSMin: screenXS, screenXSMax: screenSM - 1, screenSM, screenSMMin: screenSM, screenSMMax: screenMD - 1, screenMD, screenMDMin: screenMD, screenMDMax: screenLG - 1, screenLG, screenLGMin: screenLG, screenLGMax: screenXL - 1, screenXL, screenXLMin: screenXL, screenXLMax: screenXXL - 1, screenXXL, screenXXLMin: screenXXL, screenXXLMax: screenXXXL - 1, screenXXXL, screenXXXLMin: screenXXXL, // FIXME: component box-shadow, should be removed boxShadowPopoverArrow: "3px 3px 7px rgba(0, 0, 0, 0.1)", boxShadowCard: ` 0 1px 2px -2px ${new TinyColor("rgba(0, 0, 0, 0.16)").toRgbString()}, 0 3px 6px 0 ${new TinyColor("rgba(0, 0, 0, 0.12)").toRgbString()}, 0 5px 12px 4px ${new TinyColor("rgba(0, 0, 0, 0.09)").toRgbString()} `, boxShadowDrawerRight: ` -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05) `, boxShadowDrawerLeft: ` 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05) `, boxShadowDrawerUp: ` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `, boxShadowDrawerDown: ` 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) `, boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)", boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)", boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)", boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)" }), overrideTokens); return aliasToken; } const roundedArrow = (width, innerRadius, outerRadius, bgColor, boxShadow) => { const unitWidth = width / 2; const ax = 0; const ay = unitWidth; const bx = outerRadius * 1 / Math.sqrt(2); const by = unitWidth - outerRadius * (1 - 1 / Math.sqrt(2)); const cx = unitWidth - innerRadius * (1 / Math.sqrt(2)); const cy = outerRadius * (Math.sqrt(2) - 1) + innerRadius * (1 / Math.sqrt(2)); const dx = 2 * unitWidth - cx; const dy = cy; const ex = 2 * unitWidth - bx; const ey = by; const fx = 2 * unitWidth - ax; const fy = ay; const shadowWidth = unitWidth * Math.sqrt(2) + outerRadius * (Math.sqrt(2) - 2); const polygonOffset = outerRadius * (Math.sqrt(2) - 1); return { pointerEvents: "none", width, height: width, overflow: "hidden", "&::after": { content: '""', position: "absolute", width: shadowWidth, height: shadowWidth, bottom: 0, insetInline: 0, margin: "auto", borderRadius: { _skip_check_: true, value: `0 0 ${innerRadius}px 0` }, transform: "translateY(50%) rotate(-135deg)", boxShadow, zIndex: 0, background: "transparent" }, "&::before": { position: "absolute", bottom: 0, insetInlineStart: 0, width, height: width / 2, background: bgColor, clipPath: { _multi_value_: true, value: [`polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`, `path('M ${ax} ${ay} A ${outerRadius} ${outerRadius} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${innerRadius} ${innerRadius} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${outerRadius} ${outerRadius} 0 0 0 ${fx} ${fy} Z')`] }, content: '""' } }; }; function genPresetColor(token2, genCss) { return PresetColors.reduce((prev2, colorKey) => { const lightColor = token2[`${colorKey}-1`]; const lightBorderColor = token2[`${colorKey}-3`]; const darkColor = token2[`${colorKey}-6`]; const textColor = token2[`${colorKey}-7`]; return _extends$1(_extends$1({}, prev2), genCss(colorKey, { lightColor, lightBorderColor, darkColor, textColor })); }, {}); } const textEllipsis = { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }; const resetComponent = (token2) => ({ boxSizing: "border-box", margin: 0, padding: 0, color: token2.colorText, fontSize: token2.fontSize, // font-variant: @font-variant-base; lineHeight: token2.lineHeight, listStyle: "none", // font-feature-settings: @font-feature-settings-base; fontFamily: token2.fontFamily }); const resetIcon = () => ({ display: "inline-flex", alignItems: "center", color: "inherit", fontStyle: "normal", lineHeight: 0, textAlign: "center", textTransform: "none", // for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4 verticalAlign: "-0.125em", textRendering: "optimizeLegibility", "-webkit-font-smoothing": "antialiased", "-moz-osx-font-smoothing": "grayscale", "> *": { lineHeight: 1 }, svg: { display: "inline-block" } }); const clearFix = () => ({ // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229 "&::before": { display: "table", content: '""' }, "&::after": { // https://github.com/ant-design/ant-design/issues/21864 display: "table", clear: "both", content: '""' } }); const genLinkStyle = (token2) => ({ a: { color: token2.colorLink, textDecoration: token2.linkDecoration, backgroundColor: "transparent", outline: "none", cursor: "pointer", transition: `color ${token2.motionDurationSlow}`, "-webkit-text-decoration-skip": "objects", "&:hover": { color: token2.colorLinkHover }, "&:active": { color: token2.colorLinkActive }, [`&:active, &:hover`]: { textDecoration: token2.linkHoverDecoration, outline: 0 }, // https://github.com/ant-design/ant-design/issues/22503 "&:focus": { textDecoration: token2.linkFocusDecoration, outline: 0 }, "&[disabled]": { color: token2.colorTextDisabled, cursor: "not-allowed" } } }); const genCommonStyle = (token2, componentPrefixCls) => { const { fontFamily, fontSize } = token2; const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`; return { [rootPrefixSelector]: { fontFamily, fontSize, boxSizing: "border-box", "&::before, &::after": { boxSizing: "border-box" }, [rootPrefixSelector]: { boxSizing: "border-box", "&::before, &::after": { boxSizing: "border-box" } } } }; }; const genFocusOutline = (token2) => ({ outline: `${token2.lineWidthBold}px solid ${token2.colorPrimaryBorder}`, outlineOffset: 1, transition: "outline-offset 0s, outline 0s" }); const genFocusStyle = (token2) => ({ "&:focus-visible": _extends$1({}, genFocusOutline(token2)) }); function genComponentStyleHook(component, styleFn, getDefaultToken) { return (_prefixCls) => { const prefixCls = computed(() => _prefixCls === null || _prefixCls === void 0 ? void 0 : _prefixCls.value); const [theme, token2, hashId] = useToken(); const { getPrefixCls, iconPrefixCls } = useConfigContextInject(); const rootPrefixCls = computed(() => getPrefixCls()); const sharedInfo = computed(() => { return { theme: theme.value, token: token2.value, hashId: hashId.value, path: ["Shared", rootPrefixCls.value] }; }); useStyleRegister(sharedInfo, () => [{ // Link "&": genLinkStyle(token2.value) }]); const componentInfo = computed(() => { return { theme: theme.value, token: token2.value, hashId: hashId.value, path: [component, prefixCls.value, iconPrefixCls.value] }; }); return [useStyleRegister(componentInfo, () => { const { token: proxyToken, flush } = statisticToken(token2.value); const defaultComponentToken = typeof getDefaultToken === "function" ? getDefaultToken(proxyToken) : getDefaultToken; const mergedComponentToken = _extends$1(_extends$1({}, defaultComponentToken), token2.value[component]); const componentCls = `.${prefixCls.value}`; const mergedToken = merge(proxyToken, { componentCls, prefixCls: prefixCls.value, iconCls: `.${iconPrefixCls.value}`, antCls: `.${rootPrefixCls.value}` }, mergedComponentToken); const styleInterpolation = styleFn(mergedToken, { hashId: hashId.value, prefixCls: prefixCls.value, rootPrefixCls: rootPrefixCls.value, iconPrefixCls: iconPrefixCls.value, overrideComponentToken: token2.value[component] }); flush(component, mergedComponentToken); return [genCommonStyle(token2.value, prefixCls.value), styleInterpolation]; }), hashId]; }; } const enableStatistic = typeof CSSINJS_STATISTIC !== "undefined"; let recording = true; function merge() { for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) { objs[_key] = arguments[_key]; } if (!enableStatistic) { return _extends$1({}, ...objs); } recording = false; const ret = {}; objs.forEach((obj) => { const keys2 = Object.keys(obj); keys2.forEach((key2) => { Object.defineProperty(ret, key2, { configurable: true, enumerable: true, get: () => obj[key2] }); }); }); recording = true; return ret; } function noop$4() { } function statisticToken(token2) { let tokenKeys2; let proxy = token2; let flush = noop$4; if (enableStatistic) { tokenKeys2 = /* @__PURE__ */ new Set(); proxy = new Proxy(token2, { get(obj, prop) { if (recording) { tokenKeys2.add(prop); } return obj[prop]; } }); flush = (componentName, componentToken) => { ({ global: Array.from(tokenKeys2)}); }; } return { token: proxy, keys: tokenKeys2, flush }; } const defaultTheme = createTheme(derivative); const defaultConfig = { token: seedToken, hashed: true }; const DesignTokenContextKey = Symbol("DesignTokenContext"); const globalDesignTokenApi = shallowRef(); const useDesignTokenProvider = (value) => { provide(DesignTokenContextKey, value); watch(value, () => { globalDesignTokenApi.value = unref(value); triggerRef(globalDesignTokenApi); }, { immediate: true, deep: true }); }; const DesignTokenProvider = /* @__PURE__ */ defineComponent({ props: { value: objectType() }, setup(props2, _ref) { let { slots } = _ref; useDesignTokenProvider(computed(() => props2.value)); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); function useToken() { const designTokenContext = inject(DesignTokenContextKey, computed(() => globalDesignTokenApi.value || defaultConfig)); const salt = computed(() => `${version}-${designTokenContext.value.hashed || ""}`); const mergedTheme = computed(() => designTokenContext.value.theme || defaultTheme); const cacheToken = useCacheToken(mergedTheme, computed(() => [seedToken, designTokenContext.value.token]), computed(() => ({ salt: salt.value, override: _extends$1({ override: designTokenContext.value.token }, designTokenContext.value.components), formatToken }))); return [mergedTheme, computed(() => cacheToken.value[0]), computed(() => designTokenContext.value.hashed ? cacheToken.value[1] : "")]; } const Empty$2 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, setup() { const [, token2] = useToken(); const themeStyle = computed(() => { const bgColor = new TinyColor(token2.value.colorBgBase); if (bgColor.toHsl().l < 0.5) { return { opacity: 0.65 }; } return {}; }); return () => createVNode("svg", { "style": themeStyle.value, "width": "184", "height": "152", "viewBox": "0 0 184 152", "xmlns": "http://www.w3.org/2000/svg" }, [createVNode("g", { "fill": "none", "fill-rule": "evenodd" }, [createVNode("g", { "transform": "translate(24 31.67)" }, [createVNode("ellipse", { "fill-opacity": ".8", "fill": "#F5F5F7", "cx": "67.797", "cy": "106.89", "rx": "67.797", "ry": "12.668" }, null), createVNode("path", { "d": "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z", "fill": "#AEB8C2" }, null), createVNode("path", { "d": "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z", "fill": "url(#linearGradient-1)", "transform": "translate(13.56)" }, null), createVNode("path", { "d": "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z", "fill": "#F5F5F7" }, null), createVNode("path", { "d": "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z", "fill": "#DCE0E6" }, null)]), createVNode("path", { "d": "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z", "fill": "#DCE0E6" }, null), createVNode("g", { "transform": "translate(149.65 15.383)", "fill": "#FFF" }, [createVNode("ellipse", { "cx": "20.654", "cy": "3.167", "rx": "2.849", "ry": "2.815" }, null), createVNode("path", { "d": "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" }, null)])])]); } }); Empty$2.PRESENTED_IMAGE_DEFAULT = true; const Simple = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, setup() { const [, token2] = useToken(); const color = computed(() => { const { colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer } = token2.value; return { borderColor: new TinyColor(colorFill).onBackground(colorBgContainer).toHexString(), shadowColor: new TinyColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(), contentColor: new TinyColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString() }; }); return () => createVNode("svg", { "width": "64", "height": "41", "viewBox": "0 0 64 41", "xmlns": "http://www.w3.org/2000/svg" }, [createVNode("g", { "transform": "translate(0 1)", "fill": "none", "fill-rule": "evenodd" }, [createVNode("ellipse", { "fill": color.value.shadowColor, "cx": "32", "cy": "33", "rx": "32", "ry": "7" }, null), createVNode("g", { "fill-rule": "nonzero", "stroke": color.value.borderColor }, [createVNode("path", { "d": "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }, null), createVNode("path", { "d": "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", "fill": color.value.contentColor }, null)])])]); } }); Simple.PRESENTED_IMAGE_SIMPLE = true; const genSharedEmptyStyle = (token2) => { const { componentCls, margin, marginXS, marginXL, fontSize, lineHeight } = token2; return { [componentCls]: { marginInline: marginXS, fontSize, lineHeight, textAlign: "center", // 原来 &-image 没有父子结构,现在为了外层承担我们的hashId,改成父子结果 [`${componentCls}-image`]: { height: token2.emptyImgHeight, marginBottom: marginXS, opacity: token2.opacityImage, img: { height: "100%" }, svg: { height: "100%", margin: "auto" } }, // 原来 &-footer 没有父子结构,现在为了外层承担我们的hashId,改成父子结果 [`${componentCls}-footer`]: { marginTop: margin }, "&-normal": { marginBlock: marginXL, color: token2.colorTextDisabled, [`${componentCls}-image`]: { height: token2.emptyImgHeightMD } }, "&-small": { marginBlock: marginXS, color: token2.colorTextDisabled, [`${componentCls}-image`]: { height: token2.emptyImgHeightSM } } } }; }; const useStyle$h = genComponentStyleHook("Empty", (token2) => { const { componentCls, controlHeightLG } = token2; const emptyToken = merge(token2, { emptyImgCls: `${componentCls}-img`, emptyImgHeight: controlHeightLG * 2.5, emptyImgHeightMD: controlHeightLG, emptyImgHeightSM: controlHeightLG * 0.875 }); return [genSharedEmptyStyle(emptyToken)]; }); var __rest$t = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const emptyProps = () => ({ prefixCls: String, imageStyle: objectType(), image: anyType(), description: anyType() }); const Empty = /* @__PURE__ */ defineComponent({ name: "AEmpty", compatConfig: { MODE: 3 }, inheritAttrs: false, props: emptyProps(), setup(props2, _ref) { let { slots = {}, attrs } = _ref; const { direction, prefixCls: prefixClsRef } = useConfigInject("empty", props2); const [wrapSSR, hashId] = useStyle$h(prefixClsRef); return () => { var _a, _b; const prefixCls = prefixClsRef.value; const _c = _extends$1(_extends$1({}, props2), attrs), { image: mergedImage = ((_a = slots.image) === null || _a === void 0 ? void 0 : _a.call(slots)) || h$1(Empty$2), description = ((_b = slots.description) === null || _b === void 0 ? void 0 : _b.call(slots)) || void 0, imageStyle, class: className = "" } = _c, restProps = __rest$t(_c, ["image", "description", "imageStyle", "class"]); const image = typeof mergedImage === "function" ? mergedImage() : mergedImage; const isNormal = typeof image === "object" && "type" in image && image.type.PRESENTED_IMAGE_SIMPLE; return wrapSSR(createVNode(LocaleReceiver, { "componentName": "Empty", "children": (locale2) => { const des = typeof description !== "undefined" ? description : locale2.description; const alt = typeof des === "string" ? des : "empty"; let imageNode = null; if (typeof image === "string") { imageNode = createVNode("img", { "alt": alt, "src": image }, null); } else { imageNode = image; } return createVNode("div", _objectSpread2$1({ "class": classNames(prefixCls, className, hashId.value, { [`${prefixCls}-normal`]: isNormal, [`${prefixCls}-rtl`]: direction.value === "rtl" }) }, restProps), [createVNode("div", { "class": `${prefixCls}-image`, "style": imageStyle }, [imageNode]), des && createVNode("p", { "class": `${prefixCls}-description` }, [des]), slots.default && createVNode("div", { "class": `${prefixCls}-footer` }, [filterEmpty(slots.default())])]); } }, null)); }; } }); Empty.PRESENTED_IMAGE_DEFAULT = () => h$1(Empty$2); Empty.PRESENTED_IMAGE_SIMPLE = () => h$1(Simple); const Empty$1 = withInstall(Empty); const DefaultRenderEmpty = (props2) => { const { prefixCls } = useConfigInject("empty", props2); const renderHtml = (componentName) => { switch (componentName) { case "Table": case "List": return createVNode(Empty$1, { "image": Empty$1.PRESENTED_IMAGE_SIMPLE }, null); case "Select": case "TreeSelect": case "Cascader": case "Transfer": case "Mentions": return createVNode(Empty$1, { "image": Empty$1.PRESENTED_IMAGE_SIMPLE, "class": `${prefixCls.value}-small` }, null); default: return createVNode(Empty$1, null, null); } }; return renderHtml(props2.componentName); }; function renderEmpty(componentName) { return createVNode(DefaultRenderEmpty, { "componentName": componentName }, null); } const SizeContextKey = Symbol("SizeContextKey"); const useInjectSize = () => { return inject(SizeContextKey, ref(void 0)); }; const useProviderSize = (size) => { const parentSize = useInjectSize(); provide(SizeContextKey, computed(() => size.value || parentSize.value)); return size; }; const useConfigInject = (name, props2) => { const sizeContext = useInjectSize(); const disabledContext = useInjectDisabled(); const configProvider = inject(configProviderKey, _extends$1(_extends$1({}, defaultConfigProvider), { renderEmpty: (name2) => h$1(DefaultRenderEmpty, { componentName: name2 }) })); const prefixCls = computed(() => configProvider.getPrefixCls(name, props2.prefixCls)); const direction = computed(() => { var _a, _b; return (_a = props2.direction) !== null && _a !== void 0 ? _a : (_b = configProvider.direction) === null || _b === void 0 ? void 0 : _b.value; }); const iconPrefixCls = computed(() => { var _a; return (_a = props2.iconPrefixCls) !== null && _a !== void 0 ? _a : configProvider.iconPrefixCls.value; }); const rootPrefixCls = computed(() => configProvider.getPrefixCls()); const autoInsertSpaceInButton = computed(() => { var _a; return (_a = configProvider.autoInsertSpaceInButton) === null || _a === void 0 ? void 0 : _a.value; }); const renderEmpty2 = configProvider.renderEmpty; const space = configProvider.space; const pageHeader = configProvider.pageHeader; const form = configProvider.form; const getTargetContainer = computed(() => { var _a, _b; return (_a = props2.getTargetContainer) !== null && _a !== void 0 ? _a : (_b = configProvider.getTargetContainer) === null || _b === void 0 ? void 0 : _b.value; }); const getPopupContainer = computed(() => { var _a, _b, _c; return (_b = (_a = props2.getContainer) !== null && _a !== void 0 ? _a : props2.getPopupContainer) !== null && _b !== void 0 ? _b : (_c = configProvider.getPopupContainer) === null || _c === void 0 ? void 0 : _c.value; }); const dropdownMatchSelectWidth = computed(() => { var _a, _b; return (_a = props2.dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : (_b = configProvider.dropdownMatchSelectWidth) === null || _b === void 0 ? void 0 : _b.value; }); const virtual = computed(() => { var _a; return (props2.virtual === void 0 ? ((_a = configProvider.virtual) === null || _a === void 0 ? void 0 : _a.value) !== false : props2.virtual !== false) && dropdownMatchSelectWidth.value !== false; }); const size = computed(() => props2.size || sizeContext.value); const autocomplete = computed(() => { var _a, _b, _c; return (_a = props2.autocomplete) !== null && _a !== void 0 ? _a : (_c = (_b = configProvider.input) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.autocomplete; }); const disabled = computed(() => { var _a; return (_a = props2.disabled) !== null && _a !== void 0 ? _a : disabledContext.value; }); const csp = computed(() => { var _a; return (_a = props2.csp) !== null && _a !== void 0 ? _a : configProvider.csp; }); const wave = computed(() => { var _a, _b; return (_a = props2.wave) !== null && _a !== void 0 ? _a : (_b = configProvider.wave) === null || _b === void 0 ? void 0 : _b.value; }); return { configProvider, prefixCls, direction, size, getTargetContainer, getPopupContainer, space, pageHeader, form, autoInsertSpaceInButton, renderEmpty: renderEmpty2, virtual, dropdownMatchSelectWidth, rootPrefixCls, getPrefixCls: configProvider.getPrefixCls, autocomplete, csp, iconPrefixCls, disabled, select: configProvider.select, wave }; }; function omit$1(obj, fields) { const shallowCopy = _extends$1({}, obj); for (let i2 = 0; i2 < fields.length; i2 += 1) { const key2 = fields[i2]; delete shallowCopy[key2]; } return shallowCopy; } function t$1(t2) { return "object" == typeof t2 && null != t2 && 1 === t2.nodeType; } function e$1(t2, e2) { return (!e2 || "hidden" !== t2) && "visible" !== t2 && "clip" !== t2; } function n$1(t2, n2) { if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) { var r2 = getComputedStyle(t2, null); return e$1(r2.overflowY, n2) || e$1(r2.overflowX, n2) || function(t3) { var e2 = function(t4) { if (!t4.ownerDocument || !t4.ownerDocument.defaultView) return null; try { return t4.ownerDocument.defaultView.frameElement; } catch (t5) { return null; } }(t3); return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth); }(t2); } return false; } function r$1(t2, e2, n2, r2, i2, o2, l2, d2) { return o2 < t2 && l2 > e2 || o2 > t2 && l2 < e2 ? 0 : o2 <= t2 && d2 <= n2 || l2 >= e2 && d2 >= n2 ? o2 - t2 - r2 : l2 > e2 && d2 < n2 || o2 < t2 && d2 > n2 ? l2 - e2 + i2 : 0; } var i$1 = function(e2, i2) { var o2 = window, l2 = i2.scrollMode, d2 = i2.block, f2 = i2.inline, h2 = i2.boundary, u2 = i2.skipOverflowHiddenElements, s2 = "function" == typeof h2 ? h2 : function(t2) { return t2 !== h2; }; if (!t$1(e2)) throw new TypeError("Invalid target"); for (var a2, c2, g2 = document.scrollingElement || document.documentElement, p2 = [], m2 = e2; t$1(m2) && s2(m2); ) { if ((m2 = null == (c2 = (a2 = m2).parentElement) ? a2.getRootNode().host || null : c2) === g2) { p2.push(m2); break; } null != m2 && m2 === document.body && n$1(m2) && !n$1(document.documentElement) || null != m2 && n$1(m2, u2) && p2.push(m2); } for (var w2 = o2.visualViewport ? o2.visualViewport.width : innerWidth, v2 = o2.visualViewport ? o2.visualViewport.height : innerHeight, W = window.scrollX || pageXOffset, H = window.scrollY || pageYOffset, b2 = e2.getBoundingClientRect(), y2 = b2.height, E2 = b2.width, M2 = b2.top, V2 = b2.right, x2 = b2.bottom, I2 = b2.left, C = "start" === d2 || "nearest" === d2 ? M2 : "end" === d2 ? x2 : M2 + y2 / 2, R2 = "center" === f2 ? I2 + E2 / 2 : "end" === f2 ? V2 : I2, T2 = [], k2 = 0; k2 < p2.length; k2++) { var B2 = p2[k2], D2 = B2.getBoundingClientRect(), O2 = D2.height, X = D2.width, Y2 = D2.top, L2 = D2.right, S2 = D2.bottom, j2 = D2.left; if ("if-needed" === l2 && M2 >= 0 && I2 >= 0 && x2 <= v2 && V2 <= w2 && M2 >= Y2 && x2 <= S2 && I2 >= j2 && V2 <= L2) return T2; var N2 = getComputedStyle(B2), q2 = parseInt(N2.borderLeftWidth, 10), z2 = parseInt(N2.borderTopWidth, 10), A2 = parseInt(N2.borderRightWidth, 10), F2 = parseInt(N2.borderBottomWidth, 10), G = 0, J2 = 0, K = "offsetWidth" in B2 ? B2.offsetWidth - B2.clientWidth - q2 - A2 : 0, P2 = "offsetHeight" in B2 ? B2.offsetHeight - B2.clientHeight - z2 - F2 : 0, Q = "offsetWidth" in B2 ? 0 === B2.offsetWidth ? 0 : X / B2.offsetWidth : 0, U = "offsetHeight" in B2 ? 0 === B2.offsetHeight ? 0 : O2 / B2.offsetHeight : 0; if (g2 === B2) G = "start" === d2 ? C : "end" === d2 ? C - v2 : "nearest" === d2 ? r$1(H, H + v2, v2, z2, F2, H + C, H + C + y2, y2) : C - v2 / 2, J2 = "start" === f2 ? R2 : "center" === f2 ? R2 - w2 / 2 : "end" === f2 ? R2 - w2 : r$1(W, W + w2, w2, q2, A2, W + R2, W + R2 + E2, E2), G = Math.max(0, G + H), J2 = Math.max(0, J2 + W); else { G = "start" === d2 ? C - Y2 - z2 : "end" === d2 ? C - S2 + F2 + P2 : "nearest" === d2 ? r$1(Y2, S2, O2, z2, F2 + P2, C, C + y2, y2) : C - (Y2 + O2 / 2) + P2 / 2, J2 = "start" === f2 ? R2 - j2 - q2 : "center" === f2 ? R2 - (j2 + X / 2) + K / 2 : "end" === f2 ? R2 - L2 + A2 + K : r$1(j2, L2, X, q2, A2 + K, R2, R2 + E2, E2); var Z = B2.scrollLeft, $2 = B2.scrollTop; C += $2 - (G = Math.max(0, Math.min($2 + G / U, B2.scrollHeight - O2 / U + P2))), R2 += Z - (J2 = Math.max(0, Math.min(Z + J2 / Q, B2.scrollWidth - X / Q + K))); } T2.push({ el: B2, top: G, left: J2 }); } return T2; }; function isOptionsObject(options) { return options === Object(options) && Object.keys(options).length !== 0; } function defaultBehavior(actions, behavior) { if (behavior === void 0) { behavior = "auto"; } var canSmoothScroll = "scrollBehavior" in document.body.style; actions.forEach(function(_ref) { var el = _ref.el, top = _ref.top, left = _ref.left; if (el.scroll && canSmoothScroll) { el.scroll({ top, left, behavior }); } else { el.scrollTop = top; el.scrollLeft = left; } }); } function getOptions(options) { if (options === false) { return { block: "end", inline: "nearest" }; } if (isOptionsObject(options)) { return options; } return { block: "start", inline: "nearest" }; } function scrollIntoView(target, options) { var isTargetAttached = target.isConnected || target.ownerDocument.documentElement.contains(target); if (isOptionsObject(options) && typeof options.behavior === "function") { return options.behavior(isTargetAttached ? i$1(target, options) : []); } if (!isTargetAttached) { return; } var computeOptions = getOptions(options); return defaultBehavior(i$1(target, computeOptions), computeOptions.behavior); } function e(e2, t2) { for (var n2 = 0; n2 < t2.length; n2++) { var r2 = t2[n2]; r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e2, r2.key, r2); } } function t(t2, n2, r2) { return r2 && e(t2, r2), t2; } function n() { return (n = Object.assign || function(e2) { for (var t2 = 1; t2 < arguments.length; t2++) { var n2 = arguments[t2]; for (var r2 in n2) Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]); } return e2; }).apply(this, arguments); } function r(e2, t2) { e2.prototype = Object.create(t2.prototype), e2.prototype.constructor = e2, e2.__proto__ = t2; } function i(e2, t2) { if (null == e2) return {}; var n2, r2, i2 = {}, o2 = Object.keys(e2); for (r2 = 0; r2 < o2.length; r2++) t2.indexOf(n2 = o2[r2]) >= 0 || (i2[n2] = e2[n2]); return i2; } function o(e2) { return 1 == (null != (t2 = e2) && "object" == typeof t2 && false === Array.isArray(t2)) && "[object Object]" === Object.prototype.toString.call(e2); var t2; } var u = Object.prototype, a = u.toString, f = u.hasOwnProperty, c = /^\s*function (\w+)/; function l(e2) { var t2, n2 = null !== (t2 = null == e2 ? void 0 : e2.type) && void 0 !== t2 ? t2 : e2; if (n2) { var r2 = n2.toString().match(c); return r2 ? r2[1] : ""; } return ""; } var s = function(e2) { var t2, n2; return false !== o(e2) && "function" == typeof (t2 = e2.constructor) && false !== o(n2 = t2.prototype) && false !== n2.hasOwnProperty("isPrototypeOf"); }, v = function(e2) { return e2; }, y = v; var d = function(e2, t2) { return f.call(e2, t2); }, h = Number.isInteger || function(e2) { return "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2; }, b = Array.isArray || function(e2) { return "[object Array]" === a.call(e2); }, O = function(e2) { return "[object Function]" === a.call(e2); }, g = function(e2) { return s(e2) && d(e2, "_vueTypes_name"); }, m = function(e2) { return s(e2) && (d(e2, "type") || ["_vueTypes_name", "validator", "default", "required"].some(function(t2) { return d(e2, t2); })); }; function j(e2, t2) { return Object.defineProperty(e2.bind(t2), "__original", { value: e2 }); } function _(e2, t2, n2) { var r2; var i2 = true, o2 = ""; r2 = s(e2) ? e2 : { type: e2 }; var u2 = g(r2) ? r2._vueTypes_name + " - " : ""; if (m(r2) && null !== r2.type) { if (void 0 === r2.type || true === r2.type) return i2; if (!r2.required && void 0 === t2) return i2; b(r2.type) ? (i2 = r2.type.some(function(e3) { return true === _(e3, t2); }), o2 = r2.type.map(function(e3) { return l(e3); }).join(" or ")) : i2 = "Array" === (o2 = l(r2)) ? b(t2) : "Object" === o2 ? s(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e3) { if (null == e3) return ""; var t3 = e3.constructor.toString().match(c); return t3 ? t3[1] : ""; }(t2) === o2 : t2 instanceof r2.type; } if (!i2) { var a2 = u2 + 'value "' + t2 + '" should be of type "' + o2 + '"'; return a2; } if (d(r2, "validator") && O(r2.validator)) { var f2 = y, v2 = []; if (y = function(e3) { v2.push(e3); }, i2 = r2.validator(t2), y = f2, !i2) { var p2 = (v2.length > 1 ? "* " : "") + v2.join("\n* "); return v2.length = 0, p2; } } return i2; } function T(e2, t2) { var n2 = Object.defineProperties(t2, { _vueTypes_name: { value: e2, writable: true }, isRequired: { get: function() { return this.required = true, this; } }, def: { value: function(e3) { return void 0 !== e3 || this.default ? O(e3) || true === _(this, e3) ? (this.default = b(e3) ? function() { return [].concat(e3); } : s(e3) ? function() { return Object.assign({}, e3); } : e3, this) : (y(this._vueTypes_name + ' - invalid default value: "' + e3 + '"'), this) : this; } } }), r2 = n2.validator; return O(r2) && (n2.validator = j(r2, n2)), n2; } function w(e2, t2) { var n2 = T(e2, t2); return Object.defineProperty(n2, "validate", { value: function(e3) { return O(this.validator) && y(this._vueTypes_name + " - calling .validate() will overwrite the current custom validator function. Validator info:\n" + JSON.stringify(this)), this.validator = j(e3, this), this; } }); } function k(e2, t2, n2) { var r2, o2, u2 = (r2 = t2, o2 = {}, Object.getOwnPropertyNames(r2).forEach(function(e3) { o2[e3] = Object.getOwnPropertyDescriptor(r2, e3); }), Object.defineProperties({}, o2)); if (u2._vueTypes_name = e2, !s(n2)) return u2; var a2, f2, c2 = n2.validator, l2 = i(n2, ["validator"]); if (O(c2)) { var v2 = u2.validator; v2 && (v2 = null !== (f2 = (a2 = v2).__original) && void 0 !== f2 ? f2 : a2), u2.validator = j(v2 ? function(e3) { return v2.call(this, e3) && c2.call(this, e3); } : c2, u2); } return Object.assign(u2, l2); } function P(e2) { return e2.replace(/^(?!\s*$)/gm, " "); } var x = function() { return w("any", {}); }, A = function() { return w("function", { type: Function }); }, E = function() { return w("boolean", { type: Boolean }); }, N = function() { return w("string", { type: String }); }, q = function() { return w("number", { type: Number }); }, S = function() { return w("array", { type: Array }); }, V = function() { return w("object", { type: Object }); }, F = function() { return T("integer", { type: Number, validator: function(e2) { return h(e2); } }); }, D = function() { return T("symbol", { validator: function(e2) { return "symbol" == typeof e2; } }); }; function L(e2, t2) { if (void 0 === t2 && (t2 = "custom validation failed"), "function" != typeof e2) throw new TypeError("[VueTypes error]: You must provide a function as argument"); return T(e2.name || "<<anonymous function>>", { validator: function(n2) { var r2 = e2(n2); return r2 || y(this._vueTypes_name + " - " + t2), r2; } }); } function Y(e2) { if (!b(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument."); var t2 = 'oneOf - value should be one of "' + e2.join('", "') + '".', n2 = e2.reduce(function(e3, t3) { if (null != t3) { var n3 = t3.constructor; -1 === e3.indexOf(n3) && e3.push(n3); } return e3; }, []); return T("oneOf", { type: n2.length > 0 ? n2 : void 0, validator: function(n3) { var r2 = -1 !== e2.indexOf(n3); return r2 || y(t2), r2; } }); } function B(e2) { if (!b(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument"); for (var t2 = false, n2 = [], r2 = 0; r2 < e2.length; r2 += 1) { var i2 = e2[r2]; if (m(i2)) { if (g(i2) && "oneOf" === i2._vueTypes_name) { n2 = n2.concat(i2.type); continue; } if (O(i2.validator) && (t2 = true), true !== i2.type && i2.type) { n2 = n2.concat(i2.type); continue; } } n2.push(i2); } return n2 = n2.filter(function(e3, t3) { return n2.indexOf(e3) === t3; }), T("oneOfType", t2 ? { type: n2, validator: function(t3) { var n3 = [], r3 = e2.some(function(e3) { var r4 = _(g(e3) && "oneOf" === e3._vueTypes_name ? e3.type || null : e3, t3); return "string" == typeof r4 && n3.push(r4), true === r4; }); return r3 || y("oneOfType - provided value does not match any of the " + n3.length + " passed-in validators:\n" + P(n3.join("\n"))), r3; } } : { type: n2 }); } function I(e2) { return T("arrayOf", { type: Array, validator: function(t2) { var n2, r2 = t2.every(function(t3) { return true === (n2 = _(e2, t3)); }); return r2 || y("arrayOf - value validation error:\n" + P(n2)), r2; } }); } function J(e2) { return T("instanceOf", { type: e2 }); } function M(e2) { return T("objectOf", { type: Object, validator: function(t2) { var n2, r2 = Object.keys(t2).every(function(r3) { return true === (n2 = _(e2, t2[r3])); }); return r2 || y("objectOf - value validation error:\n" + P(n2)), r2; } }); } function R(e2) { var t2 = Object.keys(e2), n2 = t2.filter(function(t3) { var n3; return !!(null === (n3 = e2[t3]) || void 0 === n3 ? void 0 : n3.required); }), r2 = T("shape", { type: Object, validator: function(r3) { var i2 = this; if (!s(r3)) return false; var o2 = Object.keys(r3); if (n2.length > 0 && n2.some(function(e3) { return -1 === o2.indexOf(e3); })) { var u2 = n2.filter(function(e3) { return -1 === o2.indexOf(e3); }); return y(1 === u2.length ? 'shape - required property "' + u2[0] + '" is not defined.' : 'shape - required properties "' + u2.join('", "') + '" are not defined.'), false; } return o2.every(function(n3) { if (-1 === t2.indexOf(n3)) return true === i2._vueTypes_isLoose || (y('shape - shape definition does not include a "' + n3 + '" property. Allowed keys: "' + t2.join('", "') + '".'), false); var o3 = _(e2[n3], r3[n3]); return "string" == typeof o3 && y('shape - "' + n3 + '" property validation error:\n ' + P(o3)), true === o3; }); } }); return Object.defineProperty(r2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(r2, "loose", { get: function() { return this._vueTypes_isLoose = true, this; } }), r2; } var $ = function() { function e2() { } return e2.extend = function(e3) { var t2 = this; if (b(e3)) return e3.forEach(function(e4) { return t2.extend(e4); }), this; var n2 = e3.name, r2 = e3.validate, o2 = void 0 !== r2 && r2, u2 = e3.getter, a2 = void 0 !== u2 && u2, f2 = i(e3, ["name", "validate", "getter"]); if (d(this, n2)) throw new TypeError('[VueTypes error]: Type "' + n2 + '" already defined'); var c2, l2 = f2.type; return g(l2) ? (delete f2.type, Object.defineProperty(this, n2, a2 ? { get: function() { return k(n2, l2, f2); } } : { value: function() { var e4, t3 = k(n2, l2, f2); return t3.validator && (t3.validator = (e4 = t3.validator).bind.apply(e4, [t3].concat([].slice.call(arguments)))), t3; } })) : (c2 = a2 ? { get: function() { var e4 = Object.assign({}, f2); return o2 ? w(n2, e4) : T(n2, e4); }, enumerable: true } : { value: function() { var e4, t3, r3 = Object.assign({}, f2); return e4 = o2 ? w(n2, r3) : T(n2, r3), r3.validator && (e4.validator = (t3 = r3.validator).bind.apply(t3, [e4].concat([].slice.call(arguments)))), e4; }, enumerable: true }, Object.defineProperty(this, n2, c2)); }, t(e2, null, [{ key: "any", get: function() { return x(); } }, { key: "func", get: function() { return A().def(this.defaults.func); } }, { key: "bool", get: function() { return E().def(this.defaults.bool); } }, { key: "string", get: function() { return N().def(this.defaults.string); } }, { key: "number", get: function() { return q().def(this.defaults.number); } }, { key: "array", get: function() { return S().def(this.defaults.array); } }, { key: "object", get: function() { return V().def(this.defaults.object); } }, { key: "integer", get: function() { return F().def(this.defaults.integer); } }, { key: "symbol", get: function() { return D(); } }]), e2; }(); function z(e2) { var i2; return void 0 === e2 && (e2 = { func: function() { }, bool: true, string: "", number: 0, array: function() { return []; }, object: function() { return {}; }, integer: 0 }), (i2 = function(i3) { function o2() { return i3.apply(this, arguments) || this; } return r(o2, i3), t(o2, null, [{ key: "sensibleDefaults", get: function() { return n({}, this.defaults); }, set: function(t2) { this.defaults = false !== t2 ? n({}, true !== t2 ? t2 : e2) : {}; } }]), o2; }($)).defaults = n({}, e2), i2; } $.defaults = {}, $.custom = L, $.oneOf = Y, $.instanceOf = J, $.oneOfType = B, $.arrayOf = I, $.objectOf = M, $.shape = R, $.utils = { validate: function(e2, t2) { return true === _(t2, e2); }, toType: function(e2, t2, n2) { return void 0 === n2 && (n2 = false), n2 ? w(e2, t2) : T(e2, t2); } }; (function(e2) { function t2() { return e2.apply(this, arguments) || this; } return r(t2, e2), t2; })(z()); const PropTypes = z({ func: void 0, bool: void 0, string: void 0, number: void 0, array: void 0, object: void 0, integer: void 0 }); PropTypes.extend([{ name: "looseBool", getter: true, type: Boolean, default: void 0 }, { name: "style", getter: true, type: [String, Object], default: void 0 }, { name: "VueNode", getter: true, type: null }]); function withUndefined(type) { type.default = void 0; return type; } const devWarning = (valid, component, message) => { warningOnce(valid, `[ant-design-vue: ${component}] ${message}`); }; function getKey(data, index2) { const { key: key2 } = data; let value; if ("value" in data) { ({ value } = data); } if (key2 !== null && key2 !== void 0) { return key2; } if (value !== void 0) { return value; } return `rc-index-key-${index2}`; } function fillFieldNames(fieldNames, childrenAsData) { const { label, value, options } = fieldNames || {}; return { label: label || (childrenAsData ? "children" : "label"), value: value || "value", options: options || "options" }; } function flattenOptions(options) { let { fieldNames, childrenAsData } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const flattenList = []; const { label: fieldLabel, value: fieldValue, options: fieldOptions } = fillFieldNames(fieldNames, false); function dig(list, isGroupOption) { list.forEach((data) => { const label = data[fieldLabel]; if (isGroupOption || !(fieldOptions in data)) { const value = data[fieldValue]; flattenList.push({ key: getKey(data, flattenList.length), groupOption: isGroupOption, data, label, value }); } else { let grpLabel = label; if (grpLabel === void 0 && childrenAsData) { grpLabel = data.label; } flattenList.push({ key: getKey(data, flattenList.length), group: true, data, label: grpLabel }); dig(data[fieldOptions], true); } }); } dig(options, false); return flattenList; } function injectPropsWithOption(option) { const newOption = _extends$1({}, option); if (!("props" in newOption)) { Object.defineProperty(newOption, "props", { get() { return newOption; } }); } return newOption; } function getSeparatedContent(text, tokens) { if (!tokens || !tokens.length) { return null; } let match2 = false; function separate(str, _ref) { let [token2, ...restTokens] = _ref; if (!token2) { return [str]; } const list2 = str.split(token2); match2 = match2 || list2.length > 1; return list2.reduce((prevList, unitStr) => [...prevList, ...separate(unitStr, restTokens)], []).filter((unit) => unit); } const list = separate(text, tokens); return match2 ? list : null; } function returnEmptyString() { return ""; } function returnDocument(element) { if (element) { return element.ownerDocument; } return window.document; } function noop$3() { } const triggerProps = () => ({ action: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def([]), showAction: PropTypes.any.def([]), hideAction: PropTypes.any.def([]), getPopupClassNameFromAlign: PropTypes.any.def(returnEmptyString), onPopupVisibleChange: Function, afterPopupVisibleChange: PropTypes.func.def(noop$3), popup: PropTypes.any, arrow: PropTypes.bool.def(true), popupStyle: { type: Object, default: void 0 }, prefixCls: PropTypes.string.def("rc-trigger-popup"), popupClassName: PropTypes.string.def(""), popupPlacement: String, builtinPlacements: PropTypes.object, popupTransitionName: String, popupAnimation: PropTypes.any, mouseEnterDelay: PropTypes.number.def(0), mouseLeaveDelay: PropTypes.number.def(0.1), zIndex: Number, focusDelay: PropTypes.number.def(0), blurDelay: PropTypes.number.def(0.15), getPopupContainer: Function, getDocument: PropTypes.func.def(returnDocument), forceRender: { type: Boolean, default: void 0 }, destroyPopupOnHide: { type: Boolean, default: false }, mask: { type: Boolean, default: false }, maskClosable: { type: Boolean, default: true }, // onPopupAlign: PropTypes.func.def(noop), popupAlign: PropTypes.object.def(() => ({})), popupVisible: { type: Boolean, default: void 0 }, defaultPopupVisible: { type: Boolean, default: false }, maskTransitionName: String, maskAnimation: String, stretch: String, alignPoint: { type: Boolean, default: void 0 }, autoDestroy: { type: Boolean, default: false }, mobile: Object, getTriggerDOMNode: Function }); const innerProps = { visible: Boolean, prefixCls: String, zIndex: Number, destroyPopupOnHide: Boolean, forceRender: Boolean, arrow: { type: Boolean, default: true }, // Legacy Motion animation: [String, Object], transitionName: String, // Measure stretch: { type: String }, // Align align: { type: Object }, point: { type: Object }, getRootDomNode: { type: Function }, getClassNameFromAlign: { type: Function }, onAlign: { type: Function }, onMouseenter: { type: Function }, onMouseleave: { type: Function }, onMousedown: { type: Function }, onTouchstart: { type: Function } }; const mobileProps = _extends$1(_extends$1({}, innerProps), { mobile: { type: Object } }); const popupProps = _extends$1(_extends$1({}, innerProps), { mask: Boolean, mobile: { type: Object }, maskAnimation: String, maskTransitionName: String }); function getMotion$1(_ref) { let { prefixCls, animation, transitionName: transitionName2 } = _ref; if (animation) { return { name: `${prefixCls}-${animation}` }; } if (transitionName2) { return { name: transitionName2 }; } return {}; } function Mask$1(props2) { const { prefixCls, visible, zIndex, mask, maskAnimation, maskTransitionName } = props2; if (!mask) { return null; } let motion = {}; if (maskTransitionName || maskAnimation) { motion = getMotion$1({ prefixCls, transitionName: maskTransitionName, animation: maskAnimation }); } return createVNode(Transition, _objectSpread2$1({ "appear": true }, motion), { default: () => [withDirectives(createVNode("div", { "style": { zIndex }, "class": `${prefixCls}-mask` }, null), [[resolveDirective("if"), visible]])] }); } Mask$1.displayName = "Mask"; const MobilePopupInner = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "MobilePopupInner", inheritAttrs: false, props: mobileProps, emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"], setup(props2, _ref) { let { expose, slots } = _ref; const elementRef = ref(); expose({ forceAlign: () => { }, getElement: () => elementRef.value }); return () => { var _a; const { zIndex, visible, prefixCls, mobile: { popupClassName, popupStyle, popupMotion = {}, popupRender } = {} } = props2; const mergedStyle = _extends$1({ zIndex }, popupStyle); let childNode = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); if (childNode.length > 1) { childNode = createVNode("div", { "class": `${prefixCls}-content` }, [childNode]); } if (popupRender) { childNode = popupRender(childNode); } const mergedClassName = classNames(prefixCls, popupClassName); return createVNode(Transition, _objectSpread2$1({ "ref": elementRef }, popupMotion), { default: () => [visible ? createVNode("div", { "class": mergedClassName, "style": mergedStyle }, [childNode]) : null] }); }; } }); var __awaiter$1 = function(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve2) { resolve2(value); }); } return new (P2 || (P2 = Promise))(function(resolve2, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e2) { reject(e2); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e2) { reject(e2); } } function step(result) { result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, [])).next()); }); }; const StatusQueue = ["measure", "align", null, "motion"]; const useVisibleStatus = (visible, doMeasure) => { const status = shallowRef(null); const rafRef = shallowRef(); const destroyRef = shallowRef(false); function setStatus(nextStatus) { if (!destroyRef.value) { status.value = nextStatus; } } function cancelRaf() { wrapperRaf.cancel(rafRef.value); } function goNextStatus(callback) { cancelRaf(); rafRef.value = wrapperRaf(() => { let newStatus = status.value; switch (status.value) { case "align": newStatus = "motion"; break; case "motion": newStatus = "stable"; break; } setStatus(newStatus); callback === null || callback === void 0 ? void 0 : callback(); }); } watch(visible, () => { setStatus("measure"); }, { immediate: true, flush: "post" }); onMounted(() => { watch(status, () => { switch (status.value) { case "measure": doMeasure(); break; } if (status.value) { rafRef.value = wrapperRaf(() => __awaiter$1(void 0, void 0, void 0, function* () { const index2 = StatusQueue.indexOf(status.value); const nextStatus = StatusQueue[index2 + 1]; if (nextStatus && index2 !== -1) { setStatus(nextStatus); } })); } }, { immediate: true, flush: "post" }); }); onBeforeUnmount(() => { destroyRef.value = true; cancelRaf(); }); return [status, goNextStatus]; }; const useStretchStyle = (stretch) => { const targetSize = shallowRef({ width: 0, height: 0 }); function measureStretch(element) { targetSize.value = { width: element.offsetWidth, height: element.offsetHeight }; } const style = computed(() => { const sizeStyle = {}; if (stretch.value) { const { width, height } = targetSize.value; if (stretch.value.indexOf("height") !== -1 && height) { sizeStyle.height = `${height}px`; } else if (stretch.value.indexOf("minHeight") !== -1 && height) { sizeStyle.minHeight = `${height}px`; } if (stretch.value.indexOf("width") !== -1 && width) { sizeStyle.width = `${width}px`; } else if (stretch.value.indexOf("minWidth") !== -1 && width) { sizeStyle.minWidth = `${width}px`; } } return sizeStyle; }); return [style, measureStretch]; }; function ownKeys(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(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = null != arguments[i2] ? arguments[i2] : {}; i2 % 2 ? ownKeys(Object(source), true).forEach(function(key2) { _defineProperty$z(target, key2, source[key2]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key2) { Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); }); } return target; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "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(obj); } function _defineProperty$z(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var vendorPrefix; var jsCssMap = { Webkit: "-webkit-", Moz: "-moz-", // IE did it wrong again ... ms: "-ms-", O: "-o-" }; function getVendorPrefix() { if (vendorPrefix !== void 0) { return vendorPrefix; } vendorPrefix = ""; var style = document.createElement("p").style; var testProp = "Transform"; for (var key2 in jsCssMap) { if (key2 + testProp in style) { vendorPrefix = key2; } } return vendorPrefix; } function getTransitionName$1() { return getVendorPrefix() ? "".concat(getVendorPrefix(), "TransitionProperty") : "transitionProperty"; } function getTransformName() { return getVendorPrefix() ? "".concat(getVendorPrefix(), "Transform") : "transform"; } function setTransitionProperty(node2, value) { var name = getTransitionName$1(); if (name) { node2.style[name] = value; if (name !== "transitionProperty") { node2.style.transitionProperty = value; } } } function setTransform(node2, value) { var name = getTransformName(); if (name) { node2.style[name] = value; if (name !== "transform") { node2.style.transform = value; } } } function getTransitionProperty(node2) { return node2.style.transitionProperty || node2.style[getTransitionName$1()]; } function getTransformXY(node2) { var style = window.getComputedStyle(node2, null); var transform = style.getPropertyValue("transform") || style.getPropertyValue(getTransformName()); if (transform && transform !== "none") { var matrix = transform.replace(/[^0-9\-.,]/g, "").split(","); return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) }; } return { x: 0, y: 0 }; } var matrix2d = /matrix\((.*)\)/; var matrix3d = /matrix3d\((.*)\)/; function setTransformXY(node2, xy) { var style = window.getComputedStyle(node2, null); var transform = style.getPropertyValue("transform") || style.getPropertyValue(getTransformName()); if (transform && transform !== "none") { var arr; var match2d = transform.match(matrix2d); if (match2d) { match2d = match2d[1]; arr = match2d.split(",").map(function(item) { return parseFloat(item, 10); }); arr[4] = xy.x; arr[5] = xy.y; setTransform(node2, "matrix(".concat(arr.join(","), ")")); } else { var match3d = transform.match(matrix3d)[1]; arr = match3d.split(",").map(function(item) { return parseFloat(item, 10); }); arr[12] = xy.x; arr[13] = xy.y; setTransform(node2, "matrix3d(".concat(arr.join(","), ")")); } } else { setTransform(node2, "translateX(".concat(xy.x, "px) translateY(").concat(xy.y, "px) translateZ(0)")); } } var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; var getComputedStyleX; function forceRelayout(elem) { var originalStyle = elem.style.display; elem.style.display = "none"; elem.offsetHeight; elem.style.display = originalStyle; } function css(el, name, v2) { var value = v2; if (_typeof(name) === "object") { for (var i2 in name) { if (name.hasOwnProperty(i2)) { css(el, i2, name[i2]); } } return void 0; } if (typeof value !== "undefined") { if (typeof value === "number") { value = "".concat(value, "px"); } el.style[name] = value; return void 0; } return getComputedStyleX(el, name); } function getClientPosition(elem) { var box2; var x2; var y2; var doc2 = elem.ownerDocument; var body = doc2.body; var docElem = doc2 && doc2.documentElement; box2 = elem.getBoundingClientRect(); x2 = Math.floor(box2.left); y2 = Math.floor(box2.top); x2 -= docElem.clientLeft || body.clientLeft || 0; y2 -= docElem.clientTop || body.clientTop || 0; return { left: x2, top: y2 }; } function getScroll$1(w2, top) { var ret = w2["page".concat(top ? "Y" : "X", "Offset")]; var method = "scroll".concat(top ? "Top" : "Left"); if (typeof ret !== "number") { var d2 = w2.document; ret = d2.documentElement[method]; if (typeof ret !== "number") { ret = d2.body[method]; } } return ret; } function getScrollLeft(w2) { return getScroll$1(w2); } function getScrollTop(w2) { return getScroll$1(w2, true); } function getOffset$1(el) { var pos = getClientPosition(el); var doc2 = el.ownerDocument; var w2 = doc2.defaultView || doc2.parentWindow; pos.left += getScrollLeft(w2); pos.top += getScrollTop(w2); return pos; } function isWindow(obj) { return obj !== null && obj !== void 0 && obj == obj.window; } function getDocument(node2) { if (isWindow(node2)) { return node2.document; } if (node2.nodeType === 9) { return node2; } return node2.ownerDocument; } function _getComputedStyle(elem, name, cs) { var computedStyle = cs; var val = ""; var d2 = getDocument(elem); computedStyle = computedStyle || d2.defaultView.getComputedStyle(elem, null); if (computedStyle) { val = computedStyle.getPropertyValue(name) || computedStyle[name]; } return val; } var _RE_NUM_NO_PX = new RegExp("^(".concat(RE_NUM, ")(?!px)[a-z%]+$"), "i"); var RE_POS = /^(top|right|bottom|left)$/; var CURRENT_STYLE = "currentStyle"; var RUNTIME_STYLE = "runtimeStyle"; var LEFT = "left"; var PX = "px"; function _getComputedStyleIE(elem, name) { var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { var style = elem.style; var left = style[LEFT]; var rsLeft = elem[RUNTIME_STYLE][LEFT]; elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; style[LEFT] = name === "fontSize" ? "1em" : ret || 0; ret = style.pixelLeft + PX; style[LEFT] = left; elem[RUNTIME_STYLE][LEFT] = rsLeft; } return ret === "" ? "auto" : ret; } if (typeof window !== "undefined") { getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; } function getOffsetDirection(dir, option) { if (dir === "left") { return option.useCssRight ? "right" : dir; } return option.useCssBottom ? "bottom" : dir; } function oppositeOffsetDirection(dir) { if (dir === "left") { return "right"; } else if (dir === "right") { return "left"; } else if (dir === "top") { return "bottom"; } else if (dir === "bottom") { return "top"; } } function setLeftTop(elem, offset2, option) { if (css(elem, "position") === "static") { elem.style.position = "relative"; } var presetH = -999; var presetV = -999; var horizontalProperty = getOffsetDirection("left", option); var verticalProperty = getOffsetDirection("top", option); var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty); var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty); if (horizontalProperty !== "left") { presetH = 999; } if (verticalProperty !== "top") { presetV = 999; } var originalTransition = ""; var originalOffset = getOffset$1(elem); if ("left" in offset2 || "top" in offset2) { originalTransition = getTransitionProperty(elem) || ""; setTransitionProperty(elem, "none"); } if ("left" in offset2) { elem.style[oppositeHorizontalProperty] = ""; elem.style[horizontalProperty] = "".concat(presetH, "px"); } if ("top" in offset2) { elem.style[oppositeVerticalProperty] = ""; elem.style[verticalProperty] = "".concat(presetV, "px"); } forceRelayout(elem); var old = getOffset$1(elem); var originalStyle = {}; for (var key2 in offset2) { if (offset2.hasOwnProperty(key2)) { var dir = getOffsetDirection(key2, option); var preset = key2 === "left" ? presetH : presetV; var off = originalOffset[key2] - old[key2]; if (dir === key2) { originalStyle[dir] = preset + off; } else { originalStyle[dir] = preset - off; } } } css(elem, originalStyle); forceRelayout(elem); if ("left" in offset2 || "top" in offset2) { setTransitionProperty(elem, originalTransition); } var ret = {}; for (var _key in offset2) { if (offset2.hasOwnProperty(_key)) { var _dir = getOffsetDirection(_key, option); var _off = offset2[_key] - originalOffset[_key]; if (_key === _dir) { ret[_dir] = originalStyle[_dir] + _off; } else { ret[_dir] = originalStyle[_dir] - _off; } } } css(elem, ret); } function setTransform$1(elem, offset2) { var originalOffset = getOffset$1(elem); var originalXY = getTransformXY(elem); var resultXY = { x: originalXY.x, y: originalXY.y }; if ("left" in offset2) { resultXY.x = originalXY.x + offset2.left - originalOffset.left; } if ("top" in offset2) { resultXY.y = originalXY.y + offset2.top - originalOffset.top; } setTransformXY(elem, resultXY); } function setOffset(elem, offset2, option) { if (option.ignoreShake) { var oriOffset = getOffset$1(elem); var oLeft = oriOffset.left.toFixed(0); var oTop = oriOffset.top.toFixed(0); var tLeft = offset2.left.toFixed(0); var tTop = offset2.top.toFixed(0); if (oLeft === tLeft && oTop === tTop) { return; } } if (option.useCssRight || option.useCssBottom) { setLeftTop(elem, offset2, option); } else if (option.useCssTransform && getTransformName() in document.body.style) { setTransform$1(elem, offset2); } else { setLeftTop(elem, offset2, option); } } function each(arr, fn) { for (var i2 = 0; i2 < arr.length; i2++) { fn(arr[i2]); } } function isBorderBoxFn(elem) { return getComputedStyleX(elem, "boxSizing") === "border-box"; } var BOX_MODELS = ["margin", "border", "padding"]; var CONTENT_INDEX = -1; var PADDING_INDEX = 2; var BORDER_INDEX = 1; var MARGIN_INDEX = 0; function swap(elem, options, callback) { var old = {}; var style = elem.style; var name; for (name in options) { if (options.hasOwnProperty(name)) { old[name] = style[name]; style[name] = options[name]; } } callback.call(elem); for (name in options) { if (options.hasOwnProperty(name)) { style[name] = old[name]; } } } function getPBMWidth(elem, props2, which) { var value = 0; var prop; var j2; var i2; for (j2 = 0; j2 < props2.length; j2++) { prop = props2[j2]; if (prop) { for (i2 = 0; i2 < which.length; i2++) { var cssProp = void 0; if (prop === "border") { cssProp = "".concat(prop).concat(which[i2], "Width"); } else { cssProp = prop + which[i2]; } value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; } } } return value; } var domUtils = { getParent: function getParent2(element) { var parent2 = element; do { if (parent2.nodeType === 11 && parent2.host) { parent2 = parent2.host; } else { parent2 = parent2.parentNode; } } while (parent2 && parent2.nodeType !== 1 && parent2.nodeType !== 9); return parent2; } }; each(["Width", "Height"], function(name) { domUtils["doc".concat(name)] = function(refWin) { var d2 = refWin.document; return Math.max( // firefox chrome documentElement.scrollHeight< body.scrollHeight // ie standard mode : documentElement.scrollHeight> body.scrollHeight d2.documentElement["scroll".concat(name)], // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? d2.body["scroll".concat(name)], domUtils["viewport".concat(name)](d2) ); }; domUtils["viewport".concat(name)] = function(win) { var prop = "client".concat(name); var doc2 = win.document; var body = doc2.body; var documentElement = doc2.documentElement; var documentElementProp = documentElement[prop]; return doc2.compatMode === "CSS1Compat" && documentElementProp || body && body[prop] || documentElementProp; }; }); function getWH(elem, name, ex) { var extra = ex; if (isWindow(elem)) { return name === "width" ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); } else if (elem.nodeType === 9) { return name === "width" ? domUtils.docWidth(elem) : domUtils.docHeight(elem); } var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"]; var borderBoxValue = name === "width" ? Math.floor(elem.getBoundingClientRect().width) : Math.floor(elem.getBoundingClientRect().height); var isBorderBox = isBorderBoxFn(elem); var cssBoxValue = 0; if (borderBoxValue === null || borderBoxValue === void 0 || borderBoxValue <= 0) { borderBoxValue = void 0; cssBoxValue = getComputedStyleX(elem, name); if (cssBoxValue === null || cssBoxValue === void 0 || Number(cssBoxValue) < 0) { cssBoxValue = elem.style[name] || 0; } cssBoxValue = Math.floor(parseFloat(cssBoxValue)) || 0; } if (extra === void 0) { extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; } var borderBoxValueOrIsBorderBox = borderBoxValue !== void 0 || isBorderBox; var val = borderBoxValue || cssBoxValue; if (extra === CONTENT_INDEX) { if (borderBoxValueOrIsBorderBox) { return val - getPBMWidth(elem, ["border", "padding"], which); } return cssBoxValue; } else if (borderBoxValueOrIsBorderBox) { if (extra === BORDER_INDEX) { return val; } return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ["border"], which) : getPBMWidth(elem, ["margin"], which)); } return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which); } var cssShow = { position: "absolute", visibility: "hidden", display: "block" }; function getWHIgnoreDisplay() { for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) { args[_key2] = arguments[_key2]; } var val; var elem = args[0]; if (elem.offsetWidth !== 0) { val = getWH.apply(void 0, args); } else { swap(elem, cssShow, function() { val = getWH.apply(void 0, args); }); } return val; } each(["width", "height"], function(name) { var first = name.charAt(0).toUpperCase() + name.slice(1); domUtils["outer".concat(first)] = function(el, includeMargin) { return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); }; var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"]; domUtils[name] = function(elem, v2) { var val = v2; if (val !== void 0) { if (elem) { var isBorderBox = isBorderBoxFn(elem); if (isBorderBox) { val += getPBMWidth(elem, ["padding", "border"], which); } return css(elem, name, val); } return void 0; } return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); }; }); function mix(to, from2) { for (var i2 in from2) { if (from2.hasOwnProperty(i2)) { to[i2] = from2[i2]; } } return to; } var utils = { getWindow: function getWindow(node2) { if (node2 && node2.document && node2.setTimeout) { return node2; } var doc2 = node2.ownerDocument || node2; return doc2.defaultView || doc2.parentWindow; }, getDocument, offset: function offset2(el, value, option) { if (typeof value !== "undefined") { setOffset(el, value, option || {}); } else { return getOffset$1(el); } }, isWindow, each, css, clone: function clone(obj) { var i2; var ret = {}; for (i2 in obj) { if (obj.hasOwnProperty(i2)) { ret[i2] = obj[i2]; } } var overflow = obj.overflow; if (overflow) { for (i2 in obj) { if (obj.hasOwnProperty(i2)) { ret.overflow[i2] = obj.overflow[i2]; } } } return ret; }, mix, getWindowScrollLeft: function getWindowScrollLeft(w2) { return getScrollLeft(w2); }, getWindowScrollTop: function getWindowScrollTop(w2) { return getScrollTop(w2); }, merge: function merge2() { var ret = {}; for (var i2 = 0; i2 < arguments.length; i2++) { utils.mix(ret, i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2]); } return ret; }, viewportWidth: 0, viewportHeight: 0 }; mix(utils, domUtils); var getParent$1 = utils.getParent; function getOffsetParent(element) { if (utils.isWindow(element) || element.nodeType === 9) { return null; } var doc2 = utils.getDocument(element); var body = doc2.body; var parent2; var positionStyle = utils.css(element, "position"); var skipStatic = positionStyle === "fixed" || positionStyle === "absolute"; if (!skipStatic) { return element.nodeName.toLowerCase() === "html" ? null : getParent$1(element); } for (parent2 = getParent$1(element); parent2 && parent2 !== body && parent2.nodeType !== 9; parent2 = getParent$1(parent2)) { positionStyle = utils.css(parent2, "position"); if (positionStyle !== "static") { return parent2; } } return null; } var getParent$1$1 = utils.getParent; function isAncestorFixed(element) { if (utils.isWindow(element) || element.nodeType === 9) { return false; } var doc2 = utils.getDocument(element); var body = doc2.body; var parent2 = null; for ( parent2 = getParent$1$1(element); // 修复元素位于 document.documentElement 下导致崩溃问题 parent2 && parent2 !== body && parent2 !== doc2; parent2 = getParent$1$1(parent2) ) { var positionStyle = utils.css(parent2, "position"); if (positionStyle === "fixed") { return true; } } return false; } function getVisibleRectForElement(element, alwaysByViewport) { var visibleRect = { left: 0, right: Infinity, top: 0, bottom: Infinity }; var el = getOffsetParent(element); var doc2 = utils.getDocument(element); var win = doc2.defaultView || doc2.parentWindow; var body = doc2.body; var documentElement = doc2.documentElement; while (el) { if ((navigator.userAgent.indexOf("MSIE") === -1 || el.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire // viewport. In some browsers, el.offsetParent may be // document.documentElement, so check for that too. el !== body && el !== documentElement && utils.css(el, "overflow") !== "visible") { var pos = utils.offset(el); pos.left += el.clientLeft; pos.top += el.clientTop; visibleRect.top = Math.max(visibleRect.top, pos.top); visibleRect.right = Math.min( visibleRect.right, // consider area without scrollBar pos.left + el.clientWidth ); visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight); visibleRect.left = Math.max(visibleRect.left, pos.left); } else if (el === body || el === documentElement) { break; } el = getOffsetParent(el); } var originalPosition = null; if (!utils.isWindow(element) && element.nodeType !== 9) { originalPosition = element.style.position; var position2 = utils.css(element, "position"); if (position2 === "absolute") { element.style.position = "fixed"; } } var scrollX = utils.getWindowScrollLeft(win); var scrollY = utils.getWindowScrollTop(win); var viewportWidth = utils.viewportWidth(win); var viewportHeight = utils.viewportHeight(win); var documentWidth = documentElement.scrollWidth; var documentHeight = documentElement.scrollHeight; var bodyStyle = window.getComputedStyle(body); if (bodyStyle.overflowX === "hidden") { documentWidth = win.innerWidth; } if (bodyStyle.overflowY === "hidden") { documentHeight = win.innerHeight; } if (element.style) { element.style.position = originalPosition; } if (alwaysByViewport || isAncestorFixed(element)) { visibleRect.left = Math.max(visibleRect.left, scrollX); visibleRect.top = Math.max(visibleRect.top, scrollY); visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth); visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight); } else { var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth); visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth); var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight); visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight); } return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null; } function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) { var pos = utils.clone(elFuturePos); var size = { width: elRegion.width, height: elRegion.height }; if (overflow.adjustX && pos.left < visibleRect.left) { pos.left = visibleRect.left; } if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) { size.width -= pos.left + size.width - visibleRect.right; } if (overflow.adjustX && pos.left + size.width > visibleRect.right) { pos.left = Math.max(visibleRect.right - size.width, visibleRect.left); } if (overflow.adjustY && pos.top < visibleRect.top) { pos.top = visibleRect.top; } if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) { size.height -= pos.top + size.height - visibleRect.bottom; } if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) { pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top); } return utils.mix(pos, size); } function getRegion(node2) { var offset2; var w2; var h2; if (!utils.isWindow(node2) && node2.nodeType !== 9) { offset2 = utils.offset(node2); w2 = utils.outerWidth(node2); h2 = utils.outerHeight(node2); } else { var win = utils.getWindow(node2); offset2 = { left: utils.getWindowScrollLeft(win), top: utils.getWindowScrollTop(win) }; w2 = utils.viewportWidth(win); h2 = utils.viewportHeight(win); } offset2.width = w2; offset2.height = h2; return offset2; } function getAlignOffset(region, align) { var V2 = align.charAt(0); var H = align.charAt(1); var w2 = region.width; var h2 = region.height; var x2 = region.left; var y2 = region.top; if (V2 === "c") { y2 += h2 / 2; } else if (V2 === "b") { y2 += h2; } if (H === "c") { x2 += w2 / 2; } else if (H === "r") { x2 += w2; } return { left: x2, top: y2 }; } function getElFuturePos(elRegion, refNodeRegion, points, offset2, targetOffset2) { var p1 = getAlignOffset(refNodeRegion, points[1]); var p2 = getAlignOffset(elRegion, points[0]); var diff = [p2.left - p1.left, p2.top - p1.top]; return { left: Math.round(elRegion.left - diff[0] + offset2[0] - targetOffset2[0]), top: Math.round(elRegion.top - diff[1] + offset2[1] - targetOffset2[1]) }; } function isFailX(elFuturePos, elRegion, visibleRect) { return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right; } function isFailY(elFuturePos, elRegion, visibleRect) { return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; } function isCompleteFailX(elFuturePos, elRegion, visibleRect) { return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left; } function isCompleteFailY(elFuturePos, elRegion, visibleRect) { return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top; } function flip(points, reg, map) { var ret = []; utils.each(points, function(p2) { ret.push(p2.replace(reg, function(m2) { return map[m2]; })); }); return ret; } function flipOffset(offset2, index2) { offset2[index2] = -offset2[index2]; return offset2; } function convertOffset(str, offsetLen) { var n2; if (/%$/.test(str)) { n2 = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen; } else { n2 = parseInt(str, 10); } return n2 || 0; } function normalizeOffset(offset2, el) { offset2[0] = convertOffset(offset2[0], el.width); offset2[1] = convertOffset(offset2[1], el.height); } function doAlign(el, tgtRegion, align, isTgtRegionVisible) { var points = align.points; var offset2 = align.offset || [0, 0]; var targetOffset2 = align.targetOffset || [0, 0]; var overflow = align.overflow; var source = align.source || el; offset2 = [].concat(offset2); targetOffset2 = [].concat(targetOffset2); overflow = overflow || {}; var newOverflowCfg = {}; var fail = 0; var alwaysByViewport = !!(overflow && overflow.alwaysByViewport); var visibleRect = getVisibleRectForElement(source, alwaysByViewport); var elRegion = getRegion(source); normalizeOffset(offset2, elRegion); normalizeOffset(targetOffset2, tgtRegion); var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset2); var newElRegion = utils.merge(elRegion, elFuturePos); if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) { if (overflow.adjustX) { if (isFailX(elFuturePos, elRegion, visibleRect)) { var newPoints = flip(points, /[lr]/gi, { l: "r", r: "l" }); var newOffset = flipOffset(offset2, 0); var newTargetOffset = flipOffset(targetOffset2, 0); var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset); if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) { fail = 1; points = newPoints; offset2 = newOffset; targetOffset2 = newTargetOffset; } } } if (overflow.adjustY) { if (isFailY(elFuturePos, elRegion, visibleRect)) { var _newPoints = flip(points, /[tb]/gi, { t: "b", b: "t" }); var _newOffset = flipOffset(offset2, 1); var _newTargetOffset = flipOffset(targetOffset2, 1); var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset); if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) { fail = 1; points = _newPoints; offset2 = _newOffset; targetOffset2 = _newTargetOffset; } } } if (fail) { elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset2); utils.mix(newElRegion, elFuturePos); } var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect); var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); if (isStillFailX || isStillFailY) { var _newPoints2 = points; if (isStillFailX) { _newPoints2 = flip(points, /[lr]/gi, { l: "r", r: "l" }); } if (isStillFailY) { _newPoints2 = flip(points, /[tb]/gi, { t: "b", b: "t" }); } points = _newPoints2; offset2 = align.offset || [0, 0]; targetOffset2 = align.targetOffset || [0, 0]; } newOverflowCfg.adjustX = overflow.adjustX && isStillFailX; newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) { newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg); } } if (newElRegion.width !== elRegion.width) { utils.css(source, "width", utils.width(source) + newElRegion.width - elRegion.width); } if (newElRegion.height !== elRegion.height) { utils.css(source, "height", utils.height(source) + newElRegion.height - elRegion.height); } utils.offset(source, { left: newElRegion.left, top: newElRegion.top }, { useCssRight: align.useCssRight, useCssBottom: align.useCssBottom, useCssTransform: align.useCssTransform, ignoreShake: align.ignoreShake }); return { points, offset: offset2, targetOffset: targetOffset2, overflow: newOverflowCfg }; } function isOutOfVisibleRect(target, alwaysByViewport) { var visibleRect = getVisibleRectForElement(target, alwaysByViewport); var targetRegion = getRegion(target); return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom; } function alignElement(el, refNode, align) { var target = align.target || refNode; var refNodeRegion = getRegion(target); var isTargetNotOutOfVisible = !isOutOfVisibleRect(target, align.overflow && align.overflow.alwaysByViewport); return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible); } alignElement.__getOffsetParent = getOffsetParent; alignElement.__getVisibleRectForElement = getVisibleRectForElement; function alignPoint(el, tgtPoint, align) { var pageX; var pageY; var doc2 = utils.getDocument(el); var win = doc2.defaultView || doc2.parentWindow; var scrollX = utils.getWindowScrollLeft(win); var scrollY = utils.getWindowScrollTop(win); var viewportWidth = utils.viewportWidth(win); var viewportHeight = utils.viewportHeight(win); if ("pageX" in tgtPoint) { pageX = tgtPoint.pageX; } else { pageX = scrollX + tgtPoint.clientX; } if ("pageY" in tgtPoint) { pageY = tgtPoint.pageY; } else { pageY = scrollY + tgtPoint.clientY; } var tgtRegion = { left: pageX, top: pageY, width: 0, height: 0 }; var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight; var points = [align.points[0], "cc"]; return doAlign(el, tgtRegion, _objectSpread2(_objectSpread2({}, align), {}, { points }), pointInView); } function cloneElement(vnode) { let nodeProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let override = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; let mergeRef = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; let ele = vnode; if (Array.isArray(vnode)) { ele = filterEmpty(vnode)[0]; } if (!ele) { return null; } const node2 = cloneVNode(ele, nodeProps, mergeRef); node2.props = override ? _extends$1(_extends$1({}, node2.props), nodeProps) : node2.props; warning$2(typeof node2.props.class !== "object"); return node2; } function triggerVNodeUpdate(vm, attrs, dom) { render(cloneVNode(vm, _extends$1({}, attrs)), dom); } const isVisible = (element) => { if (!element) { return false; } if (element.offsetParent) { return true; } if (element.getBBox) { const box2 = element.getBBox(); if (box2.width || box2.height) { return true; } } if (element.getBoundingClientRect) { const box2 = element.getBoundingClientRect(); if (box2.width || box2.height) { return true; } } return false; }; function isSamePoint(prev2, next2) { if (prev2 === next2) return true; if (!prev2 || !next2) return false; if ("pageX" in next2 && "pageY" in next2) { return prev2.pageX === next2.pageX && prev2.pageY === next2.pageY; } if ("clientX" in next2 && "clientY" in next2) { return prev2.clientX === next2.clientX && prev2.clientY === next2.clientY; } return false; } function restoreFocus(activeElement, container) { if (activeElement !== document.activeElement && contains$1(container, activeElement) && typeof activeElement.focus === "function") { activeElement.focus(); } } function monitorResize(element, callback) { let prevWidth = null; let prevHeight = null; function onResize(_ref) { let [{ target }] = _ref; if (!document.documentElement.contains(target)) return; const { width, height } = target.getBoundingClientRect(); const fixedWidth = Math.floor(width); const fixedHeight = Math.floor(height); if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) { Promise.resolve().then(() => { callback({ width: fixedWidth, height: fixedHeight }); }); } prevWidth = fixedWidth; prevHeight = fixedHeight; } const resizeObserver = new index(onResize); if (element) { resizeObserver.observe(element); } return () => { resizeObserver.disconnect(); }; } const useBuffer = (callback, buffer) => { let called = false; let timeout = null; function cancelTrigger() { clearTimeout(timeout); } function trigger2(force) { if (!called || force === true) { if (callback() === false) { return; } called = true; cancelTrigger(); timeout = setTimeout(() => { called = false; }, buffer.value); } else { cancelTrigger(); timeout = setTimeout(() => { called = false; trigger2(); }, buffer.value); } } return [trigger2, () => { called = false; cancelTrigger(); }]; }; function listCacheClear() { this.__data__ = []; this.size = 0; } function eq(value, other) { return value === other || value !== value && other !== other; } function assocIndexOf(array, key2) { var length2 = array.length; while (length2--) { if (eq(array[length2][0], key2)) { return length2; } } return -1; } var arrayProto = Array.prototype; var splice = arrayProto.splice; function listCacheDelete(key2) { var data = this.__data__, index2 = assocIndexOf(data, key2); if (index2 < 0) { return false; } var lastIndex = data.length - 1; if (index2 == lastIndex) { data.pop(); } else { splice.call(data, index2, 1); } --this.size; return true; } function listCacheGet(key2) { var data = this.__data__, index2 = assocIndexOf(data, key2); return index2 < 0 ? void 0 : data[index2][1]; } function listCacheHas(key2) { return assocIndexOf(this.__data__, key2) > -1; } function listCacheSet(key2, value) { var data = this.__data__, index2 = assocIndexOf(data, key2); if (index2 < 0) { ++this.size; data.push([key2, value]); } else { data[index2][1] = value; } return this; } function ListCache(entries) { var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } ListCache.prototype.clear = listCacheClear; ListCache.prototype["delete"] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; function stackClear() { this.__data__ = new ListCache(); this.size = 0; } function stackDelete(key2) { var data = this.__data__, result = data["delete"](key2); this.size = data.size; return result; } function stackGet(key2) { return this.__data__.get(key2); } function stackHas(key2) { return this.__data__.has(key2); } var freeGlobal = typeof global == "object" && global && global.Object === Object && global; var freeSelf = typeof self == "object" && self && self.Object === Object && self; var root = freeGlobal || freeSelf || Function("return this")(); var Symbol$1 = root.Symbol; var objectProto$g = Object.prototype; var hasOwnProperty$d = objectProto$g.hasOwnProperty; var nativeObjectToString$1 = objectProto$g.toString; var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0; function getRawTag(value) { var isOwn = hasOwnProperty$d.call(value, symToStringTag$1), tag = value[symToStringTag$1]; try { value[symToStringTag$1] = void 0; var unmasked = true; } catch (e2) { } var result = nativeObjectToString$1.call(value); if (unmasked) { if (isOwn) { value[symToStringTag$1] = tag; } else { delete value[symToStringTag$1]; } } return result; } var objectProto$f = Object.prototype; var nativeObjectToString = objectProto$f.toString; function objectToString(value) { return nativeObjectToString.call(value); } var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; function baseGetTag(value) { if (value == null) { return value === void 0 ? undefinedTag : nullTag; } return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); } function isObject$2(value) { var type = typeof value; return value != null && (type == "object" || type == "function"); } var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; function isFunction(value) { if (!isObject$2(value)) { return false; } var tag = baseGetTag(value); return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; } var coreJsData = root["__core-js_shared__"]; var maskSrcKey = function() { var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); return uid2 ? "Symbol(src)_1." + uid2 : ""; }(); function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } var funcProto$2 = Function.prototype; var funcToString$2 = funcProto$2.toString; function toSource(func) { if (func != null) { try { return funcToString$2.call(func); } catch (e2) { } try { return func + ""; } catch (e2) { } } return ""; } var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; var funcProto$1 = Function.prototype, objectProto$e = Object.prototype; var funcToString$1 = funcProto$1.toString; var hasOwnProperty$c = objectProto$e.hasOwnProperty; var reIsNative = RegExp( "^" + funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { if (!isObject$2(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } function getValue$2(object, key2) { return object == null ? void 0 : object[key2]; } function getNative(object, key2) { var value = getValue$2(object, key2); return baseIsNative(value) ? value : void 0; } var Map$1 = getNative(root, "Map"); var nativeCreate = getNative(Object, "create"); function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } function hashDelete(key2) { var result = this.has(key2) && delete this.__data__[key2]; this.size -= result ? 1 : 0; return result; } var HASH_UNDEFINED$2 = "__lodash_hash_undefined__"; var objectProto$d = Object.prototype; var hasOwnProperty$b = objectProto$d.hasOwnProperty; function hashGet(key2) { var data = this.__data__; if (nativeCreate) { var result = data[key2]; return result === HASH_UNDEFINED$2 ? void 0 : result; } return hasOwnProperty$b.call(data, key2) ? data[key2] : void 0; } var objectProto$c = Object.prototype; var hasOwnProperty$a = objectProto$c.hasOwnProperty; function hashHas(key2) { var data = this.__data__; return nativeCreate ? data[key2] !== void 0 : hasOwnProperty$a.call(data, key2); } var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; function hashSet(key2, value) { var data = this.__data__; this.size += this.has(key2) ? 0 : 1; data[key2] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value; return this; } function Hash(entries) { var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } Hash.prototype.clear = hashClear; Hash.prototype["delete"] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; function mapCacheClear() { this.size = 0; this.__data__ = { "hash": new Hash(), "map": new (Map$1 || ListCache)(), "string": new Hash() }; } function isKeyable(value) { var type = typeof value; return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } function getMapData(map, key2) { var data = map.__data__; return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map; } function mapCacheDelete(key2) { var result = getMapData(this, key2)["delete"](key2); this.size -= result ? 1 : 0; return result; } function mapCacheGet(key2) { return getMapData(this, key2).get(key2); } function mapCacheHas(key2) { return getMapData(this, key2).has(key2); } function mapCacheSet(key2, value) { var data = getMapData(this, key2), size = data.size; data.set(key2, value); this.size += data.size == size ? 0 : 1; return this; } function MapCache(entries) { var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } } MapCache.prototype.clear = mapCacheClear; MapCache.prototype["delete"] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; var LARGE_ARRAY_SIZE$1 = 200; function stackSet(key2, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) { pairs.push([key2, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key2, value); this.size = data.size; return this; } function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } Stack.prototype.clear = stackClear; Stack.prototype["delete"] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; var HASH_UNDEFINED = "__lodash_hash_undefined__"; function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } function setCacheHas(value) { return this.__data__.has(value); } function SetCache(values) { var index2 = -1, length2 = values == null ? 0 : values.length; this.__data__ = new MapCache(); while (++index2 < length2) { this.add(values[index2]); } } SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; function arraySome(array, predicate) { var index2 = -1, length2 = array == null ? 0 : array.length; while (++index2 < length2) { if (predicate(array[index2], index2, array)) { return true; } } return false; } function cacheHas(cache, key2) { return cache.has(key2); } var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } var arrStacked = stack2.get(array); var othStacked = stack2.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; stack2.set(array, other); stack2.set(other, array); while (++index2 < arrLength) { var arrValue = array[index2], othValue = other[index2]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack2) : customizer(arrValue, othValue, index2, array, other, stack2); } if (compared !== void 0) { if (compared) { continue; } result = false; break; } if (seen) { if (!arraySome(other, function(othValue2, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) { result = false; break; } } stack2["delete"](array); stack2["delete"](other); return result; } var Uint8Array2 = root.Uint8Array; function mapToArray(map) { var index2 = -1, result = Array(map.size); map.forEach(function(value, key2) { result[++index2] = [key2, value]; }); return result; } function setToArray(set2) { var index2 = -1, result = Array(set2.size); set2.forEach(function(value) { result[++index2] = value; }); return result; } var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; var boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", mapTag$6 = "[object Map]", numberTag$4 = "[object Number]", regexpTag$3 = "[object RegExp]", setTag$6 = "[object Set]", stringTag$3 = "[object String]", symbolTag$3 = "[object Symbol]"; var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]"; var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : void 0; function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) { switch (tag) { case dataViewTag$4: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag$3: if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { return false; } return true; case boolTag$3: case dateTag$3: case numberTag$4: return eq(+object, +other); case errorTag$2: return object.name == other.name && object.message == other.message; case regexpTag$3: case stringTag$3: return object == other + ""; case mapTag$6: var convert = mapToArray; case setTag$6: var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } var stacked = stack2.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG$2; stack2.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2); stack2["delete"](object); return result; case symbolTag$3: if (symbolValueOf$1) { return symbolValueOf$1.call(object) == symbolValueOf$1.call(other); } } return false; } function arrayPush(array, values) { var index2 = -1, length2 = values.length, offset2 = array.length; while (++index2 < length2) { array[offset2 + index2] = values[index2]; } return array; } var isArray = Array.isArray; function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } function arrayFilter(array, predicate) { var index2 = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index2 < length2) { var value = array[index2]; if (predicate(value, index2, array)) { result[resIndex++] = value; } } return result; } function stubArray() { return []; } var objectProto$b = Object.prototype; var propertyIsEnumerable$1 = objectProto$b.propertyIsEnumerable; var nativeGetSymbols$1 = Object.getOwnPropertySymbols; var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols$1(object), function(symbol) { return propertyIsEnumerable$1.call(object, symbol); }); }; function baseTimes(n2, iteratee) { var index2 = -1, result = Array(n2); while (++index2 < n2) { result[index2] = iteratee(index2); } return result; } function isObjectLike(value) { return value != null && typeof value == "object"; } var argsTag$3 = "[object Arguments]"; function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag$3; } var objectProto$a = Object.prototype; var hasOwnProperty$9 = objectProto$a.hasOwnProperty; var propertyIsEnumerable = objectProto$a.propertyIsEnumerable; var isArguments = baseIsArguments(/* @__PURE__ */ function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; function stubFalse() { return false; } var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module; var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2; var Buffer$1 = moduleExports$2 ? root.Buffer : void 0; var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0; var isBuffer = nativeIsBuffer || stubFalse; var MAX_SAFE_INTEGER$1 = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; function isIndex(value, length2) { var type = typeof value; length2 = length2 == null ? MAX_SAFE_INTEGER$1 : length2; return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2); } var MAX_SAFE_INTEGER = 9007199254740991; function isLength(value) { return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]"; var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]"; var typedArrayTags = {}; typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true; typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false; function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } function baseUnary(func) { return function(value) { return func(value); }; } var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module; var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; var freeProcess = moduleExports$1 && freeGlobal.process; var nodeUtil = function() { try { var types2 = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types; if (types2) { return types2; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); } catch (e2) { } }(); var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; var objectProto$9 = Object.prototype; var hasOwnProperty$8 = objectProto$9.hasOwnProperty; function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length; for (var key2 in value) { if ((inherited || hasOwnProperty$8.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties. isIndex(key2, length2)))) { result.push(key2); } } return result; } var objectProto$8 = Object.prototype; function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$8; return value === proto; } function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } var nativeKeys = overArg(Object.keys, Object); var objectProto$7 = Object.prototype; var hasOwnProperty$7 = objectProto$7.hasOwnProperty; function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key2 in Object(object)) { if (hasOwnProperty$7.call(object, key2) && key2 != "constructor") { result.push(key2); } } return result; } function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } var COMPARE_PARTIAL_FLAG$3 = 1; var objectProto$6 = Object.prototype; var hasOwnProperty$6 = objectProto$6.hasOwnProperty; function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index2 = objLength; while (index2--) { var key2 = objProps[index2]; if (!(isPartial ? key2 in other : hasOwnProperty$6.call(other, key2))) { return false; } } var objStacked = stack2.get(object); var othStacked = stack2.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack2.set(object, other); stack2.set(other, object); var skipCtor = isPartial; while (++index2 < objLength) { key2 = objProps[index2]; var objValue = object[key2], othValue = other[key2]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key2, other, object, stack2) : customizer(objValue, othValue, key2, object, other, stack2); } if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) { result = false; break; } skipCtor || (skipCtor = key2 == "constructor"); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { result = false; } } stack2["delete"](object); stack2["delete"](other); return result; } var DataView = getNative(root, "DataView"); var Promise$1 = getNative(root, "Promise"); var Set$1 = getNative(root, "Set"); var WeakMap$1 = getNative(root, "WeakMap"); var mapTag$4 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]"; var dataViewTag$2 = "[object DataView]"; var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1); var getTag = baseGetTag; if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag$2; case mapCtorString: return mapTag$4; case promiseCtorString: return promiseTag; case setCtorString: return setTag$4; case weakMapCtorString: return weakMapTag$1; } } return result; }; } var COMPARE_PARTIAL_FLAG$2 = 1; var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", objectTag$2 = "[object Object]"; var objectProto$5 = Object.prototype; var hasOwnProperty$5 = objectProto$5.hasOwnProperty; function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag$1 : getTag(object), othTag = othIsArr ? arrayTag$1 : getTag(other); objTag = objTag == argsTag$1 ? objectTag$2 : objTag; othTag = othTag == argsTag$1 ? objectTag$2 : othTag; var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack2 || (stack2 = new Stack()); return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2); } if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) { var objIsWrapped = objIsObj && hasOwnProperty$5.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$5.call(other, "__wrapped__"); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack2 || (stack2 = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2); } } if (!isSameTag) { return false; } stack2 || (stack2 = new Stack()); return equalObjects(object, other, bitmask, customizer, equalFunc, stack2); } function baseIsEqual(value, other, bitmask, customizer, stack2) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2); } function isEqual(value, other) { return baseIsEqual(value, other); } const alignProps = { align: Object, target: [Object, Function], onAlign: Function, monitorBufferTime: Number, monitorWindowResize: Boolean, disabled: Boolean }; function getElement(func) { if (typeof func !== "function") return null; return func(); } function getPoint(point) { if (typeof point !== "object" || !point) return null; return point; } const Align = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Align", props: alignProps, emits: ["align"], setup(props2, _ref) { let { expose, slots } = _ref; const cacheRef = ref({}); const nodeRef = ref(); const [forceAlign, cancelForceAlign] = useBuffer(() => { const { disabled: latestDisabled, target: latestTarget, align: latestAlign, onAlign: latestOnAlign } = props2; if (!latestDisabled && latestTarget && nodeRef.value) { const source = nodeRef.value; let result; const element = getElement(latestTarget); const point = getPoint(latestTarget); cacheRef.value.element = element; cacheRef.value.point = point; cacheRef.value.align = latestAlign; const { activeElement } = document; if (element && isVisible(element)) { result = alignElement(source, element, latestAlign); } else if (point) { result = alignPoint(source, point, latestAlign); } restoreFocus(activeElement, source); if (latestOnAlign && result) { latestOnAlign(source, result); } return true; } return false; }, computed(() => props2.monitorBufferTime)); const resizeMonitor = ref({ cancel: () => { } }); const sourceResizeMonitor = ref({ cancel: () => { } }); const goAlign = () => { const target = props2.target; const element = getElement(target); const point = getPoint(target); if (nodeRef.value !== sourceResizeMonitor.value.element) { sourceResizeMonitor.value.cancel(); sourceResizeMonitor.value.element = nodeRef.value; sourceResizeMonitor.value.cancel = monitorResize(nodeRef.value, forceAlign); } if (cacheRef.value.element !== element || !isSamePoint(cacheRef.value.point, point) || !isEqual(cacheRef.value.align, props2.align)) { forceAlign(); if (resizeMonitor.value.element !== element) { resizeMonitor.value.cancel(); resizeMonitor.value.element = element; resizeMonitor.value.cancel = monitorResize(element, forceAlign); } } }; onMounted(() => { nextTick(() => { goAlign(); }); }); onUpdated(() => { nextTick(() => { goAlign(); }); }); watch(() => props2.disabled, (disabled) => { if (!disabled) { forceAlign(); } else { cancelForceAlign(); } }, { immediate: true, flush: "post" }); const winResizeRef = ref(null); watch(() => props2.monitorWindowResize, (monitorWindowResize) => { if (monitorWindowResize) { if (!winResizeRef.value) { winResizeRef.value = addEventListenerWrap(window, "resize", forceAlign); } } else if (winResizeRef.value) { winResizeRef.value.remove(); winResizeRef.value = null; } }, { flush: "post" }); onUnmounted(() => { resizeMonitor.value.cancel(); sourceResizeMonitor.value.cancel(); if (winResizeRef.value) winResizeRef.value.remove(); cancelForceAlign(); }); expose({ forceAlign: () => forceAlign(true) }); return () => { const child = slots === null || slots === void 0 ? void 0 : slots.default(); if (child) { return cloneElement(child[0], { ref: nodeRef }, true, true); } return null; }; } }); tuple("bottomLeft", "bottomRight", "topLeft", "topRight"); const getTransitionDirection = (placement) => { if (placement !== void 0 && (placement === "topLeft" || placement === "topRight")) { return `slide-down`; } return `slide-up`; }; const getTransitionProps = function(transitionName2) { let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const transitionProps = transitionName2 ? _extends$1({ name: transitionName2, appear: true, // type: 'animation', // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`, // appearActiveClass: `antdv-base-transtion`, // appearToClass: `${transitionName}-appear ${transitionName}-appear-active`, enterFromClass: `${transitionName2}-enter ${transitionName2}-enter-prepare ${transitionName2}-enter-start`, enterActiveClass: `${transitionName2}-enter ${transitionName2}-enter-prepare`, enterToClass: `${transitionName2}-enter ${transitionName2}-enter-active`, leaveFromClass: ` ${transitionName2}-leave`, leaveActiveClass: `${transitionName2}-leave ${transitionName2}-leave-active`, leaveToClass: `${transitionName2}-leave ${transitionName2}-leave-active` }, opt) : _extends$1({ css: false }, opt); return transitionProps; }; const getTransitionGroupProps = function(transitionName2) { let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const transitionProps = transitionName2 ? _extends$1({ name: transitionName2, appear: true, // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`, appearActiveClass: `${transitionName2}`, appearToClass: `${transitionName2}-appear ${transitionName2}-appear-active`, enterFromClass: `${transitionName2}-appear ${transitionName2}-enter ${transitionName2}-appear-prepare ${transitionName2}-enter-prepare`, enterActiveClass: `${transitionName2}`, enterToClass: `${transitionName2}-enter ${transitionName2}-appear ${transitionName2}-appear-active ${transitionName2}-enter-active`, leaveActiveClass: `${transitionName2} ${transitionName2}-leave`, leaveToClass: `${transitionName2}-leave-active` }, opt) : _extends$1({ css: false }, opt); return transitionProps; }; const getTransitionName = (rootPrefixCls, motion, transitionName2) => { if (transitionName2 !== void 0) { return transitionName2; } return `${rootPrefixCls}-${motion}`; }; const PopupInner = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "PopupInner", inheritAttrs: false, props: innerProps, emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"], setup(props2, _ref) { let { expose, attrs, slots } = _ref; const alignRef = shallowRef(); const elementRef = shallowRef(); const alignedClassName = shallowRef(); const [stretchStyle, measureStretchStyle] = useStretchStyle(toRef(props2, "stretch")); const doMeasure = () => { if (props2.stretch) { measureStretchStyle(props2.getRootDomNode()); } }; const visible = shallowRef(false); let timeoutId; watch(() => props2.visible, (val) => { clearTimeout(timeoutId); if (val) { timeoutId = setTimeout(() => { visible.value = props2.visible; }); } else { visible.value = false; } }, { immediate: true }); const [status, goNextStatus] = useVisibleStatus(visible, doMeasure); const prepareResolveRef = shallowRef(); const getAlignTarget = () => { if (props2.point) { return props2.point; } return props2.getRootDomNode; }; const forceAlign = () => { var _a; (_a = alignRef.value) === null || _a === void 0 ? void 0 : _a.forceAlign(); }; const onInternalAlign = (popupDomNode, matchAlign) => { var _a; const nextAlignedClassName = props2.getClassNameFromAlign(matchAlign); const preAlignedClassName = alignedClassName.value; if (alignedClassName.value !== nextAlignedClassName) { alignedClassName.value = nextAlignedClassName; } if (status.value === "align") { if (preAlignedClassName !== nextAlignedClassName) { Promise.resolve().then(() => { forceAlign(); }); } else { goNextStatus(() => { var _a2; (_a2 = prepareResolveRef.value) === null || _a2 === void 0 ? void 0 : _a2.call(prepareResolveRef); }); } (_a = props2.onAlign) === null || _a === void 0 ? void 0 : _a.call(props2, popupDomNode, matchAlign); } }; const motion = computed(() => { const m2 = typeof props2.animation === "object" ? props2.animation : getMotion$1(props2); ["onAfterEnter", "onAfterLeave"].forEach((eventName) => { const originFn = m2[eventName]; m2[eventName] = (node2) => { goNextStatus(); status.value = "stable"; originFn === null || originFn === void 0 ? void 0 : originFn(node2); }; }); return m2; }); const onShowPrepare = () => { return new Promise((resolve2) => { prepareResolveRef.value = resolve2; }); }; watch([motion, status], () => { if (!motion.value && status.value === "motion") { goNextStatus(); } }, { immediate: true }); expose({ forceAlign, getElement: () => { return elementRef.value.$el || elementRef.value; } }); const alignDisabled = computed(() => { var _a; if (((_a = props2.align) === null || _a === void 0 ? void 0 : _a.points) && (status.value === "align" || status.value === "stable")) { return false; } return true; }); return () => { var _a; const { zIndex, align, prefixCls, destroyPopupOnHide, onMouseenter, onMouseleave, onTouchstart = () => { }, onMousedown } = props2; const statusValue = status.value; const mergedStyle = [_extends$1(_extends$1({}, stretchStyle.value), { zIndex, opacity: statusValue === "motion" || statusValue === "stable" || !visible.value ? null : 0, // pointerEvents: statusValue === 'stable' ? null : 'none', pointerEvents: !visible.value && statusValue !== "stable" ? "none" : null }), attrs.style]; let childNode = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, { visible: props2.visible })); if (childNode.length > 1) { childNode = createVNode("div", { "class": `${prefixCls}-content` }, [childNode]); } const mergedClassName = classNames(prefixCls, attrs.class, alignedClassName.value, !props2.arrow && `${prefixCls}-arrow-hidden`); const hasAnimate = visible.value || !props2.visible; const transitionProps = hasAnimate ? getTransitionProps(motion.value.name, motion.value) : {}; return createVNode(Transition, _objectSpread2$1(_objectSpread2$1({ "ref": elementRef }, transitionProps), {}, { "onBeforeEnter": onShowPrepare }), { default: () => { return !destroyPopupOnHide || props2.visible ? withDirectives(createVNode(Align, { "target": getAlignTarget(), "key": "popup", "ref": alignRef, "monitorWindowResize": true, "disabled": alignDisabled.value, "align": align, "onAlign": onInternalAlign }, { default: () => createVNode("div", { "class": mergedClassName, "onMouseenter": onMouseenter, "onMouseleave": onMouseleave, "onMousedown": withModifiers(onMousedown, ["capture"]), [supportsPassive ? "onTouchstartPassive" : "onTouchstart"]: withModifiers(onTouchstart, ["capture"]), "style": mergedStyle }, [childNode]) }), [[vShow, visible.value]]) : null; } }); }; } }); const Popup = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Popup", inheritAttrs: false, props: popupProps, setup(props2, _ref) { let { attrs, slots, expose } = _ref; const innerVisible = shallowRef(false); const inMobile = shallowRef(false); const popupRef = shallowRef(); const rootRef = shallowRef(); watch([() => props2.visible, () => props2.mobile], () => { innerVisible.value = props2.visible; if (props2.visible && props2.mobile) { inMobile.value = true; } }, { immediate: true, flush: "post" }); expose({ forceAlign: () => { var _a; (_a = popupRef.value) === null || _a === void 0 ? void 0 : _a.forceAlign(); }, getElement: () => { var _a; return (_a = popupRef.value) === null || _a === void 0 ? void 0 : _a.getElement(); } }); return () => { const cloneProps = _extends$1(_extends$1(_extends$1({}, props2), attrs), { visible: innerVisible.value }); const popupNode = inMobile.value ? createVNode(MobilePopupInner, _objectSpread2$1(_objectSpread2$1({}, cloneProps), {}, { "mobile": props2.mobile, "ref": popupRef }), { default: slots.default }) : createVNode(PopupInner, _objectSpread2$1(_objectSpread2$1({}, cloneProps), {}, { "ref": popupRef }), { default: slots.default }); return createVNode("div", { "ref": rootRef }, [createVNode(Mask$1, cloneProps, null), popupNode]); }; } }); function isPointsEq(a1, a2, isAlignPoint) { if (isAlignPoint) { return a1[0] === a2[0]; } return a1[0] === a2[0] && a1[1] === a2[1]; } function getAlignFromPlacement(builtinPlacements, placementStr, align) { const baseAlign = builtinPlacements[placementStr] || {}; return _extends$1(_extends$1({}, baseAlign), align); } function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) { const { points } = align; const placements2 = Object.keys(builtinPlacements); for (let i2 = 0; i2 < placements2.length; i2 += 1) { const placement = placements2[i2]; if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) { return `${prefixCls}-placement-${placement}`; } } return ""; } const BaseMixin = { methods: { setState() { let state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; let callback = arguments.length > 1 ? arguments[1] : void 0; let newState = typeof state === "function" ? state(this.$data, this.$props) : state; if (this.getDerivedStateFromProps) { const s2 = this.getDerivedStateFromProps(getOptionProps(this), _extends$1(_extends$1({}, this.$data), newState)); if (s2 === null) { return; } else { newState = _extends$1(_extends$1({}, newState), s2 || {}); } } _extends$1(this.$data, newState); if (this._.isMounted) { this.$forceUpdate(); } nextTick(() => { callback && callback(); }); }, __emit() { const args = [].slice.call(arguments, 0); let eventName = args[0]; eventName = `on${eventName[0].toUpperCase()}${eventName.substring(1)}`; const event = this.$props[eventName] || this.$attrs[eventName]; if (args.length && event) { if (Array.isArray(event)) { for (let i2 = 0, l2 = event.length; i2 < l2; i2++) { event[i2](...args.slice(1)); } } else { event(...args.slice(1)); } } } } }; const PortalContextKey = Symbol("PortalContextKey"); const useProvidePortal = function(instance) { let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { inTriggerContext: true }; provide(PortalContextKey, { inTriggerContext: config.inTriggerContext, shouldRender: computed(() => { const { sPopupVisible, popupRef, forceRender, autoDestroy } = instance || {}; let shouldRender = false; if (sPopupVisible || popupRef || forceRender) { shouldRender = true; } if (!sPopupVisible && autoDestroy) { shouldRender = false; } return shouldRender; }) }); }; const useInjectPortal = () => { useProvidePortal({}, { inTriggerContext: false }); const portalContext = inject(PortalContextKey, { shouldRender: computed(() => false), inTriggerContext: false }); return { shouldRender: computed(() => portalContext.shouldRender.value || portalContext.inTriggerContext === false) }; }; const Portal$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Portal", inheritAttrs: false, props: { getContainer: PropTypes.func.isRequired, didUpdate: Function }, setup(props2, _ref) { let { slots } = _ref; let isSSR = true; let container; const { shouldRender } = useInjectPortal(); function setContainer() { if (shouldRender.value) { container = props2.getContainer(); } } onBeforeMount(() => { isSSR = false; setContainer(); }); onMounted(() => { if (container) return; setContainer(); }); const stopWatch = watch(shouldRender, () => { if (shouldRender.value && !container) { container = props2.getContainer(); } if (container) { stopWatch(); } }); onUpdated(() => { nextTick(() => { var _a; if (shouldRender.value) { (_a = props2.didUpdate) === null || _a === void 0 ? void 0 : _a.call(props2, props2); } }); }); return () => { var _a; if (!shouldRender.value) return null; if (isSSR) { return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); } return container ? createVNode(Teleport, { "to": container }, slots) : null; }; } }); let cached; function getScrollBarSize(fresh) { if (typeof document === "undefined") { return 0; } if (cached === void 0) { const inner = document.createElement("div"); inner.style.width = "100%"; inner.style.height = "200px"; const outer = document.createElement("div"); const outerStyle = outer.style; outerStyle.position = "absolute"; outerStyle.top = "0"; outerStyle.left = "0"; outerStyle.pointerEvents = "none"; outerStyle.visibility = "hidden"; outerStyle.width = "200px"; outerStyle.height = "150px"; outerStyle.overflow = "hidden"; outer.appendChild(inner); document.body.appendChild(outer); const widthContained = inner.offsetWidth; outer.style.overflow = "scroll"; let widthScroll = inner.offsetWidth; if (widthContained === widthScroll) { widthScroll = outer.clientWidth; } document.body.removeChild(outer); cached = widthContained - widthScroll; } return cached; } const UNIQUE_ID = `vc-util-locker-${Date.now()}`; let uuid$6 = 0; function isBodyOverflowing() { return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth; } function useScrollLocker(lock) { const mergedLock = computed(() => !!lock && !!lock.value); uuid$6 += 1; const id = `${UNIQUE_ID}_${uuid$6}`; watchEffect((onClear) => { if (!canUseDom$1()) { return; } if (mergedLock.value) { const scrollbarSize = getScrollBarSize(); const isOverflow = isBodyOverflowing(); updateCSS$1(` html body { overflow-y: hidden; ${isOverflow ? `width: calc(100% - ${scrollbarSize}px);` : ""} }`, id); } else { removeCSS(id); } onClear(() => { removeCSS(id); }); }, { flush: "post" }); } let openCount = 0; const supportDom = canUseDom$1(); const getParent = (getContainer2) => { if (!supportDom) { return null; } if (getContainer2) { if (typeof getContainer2 === "string") { return document.querySelectorAll(getContainer2)[0]; } if (typeof getContainer2 === "function") { return getContainer2(); } if (typeof getContainer2 === "object" && getContainer2 instanceof window.HTMLElement) { return getContainer2; } } return document.body; }; const Portal = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "PortalWrapper", inheritAttrs: false, props: { wrapperClassName: String, forceRender: { type: Boolean, default: void 0 }, getContainer: PropTypes.any, visible: { type: Boolean, default: void 0 }, autoLock: booleanType(), didUpdate: Function }, setup(props2, _ref) { let { slots } = _ref; const container = shallowRef(); const componentRef = shallowRef(); const rafId = shallowRef(); const triggerUpdate = shallowRef(1); const defaultContainer = canUseDom$1() && document.createElement("div"); const removeCurrentContainer = () => { var _a, _b; if (container.value === defaultContainer) { (_b = (_a = container.value) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(container.value); } container.value = null; }; let parent2 = null; const attachToParent = function() { let force = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; if (force || container.value && !container.value.parentNode) { parent2 = getParent(props2.getContainer); if (parent2) { parent2.appendChild(container.value); return true; } return false; } return true; }; const getContainer2 = () => { if (!supportDom) { return null; } if (!container.value) { container.value = defaultContainer; attachToParent(true); } setWrapperClassName(); return container.value; }; const setWrapperClassName = () => { const { wrapperClassName } = props2; if (container.value && wrapperClassName && wrapperClassName !== container.value.className) { container.value.className = wrapperClassName; } }; onUpdated(() => { setWrapperClassName(); attachToParent(); }); useScrollLocker(computed(() => { return props2.autoLock && props2.visible && canUseDom$1() && (container.value === document.body || container.value === defaultContainer); })); onMounted(() => { let init = false; watch([() => props2.visible, () => props2.getContainer], (_ref2, _ref3) => { let [visible, getContainer22] = _ref2; let [prevVisible, prevGetContainer] = _ref3; if (supportDom) { parent2 = getParent(props2.getContainer); if (parent2 === document.body) { if (visible && !prevVisible) { openCount += 1; } else if (init) { openCount -= 1; } } } if (init) { const getContainerIsFunc = typeof getContainer22 === "function" && typeof prevGetContainer === "function"; if (getContainerIsFunc ? getContainer22.toString() !== prevGetContainer.toString() : getContainer22 !== prevGetContainer) { removeCurrentContainer(); } } init = true; }, { immediate: true, flush: "post" }); nextTick(() => { if (!attachToParent()) { rafId.value = wrapperRaf(() => { triggerUpdate.value += 1; }); } }); }); onBeforeUnmount(() => { const { visible } = props2; if (supportDom && parent2 === document.body) { openCount = visible && openCount ? openCount - 1 : openCount; } removeCurrentContainer(); wrapperRaf.cancel(rafId.value); }); return () => { const { forceRender, visible } = props2; let portal = null; const childProps = { getOpenCount: () => openCount, getContainer: getContainer2 }; if (triggerUpdate.value && (forceRender || visible || componentRef.value)) { portal = createVNode(Portal$1, { "getContainer": getContainer2, "ref": componentRef, "didUpdate": props2.didUpdate }, { default: () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, childProps); } }); } return portal; }; } }); const ALL_HANDLERS = ["onClick", "onMousedown", "onTouchstart", "onMouseenter", "onMouseleave", "onFocus", "onBlur", "onContextmenu"]; const Trigger = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Trigger", mixins: [BaseMixin], inheritAttrs: false, props: triggerProps(), setup(props2) { const align = computed(() => { const { popupPlacement, popupAlign, builtinPlacements } = props2; if (popupPlacement && builtinPlacements) { return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign); } return popupAlign; }); const popupRef = shallowRef(null); const setPopupRef = (val) => { popupRef.value = val; }; return { vcTriggerContext: inject("vcTriggerContext", {}), popupRef, setPopupRef, triggerRef: shallowRef(null), align, focusTime: null, clickOutsideHandler: null, contextmenuOutsideHandler1: null, contextmenuOutsideHandler2: null, touchOutsideHandler: null, attachId: null, delayTimer: null, hasPopupMouseDown: false, preClickTime: null, preTouchTime: null, mouseDownTimeout: null, childOriginEvents: {} }; }, data() { const props2 = this.$props; let popupVisible; if (this.popupVisible !== void 0) { popupVisible = !!props2.popupVisible; } else { popupVisible = !!props2.defaultPopupVisible; } ALL_HANDLERS.forEach((h2) => { this[`fire${h2}`] = (e2) => { this.fireEvents(h2, e2); }; }); return { prevPopupVisible: popupVisible, sPopupVisible: popupVisible, point: null }; }, watch: { popupVisible(val) { if (val !== void 0) { this.prevPopupVisible = this.sPopupVisible; this.sPopupVisible = val; } } }, created() { provide("vcTriggerContext", { onPopupMouseDown: this.onPopupMouseDown, onPopupMouseenter: this.onPopupMouseenter, onPopupMouseleave: this.onPopupMouseleave }); useProvidePortal(this); }, deactivated() { this.setPopupVisible(false); }, mounted() { this.$nextTick(() => { this.updatedCal(); }); }, updated() { this.$nextTick(() => { this.updatedCal(); }); }, beforeUnmount() { this.clearDelayTimer(); this.clearOutsideHandler(); clearTimeout(this.mouseDownTimeout); wrapperRaf.cancel(this.attachId); }, methods: { updatedCal() { const props2 = this.$props; const state = this.$data; if (state.sPopupVisible) { let currentDocument; if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextmenuToShow())) { currentDocument = props2.getDocument(this.getRootDomNode()); this.clickOutsideHandler = addEventListenerWrap(currentDocument, "mousedown", this.onDocumentClick); } if (!this.touchOutsideHandler) { currentDocument = currentDocument || props2.getDocument(this.getRootDomNode()); this.touchOutsideHandler = addEventListenerWrap(currentDocument, "touchstart", this.onDocumentClick, supportsPassive ? { passive: false } : false); } if (!this.contextmenuOutsideHandler1 && this.isContextmenuToShow()) { currentDocument = currentDocument || props2.getDocument(this.getRootDomNode()); this.contextmenuOutsideHandler1 = addEventListenerWrap(currentDocument, "scroll", this.onContextmenuClose); } if (!this.contextmenuOutsideHandler2 && this.isContextmenuToShow()) { this.contextmenuOutsideHandler2 = addEventListenerWrap(window, "blur", this.onContextmenuClose); } } else { this.clearOutsideHandler(); } }, onMouseenter(e2) { const { mouseEnterDelay } = this.$props; this.fireEvents("onMouseenter", e2); this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e2); }, onMouseMove(e2) { this.fireEvents("onMousemove", e2); this.setPoint(e2); }, onMouseleave(e2) { this.fireEvents("onMouseleave", e2); this.delaySetPopupVisible(false, this.$props.mouseLeaveDelay); }, onPopupMouseenter() { const { vcTriggerContext = {} } = this; if (vcTriggerContext.onPopupMouseenter) { vcTriggerContext.onPopupMouseenter(); } this.clearDelayTimer(); }, onPopupMouseleave(e2) { var _a; if (e2 && e2.relatedTarget && !e2.relatedTarget.setTimeout && contains$1((_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.getElement(), e2.relatedTarget)) { return; } if (this.isMouseLeaveToHide()) { this.delaySetPopupVisible(false, this.$props.mouseLeaveDelay); } const { vcTriggerContext = {} } = this; if (vcTriggerContext.onPopupMouseleave) { vcTriggerContext.onPopupMouseleave(e2); } }, onFocus(e2) { this.fireEvents("onFocus", e2); this.clearDelayTimer(); if (this.isFocusToShow()) { this.focusTime = Date.now(); this.delaySetPopupVisible(true, this.$props.focusDelay); } }, onMousedown(e2) { this.fireEvents("onMousedown", e2); this.preClickTime = Date.now(); }, onTouchstart(e2) { this.fireEvents("onTouchstart", e2); this.preTouchTime = Date.now(); }, onBlur(e2) { if (!contains$1(e2.target, e2.relatedTarget || document.activeElement)) { this.fireEvents("onBlur", e2); this.clearDelayTimer(); if (this.isBlurToHide()) { this.delaySetPopupVisible(false, this.$props.blurDelay); } } }, onContextmenu(e2) { e2.preventDefault(); this.fireEvents("onContextmenu", e2); this.setPopupVisible(true, e2); }, onContextmenuClose() { if (this.isContextmenuToShow()) { this.close(); } }, onClick(event) { this.fireEvents("onClick", event); if (this.focusTime) { let preTime; if (this.preClickTime && this.preTouchTime) { preTime = Math.min(this.preClickTime, this.preTouchTime); } else if (this.preClickTime) { preTime = this.preClickTime; } else if (this.preTouchTime) { preTime = this.preTouchTime; } if (Math.abs(preTime - this.focusTime) < 20) { return; } this.focusTime = 0; } this.preClickTime = 0; this.preTouchTime = 0; if (this.isClickToShow() && (this.isClickToHide() || this.isBlurToHide()) && event && event.preventDefault) { event.preventDefault(); } if (event && event.domEvent) { event.domEvent.preventDefault(); } const nextVisible = !this.$data.sPopupVisible; if (this.isClickToHide() && !nextVisible || nextVisible && this.isClickToShow()) { this.setPopupVisible(!this.$data.sPopupVisible, event); } }, onPopupMouseDown() { const { vcTriggerContext = {} } = this; this.hasPopupMouseDown = true; clearTimeout(this.mouseDownTimeout); this.mouseDownTimeout = setTimeout(() => { this.hasPopupMouseDown = false; }, 0); if (vcTriggerContext.onPopupMouseDown) { vcTriggerContext.onPopupMouseDown(...arguments); } }, onDocumentClick(event) { if (this.$props.mask && !this.$props.maskClosable) { return; } const target = event.target; const root2 = this.getRootDomNode(); const popupNode = this.getPopupDomNode(); if ( // mousedown on the target should also close popup when action is contextMenu. // https://github.com/ant-design/ant-design/issues/29853 (!contains$1(root2, target) || this.isContextMenuOnly()) && !contains$1(popupNode, target) && !this.hasPopupMouseDown ) { this.delaySetPopupVisible(false, 0.1); } }, getPopupDomNode() { var _a; return ((_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.getElement()) || null; }, getRootDomNode() { var _a, _b, _c, _d; const { getTriggerDOMNode } = this.$props; if (getTriggerDOMNode) { const domNode = ((_b = (_a = this.triggerRef) === null || _a === void 0 ? void 0 : _a.$el) === null || _b === void 0 ? void 0 : _b.nodeName) === "#comment" ? null : findDOMNode(this.triggerRef); return findDOMNode(getTriggerDOMNode(domNode)); } try { const domNode = ((_d = (_c = this.triggerRef) === null || _c === void 0 ? void 0 : _c.$el) === null || _d === void 0 ? void 0 : _d.nodeName) === "#comment" ? null : findDOMNode(this.triggerRef); if (domNode) { return domNode; } } catch (err) { } return findDOMNode(this); }, handleGetPopupClassFromAlign(align) { const className = []; const props2 = this.$props; const { popupPlacement, builtinPlacements, prefixCls, alignPoint: alignPoint2, getPopupClassNameFromAlign } = props2; if (popupPlacement && builtinPlacements) { className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint2)); } if (getPopupClassNameFromAlign) { className.push(getPopupClassNameFromAlign(align)); } return className.join(" "); }, getPopupAlign() { const props2 = this.$props; const { popupPlacement, popupAlign, builtinPlacements } = props2; if (popupPlacement && builtinPlacements) { return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign); } return popupAlign; }, getComponent() { const mouseProps = {}; if (this.isMouseEnterToShow()) { mouseProps.onMouseenter = this.onPopupMouseenter; } if (this.isMouseLeaveToHide()) { mouseProps.onMouseleave = this.onPopupMouseleave; } mouseProps.onMousedown = this.onPopupMouseDown; mouseProps[supportsPassive ? "onTouchstartPassive" : "onTouchstart"] = this.onPopupMouseDown; const { handleGetPopupClassFromAlign, getRootDomNode, $attrs } = this; const { prefixCls, destroyPopupOnHide, popupClassName, popupAnimation, popupTransitionName, popupStyle, mask, maskAnimation, maskTransitionName, zIndex, stretch, alignPoint: alignPoint2, mobile, arrow, forceRender } = this.$props; const { sPopupVisible, point } = this.$data; const popupProps2 = _extends$1(_extends$1({ prefixCls, arrow, destroyPopupOnHide, visible: sPopupVisible, point: alignPoint2 ? point : null, align: this.align, animation: popupAnimation, getClassNameFromAlign: handleGetPopupClassFromAlign, stretch, getRootDomNode, mask, zIndex, transitionName: popupTransitionName, maskAnimation, maskTransitionName, class: popupClassName, style: popupStyle, onAlign: $attrs.onPopupAlign || noop$3 }, mouseProps), { ref: this.setPopupRef, mobile, forceRender }); return createVNode(Popup, popupProps2, { default: this.$slots.popup || (() => getComponent(this, "popup")) }); }, attachParent(popupContainer) { wrapperRaf.cancel(this.attachId); const { getPopupContainer, getDocument: getDocument2 } = this.$props; const domNode = this.getRootDomNode(); let mountNode; if (!getPopupContainer) { mountNode = getDocument2(this.getRootDomNode()).body; } else if (domNode || getPopupContainer.length === 0) { mountNode = getPopupContainer(domNode); } if (mountNode) { mountNode.appendChild(popupContainer); } else { this.attachId = wrapperRaf(() => { this.attachParent(popupContainer); }); } }, getContainer() { const { $props: props2 } = this; const { getDocument: getDocument2 } = props2; const popupContainer = getDocument2(this.getRootDomNode()).createElement("div"); popupContainer.style.position = "absolute"; popupContainer.style.top = "0"; popupContainer.style.left = "0"; popupContainer.style.width = "100%"; this.attachParent(popupContainer); return popupContainer; }, setPopupVisible(sPopupVisible, event) { const { alignPoint: alignPoint2, sPopupVisible: prevPopupVisible, onPopupVisibleChange } = this; this.clearDelayTimer(); if (prevPopupVisible !== sPopupVisible) { if (!hasProp(this, "popupVisible")) { this.setState({ sPopupVisible, prevPopupVisible }); } onPopupVisibleChange && onPopupVisibleChange(sPopupVisible); } if (alignPoint2 && event && sPopupVisible) { this.setPoint(event); } }, setPoint(point) { const { alignPoint: alignPoint2 } = this.$props; if (!alignPoint2 || !point) return; this.setState({ point: { pageX: point.pageX, pageY: point.pageY } }); }, handlePortalUpdate() { if (this.prevPopupVisible !== this.sPopupVisible) { this.afterPopupVisibleChange(this.sPopupVisible); } }, delaySetPopupVisible(visible, delayS, event) { const delay = delayS * 1e3; this.clearDelayTimer(); if (delay) { const point = event ? { pageX: event.pageX, pageY: event.pageY } : null; this.delayTimer = setTimeout(() => { this.setPopupVisible(visible, point); this.clearDelayTimer(); }, delay); } else { this.setPopupVisible(visible, event); } }, clearDelayTimer() { if (this.delayTimer) { clearTimeout(this.delayTimer); this.delayTimer = null; } }, clearOutsideHandler() { if (this.clickOutsideHandler) { this.clickOutsideHandler.remove(); this.clickOutsideHandler = null; } if (this.contextmenuOutsideHandler1) { this.contextmenuOutsideHandler1.remove(); this.contextmenuOutsideHandler1 = null; } if (this.contextmenuOutsideHandler2) { this.contextmenuOutsideHandler2.remove(); this.contextmenuOutsideHandler2 = null; } if (this.touchOutsideHandler) { this.touchOutsideHandler.remove(); this.touchOutsideHandler = null; } }, createTwoChains(event) { let fn = () => { }; const events = getEvents(this); if (this.childOriginEvents[event] && events[event]) { return this[`fire${event}`]; } fn = this.childOriginEvents[event] || events[event] || fn; return fn; }, isClickToShow() { const { action, showAction } = this.$props; return action.indexOf("click") !== -1 || showAction.indexOf("click") !== -1; }, isContextMenuOnly() { const { action } = this.$props; return action === "contextmenu" || action.length === 1 && action[0] === "contextmenu"; }, isContextmenuToShow() { const { action, showAction } = this.$props; return action.indexOf("contextmenu") !== -1 || showAction.indexOf("contextmenu") !== -1; }, isClickToHide() { const { action, hideAction } = this.$props; return action.indexOf("click") !== -1 || hideAction.indexOf("click") !== -1; }, isMouseEnterToShow() { const { action, showAction } = this.$props; return action.indexOf("hover") !== -1 || showAction.indexOf("mouseenter") !== -1; }, isMouseLeaveToHide() { const { action, hideAction } = this.$props; return action.indexOf("hover") !== -1 || hideAction.indexOf("mouseleave") !== -1; }, isFocusToShow() { const { action, showAction } = this.$props; return action.indexOf("focus") !== -1 || showAction.indexOf("focus") !== -1; }, isBlurToHide() { const { action, hideAction } = this.$props; return action.indexOf("focus") !== -1 || hideAction.indexOf("blur") !== -1; }, forcePopupAlign() { var _a; if (this.$data.sPopupVisible) { (_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.forceAlign(); } }, fireEvents(type, e2) { if (this.childOriginEvents[type]) { this.childOriginEvents[type](e2); } const event = this.$props[type] || this.$attrs[type]; if (event) { event(e2); } }, close() { this.setPopupVisible(false); } }, render() { const { $attrs } = this; const children = filterEmpty(getSlot(this)); const { alignPoint: alignPoint2, getPopupContainer } = this.$props; const child = children[0]; this.childOriginEvents = getEvents(child); const newChildProps = { key: "trigger" }; if (this.isContextmenuToShow()) { newChildProps.onContextmenu = this.onContextmenu; } else { newChildProps.onContextmenu = this.createTwoChains("onContextmenu"); } if (this.isClickToHide() || this.isClickToShow()) { newChildProps.onClick = this.onClick; newChildProps.onMousedown = this.onMousedown; newChildProps[supportsPassive ? "onTouchstartPassive" : "onTouchstart"] = this.onTouchstart; } else { newChildProps.onClick = this.createTwoChains("onClick"); newChildProps.onMousedown = this.createTwoChains("onMousedown"); newChildProps[supportsPassive ? "onTouchstartPassive" : "onTouchstart"] = this.createTwoChains("onTouchstart"); } if (this.isMouseEnterToShow()) { newChildProps.onMouseenter = this.onMouseenter; if (alignPoint2) { newChildProps.onMousemove = this.onMouseMove; } } else { newChildProps.onMouseenter = this.createTwoChains("onMouseenter"); } if (this.isMouseLeaveToHide()) { newChildProps.onMouseleave = this.onMouseleave; } else { newChildProps.onMouseleave = this.createTwoChains("onMouseleave"); } if (this.isFocusToShow() || this.isBlurToHide()) { newChildProps.onFocus = this.onFocus; newChildProps.onBlur = this.onBlur; } else { newChildProps.onFocus = this.createTwoChains("onFocus"); newChildProps.onBlur = (e2) => { if (e2 && (!e2.relatedTarget || !contains$1(e2.target, e2.relatedTarget))) { this.createTwoChains("onBlur")(e2); } }; } const childrenClassName = classNames(child && child.props && child.props.class, $attrs.class); if (childrenClassName) { newChildProps.class = childrenClassName; } const trigger2 = cloneElement(child, _extends$1(_extends$1({}, newChildProps), { ref: "triggerRef" }), true, true); const portal = createVNode(Portal, { "key": "portal", "getContainer": getPopupContainer && (() => getPopupContainer(this.getRootDomNode())), "didUpdate": this.handlePortalUpdate, "visible": this.$data.sPopupVisible }, { default: this.getComponent }); return createVNode(Fragment, null, [trigger2, portal]); } }); var __rest$s = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const getBuiltInPlacements = (dropdownMatchSelectWidth) => { const adjustX = dropdownMatchSelectWidth === true ? 0 : 1; return { bottomLeft: { points: ["tl", "bl"], offset: [0, 4], overflow: { adjustX, adjustY: 1 } }, bottomRight: { points: ["tr", "br"], offset: [0, 4], overflow: { adjustX, adjustY: 1 } }, topLeft: { points: ["bl", "tl"], offset: [0, -4], overflow: { adjustX, adjustY: 1 } }, topRight: { points: ["br", "tr"], offset: [0, -4], overflow: { adjustX, adjustY: 1 } } }; }; const SelectTrigger = /* @__PURE__ */ defineComponent({ name: "SelectTrigger", inheritAttrs: false, props: { dropdownAlign: Object, visible: { type: Boolean, default: void 0 }, disabled: { type: Boolean, default: void 0 }, dropdownClassName: String, dropdownStyle: PropTypes.object, placement: String, empty: { type: Boolean, default: void 0 }, prefixCls: String, popupClassName: String, animation: String, transitionName: String, getPopupContainer: Function, dropdownRender: Function, containerWidth: Number, dropdownMatchSelectWidth: PropTypes.oneOfType([Number, Boolean]).def(true), popupElement: PropTypes.any, direction: String, getTriggerDOMNode: Function, onPopupVisibleChange: Function, onPopupMouseEnter: Function, onPopupFocusin: Function, onPopupFocusout: Function }, setup(props2, _ref) { let { slots, attrs, expose } = _ref; const builtInPlacements = computed(() => { const { dropdownMatchSelectWidth } = props2; return getBuiltInPlacements(dropdownMatchSelectWidth); }); const popupRef = ref(); expose({ getPopupElement: () => { return popupRef.value; } }); return () => { const _a = _extends$1(_extends$1({}, props2), attrs), { empty = false } = _a, restProps = __rest$s(_a, ["empty"]); const { visible, dropdownAlign, prefixCls, popupElement, dropdownClassName, dropdownStyle, direction = "ltr", placement, dropdownMatchSelectWidth, containerWidth, dropdownRender, animation, transitionName: transitionName2, getPopupContainer, getTriggerDOMNode, onPopupVisibleChange, onPopupMouseEnter, onPopupFocusin, onPopupFocusout } = restProps; const dropdownPrefixCls = `${prefixCls}-dropdown`; let popupNode = popupElement; if (dropdownRender) { popupNode = dropdownRender({ menuNode: popupElement, props: props2 }); } const mergedTransitionName = animation ? `${dropdownPrefixCls}-${animation}` : transitionName2; const popupStyle = _extends$1({ minWidth: `${containerWidth}px` }, dropdownStyle); if (typeof dropdownMatchSelectWidth === "number") { popupStyle.width = `${dropdownMatchSelectWidth}px`; } else if (dropdownMatchSelectWidth) { popupStyle.width = `${containerWidth}px`; } return createVNode(Trigger, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "showAction": onPopupVisibleChange ? ["click"] : [], "hideAction": onPopupVisibleChange ? ["click"] : [], "popupPlacement": placement || (direction === "rtl" ? "bottomRight" : "bottomLeft"), "builtinPlacements": builtInPlacements.value, "prefixCls": dropdownPrefixCls, "popupTransitionName": mergedTransitionName, "popupAlign": dropdownAlign, "popupVisible": visible, "getPopupContainer": getPopupContainer, "popupClassName": classNames(dropdownClassName, { [`${dropdownPrefixCls}-empty`]: empty }), "popupStyle": popupStyle, "getTriggerDOMNode": getTriggerDOMNode, "onPopupVisibleChange": onPopupVisibleChange }), { default: slots.default, popup: () => createVNode("div", { "ref": popupRef, "onMouseenter": onPopupMouseEnter, "onFocusin": onPopupFocusin, "onFocusout": onPopupFocusout }, [popupNode]) }); }; } }); const KeyCode = { /** * BACKSPACE */ BACKSPACE: 8, /** * TAB */ TAB: 9, /** * ENTER */ ENTER: 13, /** * SHIFT */ SHIFT: 16, /** * CTRL */ CTRL: 17, /** * ALT */ ALT: 18, /** * CAPS_LOCK */ CAPS_LOCK: 20, /** * ESC */ ESC: 27, /** * SPACE */ SPACE: 32, /** * PAGE_UP */ PAGE_UP: 33, /** * PAGE_DOWN */ PAGE_DOWN: 34, /** * END */ END: 35, /** * HOME */ HOME: 36, /** * LEFT */ LEFT: 37, /** * UP */ UP: 38, /** * RIGHT */ RIGHT: 39, /** * DOWN */ DOWN: 40, /** * N */ N: 78, /** * P */ P: 80, /** * META */ META: 91, /** * WIN_KEY_RIGHT */ WIN_KEY_RIGHT: 92, /** * CONTEXT_MENU */ CONTEXT_MENU: 93, /** * F1 */ F1: 112, /** * F2 */ F2: 113, /** * F3 */ F3: 114, /** * F4 */ F4: 115, /** * F5 */ F5: 116, /** * F6 */ F6: 117, /** * F7 */ F7: 118, /** * F8 */ F8: 119, /** * F9 */ F9: 120, /** * F10 */ F10: 121, /** * F11 */ F11: 122, /** * F12 */ F12: 123, /** * SEMICOLON */ SEMICOLON: 186, /** * EQUALS */ EQUALS: 187, /** * WIN_KEY */ WIN_KEY: 224 }; const TransBtn = (props2, _ref) => { let { slots } = _ref; var _a; const { class: className, customizeIcon, customizeIconProps, onMousedown, onClick } = props2; let icon; if (typeof customizeIcon === "function") { icon = customizeIcon(customizeIconProps); } else { icon = isVNode(customizeIcon) ? cloneVNode(customizeIcon) : customizeIcon; } return createVNode("span", { "class": className, "onMousedown": (event) => { event.preventDefault(); if (onMousedown) { onMousedown(event); } }, "style": { userSelect: "none", WebkitUserSelect: "none" }, "unselectable": "on", "onClick": onClick, "aria-hidden": true }, [icon !== void 0 ? icon : createVNode("span", { "class": className.split(/\s+/).map((cls) => `${cls}-icon`) }, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])]); }; TransBtn.inheritAttrs = false; TransBtn.displayName = "TransBtn"; TransBtn.props = { class: String, customizeIcon: PropTypes.any, customizeIconProps: PropTypes.any, onMousedown: Function, onClick: Function }; var __rest$r = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const BaseInputInner = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, // inheritAttrs: false, props: { disabled: PropTypes.looseBool, type: PropTypes.string, value: PropTypes.any, tag: { type: String, default: "input" }, size: PropTypes.string, onChange: Function, onInput: Function, onBlur: Function, onFocus: Function, onKeydown: Function, onCompositionstart: Function, onCompositionend: Function, onKeyup: Function, onPaste: Function, onMousedown: Function }, emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"], setup(props2, _ref) { let { expose } = _ref; const inputRef = shallowRef(null); const focus = () => { if (inputRef.value) { inputRef.value.focus(); } }; const blur = () => { if (inputRef.value) { inputRef.value.blur(); } }; const setSelectionRange = (start, end, direction) => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end, direction); }; const select = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.select(); }; expose({ focus, blur, input: inputRef, setSelectionRange, select, getSelectionStart: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.selectionStart; }, getSelectionEnd: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.selectionEnd; }, getScrollTop: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.scrollTop; } }); return () => { const { tag: Tag, value } = props2, restProps = __rest$r(props2, ["tag", "value"]); return createVNode(Tag, _objectSpread2$1(_objectSpread2$1({}, restProps), {}, { "ref": inputRef, "value": value }), null); }; } }); function getClientSize() { const width = document.documentElement.clientWidth; const height = window.innerHeight || document.documentElement.clientHeight; return { width, height }; } function getOffset(node2) { const box2 = node2.getBoundingClientRect(); const docElem = document.documentElement; return { left: box2.left + (window.scrollX || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0), top: box2.top + (window.scrollY || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0) }; } function styleObjectToString(style) { return Object.keys(style).reduce((acc, name) => { const styleValue = style[name]; if (typeof styleValue === "undefined" || styleValue === null) { return acc; } acc += `${name}: ${style[name]};`; return acc; }, ""); } var __rest$q = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const BaseInput$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, inheritAttrs: false, props: { disabled: PropTypes.looseBool, type: PropTypes.string, value: PropTypes.any, lazy: PropTypes.bool.def(true), tag: { type: String, default: "input" }, size: PropTypes.string, style: PropTypes.oneOfType([String, Object]), class: PropTypes.string }, emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"], setup(props2, _ref) { let { emit: emit2, attrs, expose } = _ref; const inputRef = shallowRef(null); const renderValue = ref(); const isComposing = ref(false); watch([() => props2.value, isComposing], () => { if (isComposing.value) return; renderValue.value = props2.value; }, { immediate: true }); const handleChange = (e2) => { emit2("change", e2); }; const onCompositionstart = (e2) => { isComposing.value = true; e2.target.composing = true; emit2("compositionstart", e2); }; const onCompositionend = (e2) => { isComposing.value = false; e2.target.composing = false; emit2("compositionend", e2); const event = document.createEvent("HTMLEvents"); event.initEvent("input", true, true); e2.target.dispatchEvent(event); handleChange(e2); }; const handleInput = (e2) => { if (isComposing.value && props2.lazy) { renderValue.value = e2.target.value; return; } emit2("input", e2); }; const handleBlur = (e2) => { emit2("blur", e2); }; const handleFocus = (e2) => { emit2("focus", e2); }; const focus = () => { if (inputRef.value) { inputRef.value.focus(); } }; const blur = () => { if (inputRef.value) { inputRef.value.blur(); } }; const handleKeyDown = (e2) => { emit2("keydown", e2); }; const handleKeyUp = (e2) => { emit2("keyup", e2); }; const setSelectionRange = (start, end, direction) => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end, direction); }; const select = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.select(); }; expose({ focus, blur, input: computed(() => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.input; }), setSelectionRange, select, getSelectionStart: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.getSelectionStart(); }, getSelectionEnd: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.getSelectionEnd(); }, getScrollTop: () => { var _a; return (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.getScrollTop(); } }); const handleMousedown = (e2) => { emit2("mousedown", e2); }; const handlePaste = (e2) => { emit2("paste", e2); }; const styleString = computed(() => { return props2.style && typeof props2.style !== "string" ? styleObjectToString(props2.style) : props2.style; }); return () => { const { style, lazy } = props2, restProps = __rest$q(props2, ["style", "lazy"]); return createVNode(BaseInputInner, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, restProps), attrs), {}, { "style": styleString.value, "onInput": handleInput, "onChange": handleChange, "onBlur": handleBlur, "onFocus": handleFocus, "ref": inputRef, "value": renderValue.value, "onCompositionstart": onCompositionstart, "onCompositionend": onCompositionend, "onKeyup": handleKeyUp, "onKeydown": handleKeyDown, "onPaste": handlePaste, "onMousedown": handleMousedown }), null); }; } }); const inputProps$2 = { inputRef: PropTypes.any, prefixCls: String, id: String, inputElement: PropTypes.VueNode, disabled: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, editable: { type: Boolean, default: void 0 }, activeDescendantId: String, value: String, open: { type: Boolean, default: void 0 }, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** Pass accessibility props to input */ attrs: PropTypes.object, onKeydown: { type: Function }, onMousedown: { type: Function }, onChange: { type: Function }, onPaste: { type: Function }, onCompositionstart: { type: Function }, onCompositionend: { type: Function }, onFocus: { type: Function }, onBlur: { type: Function } }; const Input$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "SelectInput", inheritAttrs: false, props: inputProps$2, setup(props2) { let blurTimeout = null; const VCSelectContainerEvent = inject("VCSelectContainerEvent"); return () => { var _a; const { prefixCls, id, inputElement, disabled, tabindex, autofocus, autocomplete, editable, activeDescendantId, value, onKeydown, onMousedown, onChange, onPaste, onCompositionstart, onCompositionend, onFocus, onBlur, open: open2, inputRef, attrs } = props2; let inputNode = inputElement || createVNode(BaseInput$1, null, null); const inputProps2 = inputNode.props || {}; const { onKeydown: onOriginKeyDown, onInput: onOriginInput, onFocus: onOriginFocus, onBlur: onOriginBlur, onMousedown: onOriginMouseDown, onCompositionstart: onOriginCompositionStart, onCompositionend: onOriginCompositionEnd, style } = inputProps2; inputNode = cloneElement(inputNode, _extends$1(_extends$1(_extends$1(_extends$1(_extends$1({ type: "search" }, inputProps2), { id, ref: inputRef, disabled, tabindex, lazy: false, autocomplete: autocomplete || "off", autofocus, class: classNames(`${prefixCls}-selection-search-input`, (_a = inputNode === null || inputNode === void 0 ? void 0 : inputNode.props) === null || _a === void 0 ? void 0 : _a.class), role: "combobox", "aria-expanded": open2, "aria-haspopup": "listbox", "aria-owns": `${id}_list`, "aria-autocomplete": "list", "aria-controls": `${id}_list`, "aria-activedescendant": activeDescendantId }), attrs), { value: editable ? value : "", readonly: !editable, unselectable: !editable ? "on" : null, style: _extends$1(_extends$1({}, style), { opacity: editable ? null : 0 }), onKeydown: (event) => { onKeydown(event); if (onOriginKeyDown) { onOriginKeyDown(event); } }, onMousedown: (event) => { onMousedown(event); if (onOriginMouseDown) { onOriginMouseDown(event); } }, onInput: (event) => { onChange(event); if (onOriginInput) { onOriginInput(event); } }, onCompositionstart(event) { onCompositionstart(event); if (onOriginCompositionStart) { onOriginCompositionStart(event); } }, onCompositionend(event) { onCompositionend(event); if (onOriginCompositionEnd) { onOriginCompositionEnd(event); } }, onPaste, onFocus: function() { clearTimeout(blurTimeout); onOriginFocus && onOriginFocus(arguments.length <= 0 ? void 0 : arguments[0]); onFocus && onFocus(arguments.length <= 0 ? void 0 : arguments[0]); VCSelectContainerEvent === null || VCSelectContainerEvent === void 0 ? void 0 : VCSelectContainerEvent.focus(arguments.length <= 0 ? void 0 : arguments[0]); }, onBlur: function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } blurTimeout = setTimeout(() => { onOriginBlur && onOriginBlur(args[0]); onBlur && onBlur(args[0]); VCSelectContainerEvent === null || VCSelectContainerEvent === void 0 ? void 0 : VCSelectContainerEvent.blur(args[0]); }, 100); } }), inputNode.type === "textarea" ? {} : { type: "search" }), true, true); return inputNode; }; } }); const attributes = `accept acceptcharset accesskey action allowfullscreen allowtransparency alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge charset checked classid classname colspan cols content contenteditable contextmenu controls coords crossorigin data datetime default defer dir disabled download draggable enctype form formaction formenctype formmethod formnovalidate formtarget frameborder headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media mediagroup method min minlength multiple muted name novalidate nonce open optimum pattern placeholder poster preload radiogroup readonly rel required reversed role rowspan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellcheck src srcdoc srclang srcset start step style summary tabindex target title type usemap value width wmode wrap`; const eventsName = `onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`; const propList = `${attributes} ${eventsName}`.split(/[\s\n]+/); const ariaPrefix = "aria-"; const dataPrefix = "data-"; function match(key2, prefix) { return key2.indexOf(prefix) === 0; } function pickAttrs(props2) { let ariaOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; let mergedConfig; if (ariaOnly === false) { mergedConfig = { aria: true, data: true, attr: true }; } else if (ariaOnly === true) { mergedConfig = { aria: true }; } else { mergedConfig = _extends$1({}, ariaOnly); } const attrs = {}; Object.keys(props2).forEach((key2) => { if ( // Aria mergedConfig.aria && (key2 === "role" || match(key2, ariaPrefix)) || // Data mergedConfig.data && match(key2, dataPrefix) || // Attr mergedConfig.attr && (propList.includes(key2) || propList.includes(key2.toLowerCase())) ) { attrs[key2] = props2[key2]; } }); return attrs; } const OverflowContextProviderKey = Symbol("OverflowContextProviderKey"); const OverflowContextProvider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "OverflowContextProvider", inheritAttrs: false, props: { value: { type: Object } }, setup(props2, _ref) { let { slots } = _ref; provide(OverflowContextProviderKey, computed(() => props2.value)); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const useInjectOverflowContext = () => { return inject(OverflowContextProviderKey, computed(() => null)); }; var __rest$p = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const UNDEFINED = void 0; const Item$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Item", props: { prefixCls: String, item: PropTypes.any, renderItem: Function, responsive: Boolean, itemKey: { type: [String, Number] }, registerSize: Function, display: Boolean, order: Number, component: PropTypes.any, invalidate: Boolean }, setup(props2, _ref) { let { slots, expose } = _ref; const mergedHidden = computed(() => props2.responsive && !props2.display); const itemNodeRef = ref(); expose({ itemNodeRef }); function internalRegisterSize(width) { props2.registerSize(props2.itemKey, width); } onUnmounted(() => { internalRegisterSize(null); }); return () => { var _a; const { prefixCls, invalidate, item, renderItem, responsive, registerSize, itemKey, display, order, component: Component = "div" } = props2, restProps = __rest$p(props2, ["prefixCls", "invalidate", "item", "renderItem", "responsive", "registerSize", "itemKey", "display", "order", "component"]); const children = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); const childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children; let overflowStyle; if (!invalidate) { overflowStyle = { opacity: mergedHidden.value ? 0 : 1, height: mergedHidden.value ? 0 : UNDEFINED, overflowY: mergedHidden.value ? "hidden" : UNDEFINED, order: responsive ? order : UNDEFINED, pointerEvents: mergedHidden.value ? "none" : UNDEFINED, position: mergedHidden.value ? "absolute" : UNDEFINED }; } const overflowProps2 = {}; if (mergedHidden.value) { overflowProps2["aria-hidden"] = true; } return createVNode(ResizeObserver$1, { "disabled": !responsive, "onResize": (_ref2) => { let { offsetWidth } = _ref2; internalRegisterSize(offsetWidth); } }, { default: () => createVNode(Component, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ "class": classNames(!invalidate && prefixCls), "style": overflowStyle }, overflowProps2), restProps), {}, { "ref": itemNodeRef }), { default: () => [childNode] }) }); }; } }); var __rest$o = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const RawItem = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "RawItem", inheritAttrs: false, props: { component: PropTypes.any, title: PropTypes.any, id: String, onMouseenter: { type: Function }, onMouseleave: { type: Function }, onClick: { type: Function }, onKeydown: { type: Function }, onFocus: { type: Function }, role: String, tabindex: Number }, setup(props2, _ref) { let { slots, attrs } = _ref; const context2 = useInjectOverflowContext(); return () => { var _a; if (!context2.value) { const { component: Component = "div" } = props2, restProps2 = __rest$o(props2, ["component"]); return createVNode(Component, _objectSpread2$1(_objectSpread2$1({}, restProps2), attrs), { default: () => [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)] }); } const _b = context2.value, { className: contextClassName } = _b, restContext = __rest$o(_b, ["className"]); const { class: className } = attrs, restProps = __rest$o(attrs, ["class"]); return createVNode(OverflowContextProvider, { "value": null }, { default: () => [createVNode(Item$1, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ "class": classNames(contextClassName, className) }, restContext), restProps), props2), slots)] }); }; } }); var __rest$n = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const RESPONSIVE = "responsive"; const INVALIDATE = "invalidate"; function defaultRenderRest(omittedItems) { return `+ ${omittedItems.length} ...`; } const overflowProps = () => { return { id: String, prefixCls: String, data: Array, itemKey: [String, Number, Function], /** Used for `responsive`. It will limit render node to avoid perf issue */ itemWidth: { type: Number, default: 10 }, renderItem: Function, /** @private Do not use in your production. Render raw node that need wrap Item by developer self */ renderRawItem: Function, maxCount: [Number, String], renderRest: Function, /** @private Do not use in your production. Render raw node that need wrap Item by developer self */ renderRawRest: Function, suffix: PropTypes.any, component: String, itemComponent: PropTypes.any, /** @private This API may be refactor since not well design */ onVisibleChange: Function, /** When set to `full`, ssr will render full items by default and remove at client side */ ssr: String, onMousedown: Function, role: String }; }; const Overflow = /* @__PURE__ */ defineComponent({ name: "Overflow", inheritAttrs: false, props: overflowProps(), emits: ["visibleChange"], setup(props2, _ref) { let { attrs, emit: emit2, slots } = _ref; const fullySSR = computed(() => props2.ssr === "full"); const containerWidth = shallowRef(null); const mergedContainerWidth = computed(() => containerWidth.value || 0); const itemWidths = shallowRef(/* @__PURE__ */ new Map()); const prevRestWidth = shallowRef(0); const restWidth = shallowRef(0); const suffixWidth = shallowRef(0); const suffixFixedStart = shallowRef(null); const displayCount = shallowRef(null); const mergedDisplayCount = computed(() => { if (displayCount.value === null && fullySSR.value) { return Number.MAX_SAFE_INTEGER; } return displayCount.value || 0; }); const restReady = shallowRef(false); const itemPrefixCls = computed(() => `${props2.prefixCls}-item`); const mergedRestWidth = computed(() => Math.max(prevRestWidth.value, restWidth.value)); const isResponsive = computed(() => !!(props2.data.length && props2.maxCount === RESPONSIVE)); const invalidate = computed(() => props2.maxCount === INVALIDATE); const showRest = computed(() => isResponsive.value || typeof props2.maxCount === "number" && props2.data.length > props2.maxCount); const mergedData = computed(() => { let items = props2.data; if (isResponsive.value) { if (containerWidth.value === null && fullySSR.value) { items = props2.data; } else { items = props2.data.slice(0, Math.min(props2.data.length, mergedContainerWidth.value / props2.itemWidth)); } } else if (typeof props2.maxCount === "number") { items = props2.data.slice(0, props2.maxCount); } return items; }); const omittedItems = computed(() => { if (isResponsive.value) { return props2.data.slice(mergedDisplayCount.value + 1); } return props2.data.slice(mergedData.value.length); }); const getKey2 = (item, index2) => { var _a; if (typeof props2.itemKey === "function") { return props2.itemKey(item); } return (_a = props2.itemKey && (item === null || item === void 0 ? void 0 : item[props2.itemKey])) !== null && _a !== void 0 ? _a : index2; }; const mergedRenderItem = computed(() => props2.renderItem || ((item) => item)); const updateDisplayCount = (count, notReady) => { displayCount.value = count; if (!notReady) { restReady.value = count < props2.data.length - 1; emit2("visibleChange", count); } }; const onOverflowResize = (_2, element) => { containerWidth.value = element.clientWidth; }; const registerSize = (key2, width) => { const clone = new Map(itemWidths.value); if (width === null) { clone.delete(key2); } else { clone.set(key2, width); } itemWidths.value = clone; }; const registerOverflowSize = (_2, width) => { prevRestWidth.value = restWidth.value; restWidth.value = width; }; const registerSuffixSize = (_2, width) => { suffixWidth.value = width; }; const getItemWidth = (index2) => { return itemWidths.value.get(getKey2(mergedData.value[index2], index2)); }; watch([mergedContainerWidth, itemWidths, restWidth, suffixWidth, () => props2.itemKey, mergedData], () => { if (mergedContainerWidth.value && mergedRestWidth.value && mergedData.value) { let totalWidth = suffixWidth.value; const len = mergedData.value.length; const lastIndex = len - 1; if (!len) { updateDisplayCount(0); suffixFixedStart.value = null; return; } for (let i2 = 0; i2 < len; i2 += 1) { const currentItemWidth = getItemWidth(i2); if (currentItemWidth === void 0) { updateDisplayCount(i2 - 1, true); break; } totalWidth += currentItemWidth; if ( // Only one means `totalWidth` is the final width lastIndex === 0 && totalWidth <= mergedContainerWidth.value || // Last two width will be the final width i2 === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth.value ) { updateDisplayCount(lastIndex); suffixFixedStart.value = null; break; } else if (totalWidth + mergedRestWidth.value > mergedContainerWidth.value) { updateDisplayCount(i2 - 1); suffixFixedStart.value = totalWidth - currentItemWidth - suffixWidth.value + restWidth.value; break; } } if (props2.suffix && getItemWidth(0) + suffixWidth.value > mergedContainerWidth.value) { suffixFixedStart.value = null; } } }); return () => { const displayRest = restReady.value && !!omittedItems.value.length; const { itemComponent, renderRawItem, renderRawRest, renderRest, prefixCls = "rc-overflow", suffix, component: Component = "div", id, onMousedown } = props2; const { class: className, style } = attrs, restAttrs = __rest$n(attrs, ["class", "style"]); let suffixStyle = {}; if (suffixFixedStart.value !== null && isResponsive.value) { suffixStyle = { position: "absolute", left: `${suffixFixedStart.value}px`, top: 0 }; } const itemSharedProps = { prefixCls: itemPrefixCls.value, responsive: isResponsive.value, component: itemComponent, invalidate: invalidate.value }; const internalRenderItemNode = renderRawItem ? (item, index2) => { const key2 = getKey2(item, index2); return createVNode(OverflowContextProvider, { "key": key2, "value": _extends$1(_extends$1({}, itemSharedProps), { order: index2, item, itemKey: key2, registerSize, display: index2 <= mergedDisplayCount.value }) }, { default: () => [renderRawItem(item, index2)] }); } : (item, index2) => { const key2 = getKey2(item, index2); return createVNode(Item$1, _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), {}, { "order": index2, "key": key2, "item": item, "renderItem": mergedRenderItem.value, "itemKey": key2, "registerSize": registerSize, "display": index2 <= mergedDisplayCount.value }), null); }; let restNode = () => null; const restContextProps = { order: displayRest ? mergedDisplayCount.value : Number.MAX_SAFE_INTEGER, className: `${itemPrefixCls.value} ${itemPrefixCls.value}-rest`, registerSize: registerOverflowSize, display: displayRest }; if (!renderRawRest) { const mergedRenderRest = renderRest || defaultRenderRest; restNode = () => createVNode(Item$1, _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), restContextProps), { default: () => typeof mergedRenderRest === "function" ? mergedRenderRest(omittedItems.value) : mergedRenderRest }); } else if (renderRawRest) { restNode = () => createVNode(OverflowContextProvider, { "value": _extends$1(_extends$1({}, itemSharedProps), restContextProps) }, { default: () => [renderRawRest(omittedItems.value)] }); } const overflowNode = () => { var _a; return createVNode(Component, _objectSpread2$1({ "id": id, "class": classNames(!invalidate.value && prefixCls, className), "style": style, "onMousedown": onMousedown, "role": props2.role }, restAttrs), { default: () => [mergedData.value.map(internalRenderItemNode), showRest.value ? restNode() : null, suffix && createVNode(Item$1, _objectSpread2$1(_objectSpread2$1({}, itemSharedProps), {}, { "order": mergedDisplayCount.value, "class": `${itemPrefixCls.value}-suffix`, "registerSize": registerSuffixSize, "display": true, "style": suffixStyle }), { default: () => suffix }), (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)] }); }; return createVNode(ResizeObserver$1, { "disabled": !isResponsive.value, "onResize": onOverflowResize }, { default: overflowNode }); }; } }); Overflow.Item = RawItem; Overflow.RESPONSIVE = RESPONSIVE; Overflow.INVALIDATE = INVALIDATE; const TreeSelectLegacyContextPropsKey = Symbol("TreeSelectLegacyContextPropsKey"); function useInjectLegacySelectContext() { return inject(TreeSelectLegacyContextPropsKey, {}); } const props$1 = { id: String, prefixCls: String, values: PropTypes.array, open: { type: Boolean, default: void 0 }, searchValue: String, inputRef: PropTypes.any, placeholder: PropTypes.any, disabled: { type: Boolean, default: void 0 }, mode: String, showSearch: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), compositionStatus: Boolean, removeIcon: PropTypes.any, choiceTransitionName: String, maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), maxTagTextLength: Number, maxTagPlaceholder: PropTypes.any.def(() => (omittedValues) => `+ ${omittedValues.length} ...`), tagRender: Function, onToggleOpen: { type: Function }, onRemove: Function, onInputChange: Function, onInputPaste: Function, onInputKeyDown: Function, onInputMouseDown: Function, onInputCompositionStart: Function, onInputCompositionEnd: Function }; const onPreventMouseDown = (event) => { event.preventDefault(); event.stopPropagation(); }; const SelectSelector = /* @__PURE__ */ defineComponent({ name: "MultipleSelectSelector", inheritAttrs: false, props: props$1, setup(props2) { const measureRef = shallowRef(); const inputWidth = shallowRef(0); const focused = shallowRef(false); const legacyTreeSelectContext = useInjectLegacySelectContext(); const selectionPrefixCls = computed(() => `${props2.prefixCls}-selection`); const inputValue = computed(() => props2.open || props2.mode === "tags" ? props2.searchValue : ""); const inputEditable = computed(() => props2.mode === "tags" || props2.showSearch && (props2.open || focused.value)); const targetValue = ref(""); watchEffect(() => { targetValue.value = inputValue.value; }); onMounted(() => { watch(targetValue, () => { inputWidth.value = measureRef.value.scrollWidth; }, { flush: "post", immediate: true }); }); function defaultRenderSelector(title, content, itemDisabled, closable, onClose) { return createVNode("span", { "class": classNames(`${selectionPrefixCls.value}-item`, { [`${selectionPrefixCls.value}-item-disabled`]: itemDisabled }), "title": typeof title === "string" || typeof title === "number" ? title.toString() : void 0 }, [createVNode("span", { "class": `${selectionPrefixCls.value}-item-content` }, [content]), closable && createVNode(TransBtn, { "class": `${selectionPrefixCls.value}-item-remove`, "onMousedown": onPreventMouseDown, "onClick": onClose, "customizeIcon": props2.removeIcon }, { default: () => [createTextVNode("×")] })]); } function customizeRenderSelector(value, content, itemDisabled, closable, onClose, option) { var _a; const onMouseDown = (e2) => { onPreventMouseDown(e2); props2.onToggleOpen(!open); }; let originData = option; if (legacyTreeSelectContext.keyEntities) { originData = ((_a = legacyTreeSelectContext.keyEntities[value]) === null || _a === void 0 ? void 0 : _a.node) || {}; } return createVNode("span", { "key": value, "onMousedown": onMouseDown }, [props2.tagRender({ label: content, value, disabled: itemDisabled, closable, onClose, option: originData })]); } function renderItem(valueItem) { const { disabled: itemDisabled, label, value, option } = valueItem; const closable = !props2.disabled && !itemDisabled; let displayLabel = label; if (typeof props2.maxTagTextLength === "number") { if (typeof label === "string" || typeof label === "number") { const strLabel = String(displayLabel); if (strLabel.length > props2.maxTagTextLength) { displayLabel = `${strLabel.slice(0, props2.maxTagTextLength)}...`; } } } const onClose = (event) => { var _a; if (event) event.stopPropagation(); (_a = props2.onRemove) === null || _a === void 0 ? void 0 : _a.call(props2, valueItem); }; return typeof props2.tagRender === "function" ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose, option) : defaultRenderSelector(label, displayLabel, itemDisabled, closable, onClose); } function renderRest(omittedValues) { const { maxTagPlaceholder = (omittedValues2) => `+ ${omittedValues2.length} ...` } = props2; const content = typeof maxTagPlaceholder === "function" ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder; return defaultRenderSelector(content, content, false); } const handleInput = (e2) => { const composing = e2.target.composing; targetValue.value = e2.target.value; if (!composing) { props2.onInputChange(e2); } }; return () => { const { id, prefixCls, values, open: open2, inputRef, placeholder, disabled, autofocus, autocomplete, activeDescendantId, tabindex, compositionStatus, onInputPaste, onInputKeyDown, onInputMouseDown, onInputCompositionStart, onInputCompositionEnd } = props2; const inputNode = createVNode("div", { "class": `${selectionPrefixCls.value}-search`, "style": { width: inputWidth.value + "px" }, "key": "input" }, [createVNode(Input$1, { "inputRef": inputRef, "open": open2, "prefixCls": prefixCls, "id": id, "inputElement": null, "disabled": disabled, "autofocus": autofocus, "autocomplete": autocomplete, "editable": inputEditable.value, "activeDescendantId": activeDescendantId, "value": targetValue.value, "onKeydown": onInputKeyDown, "onMousedown": onInputMouseDown, "onChange": handleInput, "onPaste": onInputPaste, "onCompositionstart": onInputCompositionStart, "onCompositionend": onInputCompositionEnd, "tabindex": tabindex, "attrs": pickAttrs(props2, true), "onFocus": () => focused.value = true, "onBlur": () => focused.value = false }, null), createVNode("span", { "ref": measureRef, "class": `${selectionPrefixCls.value}-search-mirror`, "aria-hidden": true }, [targetValue.value, createTextVNode(" ")])]); const selectionNode = createVNode(Overflow, { "prefixCls": `${selectionPrefixCls.value}-overflow`, "data": values, "renderItem": renderItem, "renderRest": renderRest, "suffix": inputNode, "itemKey": "key", "maxCount": props2.maxTagCount, "key": "overflow" }, null); return createVNode(Fragment, null, [selectionNode, !values.length && !inputValue.value && !compositionStatus && createVNode("span", { "class": `${selectionPrefixCls.value}-placeholder` }, [placeholder])]); }; } }); const props = { inputElement: PropTypes.any, id: String, prefixCls: String, values: PropTypes.array, open: { type: Boolean, default: void 0 }, searchValue: String, inputRef: PropTypes.any, placeholder: PropTypes.any, compositionStatus: { type: Boolean, default: void 0 }, disabled: { type: Boolean, default: void 0 }, mode: String, showSearch: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, autocomplete: String, activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), activeValue: String, backfill: { type: Boolean, default: void 0 }, optionLabelRender: Function, onInputChange: Function, onInputPaste: Function, onInputKeyDown: Function, onInputMouseDown: Function, onInputCompositionStart: Function, onInputCompositionEnd: Function }; const SingleSelector = /* @__PURE__ */ defineComponent({ name: "SingleSelector", setup(props2) { const inputChanged = shallowRef(false); const combobox = computed(() => props2.mode === "combobox"); const inputEditable = computed(() => combobox.value || props2.showSearch); const inputValue = computed(() => { let inputValue2 = props2.searchValue || ""; if (combobox.value && props2.activeValue && !inputChanged.value) { inputValue2 = props2.activeValue; } return inputValue2; }); const legacyTreeSelectContext = useInjectLegacySelectContext(); watch([combobox, () => props2.activeValue], () => { if (combobox.value) { inputChanged.value = false; } }, { immediate: true }); const hasTextInput = computed(() => props2.mode !== "combobox" && !props2.open && !props2.showSearch ? false : !!inputValue.value || props2.compositionStatus); const title = computed(() => { const item = props2.values[0]; return item && (typeof item.label === "string" || typeof item.label === "number") ? item.label.toString() : void 0; }); const renderPlaceholder = () => { if (props2.values[0]) { return null; } const hiddenStyle = hasTextInput.value ? { visibility: "hidden" } : void 0; return createVNode("span", { "class": `${props2.prefixCls}-selection-placeholder`, "style": hiddenStyle }, [props2.placeholder]); }; const handleInput = (e2) => { const composing = e2.target.composing; if (!composing) { inputChanged.value = true; props2.onInputChange(e2); } }; return () => { var _a, _b, _c, _d; const { inputElement, prefixCls, id, values, inputRef, disabled, autofocus, autocomplete, activeDescendantId, open: open2, tabindex, optionLabelRender, onInputKeyDown, onInputMouseDown, onInputPaste, onInputCompositionStart, onInputCompositionEnd } = props2; const item = values[0]; let titleNode = null; if (item && legacyTreeSelectContext.customSlots) { const key2 = (_a = item.key) !== null && _a !== void 0 ? _a : item.value; const originData = ((_b = legacyTreeSelectContext.keyEntities[key2]) === null || _b === void 0 ? void 0 : _b.node) || {}; titleNode = legacyTreeSelectContext.customSlots[(_c = originData.slots) === null || _c === void 0 ? void 0 : _c.title] || legacyTreeSelectContext.customSlots.title || item.label; if (typeof titleNode === "function") { titleNode = titleNode(originData); } } else { titleNode = optionLabelRender && item ? optionLabelRender(item.option) : item === null || item === void 0 ? void 0 : item.label; } return createVNode(Fragment, null, [createVNode("span", { "class": `${prefixCls}-selection-search` }, [createVNode(Input$1, { "inputRef": inputRef, "prefixCls": prefixCls, "id": id, "open": open2, "inputElement": inputElement, "disabled": disabled, "autofocus": autofocus, "autocomplete": autocomplete, "editable": inputEditable.value, "activeDescendantId": activeDescendantId, "value": inputValue.value, "onKeydown": onInputKeyDown, "onMousedown": onInputMouseDown, "onChange": handleInput, "onPaste": onInputPaste, "onCompositionstart": onInputCompositionStart, "onCompositionend": onInputCompositionEnd, "tabindex": tabindex, "attrs": pickAttrs(props2, true) }, null)]), !combobox.value && item && !hasTextInput.value && createVNode("span", { "class": `${prefixCls}-selection-item`, "title": title.value }, [createVNode(Fragment, { "key": (_d = item.key) !== null && _d !== void 0 ? _d : item.value }, [titleNode])]), renderPlaceholder()]); }; } }); SingleSelector.props = props; SingleSelector.inheritAttrs = false; function isValidateOpenKey(currentKeyCode) { return ![ // System function button KeyCode.ESC, KeyCode.SHIFT, KeyCode.BACKSPACE, KeyCode.TAB, KeyCode.WIN_KEY, KeyCode.ALT, KeyCode.META, KeyCode.WIN_KEY_RIGHT, KeyCode.CTRL, KeyCode.SEMICOLON, KeyCode.EQUALS, KeyCode.CAPS_LOCK, KeyCode.CONTEXT_MENU, // F1-F12 KeyCode.F1, KeyCode.F2, KeyCode.F3, KeyCode.F4, KeyCode.F5, KeyCode.F6, KeyCode.F7, KeyCode.F8, KeyCode.F9, KeyCode.F10, KeyCode.F11, KeyCode.F12 ].includes(currentKeyCode); } function useLock() { let duration = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250; let lock = null; let timeout; onBeforeUnmount(() => { clearTimeout(timeout); }); function doLock(locked) { if (locked || lock === null) { lock = locked; } clearTimeout(timeout); timeout = setTimeout(() => { lock = null; }, duration); } return [() => lock, doLock]; } function createRef() { const func = (node2) => { func.current = node2; }; return func; } const Selector = /* @__PURE__ */ defineComponent({ name: "Selector", inheritAttrs: false, props: { id: String, prefixCls: String, showSearch: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, /** Display in the Selector value, it's not same as `value` prop */ values: PropTypes.array, multiple: { type: Boolean, default: void 0 }, mode: String, searchValue: String, activeValue: String, inputElement: PropTypes.any, autofocus: { type: Boolean, default: void 0 }, activeDescendantId: String, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), disabled: { type: Boolean, default: void 0 }, placeholder: PropTypes.any, removeIcon: PropTypes.any, // Tags maxTagCount: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), maxTagTextLength: Number, maxTagPlaceholder: PropTypes.any, tagRender: Function, optionLabelRender: Function, /** Check if `tokenSeparators` contains `\n` or `\r\n` */ tokenWithEnter: { type: Boolean, default: void 0 }, // Motion choiceTransitionName: String, onToggleOpen: { type: Function }, /** `onSearch` returns go next step boolean to check if need do toggle open */ onSearch: Function, onSearchSubmit: Function, onRemove: Function, onInputKeyDown: { type: Function }, /** * @private get real dom for trigger align. * This may be removed after React provides replacement of `findDOMNode` */ domRef: Function }, setup(props2, _ref) { let { expose } = _ref; const inputRef = createRef(); const compositionStatus = ref(false); const [getInputMouseDown, setInputMouseDown] = useLock(0); const onInternalInputKeyDown = (event) => { const { which } = event; if (which === KeyCode.UP || which === KeyCode.DOWN) { event.preventDefault(); } if (props2.onInputKeyDown) { props2.onInputKeyDown(event); } if (which === KeyCode.ENTER && props2.mode === "tags" && !compositionStatus.value && !props2.open) { props2.onSearchSubmit(event.target.value); } if (isValidateOpenKey(which)) { props2.onToggleOpen(true); } }; const onInternalInputMouseDown = () => { setInputMouseDown(true); }; let pastedText = null; const triggerOnSearch = (value) => { if (props2.onSearch(value, true, compositionStatus.value) !== false) { props2.onToggleOpen(true); } }; const onInputCompositionStart = () => { compositionStatus.value = true; }; const onInputCompositionEnd = (e2) => { compositionStatus.value = false; if (props2.mode !== "combobox") { triggerOnSearch(e2.target.value); } }; const onInputChange = (event) => { let { target: { value } } = event; if (props2.tokenWithEnter && pastedText && /[\r\n]/.test(pastedText)) { const replacedText = pastedText.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " "); value = value.replace(replacedText, pastedText); } pastedText = null; triggerOnSearch(value); }; const onInputPaste = (e2) => { const { clipboardData } = e2; const value = clipboardData.getData("text"); pastedText = value; }; const onClick = (_ref2) => { let { target } = _ref2; if (target !== inputRef.current) { const isIE = document.body.style.msTouchAction !== void 0; if (isIE) { setTimeout(() => { inputRef.current.focus(); }); } else { inputRef.current.focus(); } } }; const onMousedown = (event) => { const inputMouseDown = getInputMouseDown(); if (event.target !== inputRef.current && !inputMouseDown) { event.preventDefault(); } if (props2.mode !== "combobox" && (!props2.showSearch || !inputMouseDown) || !props2.open) { if (props2.open) { props2.onSearch("", true, false); } props2.onToggleOpen(); } }; expose({ focus: () => { inputRef.current.focus(); }, blur: () => { inputRef.current.blur(); } }); return () => { const { prefixCls, domRef, mode } = props2; const sharedProps = { inputRef, onInputKeyDown: onInternalInputKeyDown, onInputMouseDown: onInternalInputMouseDown, onInputChange, onInputPaste, compositionStatus: compositionStatus.value, onInputCompositionStart, onInputCompositionEnd }; const selectNode = mode === "multiple" || mode === "tags" ? createVNode(SelectSelector, _objectSpread2$1(_objectSpread2$1({}, props2), sharedProps), null) : createVNode(SingleSelector, _objectSpread2$1(_objectSpread2$1({}, props2), sharedProps), null); return createVNode("div", { "ref": domRef, "class": `${prefixCls}-selector`, "onClick": onClick, "onMousedown": onMousedown }, [selectNode]); }; } }); function useSelectTriggerControl(refs, open2, triggerOpen) { function onGlobalMouseDown(event) { var _a, _b, _c; let target = event.target; if (target.shadowRoot && event.composed) { target = event.composedPath()[0] || target; } const elements = [(_a = refs[0]) === null || _a === void 0 ? void 0 : _a.value, (_c = (_b = refs[1]) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.getPopupElement()]; if (open2.value && elements.every((element) => element && !element.contains(target) && element !== target)) { triggerOpen(false); } } onMounted(() => { window.addEventListener("mousedown", onGlobalMouseDown); }); onBeforeUnmount(() => { window.removeEventListener("mousedown", onGlobalMouseDown); }); } function useDelayReset() { let timeout = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10; const bool = shallowRef(false); let delay; const cancelLatest = () => { clearTimeout(delay); }; onMounted(() => { cancelLatest(); }); const delaySetBool = (value, callback) => { cancelLatest(); delay = setTimeout(() => { bool.value = value; if (callback) { callback(); } }, timeout); }; return [bool, delaySetBool, cancelLatest]; } const BaseSelectContextKey = Symbol("BaseSelectContextKey"); function useProvideBaseSelectProps(props2) { return provide(BaseSelectContextKey, props2); } function useBaseProps() { return inject(BaseSelectContextKey, {}); } const isMobile = () => { if (typeof navigator === "undefined" || typeof window === "undefined") { return false; } const agent = navigator.userAgent || navigator.vendor || window.opera; return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substring(0, 4)); }; function toReactive(objectRef) { if (!isRef(objectRef)) return reactive(objectRef); const proxy = new Proxy({}, { get(_2, p2, receiver) { return Reflect.get(objectRef.value, p2, receiver); }, set(_2, p2, value) { objectRef.value[p2] = value; return true; }, deleteProperty(_2, p2) { return Reflect.deleteProperty(objectRef.value, p2); }, has(_2, p2) { return Reflect.has(objectRef.value, p2); }, ownKeys() { return Object.keys(objectRef.value); }, getOwnPropertyDescriptor() { return { enumerable: true, configurable: true }; } }); return reactive(proxy); } var __rest$m = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const DEFAULT_OMIT_PROPS = ["value", "onChange", "removeIcon", "placeholder", "autofocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabindex", "OptionList", "notFoundContent"]; const baseSelectPrivateProps = () => { return { prefixCls: String, id: String, omitDomProps: Array, // >>> Value displayValues: Array, onDisplayValuesChange: Function, // >>> Active /** Current dropdown list active item string value */ activeValue: String, /** Link search input with target element */ activeDescendantId: String, onActiveValueChange: Function, // >>> Search searchValue: String, /** Trigger onSearch, return false to prevent trigger open event */ onSearch: Function, /** Trigger when search text match the `tokenSeparators`. Will provide split content */ onSearchSplit: Function, maxLength: Number, OptionList: PropTypes.any, /** Tell if provided `options` is empty */ emptyOptions: Boolean }; }; const baseSelectPropsWithoutPrivate = () => { return { showSearch: { type: Boolean, default: void 0 }, tagRender: { type: Function }, optionLabelRender: { type: Function }, direction: { type: String }, // MISC tabindex: Number, autofocus: Boolean, notFoundContent: PropTypes.any, placeholder: PropTypes.any, onClear: Function, choiceTransitionName: String, // >>> Mode mode: String, // >>> Status disabled: { type: Boolean, default: void 0 }, loading: { type: Boolean, default: void 0 }, // >>> Open open: { type: Boolean, default: void 0 }, defaultOpen: { type: Boolean, default: void 0 }, onDropdownVisibleChange: { type: Function }, // >>> Customize Input /** @private Internal usage. Do not use in your production. */ getInputElement: { type: Function }, /** @private Internal usage. Do not use in your production. */ getRawInputElement: { type: Function }, // >>> Selector maxTagTextLength: Number, maxTagCount: { type: [String, Number] }, maxTagPlaceholder: PropTypes.any, // >>> Search tokenSeparators: { type: Array }, // >>> Icons allowClear: { type: Boolean, default: void 0 }, showArrow: { type: Boolean, default: void 0 }, inputIcon: PropTypes.any, /** Clear all icon */ clearIcon: PropTypes.any, /** Selector remove icon */ removeIcon: PropTypes.any, // >>> Dropdown animation: String, transitionName: String, dropdownStyle: { type: Object }, dropdownClassName: String, dropdownMatchSelectWidth: { type: [Boolean, Number], default: void 0 }, dropdownRender: { type: Function }, dropdownAlign: Object, placement: { type: String }, getPopupContainer: { type: Function }, // >>> Focus showAction: { type: Array }, onBlur: { type: Function }, onFocus: { type: Function }, // >>> Rest Events onKeyup: Function, onKeydown: Function, onMousedown: Function, onPopupScroll: Function, onInputKeyDown: Function, onMouseenter: Function, onMouseleave: Function, onClick: Function }; }; const baseSelectProps = () => { return _extends$1(_extends$1({}, baseSelectPrivateProps()), baseSelectPropsWithoutPrivate()); }; function isMultiple(mode) { return mode === "tags" || mode === "multiple"; } const BaseSelect = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "BaseSelect", inheritAttrs: false, props: initDefaultProps(baseSelectProps(), { showAction: [], notFoundContent: "Not Found" }), setup(props2, _ref) { let { attrs, expose, slots } = _ref; const multiple = computed(() => isMultiple(props2.mode)); const mergedShowSearch = computed(() => props2.showSearch !== void 0 ? props2.showSearch : multiple.value || props2.mode === "combobox"); const mobile = shallowRef(false); onMounted(() => { mobile.value = isMobile(); }); const legacyTreeSelectContext = useInjectLegacySelectContext(); const containerRef = shallowRef(null); const selectorDomRef = createRef(); const triggerRef2 = shallowRef(null); const selectorRef = shallowRef(null); const listRef = shallowRef(null); const blurRef = ref(false); const [mockFocused, setMockFocused, cancelSetMockFocused] = useDelayReset(); const focus = () => { var _a; (_a = selectorRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = selectorRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; expose({ focus, blur, scrollTo: (arg) => { var _a; return (_a = listRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(arg); } }); const mergedSearchValue = computed(() => { var _a; if (props2.mode !== "combobox") { return props2.searchValue; } const val = (_a = props2.displayValues[0]) === null || _a === void 0 ? void 0 : _a.value; return typeof val === "string" || typeof val === "number" ? String(val) : ""; }); const initOpen = props2.open !== void 0 ? props2.open : props2.defaultOpen; const innerOpen = shallowRef(initOpen); const mergedOpen = shallowRef(initOpen); const setInnerOpen = (val) => { innerOpen.value = props2.open !== void 0 ? props2.open : val; mergedOpen.value = innerOpen.value; }; watch(() => props2.open, () => { setInnerOpen(props2.open); }); const emptyListContent = computed(() => !props2.notFoundContent && props2.emptyOptions); watchEffect(() => { mergedOpen.value = innerOpen.value; if (props2.disabled || emptyListContent.value && mergedOpen.value && props2.mode === "combobox") { mergedOpen.value = false; } }); const triggerOpen = computed(() => emptyListContent.value ? false : mergedOpen.value); const onToggleOpen = (newOpen) => { const nextOpen = newOpen !== void 0 ? newOpen : !mergedOpen.value; if (mergedOpen.value !== nextOpen && !props2.disabled) { setInnerOpen(nextOpen); props2.onDropdownVisibleChange && props2.onDropdownVisibleChange(nextOpen); if (!nextOpen && popupFocused.value) { popupFocused.value = false; setMockFocused(false, () => { focusRef.value = false; blurRef.value = false; }); } } }; const tokenWithEnter = computed(() => (props2.tokenSeparators || []).some((tokenSeparator) => ["\n", "\r\n"].includes(tokenSeparator))); const onInternalSearch = (searchText, fromTyping, isCompositing) => { var _a, _b; let ret = true; let newSearchText = searchText; (_a = props2.onActiveValueChange) === null || _a === void 0 ? void 0 : _a.call(props2, null); const patchLabels = isCompositing ? null : getSeparatedContent(searchText, props2.tokenSeparators); if (props2.mode !== "combobox" && patchLabels) { newSearchText = ""; (_b = props2.onSearchSplit) === null || _b === void 0 ? void 0 : _b.call(props2, patchLabels); onToggleOpen(false); ret = false; } if (props2.onSearch && mergedSearchValue.value !== newSearchText) { props2.onSearch(newSearchText, { source: fromTyping ? "typing" : "effect" }); } return ret; }; const onInternalSearchSubmit = (searchText) => { var _a; if (!searchText || !searchText.trim()) { return; } (_a = props2.onSearch) === null || _a === void 0 ? void 0 : _a.call(props2, searchText, { source: "submit" }); }; watch(mergedOpen, () => { if (!mergedOpen.value && !multiple.value && props2.mode !== "combobox") { onInternalSearch("", false, false); } }, { immediate: true, flush: "post" }); watch(() => props2.disabled, () => { if (innerOpen.value && !!props2.disabled) { setInnerOpen(false); } if (props2.disabled && !blurRef.value) { setMockFocused(false); } }, { immediate: true }); const [getClearLock, setClearLock] = useLock(); const onInternalKeyDown = function(event) { var _a; const clearLock = getClearLock(); const { which } = event; if (which === KeyCode.ENTER) { if (props2.mode !== "combobox") { event.preventDefault(); } if (!mergedOpen.value) { onToggleOpen(true); } } setClearLock(!!mergedSearchValue.value); if (which === KeyCode.BACKSPACE && !clearLock && multiple.value && !mergedSearchValue.value && props2.displayValues.length) { const cloneDisplayValues = [...props2.displayValues]; let removedDisplayValue = null; for (let i2 = cloneDisplayValues.length - 1; i2 >= 0; i2 -= 1) { const current = cloneDisplayValues[i2]; if (!current.disabled) { cloneDisplayValues.splice(i2, 1); removedDisplayValue = current; break; } } if (removedDisplayValue) { props2.onDisplayValuesChange(cloneDisplayValues, { type: "remove", values: [removedDisplayValue] }); } } for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } if (mergedOpen.value && listRef.value) { listRef.value.onKeydown(event, ...rest); } (_a = props2.onKeydown) === null || _a === void 0 ? void 0 : _a.call(props2, event, ...rest); }; const onInternalKeyUp = function(event) { for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { rest[_key2 - 1] = arguments[_key2]; } if (mergedOpen.value && listRef.value) { listRef.value.onKeyup(event, ...rest); } if (props2.onKeyup) { props2.onKeyup(event, ...rest); } }; const onSelectorRemove = (val) => { const newValues = props2.displayValues.filter((i2) => i2 !== val); props2.onDisplayValuesChange(newValues, { type: "remove", values: [val] }); }; const focusRef = shallowRef(false); const onContainerFocus = function() { setMockFocused(true); if (!props2.disabled) { if (props2.onFocus && !focusRef.value) { props2.onFocus(...arguments); } if (props2.showAction && props2.showAction.includes("focus")) { onToggleOpen(true); } } focusRef.value = true; }; const popupFocused = ref(false); const onContainerBlur = function() { if (popupFocused.value) { return; } blurRef.value = true; setMockFocused(false, () => { focusRef.value = false; blurRef.value = false; onToggleOpen(false); }); if (props2.disabled) { return; } const searchVal = mergedSearchValue.value; if (searchVal) { if (props2.mode === "tags") { props2.onSearch(searchVal, { source: "submit" }); } else if (props2.mode === "multiple") { props2.onSearch("", { source: "blur" }); } } if (props2.onBlur) { props2.onBlur(...arguments); } }; const onPopupFocusin = () => { popupFocused.value = true; }; const onPopupFocusout = () => { popupFocused.value = false; }; provide("VCSelectContainerEvent", { focus: onContainerFocus, blur: onContainerBlur }); const activeTimeoutIds = []; onMounted(() => { activeTimeoutIds.forEach((timeoutId) => clearTimeout(timeoutId)); activeTimeoutIds.splice(0, activeTimeoutIds.length); }); onBeforeUnmount(() => { activeTimeoutIds.forEach((timeoutId) => clearTimeout(timeoutId)); activeTimeoutIds.splice(0, activeTimeoutIds.length); }); const onInternalMouseDown = function(event) { var _a, _b; const { target } = event; const popupElement = (_a = triggerRef2.value) === null || _a === void 0 ? void 0 : _a.getPopupElement(); if (popupElement && popupElement.contains(target)) { const timeoutId = setTimeout(() => { var _a2; const index2 = activeTimeoutIds.indexOf(timeoutId); if (index2 !== -1) { activeTimeoutIds.splice(index2, 1); } cancelSetMockFocused(); if (!mobile.value && !popupElement.contains(document.activeElement)) { (_a2 = selectorRef.value) === null || _a2 === void 0 ? void 0 : _a2.focus(); } }); activeTimeoutIds.push(timeoutId); } for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { restArgs[_key3 - 1] = arguments[_key3]; } (_b = props2.onMousedown) === null || _b === void 0 ? void 0 : _b.call(props2, event, ...restArgs); }; const containerWidth = shallowRef(null); const onPopupMouseEnter = () => { }; onMounted(() => { watch(triggerOpen, () => { var _a; if (triggerOpen.value) { const newWidth = Math.ceil((_a = containerRef.value) === null || _a === void 0 ? void 0 : _a.offsetWidth); if (containerWidth.value !== newWidth && !Number.isNaN(newWidth)) { containerWidth.value = newWidth; } } }, { immediate: true, flush: "post" }); }); useSelectTriggerControl([containerRef, triggerRef2], triggerOpen, onToggleOpen); useProvideBaseSelectProps(toReactive(_extends$1(_extends$1({}, toRefs(props2)), { open: mergedOpen, triggerOpen, showSearch: mergedShowSearch, multiple, toggleOpen: onToggleOpen }))); return () => { const _a = _extends$1(_extends$1({}, props2), attrs), { prefixCls, id, open: open2, defaultOpen, mode, // Search related showSearch, searchValue, onSearch, // Icons allowClear, clearIcon, showArrow, inputIcon, // Others disabled, loading, getInputElement, getPopupContainer, placement, // Dropdown animation, transitionName: transitionName2, dropdownStyle, dropdownClassName, dropdownMatchSelectWidth, dropdownRender, dropdownAlign, showAction, direction, // Tags tokenSeparators, tagRender, optionLabelRender, // Events onPopupScroll, onDropdownVisibleChange, onFocus, onBlur, onKeyup, onKeydown, onMousedown, onClear, omitDomProps, getRawInputElement, displayValues, onDisplayValuesChange, emptyOptions, activeDescendantId, activeValue, OptionList: OptionList2 } = _a, restProps = __rest$m(_a, ["prefixCls", "id", "open", "defaultOpen", "mode", "showSearch", "searchValue", "onSearch", "allowClear", "clearIcon", "showArrow", "inputIcon", "disabled", "loading", "getInputElement", "getPopupContainer", "placement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "showAction", "direction", "tokenSeparators", "tagRender", "optionLabelRender", "onPopupScroll", "onDropdownVisibleChange", "onFocus", "onBlur", "onKeyup", "onKeydown", "onMousedown", "onClear", "omitDomProps", "getRawInputElement", "displayValues", "onDisplayValuesChange", "emptyOptions", "activeDescendantId", "activeValue", "OptionList"]); const customizeInputElement = mode === "combobox" && getInputElement && getInputElement() || null; const customizeRawInputElement = typeof getRawInputElement === "function" && getRawInputElement(); const domProps = _extends$1({}, restProps); let onTriggerVisibleChange; if (customizeRawInputElement) { onTriggerVisibleChange = (newOpen) => { onToggleOpen(newOpen); }; } DEFAULT_OMIT_PROPS.forEach((propName) => { delete domProps[propName]; }); omitDomProps === null || omitDomProps === void 0 ? void 0 : omitDomProps.forEach((propName) => { delete domProps[propName]; }); const mergedShowArrow = showArrow !== void 0 ? showArrow : loading || !multiple.value && mode !== "combobox"; let arrowNode; if (mergedShowArrow) { arrowNode = createVNode(TransBtn, { "class": classNames(`${prefixCls}-arrow`, { [`${prefixCls}-arrow-loading`]: loading }), "customizeIcon": inputIcon, "customizeIconProps": { loading, searchValue: mergedSearchValue.value, open: mergedOpen.value, focused: mockFocused.value, showSearch: mergedShowSearch.value } }, null); } let clearNode; const onClearMouseDown = () => { onClear === null || onClear === void 0 ? void 0 : onClear(); onDisplayValuesChange([], { type: "clear", values: displayValues }); onInternalSearch("", false, false); }; if (!disabled && allowClear && (displayValues.length || mergedSearchValue.value)) { clearNode = createVNode(TransBtn, { "class": `${prefixCls}-clear`, "onMousedown": onClearMouseDown, "customizeIcon": clearIcon }, { default: () => [createTextVNode("×")] }); } const optionList = createVNode(OptionList2, { "ref": listRef }, _extends$1(_extends$1({}, legacyTreeSelectContext.customSlots), { option: slots.option })); const mergedClassName = classNames(prefixCls, attrs.class, { [`${prefixCls}-focused`]: mockFocused.value, [`${prefixCls}-multiple`]: multiple.value, [`${prefixCls}-single`]: !multiple.value, [`${prefixCls}-allow-clear`]: allowClear, [`${prefixCls}-show-arrow`]: mergedShowArrow, [`${prefixCls}-disabled`]: disabled, [`${prefixCls}-loading`]: loading, [`${prefixCls}-open`]: mergedOpen.value, [`${prefixCls}-customize-input`]: customizeInputElement, [`${prefixCls}-show-search`]: mergedShowSearch.value }); const selectorNode = createVNode(SelectTrigger, { "ref": triggerRef2, "disabled": disabled, "prefixCls": prefixCls, "visible": triggerOpen.value, "popupElement": optionList, "containerWidth": containerWidth.value, "animation": animation, "transitionName": transitionName2, "dropdownStyle": dropdownStyle, "dropdownClassName": dropdownClassName, "direction": direction, "dropdownMatchSelectWidth": dropdownMatchSelectWidth, "dropdownRender": dropdownRender, "dropdownAlign": dropdownAlign, "placement": placement, "getPopupContainer": getPopupContainer, "empty": emptyOptions, "getTriggerDOMNode": () => selectorDomRef.current, "onPopupVisibleChange": onTriggerVisibleChange, "onPopupMouseEnter": onPopupMouseEnter, "onPopupFocusin": onPopupFocusin, "onPopupFocusout": onPopupFocusout }, { default: () => { return customizeRawInputElement ? isValidElement(customizeRawInputElement) && cloneElement(customizeRawInputElement, { ref: selectorDomRef }, false, true) : createVNode(Selector, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "domRef": selectorDomRef, "prefixCls": prefixCls, "inputElement": customizeInputElement, "ref": selectorRef, "id": id, "showSearch": mergedShowSearch.value, "mode": mode, "activeDescendantId": activeDescendantId, "tagRender": tagRender, "optionLabelRender": optionLabelRender, "values": displayValues, "open": mergedOpen.value, "onToggleOpen": onToggleOpen, "activeValue": activeValue, "searchValue": mergedSearchValue.value, "onSearch": onInternalSearch, "onSearchSubmit": onInternalSearchSubmit, "onRemove": onSelectorRemove, "tokenWithEnter": tokenWithEnter.value }), null); } }); let renderNode; if (customizeRawInputElement) { renderNode = selectorNode; } else { renderNode = createVNode("div", _objectSpread2$1(_objectSpread2$1({}, domProps), {}, { "class": mergedClassName, "ref": containerRef, "onMousedown": onInternalMouseDown, "onKeydown": onInternalKeyDown, "onKeyup": onInternalKeyUp }), [mockFocused.value && !mergedOpen.value && createVNode("span", { "style": { width: 0, height: 0, position: "absolute", overflow: "hidden", opacity: 0 }, "aria-live": "polite" }, [`${displayValues.map((_ref2) => { let { label, value } = _ref2; return ["number", "string"].includes(typeof label) ? label : value; }).join(", ")}`]), selectorNode, arrowNode, clearNode]); } return renderNode; }; } }); const Filter = (_ref, _ref2) => { let { height, offset: offset2, prefixCls, onInnerResize } = _ref; let { slots } = _ref2; var _a; let outerStyle = {}; let innerStyle = { display: "flex", flexDirection: "column" }; if (offset2 !== void 0) { outerStyle = { height: `${height}px`, position: "relative", overflow: "hidden" }; innerStyle = _extends$1(_extends$1({}, innerStyle), { transform: `translateY(${offset2}px)`, position: "absolute", left: 0, right: 0, top: 0 }); } return createVNode("div", { "style": outerStyle }, [createVNode(ResizeObserver$1, { "onResize": (_ref3) => { let { offsetHeight } = _ref3; if (offsetHeight && onInnerResize) { onInnerResize(); } } }, { default: () => [createVNode("div", { "style": innerStyle, "class": classNames({ [`${prefixCls}-holder-inner`]: prefixCls }) }, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])] })]); }; Filter.displayName = "Filter"; Filter.inheritAttrs = false; Filter.props = { prefixCls: String, /** Virtual filler height. Should be `count * itemMinHeight` */ height: Number, /** Set offset of visible items. Should be the top of start item position */ offset: Number, onInnerResize: Function }; const Item = (_ref, _ref2) => { let { setRef: setRef2 } = _ref; let { slots } = _ref2; var _a; const children = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); return children && children.length ? cloneVNode(children[0], { ref: setRef2 }) : children; }; Item.props = { setRef: { type: Function, default: () => { } } }; const MIN_SIZE = 20; function getPageY(e2) { return "touches" in e2 ? e2.touches[0].pageY : e2.pageY; } const ScrollBar = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ScrollBar", inheritAttrs: false, props: { prefixCls: String, scrollTop: Number, scrollHeight: Number, height: Number, count: Number, onScroll: { type: Function }, onStartMove: { type: Function }, onStopMove: { type: Function } }, setup() { return { moveRaf: null, scrollbarRef: createRef(), thumbRef: createRef(), visibleTimeout: null, state: reactive({ dragging: false, pageY: null, startTop: null, visible: false }) }; }, watch: { scrollTop: { handler() { this.delayHidden(); }, flush: "post" } }, mounted() { var _a, _b; (_a = this.scrollbarRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("touchstart", this.onScrollbarTouchStart, supportsPassive ? { passive: false } : false); (_b = this.thumbRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener("touchstart", this.onMouseDown, supportsPassive ? { passive: false } : false); }, beforeUnmount() { this.removeEvents(); clearTimeout(this.visibleTimeout); }, methods: { delayHidden() { clearTimeout(this.visibleTimeout); this.state.visible = true; this.visibleTimeout = setTimeout(() => { this.state.visible = false; }, 2e3); }, onScrollbarTouchStart(e2) { e2.preventDefault(); }, onContainerMouseDown(e2) { e2.stopPropagation(); e2.preventDefault(); }, // ======================= Clean ======================= patchEvents() { window.addEventListener("mousemove", this.onMouseMove); window.addEventListener("mouseup", this.onMouseUp); this.thumbRef.current.addEventListener("touchmove", this.onMouseMove, supportsPassive ? { passive: false } : false); this.thumbRef.current.addEventListener("touchend", this.onMouseUp); }, removeEvents() { window.removeEventListener("mousemove", this.onMouseMove); window.removeEventListener("mouseup", this.onMouseUp); this.scrollbarRef.current.removeEventListener("touchstart", this.onScrollbarTouchStart, supportsPassive ? { passive: false } : false); if (this.thumbRef.current) { this.thumbRef.current.removeEventListener("touchstart", this.onMouseDown, supportsPassive ? { passive: false } : false); this.thumbRef.current.removeEventListener("touchmove", this.onMouseMove, supportsPassive ? { passive: false } : false); this.thumbRef.current.removeEventListener("touchend", this.onMouseUp); } wrapperRaf.cancel(this.moveRaf); }, // ======================= Thumb ======================= onMouseDown(e2) { const { onStartMove } = this.$props; _extends$1(this.state, { dragging: true, pageY: getPageY(e2), startTop: this.getTop() }); onStartMove(); this.patchEvents(); e2.stopPropagation(); e2.preventDefault(); }, onMouseMove(e2) { const { dragging, pageY, startTop } = this.state; const { onScroll } = this.$props; wrapperRaf.cancel(this.moveRaf); if (dragging) { const offsetY = getPageY(e2) - pageY; const newTop = startTop + offsetY; const enableScrollRange = this.getEnableScrollRange(); const enableHeightRange = this.getEnableHeightRange(); const ptg = enableHeightRange ? newTop / enableHeightRange : 0; const newScrollTop = Math.ceil(ptg * enableScrollRange); this.moveRaf = wrapperRaf(() => { onScroll(newScrollTop); }); } }, onMouseUp() { const { onStopMove } = this.$props; this.state.dragging = false; onStopMove(); this.removeEvents(); }, // ===================== Calculate ===================== getSpinHeight() { const { height, scrollHeight } = this.$props; let baseHeight = height / scrollHeight * 100; baseHeight = Math.max(baseHeight, MIN_SIZE); baseHeight = Math.min(baseHeight, height / 2); return Math.floor(baseHeight); }, getEnableScrollRange() { const { scrollHeight, height } = this.$props; return scrollHeight - height || 0; }, getEnableHeightRange() { const { height } = this.$props; const spinHeight = this.getSpinHeight(); return height - spinHeight || 0; }, getTop() { const { scrollTop: scrollTop2 } = this.$props; const enableScrollRange = this.getEnableScrollRange(); const enableHeightRange = this.getEnableHeightRange(); if (scrollTop2 === 0 || enableScrollRange === 0) { return 0; } const ptg = scrollTop2 / enableScrollRange; return ptg * enableHeightRange; }, // Not show scrollbar when height is large than scrollHeight showScroll() { const { height, scrollHeight } = this.$props; return scrollHeight > height; } }, render() { const { dragging, visible } = this.state; const { prefixCls } = this.$props; const spinHeight = this.getSpinHeight() + "px"; const top = this.getTop() + "px"; const canScroll = this.showScroll(); const mergedVisible = canScroll && visible; return createVNode("div", { "ref": this.scrollbarRef, "class": classNames(`${prefixCls}-scrollbar`, { [`${prefixCls}-scrollbar-show`]: canScroll }), "style": { width: "8px", top: 0, bottom: 0, right: 0, position: "absolute", display: mergedVisible ? void 0 : "none" }, "onMousedown": this.onContainerMouseDown, "onMousemove": this.delayHidden }, [createVNode("div", { "ref": this.thumbRef, "class": classNames(`${prefixCls}-scrollbar-thumb`, { [`${prefixCls}-scrollbar-thumb-moving`]: dragging }), "style": { width: "100%", height: spinHeight, top, left: 0, position: "absolute", background: "rgba(0, 0, 0, 0.5)", borderRadius: "99px", cursor: "pointer", userSelect: "none" }, "onMousedown": this.onMouseDown }, null)]); } }); function useHeights(mergedData, getKey2, onItemAdd, onItemRemove) { const instance = /* @__PURE__ */ new Map(); const heights = /* @__PURE__ */ new Map(); const updatedMark = ref(Symbol("update")); watch(mergedData, () => { updatedMark.value = Symbol("update"); }); let collectRaf = void 0; function cancelRaf() { wrapperRaf.cancel(collectRaf); } function collectHeight() { cancelRaf(); collectRaf = wrapperRaf(() => { instance.forEach((element, key2) => { if (element && element.offsetParent) { const { offsetHeight } = element; if (heights.get(key2) !== offsetHeight) { updatedMark.value = Symbol("update"); heights.set(key2, element.offsetHeight); } } }); }); } function setInstance(item, ins) { const key2 = getKey2(item); instance.get(key2); if (ins) { instance.set(key2, ins.$el || ins); collectHeight(); } else { instance.delete(key2); } } onUnmounted(() => { cancelRaf(); }); return [setInstance, collectHeight, heights, updatedMark]; } function useScrollTo(containerRef, mergedData, heights, props2, getKey2, collectHeight, syncScrollTop, triggerFlash) { let scroll; return (arg) => { if (arg === null || arg === void 0) { triggerFlash(); return; } wrapperRaf.cancel(scroll); const data = mergedData.value; const itemHeight = props2.itemHeight; if (typeof arg === "number") { syncScrollTop(arg); } else if (arg && typeof arg === "object") { let index2; const { align } = arg; if ("index" in arg) { ({ index: index2 } = arg); } else { index2 = data.findIndex((item) => getKey2(item) === arg.key); } const { offset: offset2 = 0 } = arg; const syncScroll = (times, targetAlign) => { if (times < 0 || !containerRef.value) return; const height = containerRef.value.clientHeight; let needCollectHeight = false; let newTargetAlign = targetAlign; if (height) { const mergedAlign = targetAlign || align; let stackTop = 0; let itemTop = 0; let itemBottom = 0; const maxLen = Math.min(data.length, index2); for (let i2 = 0; i2 <= maxLen; i2 += 1) { const key2 = getKey2(data[i2]); itemTop = stackTop; const cacheHeight = heights.get(key2); itemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight); stackTop = itemBottom; if (i2 === index2 && cacheHeight === void 0) { needCollectHeight = true; } } const scrollTop2 = containerRef.value.scrollTop; let targetTop = null; switch (mergedAlign) { case "top": targetTop = itemTop - offset2; break; case "bottom": targetTop = itemBottom - height + offset2; break; default: { const scrollBottom = scrollTop2 + height; if (itemTop < scrollTop2) { newTargetAlign = "top"; } else if (itemBottom > scrollBottom) { newTargetAlign = "bottom"; } } } if (targetTop !== null && targetTop !== scrollTop2) { syncScrollTop(targetTop); } } scroll = wrapperRaf(() => { if (needCollectHeight) { collectHeight(); } syncScroll(times - 1, newTargetAlign); }, 2); }; syncScroll(5); } }; } const isFF = typeof navigator === "object" && /Firefox/i.test(navigator.userAgent); const useOriginScroll = (isScrollAtTop, isScrollAtBottom) => { let lock = false; let lockTimeout = null; function lockScroll() { clearTimeout(lockTimeout); lock = true; lockTimeout = setTimeout(() => { lock = false; }, 50); } return function(deltaY) { let smoothOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; const originScroll = ( // Pass origin wheel when on the top deltaY < 0 && isScrollAtTop.value || // Pass origin wheel when on the bottom deltaY > 0 && isScrollAtBottom.value ); if (smoothOffset && originScroll) { clearTimeout(lockTimeout); lock = false; } else if (!originScroll || lock) { lockScroll(); } return !lock && originScroll; }; }; function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, onWheelDelta) { let offsetRef = 0; let nextFrame2 = null; let wheelValue = null; let isMouseScroll = false; const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom); function onWheel(event) { if (!inVirtual.value) return; wrapperRaf.cancel(nextFrame2); const { deltaY } = event; offsetRef += deltaY; wheelValue = deltaY; if (originScroll(deltaY)) return; if (!isFF) { event.preventDefault(); } nextFrame2 = wrapperRaf(() => { const patchMultiple = isMouseScroll ? 10 : 1; onWheelDelta(offsetRef * patchMultiple); offsetRef = 0; }); } function onFireFoxScroll(event) { if (!inVirtual.value) return; isMouseScroll = event.detail === wheelValue; } return [onWheel, onFireFoxScroll]; } const SMOOTH_PTG = 14 / 15; function useMobileTouchMove(inVirtual, listRef, callback) { let touched = false; let touchY = 0; let element = null; let interval = null; const cleanUpEvents = () => { if (element) { element.removeEventListener("touchmove", onTouchMove); element.removeEventListener("touchend", onTouchEnd); } }; const onTouchMove = (e2) => { if (touched) { const currentY = Math.ceil(e2.touches[0].pageY); let offsetY = touchY - currentY; touchY = currentY; if (callback(offsetY)) { e2.preventDefault(); } clearInterval(interval); interval = setInterval(() => { offsetY *= SMOOTH_PTG; if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) { clearInterval(interval); } }, 16); } }; const onTouchEnd = () => { touched = false; cleanUpEvents(); }; const onTouchStart = (e2) => { cleanUpEvents(); if (e2.touches.length === 1 && !touched) { touched = true; touchY = Math.ceil(e2.touches[0].pageY); element = e2.target; element.addEventListener("touchmove", onTouchMove, { passive: false }); element.addEventListener("touchend", onTouchEnd); } }; const noop2 = () => { }; onMounted(() => { document.addEventListener("touchmove", noop2, { passive: false }); watch(inVirtual, (val) => { listRef.value.removeEventListener("touchstart", onTouchStart); cleanUpEvents(); clearInterval(interval); if (val) { listRef.value.addEventListener("touchstart", onTouchStart, { passive: false }); } }, { immediate: true }); }); onBeforeUnmount(() => { document.removeEventListener("touchmove", noop2); }); } var __rest$l = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const EMPTY_DATA = []; const ScrollStyle = { overflowY: "auto", overflowAnchor: "none" }; function renderChildren(list, startIndex, endIndex, setNodeRef, renderFunc, _ref) { let { getKey: getKey2 } = _ref; return list.slice(startIndex, endIndex + 1).map((item, index2) => { const eleIndex = startIndex + index2; const node2 = renderFunc(item, eleIndex, { // style: status === 'MEASURE_START' ? { visibility: 'hidden' } : {}, }); const key2 = getKey2(item); return createVNode(Item, { "key": key2, "setRef": (ele) => setNodeRef(item, ele) }, { default: () => [node2] }); }); } const List = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "List", inheritAttrs: false, props: { prefixCls: String, data: PropTypes.array, height: Number, itemHeight: Number, /** If not match virtual scroll condition, Set List still use height of container. */ fullHeight: { type: Boolean, default: void 0 }, itemKey: { type: [String, Number, Function], required: true }, component: { type: [String, Object] }, /** Set `false` will always use real scroll instead of virtual one */ virtual: { type: Boolean, default: void 0 }, children: Function, onScroll: Function, onMousedown: Function, onMouseenter: Function, onVisibleChange: Function }, setup(props2, _ref2) { let { expose } = _ref2; const useVirtual = computed(() => { const { height, itemHeight, virtual } = props2; return !!(virtual !== false && height && itemHeight); }); const inVirtual = computed(() => { const { height, itemHeight, data: data2 } = props2; return useVirtual.value && data2 && itemHeight * data2.length > height; }); const state = reactive({ scrollTop: 0, scrollMoving: false }); const data = computed(() => { return props2.data || EMPTY_DATA; }); const mergedData = shallowRef([]); watch(data, () => { mergedData.value = toRaw(data.value).slice(); }, { immediate: true }); const itemKey = shallowRef((_item) => void 0); watch(() => props2.itemKey, (val) => { if (typeof val === "function") { itemKey.value = val; } else { itemKey.value = (item) => item === null || item === void 0 ? void 0 : item[val]; } }, { immediate: true }); const componentRef = shallowRef(); const fillerInnerRef = shallowRef(); const scrollBarRef = shallowRef(); const getKey2 = (item) => { return itemKey.value(item); }; const sharedConfig = { getKey: getKey2 }; function syncScrollTop(newTop) { let value; if (typeof newTop === "function") { value = newTop(state.scrollTop); } else { value = newTop; } const alignedTop = keepInRange(value); if (componentRef.value) { componentRef.value.scrollTop = alignedTop; } state.scrollTop = alignedTop; } const [setInstance, collectHeight, heights, updatedMark] = useHeights(mergedData, getKey2); const calRes = reactive({ scrollHeight: void 0, start: 0, end: 0, offset: void 0 }); const offsetHeight = shallowRef(0); onMounted(() => { nextTick(() => { var _a; offsetHeight.value = ((_a = fillerInnerRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0; }); }); onUpdated(() => { nextTick(() => { var _a; offsetHeight.value = ((_a = fillerInnerRef.value) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0; }); }); watch([useVirtual, mergedData], () => { if (!useVirtual.value) { _extends$1(calRes, { scrollHeight: void 0, start: 0, end: mergedData.value.length - 1, offset: void 0 }); } }, { immediate: true }); watch([useVirtual, mergedData, offsetHeight, inVirtual], () => { if (useVirtual.value && !inVirtual.value) { _extends$1(calRes, { scrollHeight: offsetHeight.value, start: 0, end: mergedData.value.length - 1, offset: void 0 }); } if (componentRef.value) { state.scrollTop = componentRef.value.scrollTop; } }, { immediate: true }); watch([inVirtual, useVirtual, () => state.scrollTop, mergedData, updatedMark, () => props2.height, offsetHeight], () => { if (!useVirtual.value || !inVirtual.value) { return; } let itemTop = 0; let startIndex; let startOffset; let endIndex; const dataLen = mergedData.value.length; const data2 = mergedData.value; const scrollTop2 = state.scrollTop; const { itemHeight, height } = props2; const scrollTopHeight = scrollTop2 + height; for (let i2 = 0; i2 < dataLen; i2 += 1) { const item = data2[i2]; const key2 = getKey2(item); let cacheHeight = heights.get(key2); if (cacheHeight === void 0) { cacheHeight = itemHeight; } const currentItemBottom = itemTop + cacheHeight; if (startIndex === void 0 && currentItemBottom >= scrollTop2) { startIndex = i2; startOffset = itemTop; } if (endIndex === void 0 && currentItemBottom > scrollTopHeight) { endIndex = i2; } itemTop = currentItemBottom; } if (startIndex === void 0) { startIndex = 0; startOffset = 0; endIndex = Math.ceil(height / itemHeight); } if (endIndex === void 0) { endIndex = dataLen - 1; } endIndex = Math.min(endIndex + 1, dataLen); _extends$1(calRes, { scrollHeight: itemTop, start: startIndex, end: endIndex, offset: startOffset }); }, { immediate: true }); const maxScrollHeight = computed(() => calRes.scrollHeight - props2.height); function keepInRange(newScrollTop) { let newTop = newScrollTop; if (!Number.isNaN(maxScrollHeight.value)) { newTop = Math.min(newTop, maxScrollHeight.value); } newTop = Math.max(newTop, 0); return newTop; } const isScrollAtTop = computed(() => state.scrollTop <= 0); const isScrollAtBottom = computed(() => state.scrollTop >= maxScrollHeight.value); const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom); function onScrollBar(newScrollTop) { const newTop = newScrollTop; syncScrollTop(newTop); } function onFallbackScroll(e2) { var _a; const { scrollTop: newScrollTop } = e2.currentTarget; if (newScrollTop !== state.scrollTop) { syncScrollTop(newScrollTop); } (_a = props2.onScroll) === null || _a === void 0 ? void 0 : _a.call(props2, e2); } const [onRawWheel, onFireFoxScroll] = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, (offsetY) => { syncScrollTop((top) => { const newTop = top + offsetY; return newTop; }); }); useMobileTouchMove(useVirtual, componentRef, (deltaY, smoothOffset) => { if (originScroll(deltaY, smoothOffset)) { return false; } onRawWheel({ preventDefault() { }, deltaY }); return true; }); function onMozMousePixelScroll(e2) { if (useVirtual.value) { e2.preventDefault(); } } const removeEventListener2 = () => { if (componentRef.value) { componentRef.value.removeEventListener("wheel", onRawWheel, supportsPassive ? { passive: false } : false); componentRef.value.removeEventListener("DOMMouseScroll", onFireFoxScroll); componentRef.value.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll); } }; watchEffect(() => { nextTick(() => { if (componentRef.value) { removeEventListener2(); componentRef.value.addEventListener("wheel", onRawWheel, supportsPassive ? { passive: false } : false); componentRef.value.addEventListener("DOMMouseScroll", onFireFoxScroll); componentRef.value.addEventListener("MozMousePixelScroll", onMozMousePixelScroll); } }); }); onBeforeUnmount(() => { removeEventListener2(); }); const scrollTo = useScrollTo(componentRef, mergedData, heights, props2, getKey2, collectHeight, syncScrollTop, () => { var _a; (_a = scrollBarRef.value) === null || _a === void 0 ? void 0 : _a.delayHidden(); }); expose({ scrollTo }); const componentStyle = computed(() => { let cs = null; if (props2.height) { cs = _extends$1({ [props2.fullHeight ? "height" : "maxHeight"]: props2.height + "px" }, ScrollStyle); if (useVirtual.value) { cs.overflowY = "hidden"; if (state.scrollMoving) { cs.pointerEvents = "none"; } } } return cs; }); watch([() => calRes.start, () => calRes.end, mergedData], () => { if (props2.onVisibleChange) { const renderList2 = mergedData.value.slice(calRes.start, calRes.end + 1); props2.onVisibleChange(renderList2, mergedData.value); } }, { flush: "post" }); const delayHideScrollBar = () => { var _a; (_a = scrollBarRef.value) === null || _a === void 0 ? void 0 : _a.delayHidden(); }; return { state, mergedData, componentStyle, onFallbackScroll, onScrollBar, componentRef, useVirtual, calRes, collectHeight, setInstance, sharedConfig, scrollBarRef, fillerInnerRef, delayHideScrollBar }; }, render() { const _a = _extends$1(_extends$1({}, this.$props), this.$attrs), { prefixCls = "rc-virtual-list", height, itemHeight, // eslint-disable-next-line no-unused-vars fullHeight, data, itemKey, virtual, component: Component = "div", onScroll, children = this.$slots.default, style, class: className } = _a, restProps = __rest$l(_a, ["prefixCls", "height", "itemHeight", "fullHeight", "data", "itemKey", "virtual", "component", "onScroll", "children", "style", "class"]); const mergedClassName = classNames(prefixCls, className); const { scrollTop: scrollTop2 } = this.state; const { scrollHeight, offset: offset2, start, end } = this.calRes; const { componentStyle, onFallbackScroll, onScrollBar, useVirtual, collectHeight, sharedConfig, setInstance, mergedData, delayHideScrollBar } = this; return createVNode("div", _objectSpread2$1({ "style": _extends$1(_extends$1({}, style), { position: "relative" }), "class": mergedClassName }, restProps), [createVNode(Component, { "class": `${prefixCls}-holder`, "style": componentStyle, "ref": "componentRef", "onScroll": onFallbackScroll, "onMouseenter": delayHideScrollBar }, { default: () => [createVNode(Filter, { "prefixCls": prefixCls, "height": scrollHeight, "offset": offset2, "onInnerResize": collectHeight, "ref": "fillerInnerRef" }, { default: () => renderChildren(mergedData, start, end, setInstance, children, sharedConfig) })] }), useVirtual && createVNode(ScrollBar, { "ref": "scrollBarRef", "prefixCls": prefixCls, "scrollTop": scrollTop2, "height": height, "scrollHeight": scrollHeight, "count": mergedData.length, "onScroll": onScrollBar, "onStartMove": () => { this.state.scrollMoving = true; }, "onStopMove": () => { this.state.scrollMoving = false; } }, null)]); } }); function useMemo(getValue2, condition, shouldUpdate) { const cacheRef = ref(getValue2()); watch(condition, (next2, pre) => { if (shouldUpdate) { if (shouldUpdate(next2, pre)) { cacheRef.value = getValue2(); } } else { cacheRef.value = getValue2(); } }); return cacheRef; } function isPlatformMac() { return /(mac\sos|macintosh)/i.test(navigator.appVersion); } const SelectContextKey = Symbol("SelectContextKey"); function useProvideSelectProps(props2) { return provide(SelectContextKey, props2); } function useSelectProps() { return inject(SelectContextKey, {}); } var __rest$k = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function isTitleType(content) { return typeof content === "string" || typeof content === "number"; } const OptionList = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "OptionList", inheritAttrs: false, setup(_2, _ref) { let { expose, slots } = _ref; const baseProps = useBaseProps(); const props2 = useSelectProps(); const itemPrefixCls = computed(() => `${baseProps.prefixCls}-item`); const memoFlattenOptions = useMemo(() => props2.flattenOptions, [() => baseProps.open, () => props2.flattenOptions], (next2) => next2[0]); const listRef = createRef(); const onListMouseDown = (event) => { event.preventDefault(); }; const scrollIntoView2 = (args) => { if (listRef.current) { listRef.current.scrollTo(typeof args === "number" ? { index: args } : args); } }; const getEnabledActiveIndex = function(index2) { let offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; const len = memoFlattenOptions.value.length; for (let i2 = 0; i2 < len; i2 += 1) { const current = (index2 + i2 * offset2 + len) % len; const { group, data } = memoFlattenOptions.value[current]; if (!group && !data.disabled) { return current; } } return -1; }; const state = reactive({ activeIndex: getEnabledActiveIndex(0) }); const setActive = function(index2) { let fromKeyboard = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; state.activeIndex = index2; const info = { source: fromKeyboard ? "keyboard" : "mouse" }; const flattenItem = memoFlattenOptions.value[index2]; if (!flattenItem) { props2.onActiveValue(null, -1, info); return; } props2.onActiveValue(flattenItem.value, index2, info); }; watch([() => memoFlattenOptions.value.length, () => baseProps.searchValue], () => { setActive(props2.defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1); }, { immediate: true }); const isSelected = (value) => props2.rawValues.has(value) && baseProps.mode !== "combobox"; watch([() => baseProps.open, () => baseProps.searchValue], () => { if (!baseProps.multiple && baseProps.open && props2.rawValues.size === 1) { const value = Array.from(props2.rawValues)[0]; const index2 = toRaw(memoFlattenOptions.value).findIndex((_ref2) => { let { data } = _ref2; return data[props2.fieldNames.value] === value; }); if (index2 !== -1) { setActive(index2); nextTick(() => { scrollIntoView2(index2); }); } } if (baseProps.open) { nextTick(() => { var _a; (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(void 0); }); } }, { immediate: true, flush: "post" }); const onSelectValue = (value) => { if (value !== void 0) { props2.onSelect(value, { selected: !props2.rawValues.has(value) }); } if (!baseProps.multiple) { baseProps.toggleOpen(false); } }; const getLabel = (item) => typeof item.label === "function" ? item.label() : item.label; function renderItem(index2) { const item = memoFlattenOptions.value[index2]; if (!item) return null; const itemData = item.data || {}; const { value } = itemData; const { group } = item; const attrs = pickAttrs(itemData, true); const mergedLabel = getLabel(item); return item ? createVNode("div", _objectSpread2$1(_objectSpread2$1({ "aria-label": typeof mergedLabel === "string" && !group ? mergedLabel : null }, attrs), {}, { "key": index2, "role": group ? "presentation" : "option", "id": `${baseProps.id}_list_${index2}`, "aria-selected": isSelected(value) }), [value]) : null; } const onKeydown = (event) => { const { which, ctrlKey } = event; switch (which) { case KeyCode.N: case KeyCode.P: case KeyCode.UP: case KeyCode.DOWN: { let offset2 = 0; if (which === KeyCode.UP) { offset2 = -1; } else if (which === KeyCode.DOWN) { offset2 = 1; } else if (isPlatformMac() && ctrlKey) { if (which === KeyCode.N) { offset2 = 1; } else if (which === KeyCode.P) { offset2 = -1; } } if (offset2 !== 0) { const nextActiveIndex = getEnabledActiveIndex(state.activeIndex + offset2, offset2); scrollIntoView2(nextActiveIndex); setActive(nextActiveIndex, true); } break; } case KeyCode.ENTER: { const item = memoFlattenOptions.value[state.activeIndex]; if (item && !item.data.disabled) { onSelectValue(item.value); } else { onSelectValue(void 0); } if (baseProps.open) { event.preventDefault(); } break; } case KeyCode.ESC: { baseProps.toggleOpen(false); if (baseProps.open) { event.stopPropagation(); } } } }; const onKeyup = () => { }; const scrollTo = (index2) => { scrollIntoView2(index2); }; expose({ onKeydown, onKeyup, scrollTo }); return () => { const { id, notFoundContent, onPopupScroll } = baseProps; const { menuItemSelectedIcon, fieldNames, virtual, listHeight, listItemHeight } = props2; const renderOption = slots.option; const { activeIndex } = state; const omitFieldNameList = Object.keys(fieldNames).map((key2) => fieldNames[key2]); if (memoFlattenOptions.value.length === 0) { return createVNode("div", { "role": "listbox", "id": `${id}_list`, "class": `${itemPrefixCls.value}-empty`, "onMousedown": onListMouseDown }, [notFoundContent]); } return createVNode(Fragment, null, [createVNode("div", { "role": "listbox", "id": `${id}_list`, "style": { height: 0, width: 0, overflow: "hidden" } }, [renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)]), createVNode(List, { "itemKey": "key", "ref": listRef, "data": memoFlattenOptions.value, "height": listHeight, "itemHeight": listItemHeight, "fullHeight": false, "onMousedown": onListMouseDown, "onScroll": onPopupScroll, "virtual": virtual }, { default: (item, itemIndex) => { var _a; const { group, groupOption, data, value } = item; const { key: key2 } = data; const label = typeof item.label === "function" ? item.label() : item.label; if (group) { const groupTitle = (_a = data.title) !== null && _a !== void 0 ? _a : isTitleType(label) && label; return createVNode("div", { "class": classNames(itemPrefixCls.value, `${itemPrefixCls.value}-group`), "title": groupTitle }, [renderOption ? renderOption(data) : label !== void 0 ? label : key2]); } const { disabled, title, children, style, class: cls, className } = data, otherProps = __rest$k(data, ["disabled", "title", "children", "style", "class", "className"]); const passedProps = omit$1(otherProps, omitFieldNameList); const selected = isSelected(value); const optionPrefixCls = `${itemPrefixCls.value}-option`; const optionClassName = classNames(itemPrefixCls.value, optionPrefixCls, cls, className, { [`${optionPrefixCls}-grouped`]: groupOption, [`${optionPrefixCls}-active`]: activeIndex === itemIndex && !disabled, [`${optionPrefixCls}-disabled`]: disabled, [`${optionPrefixCls}-selected`]: selected }); const mergedLabel = getLabel(item); const iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === "function" || selected; const content = typeof mergedLabel === "number" ? mergedLabel : mergedLabel || value; let optionTitle = isTitleType(content) ? content.toString() : void 0; if (title !== void 0) { optionTitle = title; } return createVNode("div", _objectSpread2$1(_objectSpread2$1({}, passedProps), {}, { "aria-selected": selected, "class": optionClassName, "title": optionTitle, "onMousemove": (e2) => { if (otherProps.onMousemove) { otherProps.onMousemove(e2); } if (activeIndex === itemIndex || disabled) { return; } setActive(itemIndex); }, "onClick": (e2) => { if (!disabled) { onSelectValue(value); } if (otherProps.onClick) { otherProps.onClick(e2); } }, "style": style }), [createVNode("div", { "class": `${optionPrefixCls}-content` }, [renderOption ? renderOption(data) : content]), isValidElement(menuItemSelectedIcon) || selected, iconVisible && createVNode(TransBtn, { "class": `${itemPrefixCls.value}-option-state`, "customizeIcon": menuItemSelectedIcon, "customizeIconProps": { isSelected: selected } }, { default: () => [selected ? "✓" : null] })]); } })]); }; } }); var __rest$j = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function convertNodeToOption(node2) { const _a = node2, { key: key2, children } = _a, _b = _a.props, { value, disabled } = _b, restProps = __rest$j(_b, ["value", "disabled"]); const child = children === null || children === void 0 ? void 0 : children.default; return _extends$1({ key: key2, value: value !== void 0 ? value : key2, children: child, disabled: disabled || disabled === "" }, restProps); } function convertChildrenToData(nodes) { let optionOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; const dd = flattenChildren(nodes).map((node2, index2) => { var _a; if (!isValidElement(node2) || !node2.type) { return null; } const { type: { isSelectOptGroup }, key: key2, children, props: props2 } = node2; if (optionOnly || !isSelectOptGroup) { return convertNodeToOption(node2); } const child = children && children.default ? children.default() : void 0; const label = (props2 === null || props2 === void 0 ? void 0 : props2.label) || ((_a = children.label) === null || _a === void 0 ? void 0 : _a.call(children)) || key2; return _extends$1(_extends$1({ key: `__RC_SELECT_GRP__${key2 === null ? index2 : String(key2)}__` }, props2), { label, options: convertChildrenToData(child || []) }); }).filter((data) => data); return dd; } function useOptions(options, children, fieldNames) { const mergedOptions = shallowRef(); const valueOptions = shallowRef(); const labelOptions = shallowRef(); const tempMergedOptions = shallowRef([]); watch([options, children], () => { if (options.value) { tempMergedOptions.value = toRaw(options.value).slice(); } else { tempMergedOptions.value = convertChildrenToData(children.value); } }, { immediate: true, deep: true }); watchEffect(() => { const newOptions = tempMergedOptions.value; const newValueOptions = /* @__PURE__ */ new Map(); const newLabelOptions = /* @__PURE__ */ new Map(); const fieldNamesValue = fieldNames.value; function dig(optionList) { let isChildren = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; for (let i2 = 0; i2 < optionList.length; i2 += 1) { const option = optionList[i2]; if (!option[fieldNamesValue.options] || isChildren) { newValueOptions.set(option[fieldNamesValue.value], option); newLabelOptions.set(option[fieldNamesValue.label], option); } else { dig(option[fieldNamesValue.options], true); } } } dig(newOptions); mergedOptions.value = newOptions; valueOptions.value = newValueOptions; labelOptions.value = newLabelOptions; }); return { options: mergedOptions, valueOptions, labelOptions }; } let uuid$5 = 0; const isBrowserClient = canUseDom$1(); function getUUID$1() { let retId; if (isBrowserClient) { retId = uuid$5; uuid$5 += 1; } else { retId = "TEST_OR_SSR"; } return retId; } function useId() { let id = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ref(""); const innerId = `rc_select_${getUUID$1()}`; return id.value || innerId; } function toArray$2(value) { if (Array.isArray(value)) { return value; } return value !== void 0 ? [value] : []; } function includes(test, search) { return toArray$2(test).join("").toUpperCase().includes(search); } const useFilterOptions = (options, fieldNames, searchValue, filterOption, optionFilterProp) => computed(() => { const searchValueVal = searchValue.value; const optionFilterPropValue = optionFilterProp === null || optionFilterProp === void 0 ? void 0 : optionFilterProp.value; const filterOptionValue = filterOption === null || filterOption === void 0 ? void 0 : filterOption.value; if (!searchValueVal || filterOptionValue === false) { return options.value; } const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames.value; const filteredOptions = []; const customizeFilter = typeof filterOptionValue === "function"; const upperSearch = searchValueVal.toUpperCase(); const filterFunc = customizeFilter ? filterOptionValue : (_2, option) => { if (optionFilterPropValue) { return includes(option[optionFilterPropValue], upperSearch); } if (option[fieldOptions]) { return includes(option[fieldLabel !== "children" ? fieldLabel : "label"], upperSearch); } return includes(option[fieldValue], upperSearch); }; const wrapOption = customizeFilter ? (opt) => injectPropsWithOption(opt) : (opt) => opt; options.value.forEach((item) => { if (item[fieldOptions]) { const matchGroup = filterFunc(searchValueVal, wrapOption(item)); if (matchGroup) { filteredOptions.push(item); } else { const subOptions = item[fieldOptions].filter((subItem) => filterFunc(searchValueVal, wrapOption(subItem))); if (subOptions.length) { filteredOptions.push(_extends$1(_extends$1({}, item), { [fieldOptions]: subOptions })); } } return; } if (filterFunc(searchValueVal, wrapOption(item))) { filteredOptions.push(item); } }); return filteredOptions; }); const useCache = (labeledValues, valueOptions) => { const cacheRef = shallowRef({ values: /* @__PURE__ */ new Map(), options: /* @__PURE__ */ new Map() }); const filledLabeledValues = computed(() => { const { values: prevValueCache, options: prevOptionCache } = cacheRef.value; const patchedValues = labeledValues.value.map((item) => { var _a; if (item.label === void 0) { return _extends$1(_extends$1({}, item), { label: (_a = prevValueCache.get(item.value)) === null || _a === void 0 ? void 0 : _a.label }); } return item; }); const valueCache = /* @__PURE__ */ new Map(); const optionCache = /* @__PURE__ */ new Map(); patchedValues.forEach((item) => { valueCache.set(item.value, item); optionCache.set(item.value, valueOptions.value.get(item.value) || prevOptionCache.get(item.value)); }); cacheRef.value.values = valueCache; cacheRef.value.options = optionCache; return patchedValues; }); const getOption = (val) => valueOptions.value.get(val) || cacheRef.value.options.get(val); return [filledLabeledValues, getOption]; }; function useMergedState(defaultStateValue, option) { const { defaultValue, value = ref() } = option || {}; let initValue = typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue; if (value.value !== void 0) { initValue = unref(value); } if (defaultValue !== void 0) { initValue = typeof defaultValue === "function" ? defaultValue() : defaultValue; } const innerValue = ref(initValue); const mergedValue = ref(initValue); watchEffect(() => { let val = value.value !== void 0 ? value.value : innerValue.value; if (option.postState) { val = option.postState(val); } mergedValue.value = val; }); function triggerChange(newValue) { const preVal = mergedValue.value; innerValue.value = newValue; if (toRaw(mergedValue.value) !== newValue && option.onChange) { option.onChange(newValue, preVal); } } watch(value, () => { innerValue.value = value.value; }); return [mergedValue, triggerChange]; } function useState(defaultStateValue) { const initValue = typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue; const innerValue = ref(initValue); function triggerChange(newValue) { innerValue.value = newValue; } return [innerValue, triggerChange]; } const OMIT_DOM_PROPS = ["inputValue"]; function selectProps$1() { return _extends$1(_extends$1({}, baseSelectPropsWithoutPrivate()), { prefixCls: String, id: String, backfill: { type: Boolean, default: void 0 }, // >>> Field Names fieldNames: Object, // >>> Search /** @deprecated Use `searchValue` instead */ inputValue: String, searchValue: String, onSearch: Function, autoClearSearchValue: { type: Boolean, default: void 0 }, // >>> Select onSelect: Function, onDeselect: Function, // >>> Options /** * In Select, `false` means do nothing. * In TreeSelect, `false` will highlight match item. * It's by design. */ filterOption: { type: [Boolean, Function], default: void 0 }, filterSort: Function, optionFilterProp: String, optionLabelProp: String, options: Array, defaultActiveFirstOption: { type: Boolean, default: void 0 }, virtual: { type: Boolean, default: void 0 }, listHeight: Number, listItemHeight: Number, // >>> Icon menuItemSelectedIcon: PropTypes.any, mode: String, labelInValue: { type: Boolean, default: void 0 }, value: PropTypes.any, defaultValue: PropTypes.any, onChange: Function, children: Array }); } function isRawValue(value) { return !value || typeof value !== "object"; } const Select$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "VcSelect", inheritAttrs: false, props: initDefaultProps(selectProps$1(), { prefixCls: "vc-select", autoClearSearchValue: true, listHeight: 200, listItemHeight: 20, dropdownMatchSelectWidth: true }), setup(props2, _ref) { let { expose, attrs, slots } = _ref; const mergedId = useId(toRef(props2, "id")); const multiple = computed(() => isMultiple(props2.mode)); const childrenAsData = computed(() => !!(!props2.options && props2.children)); const mergedFilterOption = computed(() => { if (props2.filterOption === void 0 && props2.mode === "combobox") { return false; } return props2.filterOption; }); const mergedFieldNames = computed(() => fillFieldNames(props2.fieldNames, childrenAsData.value)); const [mergedSearchValue, setSearchValue] = useMergedState("", { value: computed(() => props2.searchValue !== void 0 ? props2.searchValue : props2.inputValue), postState: (search) => search || "" }); const parsedOptions = useOptions(toRef(props2, "options"), toRef(props2, "children"), mergedFieldNames); const { valueOptions, labelOptions, options: mergedOptions } = parsedOptions; const convert2LabelValues = (draftValues) => { const valueList = toArray$2(draftValues); return valueList.map((val) => { var _a, _b; let rawValue; let rawLabel; let rawKey; let rawDisabled; if (isRawValue(val)) { rawValue = val; } else { rawKey = val.key; rawLabel = val.label; rawValue = (_a = val.value) !== null && _a !== void 0 ? _a : rawKey; } const option = valueOptions.value.get(rawValue); if (option) { if (rawLabel === void 0) rawLabel = option === null || option === void 0 ? void 0 : option[props2.optionLabelProp || mergedFieldNames.value.label]; if (rawKey === void 0) rawKey = (_b = option === null || option === void 0 ? void 0 : option.key) !== null && _b !== void 0 ? _b : rawValue; rawDisabled = option === null || option === void 0 ? void 0 : option.disabled; } return { label: rawLabel, value: rawValue, key: rawKey, disabled: rawDisabled, option }; }); }; const [internalValue, setInternalValue] = useMergedState(props2.defaultValue, { value: toRef(props2, "value") }); const rawLabeledValues = computed(() => { var _a; const values = convert2LabelValues(internalValue.value); if (props2.mode === "combobox" && !((_a = values[0]) === null || _a === void 0 ? void 0 : _a.value)) { return []; } return values; }); const [mergedValues, getMixedOption] = useCache(rawLabeledValues, valueOptions); const displayValues = computed(() => { if (!props2.mode && mergedValues.value.length === 1) { const firstValue = mergedValues.value[0]; if (firstValue.value === null && (firstValue.label === null || firstValue.label === void 0)) { return []; } } return mergedValues.value.map((item) => { var _a; return _extends$1(_extends$1({}, item), { label: (_a = typeof item.label === "function" ? item.label() : item.label) !== null && _a !== void 0 ? _a : item.value }); }); }); const rawValues = computed(() => new Set(mergedValues.value.map((val) => val.value))); watchEffect(() => { var _a; if (props2.mode === "combobox") { const strValue = (_a = mergedValues.value[0]) === null || _a === void 0 ? void 0 : _a.value; if (strValue !== void 0 && strValue !== null) { setSearchValue(String(strValue)); } } }, { flush: "post" }); const createTagOption = (val, label) => { const mergedLabel = label !== null && label !== void 0 ? label : val; return { [mergedFieldNames.value.value]: val, [mergedFieldNames.value.label]: mergedLabel }; }; const filledTagOptions = shallowRef(); watchEffect(() => { if (props2.mode !== "tags") { filledTagOptions.value = mergedOptions.value; return; } const cloneOptions = mergedOptions.value.slice(); const existOptions = (val) => valueOptions.value.has(val); [...mergedValues.value].sort((a2, b2) => a2.value < b2.value ? -1 : 1).forEach((item) => { const val = item.value; if (!existOptions(val)) { cloneOptions.push(createTagOption(val, item.label)); } }); filledTagOptions.value = cloneOptions; }); const filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, toRef(props2, "optionFilterProp")); const filledSearchOptions = computed(() => { if (props2.mode !== "tags" || !mergedSearchValue.value || filteredOptions.value.some((item) => item[props2.optionFilterProp || "value"] === mergedSearchValue.value)) { return filteredOptions.value; } return [createTagOption(mergedSearchValue.value), ...filteredOptions.value]; }); const orderedFilteredOptions = computed(() => { if (!props2.filterSort) { return filledSearchOptions.value; } return [...filledSearchOptions.value].sort((a2, b2) => props2.filterSort(a2, b2)); }); const displayOptions = computed(() => flattenOptions(orderedFilteredOptions.value, { fieldNames: mergedFieldNames.value, childrenAsData: childrenAsData.value })); const triggerChange = (values) => { const labeledValues = convert2LabelValues(values); setInternalValue(labeledValues); if (props2.onChange && // Trigger event only when value changed (labeledValues.length !== mergedValues.value.length || labeledValues.some((newVal, index2) => { var _a; return ((_a = mergedValues.value[index2]) === null || _a === void 0 ? void 0 : _a.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value); }))) { const returnValues = props2.labelInValue ? labeledValues.map((v2) => { return _extends$1(_extends$1({}, v2), { originLabel: v2.label, label: typeof v2.label === "function" ? v2.label() : v2.label }); }) : labeledValues.map((v2) => v2.value); const returnOptions = labeledValues.map((v2) => injectPropsWithOption(getMixedOption(v2.value))); props2.onChange( // Value multiple.value ? returnValues : returnValues[0], // Option multiple.value ? returnOptions : returnOptions[0] ); } }; const [activeValue, setActiveValue] = useState(null); const [accessibilityIndex, setAccessibilityIndex] = useState(0); const mergedDefaultActiveFirstOption = computed(() => props2.defaultActiveFirstOption !== void 0 ? props2.defaultActiveFirstOption : props2.mode !== "combobox"); const onActiveValue = function(active, index2) { let { source = "keyboard" } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; setAccessibilityIndex(index2); if (props2.backfill && props2.mode === "combobox" && active !== null && source === "keyboard") { setActiveValue(String(active)); } }; const triggerSelect = (val, selected) => { const getSelectEnt = () => { var _a; const option = getMixedOption(val); const originLabel = option === null || option === void 0 ? void 0 : option[mergedFieldNames.value.label]; return [props2.labelInValue ? { label: typeof originLabel === "function" ? originLabel() : originLabel, originLabel, value: val, key: (_a = option === null || option === void 0 ? void 0 : option.key) !== null && _a !== void 0 ? _a : val } : val, injectPropsWithOption(option)]; }; if (selected && props2.onSelect) { const [wrappedValue, option] = getSelectEnt(); props2.onSelect(wrappedValue, option); } else if (!selected && props2.onDeselect) { const [wrappedValue, option] = getSelectEnt(); props2.onDeselect(wrappedValue, option); } }; const onInternalSelect = (val, info) => { let cloneValues; const mergedSelect = multiple.value ? info.selected : true; if (mergedSelect) { cloneValues = multiple.value ? [...mergedValues.value, val] : [val]; } else { cloneValues = mergedValues.value.filter((v2) => v2.value !== val); } triggerChange(cloneValues); triggerSelect(val, mergedSelect); if (props2.mode === "combobox") { setActiveValue(""); } else if (!multiple.value || props2.autoClearSearchValue) { setSearchValue(""); setActiveValue(""); } }; const onDisplayValuesChange = (nextValues, info) => { triggerChange(nextValues); if (info.type === "remove" || info.type === "clear") { info.values.forEach((item) => { triggerSelect(item.value, false); }); } }; const onInternalSearch = (searchText, info) => { var _a; setSearchValue(searchText); setActiveValue(null); if (info.source === "submit") { const formatted = (searchText || "").trim(); if (formatted) { const newRawValues = Array.from(/* @__PURE__ */ new Set([...rawValues.value, formatted])); triggerChange(newRawValues); triggerSelect(formatted, true); setSearchValue(""); } return; } if (info.source !== "blur") { if (props2.mode === "combobox") { triggerChange(searchText); } (_a = props2.onSearch) === null || _a === void 0 ? void 0 : _a.call(props2, searchText); } }; const onInternalSearchSplit = (words) => { let patchValues = words; if (props2.mode !== "tags") { patchValues = words.map((word) => { const opt = labelOptions.value.get(word); return opt === null || opt === void 0 ? void 0 : opt.value; }).filter((val) => val !== void 0); } const newRawValues = Array.from(/* @__PURE__ */ new Set([...rawValues.value, ...patchValues])); triggerChange(newRawValues); newRawValues.forEach((newRawValue) => { triggerSelect(newRawValue, true); }); }; const realVirtual = computed(() => props2.virtual !== false && props2.dropdownMatchSelectWidth !== false); useProvideSelectProps(toReactive(_extends$1(_extends$1({}, parsedOptions), { flattenOptions: displayOptions, onActiveValue, defaultActiveFirstOption: mergedDefaultActiveFirstOption, onSelect: onInternalSelect, menuItemSelectedIcon: toRef(props2, "menuItemSelectedIcon"), rawValues, fieldNames: mergedFieldNames, virtual: realVirtual, listHeight: toRef(props2, "listHeight"), listItemHeight: toRef(props2, "listItemHeight"), childrenAsData }))); const selectRef = ref(); expose({ focus() { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }, blur() { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }, scrollTo(arg) { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(arg); } }); const pickProps = computed(() => { return omit$1(props2, [ "id", "mode", "prefixCls", "backfill", "fieldNames", // Search "inputValue", "searchValue", "onSearch", "autoClearSearchValue", // Select "onSelect", "onDeselect", "dropdownMatchSelectWidth", // Options "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "listHeight", "listItemHeight", // Value "value", "defaultValue", "labelInValue", "onChange" ]); }); return () => { return createVNode(BaseSelect, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, pickProps.value), attrs), {}, { "id": mergedId, "prefixCls": props2.prefixCls, "ref": selectRef, "omitDomProps": OMIT_DOM_PROPS, "mode": props2.mode, "displayValues": displayValues.value, "onDisplayValuesChange": onDisplayValuesChange, "searchValue": mergedSearchValue.value, "onSearch": onInternalSearch, "onSearchSplit": onInternalSearchSplit, "dropdownMatchSelectWidth": props2.dropdownMatchSelectWidth, "OptionList": OptionList, "emptyOptions": !displayOptions.value.length, "activeValue": activeValue.value, "activeDescendantId": `${mergedId}_list_${accessibilityIndex.value}` }), slots); }; } }); const Option = () => null; Option.isSelectOption = true; Option.displayName = "ASelectOption"; const OptGroup = () => null; OptGroup.isSelectOptGroup = true; OptGroup.displayName = "ASelectOptGroup"; var DownOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" }; var contextKey = Symbol("iconContext"); var useInjectIconContext = function useInjectIconContext2() { return inject(contextKey, { prefixCls: ref("anticon"), rootClassName: ref(""), csp: ref() }); }; function canUseDom() { return !!(typeof window !== "undefined" && window.document && window.document.createElement); } function contains(root2, n2) { if (!root2) { return false; } if (root2.contains) { return root2.contains(n2); } return false; } var APPEND_ORDER = "data-vc-order"; var MARK_KEY = "vc-icon-key"; var containerCache = /* @__PURE__ */ new Map(); function getMark() { var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, mark = _ref.mark; if (mark) { return mark.startsWith("data-") ? mark : "data-".concat(mark); } return MARK_KEY; } function getContainer$1(option) { if (option.attachTo) { return option.attachTo; } var head = document.querySelector("head"); return head || document.body; } function getOrder(prepend) { if (prepend === "queue") { return "prependQueue"; } return prepend ? "prepend" : "append"; } function findStyles(container) { return Array.from((containerCache.get(container) || container).children).filter(function(node2) { return node2.tagName === "STYLE"; }); } function injectCSS(css2) { var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (!canUseDom()) { return null; } var csp = option.csp, prepend = option.prepend; var styleNode = document.createElement("style"); styleNode.setAttribute(APPEND_ORDER, getOrder(prepend)); if (csp && csp.nonce) { styleNode.nonce = csp.nonce; } styleNode.innerHTML = css2; var container = getContainer$1(option); var firstChild = container.firstChild; if (prepend) { if (prepend === "queue") { var existStyle = findStyles(container).filter(function(node2) { return ["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER)); }); if (existStyle.length) { container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling); return styleNode; } } container.insertBefore(styleNode, firstChild); } else { container.appendChild(styleNode); } return styleNode; } function findExistNode(key2) { var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var container = getContainer$1(option); return findStyles(container).find(function(node2) { return node2.getAttribute(getMark(option)) === key2; }); } function syncRealContainer(container, option) { var cachedRealContainer = containerCache.get(container); if (!cachedRealContainer || !contains(document, cachedRealContainer)) { var placeholderStyle = injectCSS("", option); var parentNode = placeholderStyle.parentNode; containerCache.set(container, parentNode); container.removeChild(placeholderStyle); } } function updateCSS(css2, key2) { var option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var container = getContainer$1(option); syncRealContainer(container, option); var existNode = findExistNode(key2, option); if (existNode) { if (option.csp && option.csp.nonce && existNode.nonce !== option.csp.nonce) { existNode.nonce = option.csp.nonce; } if (existNode.innerHTML !== css2) { existNode.innerHTML = css2; } return existNode; } var newNode = injectCSS(css2, option); newNode.setAttribute(getMark(option), key2); return newNode; } function _objectSpread$y(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$y(target, key2, source[key2]); }); } return target; } function _defineProperty$y(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } function warning$1(valid, message) { } function isIconDefinition(target) { return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function"); } function generate(node2, key2, rootProps) { if (!rootProps) { return h$1(node2.tag, _objectSpread$y({ key: key2 }, node2.attrs), (node2.children || []).map(function(child, index2) { return generate(child, "".concat(key2, "-").concat(node2.tag, "-").concat(index2)); })); } return h$1(node2.tag, _objectSpread$y({ key: key2 }, rootProps, node2.attrs), (node2.children || []).map(function(child, index2) { return generate(child, "".concat(key2, "-").concat(node2.tag, "-").concat(index2)); })); } function getSecondaryColor(primaryColor) { return generate$1(primaryColor)[0]; } function normalizeTwoToneColors(twoToneColor) { if (!twoToneColor) { return []; } return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor]; } var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n"; function getRoot(ele) { return ele && ele.getRootNode && ele.getRootNode(); } function inShadow(ele) { if (!canUseDom()) { return false; } return getRoot(ele) instanceof ShadowRoot; } function getShadowRoot(ele) { return inShadow(ele) ? getRoot(ele) : null; } var useInsertStyles = function useInsertStyles2() { var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, csp = _useInjectIconContext.csp; var instance = getCurrentInstance(); var mergedStyleStr = iconStyles; if (prefixCls) { mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls.value); } nextTick(function() { if (!canUseDom()) { return; } var ele = instance.vnode.el; var shadowRoot = getShadowRoot(ele); updateCSS(mergedStyleStr, "@ant-design-vue-icons", { prepend: true, csp: csp.value, attachTo: shadowRoot }); }); }; var _excluded$1 = ["icon", "primaryColor", "secondaryColor"]; function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(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; } function _objectWithoutPropertiesLoose$1(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 _objectSpread$x(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$x(target, key2, source[key2]); }); } return target; } function _defineProperty$x(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var twoToneColorPalette = reactive({ primaryColor: "#333", secondaryColor: "#E6E6E6", calculated: false }); function setTwoToneColors(_ref) { var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor; twoToneColorPalette.primaryColor = primaryColor; twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor); twoToneColorPalette.calculated = !!secondaryColor; } function getTwoToneColors() { return _objectSpread$x({}, twoToneColorPalette); } var IconBase = function IconBase2(props2, context2) { var _props$context$attrs = _objectSpread$x({}, props2, context2.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1); var colors = twoToneColorPalette; if (primaryColor) { colors = { primaryColor, secondaryColor: secondaryColor || getSecondaryColor(primaryColor) }; } warning$1(isIconDefinition(icon)); if (!isIconDefinition(icon)) { return null; } var target = icon; if (target && typeof target.icon === "function") { target = _objectSpread$x({}, target, { icon: target.icon(colors.primaryColor, colors.secondaryColor) }); } return generate(target.icon, "svg-".concat(target.name), _objectSpread$x({}, restProps, { "data-icon": target.name, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true" })); }; IconBase.props = { icon: Object, primaryColor: String, secondaryColor: String, focusable: String }; IconBase.inheritAttrs = false; IconBase.displayName = "IconBase"; IconBase.getTwoToneColors = getTwoToneColors; IconBase.setTwoToneColors = setTwoToneColors; function _slicedToArray$1(arr, i2) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$1(arr, i2) || _nonIterableRest$1(); } function _nonIterableRest$1() { 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 _unsupportedIterableToArray$1(o2, minLen) { if (!o2) return; if (typeof o2 === "string") return _arrayLikeToArray$1(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$1(o2, minLen); } function _arrayLikeToArray$1(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 _iterableToArrayLimit$1(arr, i2) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i2 && _arr.length === i2) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; } function setTwoToneColor(twoToneColor) { var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return IconBase.setTwoToneColors({ primaryColor, secondaryColor }); } function getTwoToneColor() { var colors = IconBase.getTwoToneColors(); if (!colors.calculated) { return colors.primaryColor; } return [colors.primaryColor, colors.secondaryColor]; } var InsertStyles = /* @__PURE__ */ defineComponent({ name: "InsertStyles", setup: function setup() { useInsertStyles(); return function() { return null; }; } }); var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"]; function _slicedToArray(arr, i2) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); } function _nonIterableRest() { 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 _unsupportedIterableToArray(o2, minLen) { if (!o2) return; if (typeof o2 === "string") return _arrayLikeToArray(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(o2, minLen); } function _arrayLikeToArray(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 _iterableToArrayLimit(arr, i2) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i2 && _arr.length === i2) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _objectSpread$w(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$w(target, key2, source[key2]); }); } return target; } function _defineProperty$w(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(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; } function _objectWithoutPropertiesLoose(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; } setTwoToneColor(blue.primary); var Icon = function Icon2(props2, context2) { var _classObj; var _props$context$attrs = _objectSpread$w({}, props2, context2.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties(_props$context$attrs, _excluded); var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, rootClassName = _useInjectIconContext.rootClassName; var classObj = (_classObj = {}, _defineProperty$w(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$w(_classObj, prefixCls.value, true), _defineProperty$w(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$w(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj); var iconTabIndex = tabindex; if (iconTabIndex === void 0 && onClick) { iconTabIndex = -1; } var svgStyle = rotate ? { msTransform: "rotate(".concat(rotate, "deg)"), transform: "rotate(".concat(rotate, "deg)") } : void 0; var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return createVNode("span", _objectSpread$w({ "role": "img", "aria-label": icon.name }, restProps, { "onClick": onClick, "class": [classObj, cls], "tabindex": iconTabIndex }), [createVNode(IconBase, { "icon": icon, "primaryColor": primaryColor, "secondaryColor": secondaryColor, "style": svgStyle }, null), createVNode(InsertStyles, null, null)]); }; Icon.props = { spin: Boolean, rotate: Number, icon: Object, twoToneColor: [String, Array] }; Icon.displayName = "AntdIcon"; Icon.inheritAttrs = false; Icon.getTwoToneColor = getTwoToneColor; Icon.setTwoToneColor = setTwoToneColor; function _objectSpread$v(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$v(target, key2, source[key2]); }); } return target; } function _defineProperty$v(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var DownOutlined = function DownOutlined2(props2, context2) { var p2 = _objectSpread$v({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$v({}, p2, { "icon": DownOutlined$1 }), null); }; DownOutlined.displayName = "DownOutlined"; DownOutlined.inheritAttrs = false; var LoadingOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" }; function _objectSpread$u(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$u(target, key2, source[key2]); }); } return target; } function _defineProperty$u(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var LoadingOutlined = function LoadingOutlined2(props2, context2) { var p2 = _objectSpread$u({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$u({}, p2, { "icon": LoadingOutlined$1 }), null); }; LoadingOutlined.displayName = "LoadingOutlined"; LoadingOutlined.inheritAttrs = false; var CheckOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" }; function _objectSpread$t(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$t(target, key2, source[key2]); }); } return target; } function _defineProperty$t(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CheckOutlined = function CheckOutlined2(props2, context2) { var p2 = _objectSpread$t({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$t({}, p2, { "icon": CheckOutlined$1 }), null); }; CheckOutlined.displayName = "CheckOutlined"; CheckOutlined.inheritAttrs = false; var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" }; function _objectSpread$s(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$s(target, key2, source[key2]); }); } return target; } function _defineProperty$s(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CloseOutlined = function CloseOutlined2(props2, context2) { var p2 = _objectSpread$s({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$s({}, p2, { "icon": CloseOutlined$1 }), null); }; CloseOutlined.displayName = "CloseOutlined"; CloseOutlined.inheritAttrs = false; var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" }; function _objectSpread$r(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$r(target, key2, source[key2]); }); } return target; } function _defineProperty$r(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CloseCircleFilled = function CloseCircleFilled2(props2, context2) { var p2 = _objectSpread$r({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$r({}, p2, { "icon": CloseCircleFilled$1 }), null); }; CloseCircleFilled.displayName = "CloseCircleFilled"; CloseCircleFilled.inheritAttrs = false; var SearchOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" }; function _objectSpread$q(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$q(target, key2, source[key2]); }); } return target; } function _defineProperty$q(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var SearchOutlined = function SearchOutlined2(props2, context2) { var p2 = _objectSpread$q({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$q({}, p2, { "icon": SearchOutlined$1 }), null); }; SearchOutlined.displayName = "SearchOutlined"; SearchOutlined.inheritAttrs = false; function getIcons(props2) { let slots = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const { loading, multiple, prefixCls, hasFeedback, feedbackIcon, showArrow } = props2; const suffixIcon = props2.suffixIcon || slots.suffixIcon && slots.suffixIcon(); const clearIcon = props2.clearIcon || slots.clearIcon && slots.clearIcon(); const menuItemSelectedIcon = props2.menuItemSelectedIcon || slots.menuItemSelectedIcon && slots.menuItemSelectedIcon(); const removeIcon = props2.removeIcon || slots.removeIcon && slots.removeIcon(); const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : createVNode(CloseCircleFilled, null, null); const getSuffixIconNode = (arrowIcon) => createVNode(Fragment, null, [showArrow !== false && arrowIcon, hasFeedback && feedbackIcon]); let mergedSuffixIcon = null; if (suffixIcon !== void 0) { mergedSuffixIcon = getSuffixIconNode(suffixIcon); } else if (loading) { mergedSuffixIcon = getSuffixIconNode(createVNode(LoadingOutlined, { "spin": true }, null)); } else { const iconCls = `${prefixCls}-suffix`; mergedSuffixIcon = (_ref) => { let { open: open2, showSearch } = _ref; if (open2 && showSearch) { return getSuffixIconNode(createVNode(SearchOutlined, { "class": iconCls }, null)); } return getSuffixIconNode(createVNode(DownOutlined, { "class": iconCls }, null)); }; } let mergedItemIcon = null; if (menuItemSelectedIcon !== void 0) { mergedItemIcon = menuItemSelectedIcon; } else if (multiple) { mergedItemIcon = createVNode(CheckOutlined, null, null); } else { mergedItemIcon = null; } let mergedRemoveIcon = null; if (removeIcon !== void 0) { mergedRemoveIcon = removeIcon; } else { mergedRemoveIcon = createVNode(CloseOutlined, null, null); } return { clearIcon: mergedClearIcon, suffixIcon: mergedSuffixIcon, itemIcon: mergedItemIcon, removeIcon: mergedRemoveIcon }; } function createContext(defaultValue) { const contextKey2 = Symbol("contextKey"); const useProvide = (props2, newProps) => { const mergedProps = reactive({}); provide(contextKey2, mergedProps); watchEffect(() => { _extends$1(mergedProps, props2, newProps || {}); }); return mergedProps; }; const useInject = () => { return inject(contextKey2, defaultValue) || {}; }; return { useProvide, useInject }; } const ContextKey = Symbol("ContextProps"); const InternalContextKey = Symbol("InternalContextProps"); const useProvideFormItemContext = function(props2) { let useValidation = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : computed(() => true); const formItemFields = ref(/* @__PURE__ */ new Map()); const addFormItemField = (key2, type) => { formItemFields.value.set(key2, type); formItemFields.value = new Map(formItemFields.value); }; const removeFormItemField = (key2) => { formItemFields.value.delete(key2); formItemFields.value = new Map(formItemFields.value); }; watch([useValidation, formItemFields], () => { }); provide(ContextKey, props2); provide(InternalContextKey, { addFormItemField, removeFormItemField }); }; const defaultContext = { id: computed(() => void 0), onFieldBlur: () => { }, onFieldChange: () => { }, clearValidate: () => { } }; const defaultInternalContext = { addFormItemField: () => { }, removeFormItemField: () => { } }; const useInjectFormItemContext = () => { const internalContext = inject(InternalContextKey, defaultInternalContext); const formItemFieldKey = Symbol("FormItemFieldKey"); const instance = getCurrentInstance(); internalContext.addFormItemField(formItemFieldKey, instance.type); onBeforeUnmount(() => { internalContext.removeFormItemField(formItemFieldKey); }); provide(InternalContextKey, defaultInternalContext); provide(ContextKey, defaultContext); return inject(ContextKey, defaultContext); }; const FormItemRest = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AFormItemRest", setup(_2, _ref) { let { slots } = _ref; provide(InternalContextKey, defaultInternalContext); provide(ContextKey, defaultContext); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const FormItemInputContext = createContext({}); const NoFormStatus = /* @__PURE__ */ defineComponent({ name: "NoFormStatus", setup(_2, _ref2) { let { slots } = _ref2; FormItemInputContext.useProvide({}); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); function getStatusClassNames(prefixCls, status, hasFeedback) { return classNames({ [`${prefixCls}-status-success`]: status === "success", [`${prefixCls}-status-warning`]: status === "warning", [`${prefixCls}-status-error`]: status === "error", [`${prefixCls}-status-validating`]: status === "validating", [`${prefixCls}-has-feedback`]: hasFeedback }); } const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus; const genSpaceCompactStyle = (token2) => { const { componentCls } = token2; return { [componentCls]: { display: "inline-flex", "&-block": { display: "flex", width: "100%" }, "&-vertical": { flexDirection: "column" } } }; }; const genSpaceStyle = (token2) => { const { componentCls } = token2; return { [componentCls]: { display: "inline-flex", "&-rtl": { direction: "rtl" }, "&-vertical": { flexDirection: "column" }, "&-align": { flexDirection: "column", "&-center": { alignItems: "center" }, "&-start": { alignItems: "flex-start" }, "&-end": { alignItems: "flex-end" }, "&-baseline": { alignItems: "baseline" } }, [`${componentCls}-item`]: { "&:empty": { display: "none" } } } }; }; const useStyle$g = genComponentStyleHook("Space", (token2) => [genSpaceStyle(token2), genSpaceCompactStyle(token2)]); var symbolTag$2 = "[object Symbol]"; function isSymbol(value) { return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$2; } function arrayMap(array, iteratee) { var index2 = -1, length2 = array == null ? 0 : array.length, result = Array(length2); while (++index2 < length2) { result[index2] = iteratee(array[index2], index2, array); } return result; } var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0; function baseToString(value) { if (typeof value == "string") { return value; } if (isArray(value)) { return arrayMap(value, baseToString) + ""; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ""; } var result = value + ""; return result == "0" && 1 / value == -Infinity ? "-0" : result; } var reWhitespace = /\s/; function trimmedEndIndex(string2) { var index2 = string2.length; while (index2-- && reWhitespace.test(string2.charAt(index2))) { } return index2; } var reTrimStart = /^\s+/; function baseTrim(string2) { return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2; } var NAN = 0 / 0; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsOctal = /^0o[0-7]+$/i; var freeParseInt = parseInt; function toNumber(value) { if (typeof value == "number") { return value; } if (isSymbol(value)) { return NAN; } if (isObject$2(value)) { var other = typeof value.valueOf == "function" ? value.valueOf() : value; value = isObject$2(other) ? other + "" : other; } if (typeof value != "string") { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } var INFINITY$1 = 1 / 0, MAX_INTEGER = 17976931348623157e292; function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY$1 || value === -INFINITY$1) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } function identity(value) { return value; } var objectCreate = Object.create; var baseCreate = /* @__PURE__ */ function() { function object() { } return function(proto) { if (!isObject$2(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object(); object.prototype = void 0; return result; }; }(); function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } function noop$2() { } function copyArray(source, array) { var index2 = -1, length2 = source.length; array || (array = Array(length2)); while (++index2 < length2) { array[index2] = source[index2]; } return array; } var HOT_COUNT = 800, HOT_SPAN = 16; var nativeNow = Date.now; function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(void 0, arguments); }; } function constant(value) { return function() { return value; }; } var defineProperty = function() { try { var func = getNative(Object, "defineProperty"); func({}, "", {}); return func; } catch (e2) { } }(); var baseSetToString = !defineProperty ? identity : function(func, string2) { return defineProperty(func, "toString", { "configurable": true, "enumerable": false, "value": constant(string2), "writable": true }); }; var setToString = shortOut(baseSetToString); function arrayEach(array, iteratee) { var index2 = -1, length2 = array == null ? 0 : array.length; while (++index2 < length2) { if (iteratee(array[index2], index2, array) === false) { break; } } return array; } function baseFindIndex(array, predicate, fromIndex, fromRight) { var length2 = array.length, index2 = fromIndex + -1; while (++index2 < length2) { if (predicate(array[index2], index2, array)) { return index2; } } return -1; } function baseIsNaN(value) { return value !== value; } function strictIndexOf(array, value, fromIndex) { var index2 = fromIndex - 1, length2 = array.length; while (++index2 < length2) { if (array[index2] === value) { return index2; } } return -1; } function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } function arrayIncludes(array, value) { var length2 = array == null ? 0 : array.length; return !!length2 && baseIndexOf(array, value, 0) > -1; } function baseAssignValue(object, key2, value) { if (key2 == "__proto__" && defineProperty) { defineProperty(object, key2, { "configurable": true, "enumerable": true, "value": value, "writable": true }); } else { object[key2] = value; } } var objectProto$4 = Object.prototype; var hasOwnProperty$4 = objectProto$4.hasOwnProperty; function assignValue(object, key2, value) { var objValue = object[key2]; if (!(hasOwnProperty$4.call(object, key2) && eq(objValue, value)) || value === void 0 && !(key2 in object)) { baseAssignValue(object, key2, value); } } function copyObject(source, props2, object, customizer) { var isNew = !object; object || (object = {}); var index2 = -1, length2 = props2.length; while (++index2 < length2) { var key2 = props2[index2]; var newValue = void 0; if (newValue === void 0) { newValue = source[key2]; } if (isNew) { baseAssignValue(object, key2, newValue); } else { assignValue(object, key2, newValue); } } return object; } var nativeMax$2 = Math.max; function overRest(func, start, transform) { start = nativeMax$2(start === void 0 ? func.length - 1 : start, 0); return function() { var args = arguments, index2 = -1, length2 = nativeMax$2(args.length - start, 0), array = Array(length2); while (++index2 < length2) { array[index2] = args[start + index2]; } index2 = -1; var otherArgs = Array(start + 1); while (++index2 < start) { otherArgs[index2] = args[index2]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ""); } function nativeKeysIn(object) { var result = []; if (object != null) { for (var key2 in Object(object)) { result.push(key2); } } return result; } var objectProto$3 = Object.prototype; var hasOwnProperty$3 = objectProto$3.hasOwnProperty; function baseKeysIn(object) { if (!isObject$2(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key2 in object) { if (!(key2 == "constructor" && (isProto || !hasOwnProperty$3.call(object, key2)))) { result.push(key2); } } return result; } function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } var FUNC_ERROR_TEXT$1 = "Expected a function"; function memoize(func, resolver) { if (typeof func != "function" || resolver != null && typeof resolver != "function") { throw new TypeError(FUNC_ERROR_TEXT$1); } var memoized = function() { var args = arguments, key2 = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key2)) { return cache.get(key2); } var result = func.apply(this, args); memoized.cache = cache.set(key2, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } memoize.Cache = MapCache; var MAX_MEMOIZE_SIZE = 500; function memoizeCapped(func) { var result = memoize(func, function(key2) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key2; }); var cache = result.cache; return result; } var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reEscapeChar = /\\(\\)?/g; var stringToPath = memoizeCapped(function(string2) { var result = []; if (string2.charCodeAt(0) === 46) { result.push(""); } string2.replace(rePropName, function(match2, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match2); }); return result; }); function toString(value) { return value == null ? "" : baseToString(value); } function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } function toKey(value) { if (typeof value == "string" || isSymbol(value)) { return value; } var result = value + ""; return result == "0" && 1 / value == -Infinity ? "-0" : result; } function baseGet(object, path2) { path2 = castPath(path2, object); var index2 = 0, length2 = path2.length; while (object != null && index2 < length2) { object = object[toKey(path2[index2++])]; } return index2 && index2 == length2 ? object : void 0; } function get$1(object, path2, defaultValue) { var result = object == null ? void 0 : baseGet(object, path2); return result === void 0 ? defaultValue : result; } var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0; function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } function baseFlatten(array, depth, predicate, isStrict, result) { var index2 = -1, length2 = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index2 < length2) { var value = array[index2]; if (predicate(value)) { { arrayPush(result, value); } } else { result[result.length] = value; } } return result; } function flatten(array) { var length2 = array == null ? 0 : array.length; return length2 ? baseFlatten(array) : []; } function flatRest(func) { return setToString(overRest(func, void 0, flatten), func + ""); } var getPrototype = overArg(Object.getPrototypeOf, Object); var objectTag$1 = "[object Object]"; var funcProto = Function.prototype, objectProto$2 = Object.prototype; var funcToString = funcProto.toString; var hasOwnProperty$2 = objectProto$2.hasOwnProperty; var objectCtorString = funcToString.call(Object); function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag$1) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor; return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } function baseSlice(array, start, end) { var index2 = -1, length2 = array.length; if (start < 0) { start = -start > length2 ? 0 : length2 + start; } end = end > length2 ? length2 : end; if (end < 0) { end += length2; } length2 = start > end ? 0 : end - start >>> 0; start >>>= 0; var result = Array(length2); while (++index2 < length2) { result[index2] = array[index2 + start]; } return result; } function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; var moduleExports = freeModule && freeModule.exports === freeExports; var Buffer2 = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0; function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); buffer.copy(result); return result; } function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } var nativeGetSymbols = Object.getOwnPropertySymbols; var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } var objectProto$1 = Object.prototype; var hasOwnProperty$1 = objectProto$1.hasOwnProperty; function initCloneArray(array) { var length2 = array.length, result = new array.constructor(length2); if (length2 && typeof array[0] == "string" && hasOwnProperty$1.call(array, "index")) { result.index = array.index; result.input = array.input; } return result; } function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array2(result).set(new Uint8Array2(arrayBuffer)); return result; } function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } var reFlags = /\w*$/; function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]"; var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]"; function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag$1: return cloneArrayBuffer(object); case boolTag$1: case dateTag$1: return new Ctor(+object); case dataViewTag$1: return cloneDataView(object, isDeep); case float32Tag$1: case float64Tag$1: case int8Tag$1: case int16Tag$1: case int32Tag$1: case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1: return cloneTypedArray(object, isDeep); case mapTag$3: return new Ctor(); case numberTag$2: case stringTag$1: return new Ctor(object); case regexpTag$1: return cloneRegExp(object); case setTag$3: return new Ctor(); case symbolTag$1: return cloneSymbol(object); } } function initCloneObject(object) { return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; } var mapTag$2 = "[object Map]"; function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag$2; } var nodeIsMap = nodeUtil && nodeUtil.isMap; var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; var setTag$2 = "[object Set]"; function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag$2; } var nodeIsSet = nodeUtil && nodeUtil.isSet; var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4; var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag$1] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; function baseClone(value, bitmask, customizer, key2, object, stack2) { var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2; if (customizer) { result = object ? customizer(value, key2, object, stack2) : customizer(value); } if (result !== void 0) { return result; } if (!isObject$2(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || isFunc && !object) { result = isFlat || isFunc ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } stack2 || (stack2 = new Stack()); var stacked = stack2.get(value); if (stacked) { return stacked; } stack2.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2)); }); } else if (isMap(value)) { value.forEach(function(subValue, key3) { result.set(key3, baseClone(subValue, bitmask, customizer, key3, value, stack2)); }); } var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; var props2 = isArr ? void 0 : keysFunc(value); arrayEach(props2 || value, function(subValue, key3) { if (props2) { key3 = subValue; subValue = value[key3]; } assignValue(result, key3, baseClone(subValue, bitmask, customizer, key3, value, stack2)); }); return result; } var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4; function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1); } var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; function baseIsMatch(object, source, matchData, customizer) { var index2 = matchData.length, length2 = index2; if (object == null) { return !length2; } object = Object(object); while (index2--) { var data = matchData[index2]; if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index2 < length2) { data = matchData[index2]; var key2 = data[0], objValue = object[key2], srcValue = data[1]; if (data[2]) { if (objValue === void 0 && !(key2 in object)) { return false; } } else { var stack2 = new Stack(); var result; if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack2) : result)) { return false; } } } return true; } function isStrictComparable(value) { return value === value && !isObject$2(value); } function getMatchData(object) { var result = keys(object), length2 = result.length; while (length2--) { var key2 = result[length2], value = object[key2]; result[length2] = [key2, value, isStrictComparable(value)]; } return result; } function matchesStrictComparable(key2, srcValue) { return function(object) { if (object == null) { return false; } return object[key2] === srcValue && (srcValue !== void 0 || key2 in Object(object)); }; } function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } function baseHasIn(object, key2) { return object != null && key2 in Object(object); } function hasPath(object, path2, hasFunc) { path2 = castPath(path2, object); var index2 = -1, length2 = path2.length, result = false; while (++index2 < length2) { var key2 = toKey(path2[index2]); if (!(result = object != null && hasFunc(object, key2))) { break; } object = object[key2]; } if (result || ++index2 != length2) { return result; } length2 = object == null ? 0 : object.length; return !!length2 && isLength(length2) && isIndex(key2, length2) && (isArray(object) || isArguments(object)); } function hasIn(object, path2) { return object != null && hasPath(object, path2, baseHasIn); } var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; function baseMatchesProperty(path2, srcValue) { if (isKey(path2) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path2), srcValue); } return function(object) { var objValue = get$1(object, path2); return objValue === void 0 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } function baseProperty(key2) { return function(object) { return object == null ? void 0 : object[key2]; }; } function basePropertyDeep(path2) { return function(object) { return baseGet(object, path2); }; } function property(path2) { return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); } function baseIteratee(value) { if (typeof value == "function") { return value; } if (value == null) { return identity; } if (typeof value == "object") { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } var now$2 = function() { return root.Date.now(); }; var FUNC_ERROR_TEXT = "Expected a function"; var nativeMax$1 = Math.max, nativeMin$1 = Math.min; function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject$2(options)) { leading = !!options.leading; maxing = "maxWait" in options; maxWait = maxing ? nativeMax$1(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = "trailing" in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = void 0; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { lastInvokeTime = time; timerId = setTimeout(timerExpired, wait); return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin$1(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { var time = now$2(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = void 0; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = void 0; return result; } function cancel() { if (timerId !== void 0) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = void 0; } function flush() { return timerId === void 0 ? result : trailingEdge(now$2()); } function debounced() { var time = now$2(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === void 0) { return leadingEdge(lastCallTime); } if (maxing) { clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === void 0) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } function last(array) { var length2 = array == null ? 0 : array.length; return length2 ? array[length2 - 1] : void 0; } function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = baseIteratee(predicate); collection = keys(collection); predicate = function(key2) { return iteratee(iterable[key2], key2, iterable); }; } var index2 = findIndexFunc(collection, predicate, fromIndex); return index2 > -1 ? iterable[iteratee ? collection[index2] : index2] : void 0; }; } var nativeMax = Math.max; function findIndex(array, predicate, fromIndex) { var length2 = array == null ? 0 : array.length; if (!length2) { return -1; } var index2 = fromIndex == null ? 0 : toInteger(fromIndex); if (index2 < 0) { index2 = nativeMax(length2 + index2, 0); } return baseFindIndex(array, baseIteratee(predicate), index2); } var find = createFind(findIndex); var nativeMin = Math.min; function baseIntersection(arrays, iteratee, comparator) { var includes2 = arrayIncludes, length2 = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; maxLength = nativeMin(array.length, maxLength); caches[othIndex] = length2 >= 120 && array.length >= 120 ? new SetCache(othIndex && array) : void 0; } array = arrays[0]; var index2 = -1, seen = caches[0]; outer: while (++index2 < length2 && result.length < maxLength) { var value = array[index2], computed2 = value; value = value !== 0 ? value : 0; if (!(seen ? cacheHas(seen, computed2) : includes2(result, computed2))) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed2) : includes2(arrays[othIndex], computed2))) { continue outer; } } if (seen) { seen.push(computed2); } result.push(value); } } return result; } function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; }); function parent(object, path2) { return path2.length < 2 ? object : baseGet(object, baseSlice(path2, 0, -1)); } var mapTag = "[object Map]", setTag = "[object Set]"; var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key2 in value) { if (hasOwnProperty.call(value, key2)) { return false; } } return true; } var numberTag = "[object Number]"; function isNumber(value) { return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; } function baseUnset(object, path2) { path2 = castPath(path2, object); object = parent(object, path2); return object == null || delete object[toKey(last(path2))]; } function customOmitClone(value) { return isPlainObject(value) ? void 0 : value; } var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path2) { path2 = castPath(path2, object); isDeep || (isDeep = path2.length > 1); return path2; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length2 = paths.length; while (length2--) { baseUnset(result, paths[length2]); } return result; }); function baseSet(object, path2, value, customizer) { if (!isObject$2(object)) { return object; } path2 = castPath(path2, object); var index2 = -1, length2 = path2.length, lastIndex = length2 - 1, nested = object; while (nested != null && ++index2 < length2) { var key2 = toKey(path2[index2]), newValue = value; if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") { return object; } if (index2 != lastIndex) { var objValue = nested[key2]; newValue = void 0; if (newValue === void 0) { newValue = isObject$2(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; } } assignValue(nested, key2, newValue); nested = nested[key2]; } return object; } function basePickBy(object, paths, predicate) { var index2 = -1, length2 = paths.length, result = {}; while (++index2 < length2) { var path2 = paths[index2], value = baseGet(object, path2); if (predicate(value, path2)) { baseSet(result, castPath(path2, object), value); } } return result; } function basePick(object, paths) { return basePickBy(object, paths, function(value, path2) { return hasIn(object, path2); }); } var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); var INFINITY = 1 / 0; var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? noop$2 : function(values) { return new Set$1(values); }; var LARGE_ARRAY_SIZE = 200; function baseUniq(array, iteratee, comparator) { var index2 = -1, includes2 = arrayIncludes, length2 = array.length, isCommon = true, result = [], seen = result; if (length2 >= LARGE_ARRAY_SIZE) { var set2 = createSet(array); if (set2) { return setToArray(set2); } isCommon = false; includes2 = cacheHas; seen = new SetCache(); } else { seen = result; } outer: while (++index2 < length2) { var value = array[index2], computed2 = value; value = value !== 0 ? value : 0; if (isCommon && computed2 === computed2) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed2) { continue outer; } } result.push(value); } else if (!includes2(seen, computed2, comparator)) { if (seen !== result) { seen.push(computed2); } result.push(value); } } return result; } function uniq(array) { return array && array.length ? baseUniq(array) : []; } const spaceCompactItemProps = () => ({ compactSize: String, compactDirection: PropTypes.oneOf(tuple("horizontal", "vertical")).def("horizontal"), isFirstItem: booleanType(), isLastItem: booleanType() }); const SpaceCompactItemContext = createContext(null); const useCompactItemContext = (prefixCls, direction) => { const compactItemContext = SpaceCompactItemContext.useInject(); const compactItemClassnames = computed(() => { if (!compactItemContext || isEmpty(compactItemContext)) return ""; const { compactDirection, isFirstItem, isLastItem } = compactItemContext; const separator = compactDirection === "vertical" ? "-vertical-" : "-"; return classNames({ [`${prefixCls.value}-compact${separator}item`]: true, [`${prefixCls.value}-compact${separator}first-item`]: isFirstItem, [`${prefixCls.value}-compact${separator}last-item`]: isLastItem, [`${prefixCls.value}-compact${separator}item-rtl`]: direction.value === "rtl" }); }); return { compactSize: computed(() => compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize), compactDirection: computed(() => compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection), compactItemClassnames }; }; const NoCompactStyle = /* @__PURE__ */ defineComponent({ name: "NoCompactStyle", setup(_2, _ref) { let { slots } = _ref; SpaceCompactItemContext.useProvide(null); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const spaceCompactProps = () => ({ prefixCls: String, size: { type: String }, direction: PropTypes.oneOf(tuple("horizontal", "vertical")).def("horizontal"), align: PropTypes.oneOf(tuple("start", "end", "center", "baseline")), block: { type: Boolean, default: void 0 } }); const CompactItem = /* @__PURE__ */ defineComponent({ name: "CompactItem", props: spaceCompactItemProps(), setup(props2, _ref2) { let { slots } = _ref2; SpaceCompactItemContext.useProvide(props2); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); /* @__PURE__ */ defineComponent({ name: "ASpaceCompact", inheritAttrs: false, props: spaceCompactProps(), setup(props2, _ref3) { let { attrs, slots } = _ref3; const { prefixCls, direction: directionConfig } = useConfigInject("space-compact", props2); const compactItemContext = SpaceCompactItemContext.useInject(); const [wrapSSR, hashId] = useStyle$g(prefixCls); const clx = computed(() => { return classNames(prefixCls.value, hashId.value, { [`${prefixCls.value}-rtl`]: directionConfig.value === "rtl", [`${prefixCls.value}-block`]: props2.block, [`${prefixCls.value}-vertical`]: props2.direction === "vertical" }); }); return () => { var _a; const childNodes = flattenChildren(((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) || []); if (childNodes.length === 0) { return null; } return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": [clx.value, attrs.class] }), [childNodes.map((child, i2) => { var _a2; const key2 = child && child.key || `${prefixCls.value}-item-${i2}`; const noCompactItemContext = !compactItemContext || isEmpty(compactItemContext); return createVNode(CompactItem, { "key": key2, "compactSize": (_a2 = props2.size) !== null && _a2 !== void 0 ? _a2 : "middle", "compactDirection": props2.direction, "isFirstItem": i2 === 0 && (noCompactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)), "isLastItem": i2 === childNodes.length - 1 && (noCompactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem)) }, { default: () => [child] }); })])); }; } }); const initMotionCommon = (duration) => ({ animationDuration: duration, animationFillMode: "both" }); const initMotionCommonLeave = (duration) => ({ animationDuration: duration, animationFillMode: "both" }); const initMotion = function(motionCls, inKeyframes, outKeyframes, duration) { let sameLevel = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false; const sameLevelPrefix = sameLevel ? "&" : ""; return { [` ${sameLevelPrefix}${motionCls}-enter, ${sameLevelPrefix}${motionCls}-appear `]: _extends$1(_extends$1({}, initMotionCommon(duration)), { animationPlayState: "paused" }), [`${sameLevelPrefix}${motionCls}-leave`]: _extends$1(_extends$1({}, initMotionCommonLeave(duration)), { animationPlayState: "paused" }), [` ${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active, ${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active `]: { animationName: inKeyframes, animationPlayState: "running" }, [`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: { animationName: outKeyframes, animationPlayState: "running", pointerEvents: "none" } }; }; const fadeIn = new Keyframe("antFadeIn", { "0%": { opacity: 0 }, "100%": { opacity: 1 } }); const fadeOut = new Keyframe("antFadeOut", { "0%": { opacity: 1 }, "100%": { opacity: 0 } }); const initFadeMotion = function(token2) { let sameLevel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; const { antCls } = token2; const motionCls = `${antCls}-fade`; const sameLevelPrefix = sameLevel ? "&" : ""; return [initMotion(motionCls, fadeIn, fadeOut, token2.motionDurationMid, sameLevel), { [` ${sameLevelPrefix}${motionCls}-enter, ${sameLevelPrefix}${motionCls}-appear `]: { opacity: 0, animationTimingFunction: "linear" }, [`${sameLevelPrefix}${motionCls}-leave`]: { animationTimingFunction: "linear" } }]; }; const moveDownIn = new Keyframe("antMoveDownIn", { "0%": { transform: "translate3d(0, 100%, 0)", transformOrigin: "0 0", opacity: 0 }, "100%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 } }); const moveDownOut = new Keyframe("antMoveDownOut", { "0%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 }, "100%": { transform: "translate3d(0, 100%, 0)", transformOrigin: "0 0", opacity: 0 } }); const moveLeftIn = new Keyframe("antMoveLeftIn", { "0%": { transform: "translate3d(-100%, 0, 0)", transformOrigin: "0 0", opacity: 0 }, "100%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 } }); const moveLeftOut = new Keyframe("antMoveLeftOut", { "0%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 }, "100%": { transform: "translate3d(-100%, 0, 0)", transformOrigin: "0 0", opacity: 0 } }); const moveRightIn = new Keyframe("antMoveRightIn", { "0%": { transform: "translate3d(100%, 0, 0)", transformOrigin: "0 0", opacity: 0 }, "100%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 } }); const moveRightOut = new Keyframe("antMoveRightOut", { "0%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 }, "100%": { transform: "translate3d(100%, 0, 0)", transformOrigin: "0 0", opacity: 0 } }); const moveUpIn = new Keyframe("antMoveUpIn", { "0%": { transform: "translate3d(0, -100%, 0)", transformOrigin: "0 0", opacity: 0 }, "100%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 } }); const moveUpOut = new Keyframe("antMoveUpOut", { "0%": { transform: "translate3d(0, 0, 0)", transformOrigin: "0 0", opacity: 1 }, "100%": { transform: "translate3d(0, -100%, 0)", transformOrigin: "0 0", opacity: 0 } }); const moveMotion = { "move-up": { inKeyframes: moveUpIn, outKeyframes: moveUpOut }, "move-down": { inKeyframes: moveDownIn, outKeyframes: moveDownOut }, "move-left": { inKeyframes: moveLeftIn, outKeyframes: moveLeftOut }, "move-right": { inKeyframes: moveRightIn, outKeyframes: moveRightOut } }; const initMoveMotion = (token2, motionName) => { const { antCls } = token2; const motionCls = `${antCls}-${motionName}`; const { inKeyframes, outKeyframes } = moveMotion[motionName]; return [initMotion(motionCls, inKeyframes, outKeyframes, token2.motionDurationMid), { [` ${motionCls}-enter, ${motionCls}-appear `]: { opacity: 0, animationTimingFunction: token2.motionEaseOutCirc }, [`${motionCls}-leave`]: { animationTimingFunction: token2.motionEaseInOutCirc } }]; }; const slideUpIn = new Keyframe("antSlideUpIn", { "0%": { transform: "scaleY(0.8)", transformOrigin: "0% 0%", opacity: 0 }, "100%": { transform: "scaleY(1)", transformOrigin: "0% 0%", opacity: 1 } }); const slideUpOut = new Keyframe("antSlideUpOut", { "0%": { transform: "scaleY(1)", transformOrigin: "0% 0%", opacity: 1 }, "100%": { transform: "scaleY(0.8)", transformOrigin: "0% 0%", opacity: 0 } }); const slideDownIn = new Keyframe("antSlideDownIn", { "0%": { transform: "scaleY(0.8)", transformOrigin: "100% 100%", opacity: 0 }, "100%": { transform: "scaleY(1)", transformOrigin: "100% 100%", opacity: 1 } }); const slideDownOut = new Keyframe("antSlideDownOut", { "0%": { transform: "scaleY(1)", transformOrigin: "100% 100%", opacity: 1 }, "100%": { transform: "scaleY(0.8)", transformOrigin: "100% 100%", opacity: 0 } }); const slideLeftIn = new Keyframe("antSlideLeftIn", { "0%": { transform: "scaleX(0.8)", transformOrigin: "0% 0%", opacity: 0 }, "100%": { transform: "scaleX(1)", transformOrigin: "0% 0%", opacity: 1 } }); const slideLeftOut = new Keyframe("antSlideLeftOut", { "0%": { transform: "scaleX(1)", transformOrigin: "0% 0%", opacity: 1 }, "100%": { transform: "scaleX(0.8)", transformOrigin: "0% 0%", opacity: 0 } }); const slideRightIn = new Keyframe("antSlideRightIn", { "0%": { transform: "scaleX(0.8)", transformOrigin: "100% 0%", opacity: 0 }, "100%": { transform: "scaleX(1)", transformOrigin: "100% 0%", opacity: 1 } }); const slideRightOut = new Keyframe("antSlideRightOut", { "0%": { transform: "scaleX(1)", transformOrigin: "100% 0%", opacity: 1 }, "100%": { transform: "scaleX(0.8)", transformOrigin: "100% 0%", opacity: 0 } }); const slideMotion = { "slide-up": { inKeyframes: slideUpIn, outKeyframes: slideUpOut }, "slide-down": { inKeyframes: slideDownIn, outKeyframes: slideDownOut }, "slide-left": { inKeyframes: slideLeftIn, outKeyframes: slideLeftOut }, "slide-right": { inKeyframes: slideRightIn, outKeyframes: slideRightOut } }; const initSlideMotion = (token2, motionName) => { const { antCls } = token2; const motionCls = `${antCls}-${motionName}`; const { inKeyframes, outKeyframes } = slideMotion[motionName]; return [initMotion(motionCls, inKeyframes, outKeyframes, token2.motionDurationMid), { [` ${motionCls}-enter, ${motionCls}-appear `]: { transform: "scale(0)", transformOrigin: "0% 0%", opacity: 0, animationTimingFunction: token2.motionEaseOutQuint }, [`${motionCls}-leave`]: { animationTimingFunction: token2.motionEaseInQuint } }]; }; const zoomIn = new Keyframe("antZoomIn", { "0%": { transform: "scale(0.2)", opacity: 0 }, "100%": { transform: "scale(1)", opacity: 1 } }); const zoomOut = new Keyframe("antZoomOut", { "0%": { transform: "scale(1)" }, "100%": { transform: "scale(0.2)", opacity: 0 } }); const zoomBigIn = new Keyframe("antZoomBigIn", { "0%": { transform: "scale(0.8)", opacity: 0 }, "100%": { transform: "scale(1)", opacity: 1 } }); const zoomBigOut = new Keyframe("antZoomBigOut", { "0%": { transform: "scale(1)" }, "100%": { transform: "scale(0.8)", opacity: 0 } }); const zoomUpIn = new Keyframe("antZoomUpIn", { "0%": { transform: "scale(0.8)", transformOrigin: "50% 0%", opacity: 0 }, "100%": { transform: "scale(1)", transformOrigin: "50% 0%" } }); const zoomUpOut = new Keyframe("antZoomUpOut", { "0%": { transform: "scale(1)", transformOrigin: "50% 0%" }, "100%": { transform: "scale(0.8)", transformOrigin: "50% 0%", opacity: 0 } }); const zoomLeftIn = new Keyframe("antZoomLeftIn", { "0%": { transform: "scale(0.8)", transformOrigin: "0% 50%", opacity: 0 }, "100%": { transform: "scale(1)", transformOrigin: "0% 50%" } }); const zoomLeftOut = new Keyframe("antZoomLeftOut", { "0%": { transform: "scale(1)", transformOrigin: "0% 50%" }, "100%": { transform: "scale(0.8)", transformOrigin: "0% 50%", opacity: 0 } }); const zoomRightIn = new Keyframe("antZoomRightIn", { "0%": { transform: "scale(0.8)", transformOrigin: "100% 50%", opacity: 0 }, "100%": { transform: "scale(1)", transformOrigin: "100% 50%" } }); const zoomRightOut = new Keyframe("antZoomRightOut", { "0%": { transform: "scale(1)", transformOrigin: "100% 50%" }, "100%": { transform: "scale(0.8)", transformOrigin: "100% 50%", opacity: 0 } }); const zoomDownIn = new Keyframe("antZoomDownIn", { "0%": { transform: "scale(0.8)", transformOrigin: "50% 100%", opacity: 0 }, "100%": { transform: "scale(1)", transformOrigin: "50% 100%" } }); const zoomDownOut = new Keyframe("antZoomDownOut", { "0%": { transform: "scale(1)", transformOrigin: "50% 100%" }, "100%": { transform: "scale(0.8)", transformOrigin: "50% 100%", opacity: 0 } }); const zoomMotion = { zoom: { inKeyframes: zoomIn, outKeyframes: zoomOut }, "zoom-big": { inKeyframes: zoomBigIn, outKeyframes: zoomBigOut }, "zoom-big-fast": { inKeyframes: zoomBigIn, outKeyframes: zoomBigOut }, "zoom-left": { inKeyframes: zoomLeftIn, outKeyframes: zoomLeftOut }, "zoom-right": { inKeyframes: zoomRightIn, outKeyframes: zoomRightOut }, "zoom-up": { inKeyframes: zoomUpIn, outKeyframes: zoomUpOut }, "zoom-down": { inKeyframes: zoomDownIn, outKeyframes: zoomDownOut } }; const initZoomMotion = (token2, motionName) => { const { antCls } = token2; const motionCls = `${antCls}-${motionName}`; const { inKeyframes, outKeyframes } = zoomMotion[motionName]; return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token2.motionDurationFast : token2.motionDurationMid), { [` ${motionCls}-enter, ${motionCls}-appear `]: { transform: "scale(0)", opacity: 0, animationTimingFunction: token2.motionEaseOutCirc, "&-prepare": { transform: "none" } }, [`${motionCls}-leave`]: { animationTimingFunction: token2.motionEaseInOutCirc } }]; }; const genCollapseMotion = (token2) => ({ [token2.componentCls]: { // For common/openAnimation [`${token2.antCls}-motion-collapse-legacy`]: { overflow: "hidden", "&-active": { transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut}, opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important` } }, [`${token2.antCls}-motion-collapse`]: { overflow: "hidden", transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut}, opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important` } } }); const genItemStyle = (token2) => { const { controlPaddingHorizontal } = token2; return { position: "relative", display: "block", minHeight: token2.controlHeight, padding: `${(token2.controlHeight - token2.fontSize * token2.lineHeight) / 2}px ${controlPaddingHorizontal}px`, color: token2.colorText, fontWeight: "normal", fontSize: token2.fontSize, lineHeight: token2.lineHeight, boxSizing: "border-box" }; }; const genSingleStyle$1 = (token2) => { const { antCls, componentCls } = token2; const selectItemCls = `${componentCls}-item`; return [ { [`${componentCls}-dropdown`]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "absolute", top: -9999, zIndex: token2.zIndexPopup, boxSizing: "border-box", padding: token2.paddingXXS, overflow: "hidden", fontSize: token2.fontSize, // Fix select render lag of long text in chrome // https://github.com/ant-design/ant-design/issues/11456 // https://github.com/ant-design/ant-design/issues/11843 fontVariant: "initial", backgroundColor: token2.colorBgElevated, borderRadius: token2.borderRadiusLG, outline: "none", boxShadow: token2.boxShadowSecondary, [` &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomLeft, &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomLeft `]: { animationName: slideUpIn }, [` &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topLeft, &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topLeft `]: { animationName: slideDownIn }, [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomLeft`]: { animationName: slideUpOut }, [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topLeft`]: { animationName: slideDownOut }, "&-hidden": { display: "none" }, "&-empty": { color: token2.colorTextDisabled }, // ========================= Options ========================= [`${selectItemCls}-empty`]: _extends$1(_extends$1({}, genItemStyle(token2)), { color: token2.colorTextDisabled }), [`${selectItemCls}`]: _extends$1(_extends$1({}, genItemStyle(token2)), { cursor: "pointer", transition: `background ${token2.motionDurationSlow} ease`, borderRadius: token2.borderRadiusSM, // =========== Group ============ "&-group": { color: token2.colorTextDescription, fontSize: token2.fontSizeSM, cursor: "default" }, // =========== Option =========== "&-option": { display: "flex", "&-content": _extends$1({ flex: "auto" }, textEllipsis), "&-state": { flex: "none" }, [`&-active:not(${selectItemCls}-option-disabled)`]: { backgroundColor: token2.controlItemBgHover }, [`&-selected:not(${selectItemCls}-option-disabled)`]: { color: token2.colorText, fontWeight: token2.fontWeightStrong, backgroundColor: token2.controlItemBgActive, [`${selectItemCls}-option-state`]: { color: token2.colorPrimary } }, "&-disabled": { [`&${selectItemCls}-option-selected`]: { backgroundColor: token2.colorBgContainerDisabled }, color: token2.colorTextDisabled, cursor: "not-allowed" }, "&-grouped": { paddingInlineStart: token2.controlPaddingHorizontal * 2 } } }), // =========================== RTL =========================== "&-rtl": { direction: "rtl" } }) }, // Follow code may reuse in other components initSlideMotion(token2, "slide-up"), initSlideMotion(token2, "slide-down"), initMoveMotion(token2, "move-up"), initMoveMotion(token2, "move-down") ]; }; const FIXED_ITEM_MARGIN = 2; function getSelectItemStyle(_ref) { let { controlHeightSM, controlHeight, lineWidth: borderWidth } = _ref; const selectItemDist = (controlHeight - controlHeightSM) / 2 - borderWidth; const selectItemMargin = Math.ceil(selectItemDist / 2); return [selectItemDist, selectItemMargin]; } function genSizeStyle$2(token2, suffix) { const { componentCls, iconCls } = token2; const selectOverflowPrefixCls = `${componentCls}-selection-overflow`; const selectItemHeight = token2.controlHeightSM; const [selectItemDist] = getSelectItemStyle(token2); const suffixCls = suffix ? `${componentCls}-${suffix}` : ""; return { [`${componentCls}-multiple${suffixCls}`]: { fontSize: token2.fontSize, /** * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome * may update to redesign with its align logic. */ // =========================== Overflow =========================== [selectOverflowPrefixCls]: { position: "relative", display: "flex", flex: "auto", flexWrap: "wrap", maxWidth: "100%", "&-item": { flex: "none", alignSelf: "center", maxWidth: "100%", display: "inline-flex" } }, // ========================= Selector ========================= [`${componentCls}-selector`]: { display: "flex", flexWrap: "wrap", alignItems: "center", // Multiple is little different that horizontal is follow the vertical padding: `${selectItemDist - FIXED_ITEM_MARGIN}px ${FIXED_ITEM_MARGIN * 2}px`, borderRadius: token2.borderRadius, [`${componentCls}-show-search&`]: { cursor: "text" }, [`${componentCls}-disabled&`]: { background: token2.colorBgContainerDisabled, cursor: "not-allowed" }, "&:after": { display: "inline-block", width: 0, margin: `${FIXED_ITEM_MARGIN}px 0`, lineHeight: `${selectItemHeight}px`, content: '"\\a0"' } }, [` &${componentCls}-show-arrow ${componentCls}-selector, &${componentCls}-allow-clear ${componentCls}-selector `]: { paddingInlineEnd: token2.fontSizeIcon + token2.controlPaddingHorizontal }, // ======================== Selections ======================== [`${componentCls}-selection-item`]: { position: "relative", display: "flex", flex: "none", boxSizing: "border-box", maxWidth: "100%", height: selectItemHeight, marginTop: FIXED_ITEM_MARGIN, marginBottom: FIXED_ITEM_MARGIN, lineHeight: `${selectItemHeight - token2.lineWidth * 2}px`, background: token2.colorFillSecondary, border: `${token2.lineWidth}px solid ${token2.colorSplit}`, borderRadius: token2.borderRadiusSM, cursor: "default", transition: `font-size ${token2.motionDurationSlow}, line-height ${token2.motionDurationSlow}, height ${token2.motionDurationSlow}`, userSelect: "none", marginInlineEnd: FIXED_ITEM_MARGIN * 2, paddingInlineStart: token2.paddingXS, paddingInlineEnd: token2.paddingXS / 2, [`${componentCls}-disabled&`]: { color: token2.colorTextDisabled, borderColor: token2.colorBorder, cursor: "not-allowed" }, // It's ok not to do this, but 24px makes bottom narrow in view should adjust "&-content": { display: "inline-block", marginInlineEnd: token2.paddingXS / 2, overflow: "hidden", whiteSpace: "pre", textOverflow: "ellipsis" }, "&-remove": _extends$1(_extends$1({}, resetIcon()), { display: "inline-block", color: token2.colorIcon, fontWeight: "bold", fontSize: 10, lineHeight: "inherit", cursor: "pointer", [`> ${iconCls}`]: { verticalAlign: "-0.2em" }, "&:hover": { color: token2.colorIconHover } }) }, // ========================== Input ========================== [`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item`]: { [`${componentCls}-selection-search`]: { marginInlineStart: 0 } }, [`${componentCls}-selection-search`]: { display: "inline-flex", position: "relative", maxWidth: "100%", marginInlineStart: token2.inputPaddingHorizontalBase - selectItemDist, [` &-input, &-mirror `]: { height: selectItemHeight, fontFamily: token2.fontFamily, lineHeight: `${selectItemHeight}px`, transition: `all ${token2.motionDurationSlow}` }, "&-input": { width: "100%", minWidth: 4.1 // fix search cursor missing }, "&-mirror": { position: "absolute", top: 0, insetInlineStart: 0, insetInlineEnd: "auto", zIndex: 999, whiteSpace: "pre", visibility: "hidden" } }, // ======================= Placeholder ======================= [`${componentCls}-selection-placeholder `]: { position: "absolute", top: "50%", insetInlineStart: token2.inputPaddingHorizontalBase, insetInlineEnd: token2.inputPaddingHorizontalBase, transform: "translateY(-50%)", transition: `all ${token2.motionDurationSlow}` } } }; } function genMultipleStyle(token2) { const { componentCls } = token2; const smallToken = merge(token2, { controlHeight: token2.controlHeightSM, controlHeightSM: token2.controlHeightXS, borderRadius: token2.borderRadiusSM, borderRadiusSM: token2.borderRadiusXS }); const [, smSelectItemMargin] = getSelectItemStyle(token2); return [ genSizeStyle$2(token2), // ======================== Small ======================== // Shared genSizeStyle$2(smallToken, "sm"), // Padding { [`${componentCls}-multiple${componentCls}-sm`]: { [`${componentCls}-selection-placeholder`]: { insetInlineStart: token2.controlPaddingHorizontalSM - token2.lineWidth, insetInlineEnd: "auto" }, // https://github.com/ant-design/ant-design/issues/29559 [`${componentCls}-selection-search`]: { marginInlineStart: smSelectItemMargin } } }, // ======================== Large ======================== // Shared genSizeStyle$2(merge(token2, { fontSize: token2.fontSizeLG, controlHeight: token2.controlHeightLG, controlHeightSM: token2.controlHeight, borderRadius: token2.borderRadiusLG, borderRadiusSM: token2.borderRadius }), "lg") ]; } function genSizeStyle$1(token2, suffix) { const { componentCls, inputPaddingHorizontalBase, borderRadius } = token2; const selectHeightWithoutBorder = token2.controlHeight - token2.lineWidth * 2; const selectionItemPadding = Math.ceil(token2.fontSize * 1.25); const suffixCls = suffix ? `${componentCls}-${suffix}` : ""; return { [`${componentCls}-single${suffixCls}`]: { fontSize: token2.fontSize, // ========================= Selector ========================= [`${componentCls}-selector`]: _extends$1(_extends$1({}, resetComponent(token2)), { display: "flex", borderRadius, [`${componentCls}-selection-search`]: { position: "absolute", top: 0, insetInlineStart: inputPaddingHorizontalBase, insetInlineEnd: inputPaddingHorizontalBase, bottom: 0, "&-input": { width: "100%" } }, [` ${componentCls}-selection-item, ${componentCls}-selection-placeholder `]: { padding: 0, lineHeight: `${selectHeightWithoutBorder}px`, transition: `all ${token2.motionDurationSlow}`, // Firefox inline-block position calculation is not same as Chrome & Safari. Patch this: "@supports (-moz-appearance: meterbar)": { lineHeight: `${selectHeightWithoutBorder}px` } }, [`${componentCls}-selection-item`]: { position: "relative", userSelect: "none" }, [`${componentCls}-selection-placeholder`]: { transition: "none", pointerEvents: "none" }, // For common baseline align [[ "&:after", /* For '' value baseline align */ `${componentCls}-selection-item:after`, /* For undefined value baseline align */ `${componentCls}-selection-placeholder:after` ].join(",")]: { display: "inline-block", width: 0, visibility: "hidden", content: '"\\a0"' } }), [` &${componentCls}-show-arrow ${componentCls}-selection-item, &${componentCls}-show-arrow ${componentCls}-selection-placeholder `]: { paddingInlineEnd: selectionItemPadding }, // Opacity selection if open [`&${componentCls}-open ${componentCls}-selection-item`]: { color: token2.colorTextPlaceholder }, // ========================== Input ========================== // We only change the style of non-customize input which is only support by `combobox` mode. // Not customize [`&:not(${componentCls}-customize-input)`]: { [`${componentCls}-selector`]: { width: "100%", height: token2.controlHeight, padding: `0 ${inputPaddingHorizontalBase}px`, [`${componentCls}-selection-search-input`]: { height: selectHeightWithoutBorder }, "&:after": { lineHeight: `${selectHeightWithoutBorder}px` } } }, [`&${componentCls}-customize-input`]: { [`${componentCls}-selector`]: { "&:after": { display: "none" }, [`${componentCls}-selection-search`]: { position: "static", width: "100%" }, [`${componentCls}-selection-placeholder`]: { position: "absolute", insetInlineStart: 0, insetInlineEnd: 0, padding: `0 ${inputPaddingHorizontalBase}px`, "&:after": { display: "none" } } } } } }; } function genSingleStyle(token2) { const { componentCls } = token2; const inputPaddingHorizontalSM = token2.controlPaddingHorizontalSM - token2.lineWidth; return [ genSizeStyle$1(token2), // ======================== Small ======================== // Shared genSizeStyle$1(merge(token2, { controlHeight: token2.controlHeightSM, borderRadius: token2.borderRadiusSM }), "sm"), // padding { [`${componentCls}-single${componentCls}-sm`]: { [`&:not(${componentCls}-customize-input)`]: { [`${componentCls}-selection-search`]: { insetInlineStart: inputPaddingHorizontalSM, insetInlineEnd: inputPaddingHorizontalSM }, [`${componentCls}-selector`]: { padding: `0 ${inputPaddingHorizontalSM}px` }, // With arrow should provides `padding-right` to show the arrow [`&${componentCls}-show-arrow ${componentCls}-selection-search`]: { insetInlineEnd: inputPaddingHorizontalSM + token2.fontSize * 1.5 }, [` &${componentCls}-show-arrow ${componentCls}-selection-item, &${componentCls}-show-arrow ${componentCls}-selection-placeholder `]: { paddingInlineEnd: token2.fontSize * 1.5 } } } }, // ======================== Large ======================== // Shared genSizeStyle$1(merge(token2, { controlHeight: token2.controlHeightLG, fontSize: token2.fontSizeLG, borderRadius: token2.borderRadiusLG }), "lg") ]; } function compactItemBorder(token2, parentCls, options) { const { focusElCls, focus, borderElCls } = options; const childCombinator = borderElCls ? "> *" : ""; const hoverEffects = ["hover", focus ? "focus" : null, "active"].filter(Boolean).map((n2) => `&:${n2} ${childCombinator}`).join(","); return { [`&-item:not(${parentCls}-last-item)`]: { marginInlineEnd: -token2.lineWidth }, "&-item": _extends$1(_extends$1({ [hoverEffects]: { zIndex: 2 } }, focusElCls ? { [`&${focusElCls}`]: { zIndex: 2 } } : {}), { [`&[disabled] ${childCombinator}`]: { zIndex: 0 } }) }; } function compactItemBorderRadius(prefixCls, parentCls, options) { const { borderElCls } = options; const childCombinator = borderElCls ? `> ${borderElCls}` : ""; return { [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: { borderRadius: 0 }, [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: { borderStartEndRadius: 0, borderEndEndRadius: 0 } }, [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 } } }; } function genCompactItemStyle(token2) { let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { focus: true }; const { componentCls } = token2; const compactCls = `${componentCls}-compact`; return { [compactCls]: _extends$1(_extends$1({}, compactItemBorder(token2, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options)) }; } const genSelectorStyle = (token2) => { const { componentCls } = token2; return { position: "relative", backgroundColor: token2.colorBgContainer, border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`, transition: `all ${token2.motionDurationMid} ${token2.motionEaseInOut}`, input: { cursor: "pointer" }, [`${componentCls}-show-search&`]: { cursor: "text", input: { cursor: "auto", color: "inherit" } }, [`${componentCls}-disabled&`]: { color: token2.colorTextDisabled, background: token2.colorBgContainerDisabled, cursor: "not-allowed", [`${componentCls}-multiple&`]: { background: token2.colorBgContainerDisabled }, input: { cursor: "not-allowed" } } }; }; const genStatusStyle$1 = function(rootSelectCls, token2) { let overwriteDefaultBorder = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; const { componentCls, borderHoverColor, outlineColor, antCls } = token2; const overwriteStyle = overwriteDefaultBorder ? { [`${componentCls}-selector`]: { borderColor: borderHoverColor } } : {}; return { [rootSelectCls]: { [`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: _extends$1(_extends$1({}, overwriteStyle), { [`${componentCls}-focused& ${componentCls}-selector`]: { borderColor: borderHoverColor, boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${outlineColor}`, borderInlineEndWidth: `${token2.controlLineWidth}px !important`, outline: 0 }, [`&:hover ${componentCls}-selector`]: { borderColor: borderHoverColor, borderInlineEndWidth: `${token2.controlLineWidth}px !important` } }) } }; }; const getSearchInputWithoutBorderStyle = (token2) => { const { componentCls } = token2; return { [`${componentCls}-selection-search-input`]: { margin: 0, padding: 0, background: "transparent", border: "none", outline: "none", appearance: "none", "&::-webkit-search-cancel-button": { display: "none", "-webkit-appearance": "none" } } }; }; const genBaseStyle$3 = (token2) => { const { componentCls, inputPaddingHorizontalBase, iconCls } = token2; return { [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "relative", display: "inline-block", cursor: "pointer", [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: _extends$1(_extends$1({}, genSelectorStyle(token2)), getSearchInputWithoutBorderStyle(token2)), // [`&:not(&-disabled):hover ${selectCls}-selector`]: { // ...genHoverStyle(token), // }, // ======================== Selection ======================== [`${componentCls}-selection-item`]: _extends$1({ flex: 1, fontWeight: "normal" }, textEllipsis), // ======================= Placeholder ======================= [`${componentCls}-selection-placeholder`]: _extends$1(_extends$1({}, textEllipsis), { flex: 1, color: token2.colorTextPlaceholder, pointerEvents: "none" }), // ========================== Arrow ========================== [`${componentCls}-arrow`]: _extends$1(_extends$1({}, resetIcon()), { position: "absolute", top: "50%", insetInlineStart: "auto", insetInlineEnd: inputPaddingHorizontalBase, height: token2.fontSizeIcon, marginTop: -token2.fontSizeIcon / 2, color: token2.colorTextQuaternary, fontSize: token2.fontSizeIcon, lineHeight: 1, textAlign: "center", pointerEvents: "none", display: "flex", alignItems: "center", [iconCls]: { verticalAlign: "top", transition: `transform ${token2.motionDurationSlow}`, "> svg": { verticalAlign: "top" }, [`&:not(${componentCls}-suffix)`]: { pointerEvents: "auto" } }, [`${componentCls}-disabled &`]: { cursor: "not-allowed" }, "> *:not(:last-child)": { marginInlineEnd: 8 // FIXME: magic } }), // ========================== Clear ========================== [`${componentCls}-clear`]: { position: "absolute", top: "50%", insetInlineStart: "auto", insetInlineEnd: inputPaddingHorizontalBase, zIndex: 1, display: "inline-block", width: token2.fontSizeIcon, height: token2.fontSizeIcon, marginTop: -token2.fontSizeIcon / 2, color: token2.colorTextQuaternary, fontSize: token2.fontSizeIcon, fontStyle: "normal", lineHeight: 1, textAlign: "center", textTransform: "none", background: token2.colorBgContainer, cursor: "pointer", opacity: 0, transition: `color ${token2.motionDurationMid} ease, opacity ${token2.motionDurationSlow} ease`, textRendering: "auto", "&:before": { display: "block" }, "&:hover": { color: token2.colorTextTertiary } }, "&:hover": { [`${componentCls}-clear`]: { opacity: 1 } } }), // ========================= Feedback ========================== [`${componentCls}-has-feedback`]: { [`${componentCls}-clear`]: { insetInlineEnd: inputPaddingHorizontalBase + token2.fontSize + token2.paddingXXS } } }; }; const genSelectStyle = (token2) => { const { componentCls } = token2; return [ { [componentCls]: { // ==================== BorderLess ==================== [`&-borderless ${componentCls}-selector`]: { backgroundColor: `transparent !important`, borderColor: `transparent !important`, boxShadow: `none !important` }, // ==================== In Form ==================== [`&${componentCls}-in-form-item`]: { width: "100%" } } }, // ===================================================== // == LTR == // ===================================================== // Base genBaseStyle$3(token2), // Single genSingleStyle(token2), // Multiple genMultipleStyle(token2), // Dropdown genSingleStyle$1(token2), // ===================================================== // == RTL == // ===================================================== { [`${componentCls}-rtl`]: { direction: "rtl" } }, // ===================================================== // == Status == // ===================================================== genStatusStyle$1(componentCls, merge(token2, { borderHoverColor: token2.colorPrimaryHover, outlineColor: token2.controlOutline })), genStatusStyle$1(`${componentCls}-status-error`, merge(token2, { borderHoverColor: token2.colorErrorHover, outlineColor: token2.colorErrorOutline }), true), genStatusStyle$1(`${componentCls}-status-warning`, merge(token2, { borderHoverColor: token2.colorWarningHover, outlineColor: token2.colorWarningOutline }), true), // ===================================================== // == Space Compact == // ===================================================== genCompactItemStyle(token2, { borderElCls: `${componentCls}-selector`, focusElCls: `${componentCls}-focused` }) ]; }; const useSelectStyle = genComponentStyleHook("Select", (token2, _ref) => { let { rootPrefixCls } = _ref; const selectToken = merge(token2, { rootPrefixCls, inputPaddingHorizontalBase: token2.paddingSM - 1 }); return [genSelectStyle(selectToken)]; }, (token2) => ({ zIndexPopup: token2.zIndexPopupBase + 50 })); const selectProps = () => _extends$1(_extends$1({}, omit$1(selectProps$1(), ["inputIcon", "mode", "getInputElement", "getRawInputElement", "backfill"])), { value: someType([Array, Object, String, Number]), defaultValue: someType([Array, Object, String, Number]), notFoundContent: PropTypes.any, suffixIcon: PropTypes.any, itemIcon: PropTypes.any, size: stringType(), mode: stringType(), bordered: booleanType(true), transitionName: String, choiceTransitionName: stringType(""), popupClassName: String, /** @deprecated Please use `popupClassName` instead */ dropdownClassName: String, placement: stringType(), status: stringType(), "onUpdate:value": functionType() }); const SECRET_COMBOBOX_MODE_DO_NOT_USE = "SECRET_COMBOBOX_MODE_DO_NOT_USE"; const Select = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASelect", Option, OptGroup, inheritAttrs: false, props: initDefaultProps(selectProps(), { listHeight: 256, listItemHeight: 24 }), SECRET_COMBOBOX_MODE_DO_NOT_USE, slots: Object, setup(props2, _ref) { let { attrs, emit: emit2, slots, expose } = _ref; const selectRef = ref(); const formItemContext = useInjectFormItemContext(); const formItemInputContext = FormItemInputContext.useInject(); const mergedStatus = computed(() => getMergedStatus(formItemInputContext.status, props2.status)); const focus = () => { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; const scrollTo = (arg) => { var _a; (_a = selectRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(arg); }; const mode = computed(() => { const { mode: mode2 } = props2; if (mode2 === "combobox") { return void 0; } if (mode2 === SECRET_COMBOBOX_MODE_DO_NOT_USE) { return "combobox"; } return mode2; }); const { prefixCls, direction, renderEmpty: renderEmpty2, size: contextSize, getPrefixCls, getPopupContainer, disabled, select } = useConfigInject("select", props2); const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction); const mergedSize = computed(() => compactSize.value || contextSize.value); const contextDisabled = useInjectDisabled(); const mergedDisabled = computed(() => { var _a; return (_a = disabled.value) !== null && _a !== void 0 ? _a : contextDisabled.value; }); const [wrapSSR, hashId] = useSelectStyle(prefixCls); const rootPrefixCls = computed(() => getPrefixCls()); const placement = computed(() => { if (props2.placement !== void 0) { return props2.placement; } return direction.value === "rtl" ? "bottomRight" : "bottomLeft"; }); const transitionName2 = computed(() => getTransitionName(rootPrefixCls.value, getTransitionDirection(placement.value), props2.transitionName)); const mergedClassName = computed(() => classNames({ [`${prefixCls.value}-lg`]: mergedSize.value === "large", [`${prefixCls.value}-sm`]: mergedSize.value === "small", [`${prefixCls.value}-rtl`]: direction.value === "rtl", [`${prefixCls.value}-borderless`]: !props2.bordered, [`${prefixCls.value}-in-form-item`]: formItemInputContext.isFormItemInput }, getStatusClassNames(prefixCls.value, mergedStatus.value, formItemInputContext.hasFeedback), compactItemClassnames.value, hashId.value)); const triggerChange = function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } emit2("update:value", args[0]); emit2("change", ...args); formItemContext.onFieldChange(); }; const handleBlur = (e2) => { emit2("blur", e2); formItemContext.onFieldBlur(); }; expose({ blur, focus, scrollTo }); const isMultiple2 = computed(() => mode.value === "multiple" || mode.value === "tags"); const mergedShowArrow = computed(() => props2.showArrow !== void 0 ? props2.showArrow : props2.loading || !(isMultiple2.value || mode.value === "combobox")); return () => { var _a, _b, _c, _d; const { notFoundContent, listHeight = 256, listItemHeight = 24, popupClassName, dropdownClassName, virtual, dropdownMatchSelectWidth, id = formItemContext.id.value, placeholder = (_a = slots.placeholder) === null || _a === void 0 ? void 0 : _a.call(slots), showArrow } = props2; const { hasFeedback, feedbackIcon } = formItemInputContext; let mergedNotFound; if (notFoundContent !== void 0) { mergedNotFound = notFoundContent; } else if (slots.notFoundContent) { mergedNotFound = slots.notFoundContent(); } else if (mode.value === "combobox") { mergedNotFound = null; } else { mergedNotFound = (renderEmpty2 === null || renderEmpty2 === void 0 ? void 0 : renderEmpty2("Select")) || createVNode(DefaultRenderEmpty, { "componentName": "Select" }, null); } const { suffixIcon, itemIcon, removeIcon, clearIcon } = getIcons(_extends$1(_extends$1({}, props2), { multiple: isMultiple2.value, prefixCls: prefixCls.value, hasFeedback, feedbackIcon, showArrow: mergedShowArrow.value }), slots); const selectProps2 = omit$1(props2, ["prefixCls", "suffixIcon", "itemIcon", "removeIcon", "clearIcon", "size", "bordered", "status"]); const rcSelectRtlDropdownClassName = classNames(popupClassName || dropdownClassName, { [`${prefixCls.value}-dropdown-${direction.value}`]: direction.value === "rtl" }, hashId.value); return wrapSSR(createVNode(Select$1, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ "ref": selectRef, "virtual": virtual, "dropdownMatchSelectWidth": dropdownMatchSelectWidth }, selectProps2), attrs), {}, { "showSearch": (_b = props2.showSearch) !== null && _b !== void 0 ? _b : (_c = select === null || select === void 0 ? void 0 : select.value) === null || _c === void 0 ? void 0 : _c.showSearch, "placeholder": placeholder, "listHeight": listHeight, "listItemHeight": listItemHeight, "mode": mode.value, "prefixCls": prefixCls.value, "direction": direction.value, "inputIcon": suffixIcon, "menuItemSelectedIcon": itemIcon, "removeIcon": removeIcon, "clearIcon": clearIcon, "notFoundContent": mergedNotFound, "class": [mergedClassName.value, attrs.class], "getPopupContainer": getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value, "dropdownClassName": rcSelectRtlDropdownClassName, "onChange": triggerChange, "onBlur": handleBlur, "id": id, "dropdownRender": selectProps2.dropdownRender || slots.dropdownRender, "transitionName": transitionName2.value, "children": (_d = slots.default) === null || _d === void 0 ? void 0 : _d.call(slots), "tagRender": props2.tagRender || slots.tagRender, "optionLabelRender": slots.optionLabel, "maxTagPlaceholder": props2.maxTagPlaceholder || slots.maxTagPlaceholder, "showArrow": hasFeedback || showArrow, "disabled": mergedDisabled.value }), { option: slots.option })); }; } }); Select.install = function(app) { app.component(Select.name, Select); app.component(Select.Option.displayName, Select.Option); app.component(Select.OptGroup.displayName, Select.OptGroup); return app; }; Select.Option; Select.OptGroup; var CheckCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "check-circle", "theme": "outlined" }; function _objectSpread$p(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$p(target, key2, source[key2]); }); } return target; } function _defineProperty$p(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CheckCircleOutlined = function CheckCircleOutlined2(props2, context2) { var p2 = _objectSpread$p({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$p({}, p2, { "icon": CheckCircleOutlined$1 }), null); }; CheckCircleOutlined.displayName = "CheckCircleOutlined"; CheckCircleOutlined.inheritAttrs = false; var ExclamationCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" }; function _objectSpread$o(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$o(target, key2, source[key2]); }); } return target; } function _defineProperty$o(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var ExclamationCircleOutlined = function ExclamationCircleOutlined2(props2, context2) { var p2 = _objectSpread$o({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$o({}, p2, { "icon": ExclamationCircleOutlined$1 }), null); }; ExclamationCircleOutlined.displayName = "ExclamationCircleOutlined"; ExclamationCircleOutlined.inheritAttrs = false; var InfoCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, "name": "info-circle", "theme": "outlined" }; function _objectSpread$n(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$n(target, key2, source[key2]); }); } return target; } function _defineProperty$n(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var InfoCircleOutlined = function InfoCircleOutlined2(props2, context2) { var p2 = _objectSpread$n({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$n({}, p2, { "icon": InfoCircleOutlined$1 }), null); }; InfoCircleOutlined.displayName = "InfoCircleOutlined"; InfoCircleOutlined.inheritAttrs = false; var CloseCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, "name": "close-circle", "theme": "outlined" }; function _objectSpread$m(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$m(target, key2, source[key2]); }); } return target; } function _defineProperty$m(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CloseCircleOutlined = function CloseCircleOutlined2(props2, context2) { var p2 = _objectSpread$m({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$m({}, p2, { "icon": CloseCircleOutlined$1 }), null); }; CloseCircleOutlined.displayName = "CloseCircleOutlined"; CloseCircleOutlined.inheritAttrs = false; var CheckCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" }; function _objectSpread$l(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$l(target, key2, source[key2]); }); } return target; } function _defineProperty$l(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var CheckCircleFilled = function CheckCircleFilled2(props2, context2) { var p2 = _objectSpread$l({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$l({}, p2, { "icon": CheckCircleFilled$1 }), null); }; CheckCircleFilled.displayName = "CheckCircleFilled"; CheckCircleFilled.inheritAttrs = false; var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" }; function _objectSpread$k(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$k(target, key2, source[key2]); }); } return target; } function _defineProperty$k(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var ExclamationCircleFilled = function ExclamationCircleFilled2(props2, context2) { var p2 = _objectSpread$k({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$k({}, p2, { "icon": ExclamationCircleFilled$1 }), null); }; ExclamationCircleFilled.displayName = "ExclamationCircleFilled"; ExclamationCircleFilled.inheritAttrs = false; var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" }; function _objectSpread$j(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$j(target, key2, source[key2]); }); } return target; } function _defineProperty$j(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var InfoCircleFilled = function InfoCircleFilled2(props2, context2) { var p2 = _objectSpread$j({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$j({}, p2, { "icon": InfoCircleFilled$1 }), null); }; InfoCircleFilled.displayName = "InfoCircleFilled"; InfoCircleFilled.inheritAttrs = false; const genAlertTypeStyle = (bgColor, borderColor, iconColor, token2, alertCls) => ({ backgroundColor: bgColor, border: `${token2.lineWidth}px ${token2.lineType} ${borderColor}`, [`${alertCls}-icon`]: { color: iconColor } }); const genBaseStyle$2 = (token2) => { const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, borderRadiusLG: borderRadius, motionEaseInOutCirc, alertIconSizeLG, colorText, paddingContentVerticalSM, alertPaddingHorizontal, paddingMD, paddingContentHorizontalLG } = token2; return { [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "relative", display: "flex", alignItems: "center", padding: `${paddingContentVerticalSM}px ${alertPaddingHorizontal}px`, wordWrap: "break-word", borderRadius, [`&${componentCls}-rtl`]: { direction: "rtl" }, [`${componentCls}-content`]: { flex: 1, minWidth: 0 }, [`${componentCls}-icon`]: { marginInlineEnd: marginXS, lineHeight: 0 }, [`&-description`]: { display: "none", fontSize, lineHeight }, "&-message": { color: colorText }, [`&${componentCls}-motion-leave`]: { overflow: "hidden", opacity: 1, transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc}, padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc}, margin-bottom ${duration} ${motionEaseInOutCirc}` }, [`&${componentCls}-motion-leave-active`]: { maxHeight: 0, marginBottom: "0 !important", paddingTop: 0, paddingBottom: 0, opacity: 0 } }), [`${componentCls}-with-description`]: { alignItems: "flex-start", paddingInline: paddingContentHorizontalLG, paddingBlock: paddingMD, [`${componentCls}-icon`]: { marginInlineEnd: marginSM, fontSize: alertIconSizeLG, lineHeight: 0 }, [`${componentCls}-message`]: { display: "block", marginBottom: marginXS, color: colorText, fontSize: fontSizeLG }, [`${componentCls}-description`]: { display: "block" } }, [`${componentCls}-banner`]: { marginBottom: 0, border: "0 !important", borderRadius: 0 } }; }; const genTypeStyle = (token2) => { const { componentCls, colorSuccess, colorSuccessBorder, colorSuccessBg, colorWarning, colorWarningBorder, colorWarningBg, colorError, colorErrorBorder, colorErrorBg, colorInfo, colorInfoBorder, colorInfoBg } = token2; return { [componentCls]: { "&-success": genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token2, componentCls), "&-info": genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token2, componentCls), "&-warning": genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token2, componentCls), "&-error": _extends$1(_extends$1({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token2, componentCls)), { [`${componentCls}-description > pre`]: { margin: 0, padding: 0 } }) } }; }; const genActionStyle = (token2) => { const { componentCls, iconCls, motionDurationMid, marginXS, fontSizeIcon, colorIcon, colorIconHover } = token2; return { [componentCls]: { [`&-action`]: { marginInlineStart: marginXS }, [`${componentCls}-close-icon`]: { marginInlineStart: marginXS, padding: 0, overflow: "hidden", fontSize: fontSizeIcon, lineHeight: `${fontSizeIcon}px`, backgroundColor: "transparent", border: "none", outline: "none", cursor: "pointer", [`${iconCls}-close`]: { color: colorIcon, transition: `color ${motionDurationMid}`, "&:hover": { color: colorIconHover } } }, "&-close-text": { color: colorIcon, transition: `color ${motionDurationMid}`, "&:hover": { color: colorIconHover } } } }; }; const genAlertStyle = (token2) => [genBaseStyle$2(token2), genTypeStyle(token2), genActionStyle(token2)]; const useStyle$f = genComponentStyleHook("Alert", (token2) => { const { fontSizeHeading3 } = token2; const alertToken = merge(token2, { alertIconSizeLG: fontSizeHeading3, alertPaddingHorizontal: 12 // Fixed value here. }); return [genAlertStyle(alertToken)]; }); const iconMapFilled = { success: CheckCircleFilled, info: InfoCircleFilled, error: CloseCircleFilled, warning: ExclamationCircleFilled }; const iconMapOutlined = { success: CheckCircleOutlined, info: InfoCircleOutlined, error: CloseCircleOutlined, warning: ExclamationCircleOutlined }; const AlertTypes = tuple("success", "info", "warning", "error"); const alertProps = () => ({ /** * Type of Alert styles, options: `success`, `info`, `warning`, `error` */ type: PropTypes.oneOf(AlertTypes), /** Whether Alert can be closed */ closable: { type: Boolean, default: void 0 }, /** Close text to show */ closeText: PropTypes.any, /** Content of Alert */ message: PropTypes.any, /** Additional content of Alert */ description: PropTypes.any, /** Trigger when animation ending of Alert */ afterClose: Function, /** Whether to show icon */ showIcon: { type: Boolean, default: void 0 }, prefixCls: String, banner: { type: Boolean, default: void 0 }, icon: PropTypes.any, closeIcon: PropTypes.any, onClose: Function }); const Alert = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AAlert", inheritAttrs: false, props: alertProps(), setup(props2, _ref) { let { slots, emit: emit2, attrs, expose } = _ref; const { prefixCls, direction } = useConfigInject("alert", props2); const [wrapSSR, hashId] = useStyle$f(prefixCls); const closing = shallowRef(false); const closed = shallowRef(false); const alertNode = shallowRef(); const handleClose = (e2) => { e2.preventDefault(); const dom = alertNode.value; dom.style.height = `${dom.offsetHeight}px`; dom.style.height = `${dom.offsetHeight}px`; closing.value = true; emit2("close", e2); }; const animationEnd = () => { var _a; closing.value = false; closed.value = true; (_a = props2.afterClose) === null || _a === void 0 ? void 0 : _a.call(props2); }; const mergedType = computed(() => { const { type } = props2; if (type !== void 0) { return type; } return props2.banner ? "warning" : "info"; }); expose({ animationEnd }); const motionStyle = shallowRef({}); return () => { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; const { banner, closeIcon: customCloseIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots) } = props2; let { closable, showIcon } = props2; const closeText = (_b = props2.closeText) !== null && _b !== void 0 ? _b : (_c = slots.closeText) === null || _c === void 0 ? void 0 : _c.call(slots); const description = (_d = props2.description) !== null && _d !== void 0 ? _d : (_e = slots.description) === null || _e === void 0 ? void 0 : _e.call(slots); const message = (_f = props2.message) !== null && _f !== void 0 ? _f : (_g = slots.message) === null || _g === void 0 ? void 0 : _g.call(slots); const icon = (_h = props2.icon) !== null && _h !== void 0 ? _h : (_j = slots.icon) === null || _j === void 0 ? void 0 : _j.call(slots); const action = (_k = slots.action) === null || _k === void 0 ? void 0 : _k.call(slots); showIcon = banner && showIcon === void 0 ? true : showIcon; const IconType = (description ? iconMapOutlined : iconMapFilled)[mergedType.value] || null; if (closeText) { closable = true; } const prefixClsValue = prefixCls.value; const alertCls = classNames(prefixClsValue, { [`${prefixClsValue}-${mergedType.value}`]: true, [`${prefixClsValue}-closing`]: closing.value, [`${prefixClsValue}-with-description`]: !!description, [`${prefixClsValue}-no-icon`]: !showIcon, [`${prefixClsValue}-banner`]: !!banner, [`${prefixClsValue}-closable`]: closable, [`${prefixClsValue}-rtl`]: direction.value === "rtl", [hashId.value]: true }); const closeIcon = closable ? createVNode("button", { "type": "button", "onClick": handleClose, "class": `${prefixClsValue}-close-icon`, "tabindex": 0 }, [closeText ? createVNode("span", { "class": `${prefixClsValue}-close-text` }, [closeText]) : customCloseIcon === void 0 ? createVNode(CloseOutlined, null, null) : customCloseIcon]) : null; const iconNode = icon && (isValidElement(icon) ? cloneElement(icon, { class: `${prefixClsValue}-icon` }) : createVNode("span", { "class": `${prefixClsValue}-icon` }, [icon])) || createVNode(IconType, { "class": `${prefixClsValue}-icon` }, null); const transitionProps = getTransitionProps(`${prefixClsValue}-motion`, { appear: false, css: true, onAfterLeave: animationEnd, onBeforeLeave: (node2) => { node2.style.maxHeight = `${node2.offsetHeight}px`; }, onLeave: (node2) => { node2.style.maxHeight = "0px"; } }); return wrapSSR(closed.value ? null : createVNode(Transition, transitionProps, { default: () => [withDirectives(createVNode("div", _objectSpread2$1(_objectSpread2$1({ "role": "alert" }, attrs), {}, { "style": [attrs.style, motionStyle.value], "class": [attrs.class, alertCls], "data-show": !closing.value, "ref": alertNode }), [showIcon ? iconNode : null, createVNode("div", { "class": `${prefixClsValue}-content` }, [message ? createVNode("div", { "class": `${prefixClsValue}-message` }, [message]) : null, description ? createVNode("div", { "class": `${prefixClsValue}-description` }, [description]) : null]), action ? createVNode("div", { "class": `${prefixClsValue}-action` }, [action]) : null, closeIcon]), [[vShow, !closing.value]])] })); }; } }); const Alert$1 = withInstall(Alert); const responsiveArray = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"]; const getResponsiveMap = (token2) => ({ xs: `(max-width: ${token2.screenXSMax}px)`, sm: `(min-width: ${token2.screenSM}px)`, md: `(min-width: ${token2.screenMD}px)`, lg: `(min-width: ${token2.screenLG}px)`, xl: `(min-width: ${token2.screenXL}px)`, xxl: `(min-width: ${token2.screenXXL}px)`, xxxl: `{min-width: ${token2.screenXXXL}px}` }); function useResponsiveObserver() { const [, token2] = useToken(); return computed(() => { const responsiveMap = getResponsiveMap(token2.value); const subscribers = /* @__PURE__ */ new Map(); let subUid = -1; let screens = {}; return { matchHandlers: {}, dispatch(pointMap) { screens = pointMap; subscribers.forEach((func) => func(screens)); return subscribers.size >= 1; }, subscribe(func) { if (!subscribers.size) this.register(); subUid += 1; subscribers.set(subUid, func); func(screens); return subUid; }, unsubscribe(paramToken) { subscribers.delete(paramToken); if (!subscribers.size) this.unregister(); }, unregister() { Object.keys(responsiveMap).forEach((screen) => { const matchMediaQuery = responsiveMap[screen]; const handler = this.matchHandlers[matchMediaQuery]; handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener); }); subscribers.clear(); }, register() { Object.keys(responsiveMap).forEach((screen) => { const matchMediaQuery = responsiveMap[screen]; const listener = (_ref) => { let { matches } = _ref; this.dispatch(_extends$1(_extends$1({}, screens), { [screen]: matches })); }; const mql = window.matchMedia(matchMediaQuery); mql.addListener(listener); this.matchHandlers[matchMediaQuery] = { mql, listener }; listener(mql); }); }, responsiveMap }; }); } const autoAdjustOverflow$2 = { adjustX: 1, adjustY: 1 }; const targetOffset$2 = [0, 0]; const placements$2 = { left: { points: ["cr", "cl"], overflow: autoAdjustOverflow$2, offset: [-4, 0], targetOffset: targetOffset$2 }, right: { points: ["cl", "cr"], overflow: autoAdjustOverflow$2, offset: [4, 0], targetOffset: targetOffset$2 }, top: { points: ["bc", "tc"], overflow: autoAdjustOverflow$2, offset: [0, -4], targetOffset: targetOffset$2 }, bottom: { points: ["tc", "bc"], overflow: autoAdjustOverflow$2, offset: [0, 4], targetOffset: targetOffset$2 }, topLeft: { points: ["bl", "tl"], overflow: autoAdjustOverflow$2, offset: [0, -4], targetOffset: targetOffset$2 }, leftTop: { points: ["tr", "tl"], overflow: autoAdjustOverflow$2, offset: [-4, 0], targetOffset: targetOffset$2 }, topRight: { points: ["br", "tr"], overflow: autoAdjustOverflow$2, offset: [0, -4], targetOffset: targetOffset$2 }, rightTop: { points: ["tl", "tr"], overflow: autoAdjustOverflow$2, offset: [4, 0], targetOffset: targetOffset$2 }, bottomRight: { points: ["tr", "br"], overflow: autoAdjustOverflow$2, offset: [0, 4], targetOffset: targetOffset$2 }, rightBottom: { points: ["bl", "br"], overflow: autoAdjustOverflow$2, offset: [4, 0], targetOffset: targetOffset$2 }, bottomLeft: { points: ["tl", "bl"], overflow: autoAdjustOverflow$2, offset: [0, 4], targetOffset: targetOffset$2 }, leftBottom: { points: ["br", "bl"], overflow: autoAdjustOverflow$2, offset: [-4, 0], targetOffset: targetOffset$2 } }; const tooltipContentProps = { prefixCls: String, id: String, overlayInnerStyle: PropTypes.any }; const Content$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "TooltipContent", props: tooltipContentProps, setup(props2, _ref) { let { slots } = _ref; return () => { var _a; return createVNode("div", { "class": `${props2.prefixCls}-inner`, "id": props2.id, "role": "tooltip", "style": props2.overlayInnerStyle }, [(_a = slots.overlay) === null || _a === void 0 ? void 0 : _a.call(slots)]); }; } }); var __rest$i = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function noop$1() { } const Tooltip$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Tooltip", inheritAttrs: false, props: { trigger: PropTypes.any.def(["hover"]), defaultVisible: { type: Boolean, default: void 0 }, visible: { type: Boolean, default: void 0 }, placement: PropTypes.string.def("right"), transitionName: String, animation: PropTypes.any, afterVisibleChange: PropTypes.func.def(() => { }), overlayStyle: { type: Object, default: void 0 }, overlayClassName: String, prefixCls: PropTypes.string.def("rc-tooltip"), mouseEnterDelay: PropTypes.number.def(0.1), mouseLeaveDelay: PropTypes.number.def(0.1), getPopupContainer: Function, destroyTooltipOnHide: { type: Boolean, default: false }, align: PropTypes.object.def(() => ({})), arrowContent: PropTypes.any.def(null), tipId: String, builtinPlacements: PropTypes.object, overlayInnerStyle: { type: Object, default: void 0 }, popupVisible: { type: Boolean, default: void 0 }, onVisibleChange: Function, onPopupAlign: Function, arrow: { type: Boolean, default: true } }, setup(props2, _ref) { let { slots, attrs, expose } = _ref; const triggerDOM = shallowRef(); const getPopupElement = () => { const { prefixCls, tipId, overlayInnerStyle } = props2; return [!!props2.arrow ? createVNode("div", { "class": `${prefixCls}-arrow`, "key": "arrow" }, [getPropsSlot(slots, props2, "arrowContent")]) : null, createVNode(Content$1, { "key": "content", "prefixCls": prefixCls, "id": tipId, "overlayInnerStyle": overlayInnerStyle }, { overlay: slots.overlay })]; }; const getPopupDomNode = () => { return triggerDOM.value.getPopupDomNode(); }; expose({ getPopupDomNode, triggerDOM, forcePopupAlign: () => { var _a; return (_a = triggerDOM.value) === null || _a === void 0 ? void 0 : _a.forcePopupAlign(); } }); const destroyTooltip = shallowRef(false); const autoDestroy = shallowRef(false); watchEffect(() => { const { destroyTooltipOnHide } = props2; if (typeof destroyTooltipOnHide === "boolean") { destroyTooltip.value = destroyTooltipOnHide; } else if (destroyTooltipOnHide && typeof destroyTooltipOnHide === "object") { const { keepParent } = destroyTooltipOnHide; destroyTooltip.value = keepParent === true; autoDestroy.value = keepParent === false; } }); return () => { const { overlayClassName, trigger: trigger2, mouseEnterDelay, mouseLeaveDelay, overlayStyle, prefixCls, afterVisibleChange, transitionName: transitionName2, animation, placement, align, destroyTooltipOnHide, defaultVisible } = props2, restProps = __rest$i(props2, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible"]); const extraProps = _extends$1({}, restProps); if (props2.visible !== void 0) { extraProps.popupVisible = props2.visible; } const triggerProps2 = _extends$1(_extends$1(_extends$1({ popupClassName: overlayClassName, prefixCls, action: trigger2, builtinPlacements: placements$2, popupPlacement: placement, popupAlign: align, afterPopupVisibleChange: afterVisibleChange, popupTransitionName: transitionName2, popupAnimation: animation, defaultPopupVisible: defaultVisible, destroyPopupOnHide: destroyTooltip.value, autoDestroy: autoDestroy.value, mouseLeaveDelay, popupStyle: overlayStyle, mouseEnterDelay }, extraProps), attrs), { onPopupVisibleChange: props2.onVisibleChange || noop$1, onPopupAlign: props2.onPopupAlign || noop$1, ref: triggerDOM, arrow: !!props2.arrow, popup: getPopupElement() }); return createVNode(Trigger, triggerProps2, { default: slots.default }); }; } }); const abstractTooltipProps = () => ({ trigger: [String, Array], open: { type: Boolean, default: void 0 }, /** @deprecated Please use `open` instead. */ visible: { type: Boolean, default: void 0 }, placement: String, color: String, transitionName: String, overlayStyle: objectType(), overlayInnerStyle: objectType(), overlayClassName: String, openClassName: String, prefixCls: String, mouseEnterDelay: Number, mouseLeaveDelay: Number, getPopupContainer: Function, /**@deprecated Please use `arrow={{ pointAtCenter: true }}` instead. */ arrowPointAtCenter: { type: Boolean, default: void 0 }, arrow: { type: [Boolean, Object], default: true }, autoAdjustOverflow: { type: [Boolean, Object], default: void 0 }, destroyTooltipOnHide: { type: Boolean, default: void 0 }, align: objectType(), builtinPlacements: objectType(), children: Array, /** @deprecated Please use `onOpenChange` instead. */ onVisibleChange: Function, /** @deprecated Please use `onUpdate:open` instead. */ "onUpdate:visible": Function, onOpenChange: Function, "onUpdate:open": Function }); const autoAdjustOverflowEnabled = { adjustX: 1, adjustY: 1 }; const autoAdjustOverflowDisabled = { adjustX: 0, adjustY: 0 }; const targetOffset$1 = [0, 0]; function getOverflowOptions(autoAdjustOverflow2) { if (typeof autoAdjustOverflow2 === "boolean") { return autoAdjustOverflow2 ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled; } return _extends$1(_extends$1({}, autoAdjustOverflowDisabled), autoAdjustOverflow2); } function getPlacements(config) { const { arrowWidth = 4, horizontalArrowShift = 16, verticalArrowShift = 8, autoAdjustOverflow: autoAdjustOverflow2, arrowPointAtCenter } = config; const placementMap = { left: { points: ["cr", "cl"], offset: [-4, 0] }, right: { points: ["cl", "cr"], offset: [4, 0] }, top: { points: ["bc", "tc"], offset: [0, -4] }, bottom: { points: ["tc", "bc"], offset: [0, 4] }, topLeft: { points: ["bl", "tc"], offset: [-(horizontalArrowShift + arrowWidth), -4] }, leftTop: { points: ["tr", "cl"], offset: [-4, -(verticalArrowShift + arrowWidth)] }, topRight: { points: ["br", "tc"], offset: [horizontalArrowShift + arrowWidth, -4] }, rightTop: { points: ["tl", "cr"], offset: [4, -(verticalArrowShift + arrowWidth)] }, bottomRight: { points: ["tr", "bc"], offset: [horizontalArrowShift + arrowWidth, 4] }, rightBottom: { points: ["bl", "cr"], offset: [4, verticalArrowShift + arrowWidth] }, bottomLeft: { points: ["tl", "bc"], offset: [-(horizontalArrowShift + arrowWidth), 4] }, leftBottom: { points: ["br", "cl"], offset: [-4, verticalArrowShift + arrowWidth] } }; Object.keys(placementMap).forEach((key2) => { placementMap[key2] = arrowPointAtCenter ? _extends$1(_extends$1({}, placementMap[key2]), { overflow: getOverflowOptions(autoAdjustOverflow2), targetOffset: targetOffset$1 }) : _extends$1(_extends$1({}, placements$2[key2]), { overflow: getOverflowOptions(autoAdjustOverflow2) }); placementMap[key2].ignoreShake = true; }); return placementMap; } function firstNotUndefined() { let arr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; for (let i2 = 0, len = arr.length; i2 < len; i2++) { if (arr[i2] !== void 0) { return arr[i2]; } } return void 0; } const inverseColors = PresetColors.map((color) => `${color}-inverse`); function isPresetColor(color) { let includeInverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; if (includeInverse) { return [...inverseColors, ...PresetColors].includes(color); } return PresetColors.includes(color); } function parseColor(prefixCls, color) { const isInternalColor = isPresetColor(color); const className = classNames({ [`${prefixCls}-${color}`]: color && isInternalColor }); const overlayStyle = {}; const arrowStyle = {}; if (color && !isInternalColor) { overlayStyle.background = color; arrowStyle["--antd-arrow-background-color"] = color; } return { className, overlayStyle, arrowStyle }; } function connectArrowCls(classList) { let showArrowCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; return classList.map((cls) => `${showArrowCls}${cls}`).join(","); } const MAX_VERTICAL_CONTENT_RADIUS = 8; function getArrowOffset(options) { const maxVerticalContentRadius = MAX_VERTICAL_CONTENT_RADIUS; const { sizePopupArrow, contentRadius, borderRadiusOuter } = options; const arrowInnerOffset = sizePopupArrow / 2 - Math.ceil(borderRadiusOuter * (Math.sqrt(2) - 1)); const dropdownArrowOffset = (contentRadius > 12 ? contentRadius + 2 : 12) - arrowInnerOffset; const dropdownArrowOffsetVertical = maxVerticalContentRadius - arrowInnerOffset; return { dropdownArrowOffset, dropdownArrowOffsetVertical }; } function getArrowStyle(token2, options) { const { componentCls, sizePopupArrow, marginXXS, borderRadiusXS, borderRadiusOuter, boxShadowPopoverArrow } = token2; const { colorBg, showArrowCls, contentRadius = token2.borderRadiusLG } = options; const { dropdownArrowOffsetVertical, dropdownArrowOffset } = getArrowOffset({ sizePopupArrow, contentRadius, borderRadiusOuter }); const dropdownArrowDistance = sizePopupArrow / 2 + marginXXS; return { [componentCls]: { // ============================ Basic ============================ [`${componentCls}-arrow`]: [_extends$1(_extends$1({ position: "absolute", zIndex: 1, display: "block" }, roundedArrow(sizePopupArrow, borderRadiusXS, borderRadiusOuter, colorBg, boxShadowPopoverArrow)), { "&:before": { background: colorBg } })], // ========================== Placement ========================== // Here handle the arrow position and rotate stuff // >>>>> Top [[`&-placement-top ${componentCls}-arrow`, `&-placement-topLeft ${componentCls}-arrow`, `&-placement-topRight ${componentCls}-arrow`].join(",")]: { bottom: 0, transform: "translateY(100%) rotate(180deg)" }, [`&-placement-top ${componentCls}-arrow`]: { left: { _skip_check_: true, value: "50%" }, transform: "translateX(-50%) translateY(100%) rotate(180deg)" }, [`&-placement-topLeft ${componentCls}-arrow`]: { left: { _skip_check_: true, value: dropdownArrowOffset } }, [`&-placement-topRight ${componentCls}-arrow`]: { right: { _skip_check_: true, value: dropdownArrowOffset } }, // >>>>> Bottom [[`&-placement-bottom ${componentCls}-arrow`, `&-placement-bottomLeft ${componentCls}-arrow`, `&-placement-bottomRight ${componentCls}-arrow`].join(",")]: { top: 0, transform: `translateY(-100%)` }, [`&-placement-bottom ${componentCls}-arrow`]: { left: { _skip_check_: true, value: "50%" }, transform: `translateX(-50%) translateY(-100%)` }, [`&-placement-bottomLeft ${componentCls}-arrow`]: { left: { _skip_check_: true, value: dropdownArrowOffset } }, [`&-placement-bottomRight ${componentCls}-arrow`]: { right: { _skip_check_: true, value: dropdownArrowOffset } }, // >>>>> Left [[`&-placement-left ${componentCls}-arrow`, `&-placement-leftTop ${componentCls}-arrow`, `&-placement-leftBottom ${componentCls}-arrow`].join(",")]: { right: { _skip_check_: true, value: 0 }, transform: "translateX(100%) rotate(90deg)" }, [`&-placement-left ${componentCls}-arrow`]: { top: { _skip_check_: true, value: "50%" }, transform: "translateY(-50%) translateX(100%) rotate(90deg)" }, [`&-placement-leftTop ${componentCls}-arrow`]: { top: dropdownArrowOffsetVertical }, [`&-placement-leftBottom ${componentCls}-arrow`]: { bottom: dropdownArrowOffsetVertical }, // >>>>> Right [[`&-placement-right ${componentCls}-arrow`, `&-placement-rightTop ${componentCls}-arrow`, `&-placement-rightBottom ${componentCls}-arrow`].join(",")]: { left: { _skip_check_: true, value: 0 }, transform: "translateX(-100%) rotate(-90deg)" }, [`&-placement-right ${componentCls}-arrow`]: { top: { _skip_check_: true, value: "50%" }, transform: "translateY(-50%) translateX(-100%) rotate(-90deg)" }, [`&-placement-rightTop ${componentCls}-arrow`]: { top: dropdownArrowOffsetVertical }, [`&-placement-rightBottom ${componentCls}-arrow`]: { bottom: dropdownArrowOffsetVertical }, // =========================== Offset ============================ // Offset the popover to account for the dropdown arrow // >>>>> Top [connectArrowCls([`&-placement-topLeft`, `&-placement-top`, `&-placement-topRight`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: { paddingBottom: dropdownArrowDistance }, // >>>>> Bottom [connectArrowCls([`&-placement-bottomLeft`, `&-placement-bottom`, `&-placement-bottomRight`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: { paddingTop: dropdownArrowDistance }, // >>>>> Left [connectArrowCls([`&-placement-leftTop`, `&-placement-left`, `&-placement-leftBottom`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: { paddingRight: { _skip_check_: true, value: dropdownArrowDistance } }, // >>>>> Right [connectArrowCls([`&-placement-rightTop`, `&-placement-right`, `&-placement-rightBottom`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: { paddingLeft: { _skip_check_: true, value: dropdownArrowDistance } } } }; } const genTooltipStyle = (token2) => { const { componentCls, // ant-tooltip tooltipMaxWidth, tooltipColor, tooltipBg, tooltipBorderRadius, zIndexPopup, controlHeight, boxShadowSecondary, paddingSM, paddingXS, tooltipRadiusOuter } = token2; return [ { [componentCls]: _extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), { position: "absolute", zIndex: zIndexPopup, display: "block", "&": [{ width: "max-content" }, { width: "intrinsic" }], maxWidth: tooltipMaxWidth, visibility: "visible", "&-hidden": { display: "none" }, "--antd-arrow-background-color": tooltipBg, // Wrapper for the tooltip content [`${componentCls}-inner`]: { minWidth: controlHeight, minHeight: controlHeight, padding: `${paddingSM / 2}px ${paddingXS}px`, color: tooltipColor, textAlign: "start", textDecoration: "none", wordWrap: "break-word", backgroundColor: tooltipBg, borderRadius: tooltipBorderRadius, boxShadow: boxShadowSecondary }, // Limit left and right placement radius [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(",")]: { [`${componentCls}-inner`]: { borderRadius: Math.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS) } }, [`${componentCls}-content`]: { position: "relative" } }), genPresetColor(token2, (colorKey, _ref) => { let { darkColor } = _ref; return { [`&${componentCls}-${colorKey}`]: { [`${componentCls}-inner`]: { backgroundColor: darkColor }, [`${componentCls}-arrow`]: { "--antd-arrow-background-color": darkColor } } }; })), { // RTL "&-rtl": { direction: "rtl" } }) }, // Arrow Style getArrowStyle(merge(token2, { borderRadiusOuter: tooltipRadiusOuter }), { colorBg: "var(--antd-arrow-background-color)", showArrowCls: "", contentRadius: tooltipBorderRadius }), // Pure Render { [`${componentCls}-pure`]: { position: "relative", maxWidth: "none" } } ]; }; const useStyle$e = (prefixCls, injectStyle) => { const useOriginHook = genComponentStyleHook("Tooltip", (token2) => { if ((injectStyle === null || injectStyle === void 0 ? void 0 : injectStyle.value) === false) { return []; } const { borderRadius, colorTextLightSolid, colorBgDefault, borderRadiusOuter } = token2; const TooltipToken = merge(token2, { // default variables tooltipMaxWidth: 250, tooltipColor: colorTextLightSolid, tooltipBorderRadius: borderRadius, tooltipBg: colorBgDefault, tooltipRadiusOuter: borderRadiusOuter > 4 ? 4 : borderRadiusOuter }); return [genTooltipStyle(TooltipToken), initZoomMotion(token2, "zoom-big-fast")]; }, (_ref2) => { let { zIndexPopupBase, colorBgSpotlight } = _ref2; return { zIndexPopup: zIndexPopupBase + 70, colorBgDefault: colorBgSpotlight }; }); return useOriginHook(prefixCls); }; const splitObject = (obj, keys2) => { const picked = {}; const omitted = _extends$1({}, obj); keys2.forEach((key2) => { if (obj && key2 in obj) { picked[key2] = obj[key2]; delete omitted[key2]; } }); return { picked, omitted }; }; const tooltipProps = () => _extends$1(_extends$1({}, abstractTooltipProps()), { title: PropTypes.any }); const ToolTip = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ATooltip", inheritAttrs: false, props: initDefaultProps(tooltipProps(), { trigger: "hover", align: {}, placement: "top", mouseEnterDelay: 0.1, mouseLeaveDelay: 0.1, arrowPointAtCenter: false, autoAdjustOverflow: true }), slots: Object, // emits: ['update:visible', 'visibleChange'], setup(props2, _ref) { let { slots, emit: emit2, attrs, expose } = _ref; const { prefixCls, getPopupContainer, direction, rootPrefixCls } = useConfigInject("tooltip", props2); const mergedOpen = computed(() => { var _a; return (_a = props2.open) !== null && _a !== void 0 ? _a : props2.visible; }); const innerOpen = ref(firstNotUndefined([props2.open, props2.visible])); const tooltip = ref(); let rafId; watch(mergedOpen, (val) => { wrapperRaf.cancel(rafId); rafId = wrapperRaf(() => { innerOpen.value = !!val; }); }); const isNoTitle = () => { var _a; const title = (_a = props2.title) !== null && _a !== void 0 ? _a : slots.title; return !title && title !== 0; }; const handleVisibleChange = (val) => { const noTitle = isNoTitle(); if (mergedOpen.value === void 0) { innerOpen.value = noTitle ? false : val; } if (!noTitle) { emit2("update:visible", val); emit2("visibleChange", val); emit2("update:open", val); emit2("openChange", val); } }; const getPopupDomNode = () => { return tooltip.value.getPopupDomNode(); }; expose({ getPopupDomNode, open: innerOpen, forcePopupAlign: () => { var _a; return (_a = tooltip.value) === null || _a === void 0 ? void 0 : _a.forcePopupAlign(); } }); const tooltipPlacements = computed(() => { var _a; const { builtinPlacements, autoAdjustOverflow: autoAdjustOverflow2, arrow, arrowPointAtCenter } = props2; let mergedArrowPointAtCenter = arrowPointAtCenter; if (typeof arrow === "object") { mergedArrowPointAtCenter = (_a = arrow.pointAtCenter) !== null && _a !== void 0 ? _a : arrowPointAtCenter; } return builtinPlacements || getPlacements({ arrowPointAtCenter: mergedArrowPointAtCenter, autoAdjustOverflow: autoAdjustOverflow2 }); }); const isTrueProps = (val) => { return val || val === ""; }; const getDisabledCompatibleChildren = (ele) => { const elementType = ele.type; if (typeof elementType === "object" && ele.props) { if ((elementType.__ANT_BUTTON === true || elementType === "button") && isTrueProps(ele.props.disabled) || elementType.__ANT_SWITCH === true && (isTrueProps(ele.props.disabled) || isTrueProps(ele.props.loading)) || elementType.__ANT_RADIO === true && isTrueProps(ele.props.disabled)) { const { picked, omitted } = splitObject(getStyle$1(ele), ["position", "left", "right", "top", "bottom", "float", "display", "zIndex"]); const spanStyle = _extends$1(_extends$1({ display: "inline-block" }, picked), { cursor: "not-allowed", lineHeight: 1, width: ele.props && ele.props.block ? "100%" : void 0 }); const buttonStyle = _extends$1(_extends$1({}, omitted), { pointerEvents: "none" }); const child = cloneElement(ele, { style: buttonStyle }, true); return createVNode("span", { "style": spanStyle, "class": `${prefixCls.value}-disabled-compatible-wrapper` }, [child]); } } return ele; }; const getOverlay = () => { var _a, _b; return (_a = props2.title) !== null && _a !== void 0 ? _a : (_b = slots.title) === null || _b === void 0 ? void 0 : _b.call(slots); }; const onPopupAlign = (domNode, align) => { const placements2 = tooltipPlacements.value; const placement = Object.keys(placements2).find((key2) => { var _a, _b; return placements2[key2].points[0] === ((_a = align.points) === null || _a === void 0 ? void 0 : _a[0]) && placements2[key2].points[1] === ((_b = align.points) === null || _b === void 0 ? void 0 : _b[1]); }); if (placement) { const rect = domNode.getBoundingClientRect(); const transformOrigin = { top: "50%", left: "50%" }; if (placement.indexOf("top") >= 0 || placement.indexOf("Bottom") >= 0) { transformOrigin.top = `${rect.height - align.offset[1]}px`; } else if (placement.indexOf("Top") >= 0 || placement.indexOf("bottom") >= 0) { transformOrigin.top = `${-align.offset[1]}px`; } if (placement.indexOf("left") >= 0 || placement.indexOf("Right") >= 0) { transformOrigin.left = `${rect.width - align.offset[0]}px`; } else if (placement.indexOf("right") >= 0 || placement.indexOf("Left") >= 0) { transformOrigin.left = `${-align.offset[0]}px`; } domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`; } }; const colorInfo = computed(() => parseColor(prefixCls.value, props2.color)); const injectFromPopover = computed(() => attrs["data-popover-inject"]); const [wrapSSR, hashId] = useStyle$e(prefixCls, computed(() => !injectFromPopover.value)); return () => { var _a, _b; const { openClassName, overlayClassName, overlayStyle, overlayInnerStyle } = props2; let children = (_b = filterEmpty((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))) !== null && _b !== void 0 ? _b : null; children = children.length === 1 ? children[0] : children; let tempVisible = innerOpen.value; if (mergedOpen.value === void 0 && isNoTitle()) { tempVisible = false; } if (!children) { return null; } const child = getDisabledCompatibleChildren(isValidElement(children) && !isFragment(children) ? children : createVNode("span", null, [children])); const childCls = classNames({ [openClassName || `${prefixCls.value}-open`]: true, [child.props && child.props.class]: child.props && child.props.class }); const customOverlayClassName = classNames(overlayClassName, { [`${prefixCls.value}-rtl`]: direction.value === "rtl" }, colorInfo.value.className, hashId.value); const formattedOverlayInnerStyle = _extends$1(_extends$1({}, colorInfo.value.overlayStyle), overlayInnerStyle); const arrowContentStyle = colorInfo.value.arrowStyle; const vcTooltipProps = _extends$1(_extends$1(_extends$1({}, attrs), props2), { prefixCls: prefixCls.value, arrow: !!props2.arrow, getPopupContainer: getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value, builtinPlacements: tooltipPlacements.value, visible: tempVisible, ref: tooltip, overlayClassName: customOverlayClassName, overlayStyle: _extends$1(_extends$1({}, arrowContentStyle), overlayStyle), overlayInnerStyle: formattedOverlayInnerStyle, onVisibleChange: handleVisibleChange, onPopupAlign, transitionName: getTransitionName(rootPrefixCls.value, "zoom-big-fast", props2.transitionName) }); return wrapSSR(createVNode(Tooltip$1, vcTooltipProps, { default: () => [innerOpen.value ? cloneElement(child, { class: childCls }) : child], arrowContent: () => createVNode("span", { "class": `${prefixCls.value}-arrow-content` }, null), overlay: getOverlay })); }; } }); const Tooltip = withInstall(ToolTip); const autoAdjustOverflow$1 = { adjustX: 1, adjustY: 1 }; const targetOffset = [0, 0]; const placements$1 = { topLeft: { points: ["bl", "tl"], overflow: autoAdjustOverflow$1, offset: [0, -4], targetOffset }, topCenter: { points: ["bc", "tc"], overflow: autoAdjustOverflow$1, offset: [0, -4], targetOffset }, topRight: { points: ["br", "tr"], overflow: autoAdjustOverflow$1, offset: [0, -4], targetOffset }, bottomLeft: { points: ["tl", "bl"], overflow: autoAdjustOverflow$1, offset: [0, 4], targetOffset }, bottomCenter: { points: ["tc", "bc"], overflow: autoAdjustOverflow$1, offset: [0, 4], targetOffset }, bottomRight: { points: ["tr", "br"], overflow: autoAdjustOverflow$1, offset: [0, 4], targetOffset } }; var __rest$h = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const Dropdown = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, props: { minOverlayWidthMatchTrigger: { type: Boolean, default: void 0 }, arrow: { type: Boolean, default: false }, prefixCls: PropTypes.string.def("rc-dropdown"), transitionName: String, overlayClassName: PropTypes.string.def(""), openClassName: String, animation: PropTypes.any, align: PropTypes.object, overlayStyle: { type: Object, default: void 0 }, placement: PropTypes.string.def("bottomLeft"), overlay: PropTypes.any, trigger: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).def("hover"), alignPoint: { type: Boolean, default: void 0 }, showAction: PropTypes.array, hideAction: PropTypes.array, getPopupContainer: Function, visible: { type: Boolean, default: void 0 }, defaultVisible: { type: Boolean, default: false }, mouseEnterDelay: PropTypes.number.def(0.15), mouseLeaveDelay: PropTypes.number.def(0.1) }, emits: ["visibleChange", "overlayClick"], setup(props2, _ref) { let { slots, emit: emit2, expose } = _ref; const triggerVisible = ref(!!props2.visible); watch(() => props2.visible, (val) => { if (val !== void 0) { triggerVisible.value = val; } }); const triggerRef2 = ref(); expose({ triggerRef: triggerRef2 }); const onClick = (e2) => { if (props2.visible === void 0) { triggerVisible.value = false; } emit2("overlayClick", e2); }; const onVisibleChange = (visible) => { if (props2.visible === void 0) { triggerVisible.value = visible; } emit2("visibleChange", visible); }; const getMenuElement = () => { var _a; const overlayElement = (_a = slots.overlay) === null || _a === void 0 ? void 0 : _a.call(slots); const extraOverlayProps = { prefixCls: `${props2.prefixCls}-menu`, onClick }; return createVNode(Fragment, { "key": skipFlattenKey }, [props2.arrow && createVNode("div", { "class": `${props2.prefixCls}-arrow` }, null), cloneElement(overlayElement, extraOverlayProps, false)]); }; const minOverlayWidthMatchTrigger = computed(() => { const { minOverlayWidthMatchTrigger: matchTrigger = !props2.alignPoint } = props2; return matchTrigger; }); const renderChildren2 = () => { var _a; const children = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); return triggerVisible.value && children ? cloneElement(children[0], { class: props2.openClassName || `${props2.prefixCls}-open` }, false) : children; }; const triggerHideAction = computed(() => { if (!props2.hideAction && props2.trigger.indexOf("contextmenu") !== -1) { return ["click"]; } return props2.hideAction; }); return () => { const { prefixCls, arrow, showAction, overlayStyle, trigger: trigger2, placement, align, getPopupContainer, transitionName: transitionName2, animation, overlayClassName } = props2, otherProps = __rest$h(props2, ["prefixCls", "arrow", "showAction", "overlayStyle", "trigger", "placement", "align", "getPopupContainer", "transitionName", "animation", "overlayClassName"]); return createVNode(Trigger, _objectSpread2$1(_objectSpread2$1({}, otherProps), {}, { "prefixCls": prefixCls, "ref": triggerRef2, "popupClassName": classNames(overlayClassName, { [`${prefixCls}-show-arrow`]: arrow }), "popupStyle": overlayStyle, "builtinPlacements": placements$1, "action": trigger2, "showAction": showAction, "hideAction": triggerHideAction.value || [], "popupPlacement": placement, "popupAlign": align, "popupTransitionName": transitionName2, "popupAnimation": animation, "popupVisible": triggerVisible.value, "stretch": minOverlayWidthMatchTrigger.value ? "minWidth" : "", "onPopupVisibleChange": onVisibleChange, "getPopupContainer": getPopupContainer }), { popup: getMenuElement, default: renderChildren2 }); }; } }); const genWaveStyle = (token2) => { const { componentCls, colorPrimary } = token2; return { [componentCls]: { position: "absolute", background: "transparent", pointerEvents: "none", boxSizing: "border-box", color: `var(--wave-color, ${colorPrimary})`, boxShadow: `0 0 0 0 currentcolor`, opacity: 0.2, // =================== Motion =================== "&.wave-motion-appear": { transition: [`box-shadow 0.4s ${token2.motionEaseOutCirc}`, `opacity 2s ${token2.motionEaseOutCirc}`].join(","), "&-active": { boxShadow: `0 0 0 6px currentcolor`, opacity: 0 } } } }; }; const useStyle$d = genComponentStyleHook("Wave", (token2) => [genWaveStyle(token2)]); function isNotGrey(color) { const match2 = (color || "").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/); if (match2 && match2[1] && match2[2] && match2[3]) { return !(match2[1] === match2[2] && match2[2] === match2[3]); } return true; } function isValidWaveColor(color) { return color && color !== "#fff" && color !== "#ffffff" && color !== "rgb(255, 255, 255)" && color !== "rgba(255, 255, 255, 1)" && isNotGrey(color) && !/rgba\((?:\d*, ){3}0\)/.test(color) && // any transparent rgba color color !== "transparent"; } function getTargetWaveColor(node2) { const { borderTopColor, borderColor, backgroundColor } = getComputedStyle(node2); if (isValidWaveColor(borderTopColor)) { return borderTopColor; } if (isValidWaveColor(borderColor)) { return borderColor; } if (isValidWaveColor(backgroundColor)) { return backgroundColor; } return null; } function validateNum(value) { return Number.isNaN(value) ? 0 : value; } const WaveEffect = /* @__PURE__ */ defineComponent({ props: { target: objectType(), className: String }, setup(props2) { const divRef = shallowRef(null); const [color, setWaveColor] = useState(null); const [borderRadius, setBorderRadius] = useState([]); const [left, setLeft] = useState(0); const [top, setTop] = useState(0); const [width, setWidth] = useState(0); const [height, setHeight] = useState(0); const [enabled, setEnabled] = useState(false); function syncPos() { const { target } = props2; const nodeStyle = getComputedStyle(target); setWaveColor(getTargetWaveColor(target)); const isStatic = nodeStyle.position === "static"; const { borderLeftWidth, borderTopWidth } = nodeStyle; setLeft(isStatic ? target.offsetLeft : validateNum(-parseFloat(borderLeftWidth))); setTop(isStatic ? target.offsetTop : validateNum(-parseFloat(borderTopWidth))); setWidth(target.offsetWidth); setHeight(target.offsetHeight); const { borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius } = nodeStyle; setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map((radius) => validateNum(parseFloat(radius)))); } let resizeObserver; let rafId; let timeoutId; const clear = () => { clearTimeout(timeoutId); wrapperRaf.cancel(rafId); resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect(); }; const removeDom = () => { var _a; const holder = (_a = divRef.value) === null || _a === void 0 ? void 0 : _a.parentElement; if (holder) { render(null, holder); if (holder.parentElement) { holder.parentElement.removeChild(holder); } } }; onMounted(() => { clear(); timeoutId = setTimeout(() => { removeDom(); }, 5e3); const { target } = props2; if (target) { rafId = wrapperRaf(() => { syncPos(); setEnabled(true); }); if (typeof ResizeObserver !== "undefined") { resizeObserver = new ResizeObserver(syncPos); resizeObserver.observe(target); } } }); onBeforeUnmount(() => { clear(); }); const onTransitionend = (e2) => { if (e2.propertyName === "opacity") { removeDom(); } }; return () => { if (!enabled.value) { return null; } const waveStyle = { left: `${left.value}px`, top: `${top.value}px`, width: `${width.value}px`, height: `${height.value}px`, borderRadius: borderRadius.value.map((radius) => `${radius}px`).join(" ") }; if (color) { waveStyle["--wave-color"] = color.value; } return createVNode(Transition, { "appear": true, "name": "wave-motion", "appearFromClass": "wave-motion-appear", "appearActiveClass": "wave-motion-appear", "appearToClass": "wave-motion-appear wave-motion-appear-active" }, { default: () => [createVNode("div", { "ref": divRef, "class": props2.className, "style": waveStyle, "onTransitionend": onTransitionend }, null)] }); }; } }); function showWaveEffect(node2, className) { const holder = document.createElement("div"); holder.style.position = "absolute"; holder.style.left = `0px`; holder.style.top = `0px`; node2 === null || node2 === void 0 ? void 0 : node2.insertBefore(holder, node2 === null || node2 === void 0 ? void 0 : node2.firstChild); render(createVNode(WaveEffect, { "target": node2, "className": className }, null), holder); return () => { render(null, holder); if (holder.parentElement) { holder.parentElement.removeChild(holder); } }; } function useWave(className, wave) { const instance = getCurrentInstance(); let stopWave; function showWave() { var _a; const node2 = findDOMNode(instance); stopWave === null || stopWave === void 0 ? void 0 : stopWave(); if (((_a = wave === null || wave === void 0 ? void 0 : wave.value) === null || _a === void 0 ? void 0 : _a.disabled) || !node2) { return; } stopWave = showWaveEffect(node2, className.value); } onBeforeUnmount(() => { stopWave === null || stopWave === void 0 ? void 0 : stopWave(); }); return showWave; } const Wave = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Wave", props: { disabled: Boolean }, setup(props2, _ref) { let { slots } = _ref; const instance = getCurrentInstance(); const { prefixCls, wave } = useConfigInject("wave", props2); const [, hashId] = useStyle$d(prefixCls); const showWave = useWave(computed(() => classNames(prefixCls.value, hashId.value)), wave); let onClick; const clear = () => { const node2 = findDOMNode(instance); node2.removeEventListener("click", onClick, true); }; onMounted(() => { watch(() => props2.disabled, () => { clear(); nextTick(() => { const node2 = findDOMNode(instance); node2 === null || node2 === void 0 ? void 0 : node2.removeEventListener("click", onClick, true); if (!node2 || node2.nodeType !== 1 || props2.disabled) { return; } onClick = (e2) => { if (e2.target.tagName === "INPUT" || !isVisible(e2.target) || // No need wave !node2.getAttribute || node2.getAttribute("disabled") || node2.disabled || node2.className.includes("disabled") || node2.className.includes("-leave")) { return; } showWave(); }; node2.addEventListener("click", onClick, true); }); }, { immediate: true, flush: "post" }); }); onBeforeUnmount(() => { clear(); }); return () => { var _a; const children = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0]; return children; }; } }); function convertLegacyProps(type) { if (type === "danger") { return { danger: true }; } return { type }; } const buttonProps = () => ({ prefixCls: String, type: String, htmlType: { type: String, default: "button" }, shape: { type: String }, size: { type: String }, loading: { type: [Boolean, Object], default: () => false }, disabled: { type: Boolean, default: void 0 }, ghost: { type: Boolean, default: void 0 }, block: { type: Boolean, default: void 0 }, danger: { type: Boolean, default: void 0 }, icon: PropTypes.any, href: String, target: String, title: String, onClick: eventType(), onMousedown: eventType() }); const getCollapsedWidth = (node2) => { if (node2) { node2.style.width = "0px"; node2.style.opacity = "0"; node2.style.transform = "scale(0)"; } }; const getRealWidth = (node2) => { nextTick(() => { if (node2) { node2.style.width = `${node2.scrollWidth}px`; node2.style.opacity = "1"; node2.style.transform = "scale(1)"; } }); }; const resetStyle = (node2) => { if (node2 && node2.style) { node2.style.width = null; node2.style.opacity = null; node2.style.transform = null; } }; const LoadingIcon = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "LoadingIcon", props: { prefixCls: String, loading: [Boolean, Object], existIcon: Boolean }, setup(props2) { return () => { const { existIcon, prefixCls, loading } = props2; if (existIcon) { return createVNode("span", { "class": `${prefixCls}-loading-icon` }, [createVNode(LoadingOutlined, null, null)]); } const visible = !!loading; return createVNode(Transition, { "name": `${prefixCls}-loading-icon-motion`, "onBeforeEnter": getCollapsedWidth, "onEnter": getRealWidth, "onAfterEnter": resetStyle, "onBeforeLeave": getRealWidth, "onLeave": (node2) => { setTimeout(() => { getCollapsedWidth(node2); }); }, "onAfterLeave": resetStyle }, { default: () => [visible ? createVNode("span", { "class": `${prefixCls}-loading-icon` }, [createVNode(LoadingOutlined, null, null)]) : null] }); }; } }); const genButtonBorderStyle = (buttonTypeCls, borderColor) => ({ // Border [`> span, > ${buttonTypeCls}`]: { "&:not(:last-child)": { [`&, & > ${buttonTypeCls}`]: { "&:not(:disabled)": { borderInlineEndColor: borderColor } } }, "&:not(:first-child)": { [`&, & > ${buttonTypeCls}`]: { "&:not(:disabled)": { borderInlineStartColor: borderColor } } } } }); const genGroupStyle$1 = (token2) => { const { componentCls, fontSize, lineWidth, colorPrimaryHover, colorErrorHover } = token2; return { [`${componentCls}-group`]: [ { position: "relative", display: "inline-flex", // Border [`> span, > ${componentCls}`]: { "&:not(:last-child)": { [`&, & > ${componentCls}`]: { borderStartEndRadius: 0, borderEndEndRadius: 0 } }, "&:not(:first-child)": { marginInlineStart: -lineWidth, [`&, & > ${componentCls}`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 } } }, [componentCls]: { position: "relative", zIndex: 1, [`&:hover, &:focus, &:active`]: { zIndex: 2 }, "&[disabled]": { zIndex: 0 } }, [`${componentCls}-icon-only`]: { fontSize } }, // Border Color genButtonBorderStyle(`${componentCls}-primary`, colorPrimaryHover), genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover) ] }; }; function compactItemVerticalBorder(token2, parentCls) { return { // border collapse [`&-item:not(${parentCls}-last-item)`]: { marginBottom: -token2.lineWidth }, "&-item": { "&:hover,&:focus,&:active": { zIndex: 2 }, "&[disabled]": { zIndex: 0 } } }; } function compactItemBorderVerticalRadius(prefixCls, parentCls) { return { [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: { borderRadius: 0 }, [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: { [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: { borderEndEndRadius: 0, borderEndStartRadius: 0 } }, [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: { [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: { borderStartStartRadius: 0, borderStartEndRadius: 0 } } }; } function genCompactItemVerticalStyle(token2) { const compactCls = `${token2.componentCls}-compact-vertical`; return { [compactCls]: _extends$1(_extends$1({}, compactItemVerticalBorder(token2, compactCls)), compactItemBorderVerticalRadius(token2.componentCls, compactCls)) }; } const genSharedButtonStyle = (token2) => { const { componentCls, iconCls } = token2; return { [componentCls]: { outline: "none", position: "relative", display: "inline-block", fontWeight: 400, whiteSpace: "nowrap", textAlign: "center", backgroundImage: "none", backgroundColor: "transparent", border: `${token2.lineWidth}px ${token2.lineType} transparent`, cursor: "pointer", transition: `all ${token2.motionDurationMid} ${token2.motionEaseInOut}`, userSelect: "none", touchAction: "manipulation", lineHeight: token2.lineHeight, color: token2.colorText, "> span": { display: "inline-block" }, // Leave a space between icon and text. [`> ${iconCls} + span, > span + ${iconCls}`]: { marginInlineStart: token2.marginXS }, "> a": { color: "currentColor" }, "&:not(:disabled)": _extends$1({}, genFocusStyle(token2)), // make `btn-icon-only` not too narrow [`&-icon-only${componentCls}-compact-item`]: { flex: "none" }, // Special styles for Primary Button [`&-compact-item${componentCls}-primary`]: { [`&:not([disabled]) + ${componentCls}-compact-item${componentCls}-primary:not([disabled])`]: { position: "relative", "&:before": { position: "absolute", top: -token2.lineWidth, insetInlineStart: -token2.lineWidth, display: "inline-block", width: token2.lineWidth, height: `calc(100% + ${token2.lineWidth * 2}px)`, backgroundColor: token2.colorPrimaryHover, content: '""' } } }, // Special styles for Primary Button "&-compact-vertical-item": { [`&${componentCls}-primary`]: { [`&:not([disabled]) + ${componentCls}-compact-vertical-item${componentCls}-primary:not([disabled])`]: { position: "relative", "&:before": { position: "absolute", top: -token2.lineWidth, insetInlineStart: -token2.lineWidth, display: "inline-block", width: `calc(100% + ${token2.lineWidth * 2}px)`, height: token2.lineWidth, backgroundColor: token2.colorPrimaryHover, content: '""' } } } } } }; }; const genHoverActiveButtonStyle = (hoverStyle, activeStyle) => ({ "&:not(:disabled)": { "&:hover": hoverStyle, "&:active": activeStyle } }); const genCircleButtonStyle = (token2) => ({ minWidth: token2.controlHeight, paddingInlineStart: 0, paddingInlineEnd: 0, borderRadius: "50%" }); const genRoundButtonStyle = (token2) => ({ borderRadius: token2.controlHeight, paddingInlineStart: token2.controlHeight / 2, paddingInlineEnd: token2.controlHeight / 2 }); const genDisabledStyle$1 = (token2) => ({ cursor: "not-allowed", borderColor: token2.colorBorder, color: token2.colorTextDisabled, backgroundColor: token2.colorBgContainerDisabled, boxShadow: "none" }); const genGhostButtonStyle = (btnCls, textColor, borderColor, textColorDisabled, borderColorDisabled, hoverStyle, activeStyle) => ({ [`&${btnCls}-background-ghost`]: _extends$1(_extends$1({ color: textColor || void 0, backgroundColor: "transparent", borderColor: borderColor || void 0, boxShadow: "none" }, genHoverActiveButtonStyle(_extends$1({ backgroundColor: "transparent" }, hoverStyle), _extends$1({ backgroundColor: "transparent" }, activeStyle))), { "&:disabled": { cursor: "not-allowed", color: textColorDisabled || void 0, borderColor: borderColorDisabled || void 0 } }) }); const genSolidDisabledButtonStyle = (token2) => ({ "&:disabled": _extends$1({}, genDisabledStyle$1(token2)) }); const genSolidButtonStyle = (token2) => _extends$1({}, genSolidDisabledButtonStyle(token2)); const genPureDisabledButtonStyle = (token2) => ({ "&:disabled": { cursor: "not-allowed", color: token2.colorTextDisabled } }); const genDefaultButtonStyle = (token2) => _extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, genSolidButtonStyle(token2)), { backgroundColor: token2.colorBgContainer, borderColor: token2.colorBorder, boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlTmpOutline}` }), genHoverActiveButtonStyle({ color: token2.colorPrimaryHover, borderColor: token2.colorPrimaryHover }, { color: token2.colorPrimaryActive, borderColor: token2.colorPrimaryActive })), genGhostButtonStyle(token2.componentCls, token2.colorBgContainer, token2.colorBgContainer, token2.colorTextDisabled, token2.colorBorder)), { [`&${token2.componentCls}-dangerous`]: _extends$1(_extends$1(_extends$1({ color: token2.colorError, borderColor: token2.colorError }, genHoverActiveButtonStyle({ color: token2.colorErrorHover, borderColor: token2.colorErrorBorderHover }, { color: token2.colorErrorActive, borderColor: token2.colorErrorActive })), genGhostButtonStyle(token2.componentCls, token2.colorError, token2.colorError, token2.colorTextDisabled, token2.colorBorder)), genSolidDisabledButtonStyle(token2)) }); const genPrimaryButtonStyle = (token2) => _extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, genSolidButtonStyle(token2)), { color: token2.colorTextLightSolid, backgroundColor: token2.colorPrimary, boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlOutline}` }), genHoverActiveButtonStyle({ color: token2.colorTextLightSolid, backgroundColor: token2.colorPrimaryHover }, { color: token2.colorTextLightSolid, backgroundColor: token2.colorPrimaryActive })), genGhostButtonStyle(token2.componentCls, token2.colorPrimary, token2.colorPrimary, token2.colorTextDisabled, token2.colorBorder, { color: token2.colorPrimaryHover, borderColor: token2.colorPrimaryHover }, { color: token2.colorPrimaryActive, borderColor: token2.colorPrimaryActive })), { [`&${token2.componentCls}-dangerous`]: _extends$1(_extends$1(_extends$1({ backgroundColor: token2.colorError, boxShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.colorErrorOutline}` }, genHoverActiveButtonStyle({ backgroundColor: token2.colorErrorHover }, { backgroundColor: token2.colorErrorActive })), genGhostButtonStyle(token2.componentCls, token2.colorError, token2.colorError, token2.colorTextDisabled, token2.colorBorder, { color: token2.colorErrorHover, borderColor: token2.colorErrorHover }, { color: token2.colorErrorActive, borderColor: token2.colorErrorActive })), genSolidDisabledButtonStyle(token2)) }); const genDashedButtonStyle = (token2) => _extends$1(_extends$1({}, genDefaultButtonStyle(token2)), { borderStyle: "dashed" }); const genLinkButtonStyle = (token2) => _extends$1(_extends$1(_extends$1({ color: token2.colorLink }, genHoverActiveButtonStyle({ color: token2.colorLinkHover }, { color: token2.colorLinkActive })), genPureDisabledButtonStyle(token2)), { [`&${token2.componentCls}-dangerous`]: _extends$1(_extends$1({ color: token2.colorError }, genHoverActiveButtonStyle({ color: token2.colorErrorHover }, { color: token2.colorErrorActive })), genPureDisabledButtonStyle(token2)) }); const genTextButtonStyle = (token2) => _extends$1(_extends$1(_extends$1({}, genHoverActiveButtonStyle({ color: token2.colorText, backgroundColor: token2.colorBgTextHover }, { color: token2.colorText, backgroundColor: token2.colorBgTextActive })), genPureDisabledButtonStyle(token2)), { [`&${token2.componentCls}-dangerous`]: _extends$1(_extends$1({ color: token2.colorError }, genPureDisabledButtonStyle(token2)), genHoverActiveButtonStyle({ color: token2.colorErrorHover, backgroundColor: token2.colorErrorBg }, { color: token2.colorErrorHover, backgroundColor: token2.colorErrorBg })) }); const genDisabledButtonStyle = (token2) => _extends$1(_extends$1({}, genDisabledStyle$1(token2)), { [`&${token2.componentCls}:hover`]: _extends$1({}, genDisabledStyle$1(token2)) }); const genTypeButtonStyle = (token2) => { const { componentCls } = token2; return { [`${componentCls}-default`]: genDefaultButtonStyle(token2), [`${componentCls}-primary`]: genPrimaryButtonStyle(token2), [`${componentCls}-dashed`]: genDashedButtonStyle(token2), [`${componentCls}-link`]: genLinkButtonStyle(token2), [`${componentCls}-text`]: genTextButtonStyle(token2), [`${componentCls}-disabled`]: genDisabledButtonStyle(token2) }; }; const genSizeButtonStyle = function(token2) { let sizePrefixCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; const { componentCls, iconCls, controlHeight, fontSize, lineHeight, lineWidth, borderRadius, buttonPaddingHorizontal } = token2; const paddingVertical = Math.max(0, (controlHeight - fontSize * lineHeight) / 2 - lineWidth); const paddingHorizontal = buttonPaddingHorizontal - lineWidth; const iconOnlyCls = `${componentCls}-icon-only`; return [ // Size { [`${componentCls}${sizePrefixCls}`]: { fontSize, height: controlHeight, padding: `${paddingVertical}px ${paddingHorizontal}px`, borderRadius, [`&${iconOnlyCls}`]: { width: controlHeight, paddingInlineStart: 0, paddingInlineEnd: 0, [`&${componentCls}-round`]: { width: "auto" }, "> span": { transform: "scale(1.143)" // 14px -> 16px } }, // Loading [`&${componentCls}-loading`]: { opacity: token2.opacityLoading, cursor: "default" }, [`${componentCls}-loading-icon`]: { transition: `width ${token2.motionDurationSlow} ${token2.motionEaseInOut}, opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut}` }, [`&:not(${iconOnlyCls}) ${componentCls}-loading-icon > ${iconCls}`]: { marginInlineEnd: token2.marginXS } } }, // Shape - patch prefixCls again to override solid border radius style { [`${componentCls}${componentCls}-circle${sizePrefixCls}`]: genCircleButtonStyle(token2) }, { [`${componentCls}${componentCls}-round${sizePrefixCls}`]: genRoundButtonStyle(token2) } ]; }; const genSizeBaseButtonStyle = (token2) => genSizeButtonStyle(token2); const genSizeSmallButtonStyle = (token2) => { const smallToken = merge(token2, { controlHeight: token2.controlHeightSM, padding: token2.paddingXS, buttonPaddingHorizontal: 8, borderRadius: token2.borderRadiusSM }); return genSizeButtonStyle(smallToken, `${token2.componentCls}-sm`); }; const genSizeLargeButtonStyle = (token2) => { const largeToken = merge(token2, { controlHeight: token2.controlHeightLG, fontSize: token2.fontSizeLG, borderRadius: token2.borderRadiusLG }); return genSizeButtonStyle(largeToken, `${token2.componentCls}-lg`); }; const genBlockButtonStyle = (token2) => { const { componentCls } = token2; return { [componentCls]: { [`&${componentCls}-block`]: { width: "100%" } } }; }; const useStyle$c = genComponentStyleHook("Button", (token2) => { const { controlTmpOutline, paddingContentHorizontal } = token2; const buttonToken = merge(token2, { colorOutlineDefault: controlTmpOutline, buttonPaddingHorizontal: paddingContentHorizontal }); return [ // Shared genSharedButtonStyle(buttonToken), // Size genSizeSmallButtonStyle(buttonToken), genSizeBaseButtonStyle(buttonToken), genSizeLargeButtonStyle(buttonToken), // Block genBlockButtonStyle(buttonToken), // Group (type, ghost, danger, disabled, loading) genTypeButtonStyle(buttonToken), // Button Group genGroupStyle$1(buttonToken), // Space Compact genCompactItemStyle(token2, { focus: false }), genCompactItemVerticalStyle(token2) ]; }); const buttonGroupProps = () => ({ prefixCls: String, size: { type: String } }); const GroupSizeContext = createContext(); const ButtonGroup = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AButtonGroup", props: buttonGroupProps(), setup(props2, _ref) { let { slots } = _ref; const { prefixCls, direction } = useConfigInject("btn-group", props2); const [, , hashId] = useToken(); GroupSizeContext.useProvide(reactive({ size: computed(() => props2.size) })); const classes = computed(() => { const { size } = props2; let sizeCls = ""; switch (size) { case "large": sizeCls = "lg"; break; case "small": sizeCls = "sm"; break; case "middle": case void 0: break; default: devWarning(!size, "Button.Group", "Invalid prop `size`."); } return { [`${prefixCls.value}`]: true, [`${prefixCls.value}-${sizeCls}`]: sizeCls, [`${prefixCls.value}-rtl`]: direction.value === "rtl", [hashId.value]: true }; }); return () => { var _a; return createVNode("div", { "class": classes.value }, [flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))]); }; } }); const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/; const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar); function isUnBorderedButtonType(type) { return type === "text" || type === "link"; } const Button$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AButton", inheritAttrs: false, __ANT_BUTTON: true, props: initDefaultProps(buttonProps(), { type: "default" }), slots: Object, // emits: ['click', 'mousedown'], setup(props2, _ref) { let { slots, attrs, emit: emit2, expose } = _ref; const { prefixCls, autoInsertSpaceInButton, direction, size } = useConfigInject("btn", props2); const [wrapSSR, hashId] = useStyle$c(prefixCls); const groupSizeContext = GroupSizeContext.useInject(); const disabledContext = useInjectDisabled(); const mergedDisabled = computed(() => { var _a; return (_a = props2.disabled) !== null && _a !== void 0 ? _a : disabledContext.value; }); const buttonNodeRef = shallowRef(null); const delayTimeoutRef = shallowRef(void 0); let isNeedInserted = false; const innerLoading = shallowRef(false); const hasTwoCNChar = shallowRef(false); const autoInsertSpace = computed(() => autoInsertSpaceInButton.value !== false); const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction); const loadingOrDelay = computed(() => typeof props2.loading === "object" && props2.loading.delay ? props2.loading.delay || true : !!props2.loading); watch(loadingOrDelay, (val) => { clearTimeout(delayTimeoutRef.value); if (typeof loadingOrDelay.value === "number") { delayTimeoutRef.value = setTimeout(() => { innerLoading.value = val; }, loadingOrDelay.value); } else { innerLoading.value = val; } }, { immediate: true }); const classes = computed(() => { const { type, shape = "default", ghost, block, danger } = props2; const pre = prefixCls.value; const sizeClassNameMap = { large: "lg", small: "sm", middle: void 0 }; const sizeFullname = compactSize.value || (groupSizeContext === null || groupSizeContext === void 0 ? void 0 : groupSizeContext.size) || size.value; const sizeCls = sizeFullname ? sizeClassNameMap[sizeFullname] || "" : ""; return [compactItemClassnames.value, { [hashId.value]: true, [`${pre}`]: true, [`${pre}-${shape}`]: shape !== "default" && shape, [`${pre}-${type}`]: type, [`${pre}-${sizeCls}`]: sizeCls, [`${pre}-loading`]: innerLoading.value, [`${pre}-background-ghost`]: ghost && !isUnBorderedButtonType(type), [`${pre}-two-chinese-chars`]: hasTwoCNChar.value && autoInsertSpace.value, [`${pre}-block`]: block, [`${pre}-dangerous`]: !!danger, [`${pre}-rtl`]: direction.value === "rtl" }]; }); const fixTwoCNChar = () => { const node2 = buttonNodeRef.value; if (!node2 || autoInsertSpaceInButton.value === false) { return; } const buttonText = node2.textContent; if (isNeedInserted && isTwoCNChar(buttonText)) { if (!hasTwoCNChar.value) { hasTwoCNChar.value = true; } } else if (hasTwoCNChar.value) { hasTwoCNChar.value = false; } }; const handleClick = (event) => { if (innerLoading.value || mergedDisabled.value) { event.preventDefault(); return; } emit2("click", event); }; const handleMousedown = (event) => { emit2("mousedown", event); }; const insertSpace = (child, needInserted) => { const SPACE = needInserted ? " " : ""; if (child.type === Text) { let text = child.children.trim(); if (isTwoCNChar(text)) { text = text.split("").join(SPACE); } return createVNode("span", null, [text]); } return child; }; watchEffect(() => { devWarning(!(props2.ghost && isUnBorderedButtonType(props2.type)), "Button", "`link` or `text` button can't be a `ghost` button."); }); onMounted(fixTwoCNChar); onUpdated(fixTwoCNChar); onBeforeUnmount(() => { delayTimeoutRef.value && clearTimeout(delayTimeoutRef.value); }); const focus = () => { var _a; (_a = buttonNodeRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = buttonNodeRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; expose({ focus, blur }); return () => { var _a, _b; const { icon = (_a = slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots) } = props2; const children = flattenChildren((_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots)); isNeedInserted = children.length === 1 && !icon && !isUnBorderedButtonType(props2.type); const { type, htmlType, href, title, target } = props2; const iconType = innerLoading.value ? "loading" : icon; const buttonProps2 = _extends$1(_extends$1({}, attrs), { title, disabled: mergedDisabled.value, class: [classes.value, attrs.class, { [`${prefixCls.value}-icon-only`]: children.length === 0 && !!iconType }], onClick: handleClick, onMousedown: handleMousedown }); if (!mergedDisabled.value) { delete buttonProps2.disabled; } const iconNode = icon && !innerLoading.value ? icon : createVNode(LoadingIcon, { "existIcon": !!icon, "prefixCls": prefixCls.value, "loading": !!innerLoading.value }, null); const kids = children.map((child) => insertSpace(child, isNeedInserted && autoInsertSpace.value)); if (href !== void 0) { return wrapSSR(createVNode("a", _objectSpread2$1(_objectSpread2$1({}, buttonProps2), {}, { "href": href, "target": target, "ref": buttonNodeRef }), [iconNode, kids])); } let buttonNode = createVNode("button", _objectSpread2$1(_objectSpread2$1({}, buttonProps2), {}, { "ref": buttonNodeRef, "type": htmlType }), [iconNode, kids]); if (!isUnBorderedButtonType(type)) { const _buttonNode = /* @__PURE__ */ function() { return buttonNode; }(); buttonNode = createVNode(Wave, { "ref": "wave", "disabled": !!innerLoading.value }, { default: () => [_buttonNode] }); } return wrapSSR(buttonNode); }; } }); Button$1.Group = ButtonGroup; Button$1.install = function(app) { app.component(Button$1.name, Button$1); app.component(ButtonGroup.name, ButtonGroup); return app; }; var EllipsisOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "ellipsis", "theme": "outlined" }; function _objectSpread$i(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$i(target, key2, source[key2]); }); } return target; } function _defineProperty$i(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var EllipsisOutlined = function EllipsisOutlined2(props2, context2) { var p2 = _objectSpread$i({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$i({}, p2, { "icon": EllipsisOutlined$1 }), null); }; EllipsisOutlined.displayName = "EllipsisOutlined"; EllipsisOutlined.inheritAttrs = false; var RightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" }; function _objectSpread$h(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$h(target, key2, source[key2]); }); } return target; } function _defineProperty$h(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var RightOutlined = function RightOutlined2(props2, context2) { var p2 = _objectSpread$h({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$h({}, p2, { "icon": RightOutlined$1 }), null); }; RightOutlined.displayName = "RightOutlined"; RightOutlined.inheritAttrs = false; const OverrideContextKey = Symbol("OverrideContextKey"); const useInjectOverride = () => { return inject(OverrideContextKey, void 0); }; const useProvideOverride = (props2) => { var _a, _b, _c; const { prefixCls, mode, selectable, validator, onClick, expandIcon } = useInjectOverride() || {}; provide(OverrideContextKey, { prefixCls: computed(() => { var _a2, _b2; return (_b2 = (_a2 = props2.prefixCls) === null || _a2 === void 0 ? void 0 : _a2.value) !== null && _b2 !== void 0 ? _b2 : prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.value; }), mode: computed(() => { var _a2, _b2; return (_b2 = (_a2 = props2.mode) === null || _a2 === void 0 ? void 0 : _a2.value) !== null && _b2 !== void 0 ? _b2 : mode === null || mode === void 0 ? void 0 : mode.value; }), selectable: computed(() => { var _a2, _b2; return (_b2 = (_a2 = props2.selectable) === null || _a2 === void 0 ? void 0 : _a2.value) !== null && _b2 !== void 0 ? _b2 : selectable === null || selectable === void 0 ? void 0 : selectable.value; }), validator: (_a = props2.validator) !== null && _a !== void 0 ? _a : validator, onClick: (_b = props2.onClick) !== null && _b !== void 0 ? _b : onClick, expandIcon: (_c = props2.expandIcon) !== null && _c !== void 0 ? _c : expandIcon === null || expandIcon === void 0 ? void 0 : expandIcon.value }); }; function shallowEqual(objA, objB, compare, compareContext) { let ret = void 0; if (ret !== void 0) { return !!ret; } if (objA === objB) { return true; } if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) { return false; } const keysA = Object.keys(objA); const keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); for (let idx = 0; idx < keysA.length; idx++) { const key2 = keysA[idx]; if (!bHasOwnProperty(key2)) { return false; } const valueA = objA[key2]; const valueB = objB[key2]; ret = void 0; if (ret === false || ret === void 0 && valueA !== valueB) { return false; } } return true; } function shallowequal(value, other) { return shallowEqual(toRaw(value), toRaw(other)); } const MenuContextKey = Symbol("menuContextKey"); const useProvideMenu = (props2) => { provide(MenuContextKey, props2); }; const useInjectMenu = () => { return inject(MenuContextKey); }; const ForceRenderKey = Symbol("ForceRenderKey"); const useProvideForceRender = (forceRender) => { provide(ForceRenderKey, forceRender); }; const useInjectForceRender = () => { return inject(ForceRenderKey, false); }; const MenuFirstLevelContextKey = Symbol("menuFirstLevelContextKey"); const useProvideFirstLevel = (firstLevel) => { provide(MenuFirstLevelContextKey, firstLevel); }; const useInjectFirstLevel = () => { return inject(MenuFirstLevelContextKey, true); }; const MenuContextProvider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "MenuContextProvider", inheritAttrs: false, props: { mode: { type: String, default: void 0 }, overflowDisabled: { type: Boolean, default: void 0 } }, setup(props2, _ref) { let { slots } = _ref; const menuContext = useInjectMenu(); const newContext = _extends$1({}, menuContext); if (props2.mode !== void 0) { newContext.mode = toRef(props2, "mode"); } if (props2.overflowDisabled !== void 0) { newContext.overflowDisabled = toRef(props2, "overflowDisabled"); } useProvideMenu(newContext); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const SiderCollapsedKey = Symbol("siderCollapsed"); const OVERFLOW_KEY = "$$__vc-menu-more__key"; const KeyPathContext = Symbol("KeyPathContext"); const useInjectKeyPath = () => { return inject(KeyPathContext, { parentEventKeys: computed(() => []), parentKeys: computed(() => []), parentInfo: {} }); }; const useProvideKeyPath = (eventKey, key2, menuInfo) => { const { parentEventKeys, parentKeys } = useInjectKeyPath(); const eventKeys = computed(() => [...parentEventKeys.value, eventKey]); const keys2 = computed(() => [...parentKeys.value, key2]); provide(KeyPathContext, { parentEventKeys: eventKeys, parentKeys: keys2, parentInfo: menuInfo }); return keys2; }; const measure = Symbol("measure"); const PathContext = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, setup(_props, _ref) { let { slots } = _ref; provide(measure, true); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const useMeasure = () => { return inject(measure, false); }; function useDirectionStyle(level) { const { mode, rtl: rtl2, inlineIndent } = useInjectMenu(); return computed(() => mode.value !== "inline" ? null : rtl2.value ? { paddingRight: `${level.value * inlineIndent.value}px` } : { paddingLeft: `${level.value * inlineIndent.value}px` }); } let indexGuid$2 = 0; const menuItemProps = () => ({ id: String, role: String, disabled: Boolean, danger: Boolean, title: { type: [String, Boolean], default: void 0 }, icon: PropTypes.any, onMouseenter: Function, onMouseleave: Function, onClick: Function, onKeydown: Function, onFocus: Function, // Internal user prop originItemValue: objectType() }); const MenuItem = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AMenuItem", inheritAttrs: false, props: menuItemProps(), slots: Object, setup(props2, _ref) { let { slots, emit: emit2, attrs } = _ref; const instance = getCurrentInstance(); const isMeasure = useMeasure(); const key2 = typeof instance.vnode.key === "symbol" ? String(instance.vnode.key) : instance.vnode.key; devWarning(typeof instance.vnode.key !== "symbol", "MenuItem", `MenuItem \`:key="${String(key2)}"\` not support Symbol type`); const eventKey = `menu_item_${++indexGuid$2}_$$_${key2}`; const { parentEventKeys, parentKeys } = useInjectKeyPath(); const { prefixCls, activeKeys, disabled, changeActiveKeys, rtl: rtl2, inlineCollapsed, siderCollapsed, onItemClick, selectedKeys, registerMenuInfo, unRegisterMenuInfo } = useInjectMenu(); const firstLevel = useInjectFirstLevel(); const isActive = shallowRef(false); const keysPath = computed(() => { return [...parentKeys.value, key2]; }); const menuInfo = { eventKey, key: key2, parentEventKeys, parentKeys, isLeaf: true }; registerMenuInfo(eventKey, menuInfo); onBeforeUnmount(() => { unRegisterMenuInfo(eventKey); }); watch(activeKeys, () => { isActive.value = !!activeKeys.value.find((val) => val === key2); }, { immediate: true }); const mergedDisabled = computed(() => disabled.value || props2.disabled); const selected = computed(() => selectedKeys.value.includes(key2)); const classNames2 = computed(() => { const itemCls = `${prefixCls.value}-item`; return { [`${itemCls}`]: true, [`${itemCls}-danger`]: props2.danger, [`${itemCls}-active`]: isActive.value, [`${itemCls}-selected`]: selected.value, [`${itemCls}-disabled`]: mergedDisabled.value }; }); const getEventInfo = (e2) => { return { key: key2, eventKey, keyPath: keysPath.value, eventKeyPath: [...parentEventKeys.value, eventKey], domEvent: e2, item: _extends$1(_extends$1({}, props2), attrs) }; }; const onInternalClick = (e2) => { if (mergedDisabled.value) { return; } const info = getEventInfo(e2); emit2("click", e2); onItemClick(info); }; const onMouseEnter = (event) => { if (!mergedDisabled.value) { changeActiveKeys(keysPath.value); emit2("mouseenter", event); } }; const onMouseLeave = (event) => { if (!mergedDisabled.value) { changeActiveKeys([]); emit2("mouseleave", event); } }; const onInternalKeyDown = (e2) => { emit2("keydown", e2); if (e2.which === KeyCode.ENTER) { const info = getEventInfo(e2); emit2("click", e2); onItemClick(info); } }; const onInternalFocus = (e2) => { changeActiveKeys(keysPath.value); emit2("focus", e2); }; const renderItemChildren = (icon, children) => { const wrapNode = createVNode("span", { "class": `${prefixCls.value}-title-content` }, [children]); if (!icon || isValidElement(children) && children.type === "span") { if (children && inlineCollapsed.value && firstLevel && typeof children === "string") { return createVNode("div", { "class": `${prefixCls.value}-inline-collapsed-noicon` }, [children.charAt(0)]); } } return wrapNode; }; const directionStyle = useDirectionStyle(computed(() => keysPath.value.length)); return () => { var _a, _b, _c, _d, _e; if (isMeasure) return null; const title = (_a = props2.title) !== null && _a !== void 0 ? _a : (_b = slots.title) === null || _b === void 0 ? void 0 : _b.call(slots); const children = flattenChildren((_c = slots.default) === null || _c === void 0 ? void 0 : _c.call(slots)); const childrenLength = children.length; let tooltipTitle = title; if (typeof title === "undefined") { tooltipTitle = firstLevel && childrenLength ? children : ""; } else if (title === false) { tooltipTitle = ""; } const tooltipProps2 = { title: tooltipTitle }; if (!siderCollapsed.value && !inlineCollapsed.value) { tooltipProps2.title = null; tooltipProps2.open = false; } const optionRoleProps = {}; if (props2.role === "option") { optionRoleProps["aria-selected"] = selected.value; } const icon = (_d = props2.icon) !== null && _d !== void 0 ? _d : (_e = slots.icon) === null || _e === void 0 ? void 0 : _e.call(slots, props2); return createVNode(Tooltip, _objectSpread2$1(_objectSpread2$1({}, tooltipProps2), {}, { "placement": rtl2.value ? "left" : "right", "overlayClassName": `${prefixCls.value}-inline-collapsed-tooltip` }), { default: () => [createVNode(Overflow.Item, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ "component": "li" }, attrs), {}, { "id": props2.id, "style": _extends$1(_extends$1({}, attrs.style || {}), directionStyle.value), "class": [classNames2.value, { [`${attrs.class}`]: !!attrs.class, [`${prefixCls.value}-item-only-child`]: (icon ? childrenLength + 1 : childrenLength) === 1 }], "role": props2.role || "menuitem", "tabindex": props2.disabled ? null : -1, "data-menu-id": key2, "aria-disabled": props2.disabled }, optionRoleProps), {}, { "onMouseenter": onMouseEnter, "onMouseleave": onMouseLeave, "onClick": onInternalClick, "onKeydown": onInternalKeyDown, "onFocus": onInternalFocus, "title": typeof title === "string" ? title : void 0 }), { default: () => [cloneElement(typeof icon === "function" ? icon(props2.originItemValue) : icon, { class: `${prefixCls.value}-item-icon` }, false), renderItemChildren(icon, children)] })] }); }; } }); const autoAdjustOverflow = { adjustX: 1, adjustY: 1 }; const placements = { topLeft: { points: ["bl", "tl"], overflow: autoAdjustOverflow, offset: [0, -7] }, bottomLeft: { points: ["tl", "bl"], overflow: autoAdjustOverflow, offset: [0, 7] }, leftTop: { points: ["tr", "tl"], overflow: autoAdjustOverflow, offset: [-4, 0] }, rightTop: { points: ["tl", "tr"], overflow: autoAdjustOverflow, offset: [4, 0] } }; const placementsRtl = { topLeft: { points: ["bl", "tl"], overflow: autoAdjustOverflow, offset: [0, -7] }, bottomLeft: { points: ["tl", "bl"], overflow: autoAdjustOverflow, offset: [0, 7] }, rightTop: { points: ["tr", "tl"], overflow: autoAdjustOverflow, offset: [-4, 0] }, leftTop: { points: ["tl", "tr"], overflow: autoAdjustOverflow, offset: [4, 0] } }; const popupPlacementMap = { horizontal: "bottomLeft", vertical: "rightTop", "vertical-left": "rightTop", "vertical-right": "leftTop" }; const PopupTrigger = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "PopupTrigger", inheritAttrs: false, props: { prefixCls: String, mode: String, visible: Boolean, // popup: React.ReactNode; popupClassName: String, popupOffset: Array, disabled: Boolean, onVisibleChange: Function }, slots: Object, emits: ["visibleChange"], setup(props2, _ref) { let { slots, emit: emit2 } = _ref; const innerVisible = shallowRef(false); const { getPopupContainer, rtl: rtl2, subMenuOpenDelay, subMenuCloseDelay, builtinPlacements, triggerSubMenuAction, forceSubMenuRender, motion, defaultMotions, rootClassName } = useInjectMenu(); const forceRender = useInjectForceRender(); const placement = computed(() => rtl2.value ? _extends$1(_extends$1({}, placementsRtl), builtinPlacements.value) : _extends$1(_extends$1({}, placements), builtinPlacements.value)); const popupPlacement = computed(() => popupPlacementMap[props2.mode]); const visibleRef = shallowRef(); watch(() => props2.visible, (visible) => { wrapperRaf.cancel(visibleRef.value); visibleRef.value = wrapperRaf(() => { innerVisible.value = visible; }); }, { immediate: true }); onBeforeUnmount(() => { wrapperRaf.cancel(visibleRef.value); }); const onVisibleChange = (visible) => { emit2("visibleChange", visible); }; const mergedMotion = computed(() => { var _a, _b; const m2 = motion.value || ((_a = defaultMotions.value) === null || _a === void 0 ? void 0 : _a[props2.mode]) || ((_b = defaultMotions.value) === null || _b === void 0 ? void 0 : _b.other); const res = typeof m2 === "function" ? m2() : m2; return res ? getTransitionProps(res.name, { css: true }) : void 0; }); return () => { const { prefixCls, popupClassName, mode, popupOffset, disabled } = props2; return createVNode(Trigger, { "prefixCls": prefixCls, "popupClassName": classNames(`${prefixCls}-popup`, { [`${prefixCls}-rtl`]: rtl2.value }, popupClassName, rootClassName.value), "stretch": mode === "horizontal" ? "minWidth" : null, "getPopupContainer": getPopupContainer.value, "builtinPlacements": placement.value, "popupPlacement": popupPlacement.value, "popupVisible": innerVisible.value, "popupAlign": popupOffset && { offset: popupOffset }, "action": disabled ? [] : [triggerSubMenuAction.value], "mouseEnterDelay": subMenuOpenDelay.value, "mouseLeaveDelay": subMenuCloseDelay.value, "onPopupVisibleChange": onVisibleChange, "forceRender": forceRender || forceSubMenuRender.value, "popupAnimation": mergedMotion.value }, { popup: slots.popup, default: slots.default }); }; } }); const InternalSubMenuList = (_props, _ref) => { let { slots, attrs } = _ref; var _a; const { prefixCls, mode } = useInjectMenu(); return createVNode("ul", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": classNames(prefixCls.value, `${prefixCls.value}-sub`, `${prefixCls.value}-${mode.value === "inline" ? "inline" : "vertical"}`), "data-menu-list": true }), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]); }; InternalSubMenuList.displayName = "SubMenuList"; const InlineSubMenuList = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "InlineSubMenuList", inheritAttrs: false, props: { id: String, open: Boolean, keyPath: Array }, setup(props2, _ref) { let { slots } = _ref; const fixedMode = computed(() => "inline"); const { motion, mode, defaultMotions } = useInjectMenu(); const sameModeRef = computed(() => mode.value === fixedMode.value); const destroy = ref(!sameModeRef.value); const mergedOpen = computed(() => sameModeRef.value ? props2.open : false); watch(mode, () => { if (sameModeRef.value) { destroy.value = false; } }, { flush: "post" }); const mergedMotion = computed(() => { var _a, _b; const m2 = motion.value || ((_a = defaultMotions.value) === null || _a === void 0 ? void 0 : _a[fixedMode.value]) || ((_b = defaultMotions.value) === null || _b === void 0 ? void 0 : _b.other); const res = typeof m2 === "function" ? m2() : m2; return _extends$1(_extends$1({}, res), { appear: props2.keyPath.length <= 1 }); }); return () => { var _a; if (destroy.value) { return null; } return createVNode(MenuContextProvider, { "mode": fixedMode.value }, { default: () => [createVNode(Transition, mergedMotion.value, { default: () => [withDirectives(createVNode(InternalSubMenuList, { "id": props2.id }, { default: () => [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)] }), [[vShow, mergedOpen.value]])] })] }); }; } }); let indexGuid$1 = 0; const subMenuProps = () => ({ icon: PropTypes.any, title: PropTypes.any, disabled: Boolean, level: Number, popupClassName: String, popupOffset: Array, internalPopupClose: Boolean, eventKey: String, expandIcon: Function, theme: String, onMouseenter: Function, onMouseleave: Function, onTitleClick: Function, // Internal user prop originItemValue: objectType() }); const SubMenu = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASubMenu", inheritAttrs: false, props: subMenuProps(), slots: Object, setup(props2, _ref) { let { slots, attrs, emit: emit2 } = _ref; var _a, _b; useProvideFirstLevel(false); const isMeasure = useMeasure(); const instance = getCurrentInstance(); const vnodeKey = typeof instance.vnode.key === "symbol" ? String(instance.vnode.key) : instance.vnode.key; devWarning(typeof instance.vnode.key !== "symbol", "SubMenu", `SubMenu \`:key="${String(vnodeKey)}"\` not support Symbol type`); const key2 = isValid$2(vnodeKey) ? vnodeKey : `sub_menu_${++indexGuid$1}_$$_not_set_key`; const eventKey = (_a = props2.eventKey) !== null && _a !== void 0 ? _a : isValid$2(vnodeKey) ? `sub_menu_${++indexGuid$1}_$$_${vnodeKey}` : key2; const { parentEventKeys, parentInfo, parentKeys } = useInjectKeyPath(); const keysPath = computed(() => [...parentKeys.value, key2]); const childrenEventKeys = shallowRef([]); const menuInfo = { eventKey, key: key2, parentEventKeys, childrenEventKeys, parentKeys }; (_b = parentInfo.childrenEventKeys) === null || _b === void 0 ? void 0 : _b.value.push(eventKey); onBeforeUnmount(() => { var _a2; if (parentInfo.childrenEventKeys) { parentInfo.childrenEventKeys.value = (_a2 = parentInfo.childrenEventKeys) === null || _a2 === void 0 ? void 0 : _a2.value.filter((k2) => k2 != eventKey); } }); useProvideKeyPath(eventKey, key2, menuInfo); const { prefixCls, activeKeys, disabled: contextDisabled, changeActiveKeys, mode, inlineCollapsed, openKeys, overflowDisabled, onOpenChange, registerMenuInfo, unRegisterMenuInfo, selectedSubMenuKeys, expandIcon: menuExpandIcon, theme } = useInjectMenu(); const hasKey = vnodeKey !== void 0 && vnodeKey !== null; const forceRender = !isMeasure && (useInjectForceRender() || !hasKey); useProvideForceRender(forceRender); if (isMeasure && hasKey || !isMeasure && !hasKey || forceRender) { registerMenuInfo(eventKey, menuInfo); onBeforeUnmount(() => { unRegisterMenuInfo(eventKey); }); } const subMenuPrefixCls = computed(() => `${prefixCls.value}-submenu`); const mergedDisabled = computed(() => contextDisabled.value || props2.disabled); const elementRef = shallowRef(); const popupRef = shallowRef(); const originOpen = computed(() => openKeys.value.includes(key2)); const open2 = computed(() => !overflowDisabled.value && originOpen.value); const childrenSelected = computed(() => { return selectedSubMenuKeys.value.includes(key2); }); const isActive = shallowRef(false); watch(activeKeys, () => { isActive.value = !!activeKeys.value.find((val) => val === key2); }, { immediate: true }); const onInternalTitleClick = (e2) => { if (mergedDisabled.value) { return; } emit2("titleClick", e2, key2); if (mode.value === "inline") { onOpenChange(key2, !originOpen.value); } }; const onMouseEnter = (event) => { if (!mergedDisabled.value) { changeActiveKeys(keysPath.value); emit2("mouseenter", event); } }; const onMouseLeave = (event) => { if (!mergedDisabled.value) { changeActiveKeys([]); emit2("mouseleave", event); } }; const directionStyle = useDirectionStyle(computed(() => keysPath.value.length)); const onPopupVisibleChange = (newVisible) => { if (mode.value !== "inline") { onOpenChange(key2, newVisible); } }; const onInternalFocus = () => { changeActiveKeys(keysPath.value); }; const popupId = eventKey && `${eventKey}-popup`; const popupClassName = computed(() => classNames(prefixCls.value, `${prefixCls.value}-${props2.theme || theme.value}`, props2.popupClassName)); const renderTitle = (title, icon) => { if (!icon) { return inlineCollapsed.value && !parentKeys.value.length && title && typeof title === "string" ? createVNode("div", { "class": `${prefixCls.value}-inline-collapsed-noicon` }, [title.charAt(0)]) : createVNode("span", { "class": `${prefixCls.value}-title-content` }, [title]); } const titleIsSpan = isValidElement(title) && title.type === "span"; return createVNode(Fragment, null, [cloneElement(typeof icon === "function" ? icon(props2.originItemValue) : icon, { class: `${prefixCls.value}-item-icon` }, false), titleIsSpan ? title : createVNode("span", { "class": `${prefixCls.value}-title-content` }, [title])]); }; const triggerModeRef = computed(() => { return mode.value !== "inline" && keysPath.value.length > 1 ? "vertical" : mode.value; }); const renderMode = computed(() => mode.value === "horizontal" ? "vertical" : mode.value); const subMenuTriggerModeRef = computed(() => triggerModeRef.value === "horizontal" ? "vertical" : triggerModeRef.value); const baseTitleNode = () => { var _a2, _b2; const subMenuPrefixClsValue = subMenuPrefixCls.value; const icon = (_a2 = props2.icon) !== null && _a2 !== void 0 ? _a2 : (_b2 = slots.icon) === null || _b2 === void 0 ? void 0 : _b2.call(slots, props2); const expandIcon = props2.expandIcon || slots.expandIcon || menuExpandIcon.value; const title = renderTitle(getPropsSlot(slots, props2, "title"), icon); return createVNode("div", { "style": directionStyle.value, "class": `${subMenuPrefixClsValue}-title`, "tabindex": mergedDisabled.value ? null : -1, "ref": elementRef, "title": typeof title === "string" ? title : null, "data-menu-id": key2, "aria-expanded": open2.value, "aria-haspopup": true, "aria-controls": popupId, "aria-disabled": mergedDisabled.value, "onClick": onInternalTitleClick, "onFocus": onInternalFocus }, [title, mode.value !== "horizontal" && expandIcon ? expandIcon(_extends$1(_extends$1({}, props2), { isOpen: open2.value })) : createVNode("i", { "class": `${subMenuPrefixClsValue}-arrow` }, null)]); }; return () => { var _a2; if (isMeasure) { if (!hasKey) { return null; } return (_a2 = slots.default) === null || _a2 === void 0 ? void 0 : _a2.call(slots); } const subMenuPrefixClsValue = subMenuPrefixCls.value; let titleNode = () => null; if (!overflowDisabled.value && mode.value !== "inline") { const popupOffset = mode.value === "horizontal" ? [0, 8] : [10, 0]; titleNode = () => createVNode(PopupTrigger, { "mode": triggerModeRef.value, "prefixCls": subMenuPrefixClsValue, "visible": !props2.internalPopupClose && open2.value, "popupClassName": popupClassName.value, "popupOffset": props2.popupOffset || popupOffset, "disabled": mergedDisabled.value, "onVisibleChange": onPopupVisibleChange }, { default: () => [baseTitleNode()], popup: () => createVNode(MenuContextProvider, { "mode": subMenuTriggerModeRef.value }, { default: () => [createVNode(InternalSubMenuList, { "id": popupId, "ref": popupRef }, { default: slots.default })] }) }); } else { titleNode = () => createVNode(PopupTrigger, null, { default: baseTitleNode }); } return createVNode(MenuContextProvider, { "mode": renderMode.value }, { default: () => [createVNode(Overflow.Item, _objectSpread2$1(_objectSpread2$1({ "component": "li" }, attrs), {}, { "role": "none", "class": classNames(subMenuPrefixClsValue, `${subMenuPrefixClsValue}-${mode.value}`, attrs.class, { [`${subMenuPrefixClsValue}-open`]: open2.value, [`${subMenuPrefixClsValue}-active`]: isActive.value, [`${subMenuPrefixClsValue}-selected`]: childrenSelected.value, [`${subMenuPrefixClsValue}-disabled`]: mergedDisabled.value }), "onMouseenter": onMouseEnter, "onMouseleave": onMouseLeave, "data-submenu-id": key2 }), { default: () => { return createVNode(Fragment, null, [titleNode(), !overflowDisabled.value && createVNode(InlineSubMenuList, { "id": popupId, "open": open2.value, "keyPath": keysPath.value }, { default: slots.default })]); } })] }); }; } }); function hasClass(node2, className) { if (node2.classList) { return node2.classList.contains(className); } const originClass = node2.className; return ` ${originClass} `.indexOf(` ${className} `) > -1; } function addClass(node2, className) { if (node2.classList) { node2.classList.add(className); } else { if (!hasClass(node2, className)) { node2.className = `${node2.className} ${className}`; } } } function removeClass(node2, className) { if (node2.classList) { node2.classList.remove(className); } else { if (hasClass(node2, className)) { const originClass = node2.className; node2.className = ` ${originClass} `.replace(` ${className} `, " "); } } } const collapseMotion = function() { let name = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "ant-motion-collapse"; let appear = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return { name, appear, css: true, onBeforeEnter: (node2) => { node2.style.height = "0px"; node2.style.opacity = "0"; addClass(node2, name); }, onEnter: (node2) => { nextTick(() => { node2.style.height = `${node2.scrollHeight}px`; node2.style.opacity = "1"; }); }, onAfterEnter: (node2) => { if (node2) { removeClass(node2, name); node2.style.height = null; node2.style.opacity = null; } }, onBeforeLeave: (node2) => { addClass(node2, name); node2.style.height = `${node2.offsetHeight}px`; node2.style.opacity = null; }, onLeave: (node2) => { setTimeout(() => { node2.style.height = "0px"; node2.style.opacity = "0"; }); }, onAfterLeave: (node2) => { if (node2) { removeClass(node2, name); if (node2.style) { node2.style.height = null; node2.style.opacity = null; } } } }; }; const menuItemGroupProps = () => ({ title: PropTypes.any, // Internal user prop originItemValue: objectType() }); const ItemGroup = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AMenuItemGroup", inheritAttrs: false, props: menuItemGroupProps(), slots: Object, setup(props2, _ref) { let { slots, attrs } = _ref; const { prefixCls } = useInjectMenu(); const groupPrefixCls = computed(() => `${prefixCls.value}-item-group`); const isMeasure = useMeasure(); return () => { var _a, _b; if (isMeasure) return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); return createVNode("li", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "onClick": (e2) => e2.stopPropagation(), "class": groupPrefixCls.value }), [createVNode("div", { "title": typeof props2.title === "string" ? props2.title : void 0, "class": `${groupPrefixCls.value}-title` }, [getPropsSlot(slots, props2, "title")]), createVNode("ul", { "class": `${groupPrefixCls.value}-list` }, [(_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots)])]); }; } }); const menuDividerProps = () => ({ prefixCls: String, dashed: Boolean }); const Divider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AMenuDivider", props: menuDividerProps(), setup(props2) { const { prefixCls } = useInjectMenu(); const cls = computed(() => { return { [`${prefixCls.value}-item-divider`]: true, [`${prefixCls.value}-item-divider-dashed`]: !!props2.dashed }; }); return () => { return createVNode("li", { "class": cls.value }, null); }; } }); var __rest$g = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function convertItemsToNodes(list, store, parentMenuInfo) { return (list || []).map((opt, index2) => { if (opt && typeof opt === "object") { const _a = opt, { label, children, key: key2, type } = _a, restProps = __rest$g(_a, ["label", "children", "key", "type"]); const mergedKey = key2 !== null && key2 !== void 0 ? key2 : `tmp-${index2}`; const parentKeys = parentMenuInfo ? parentMenuInfo.parentKeys.slice() : []; const childrenEventKeys = []; const menuInfo = { eventKey: mergedKey, key: mergedKey, parentEventKeys: ref(parentKeys), parentKeys: ref(parentKeys), childrenEventKeys: ref(childrenEventKeys), isLeaf: false }; if (children || type === "group") { if (type === "group") { const childrenNodes2 = convertItemsToNodes(children, store, parentMenuInfo); return createVNode(ItemGroup, _objectSpread2$1(_objectSpread2$1({ "key": mergedKey }, restProps), {}, { "title": label, "originItemValue": opt }), { default: () => [childrenNodes2] }); } store.set(mergedKey, menuInfo); if (parentMenuInfo) { parentMenuInfo.childrenEventKeys.push(mergedKey); } const childrenNodes = convertItemsToNodes(children, store, { childrenEventKeys, parentKeys: [].concat(parentKeys, mergedKey) }); return createVNode(SubMenu, _objectSpread2$1(_objectSpread2$1({ "key": mergedKey }, restProps), {}, { "title": label, "originItemValue": opt }), { default: () => [childrenNodes] }); } if (type === "divider") { return createVNode(Divider, _objectSpread2$1({ "key": mergedKey }, restProps), null); } menuInfo.isLeaf = true; store.set(mergedKey, menuInfo); return createVNode(MenuItem, _objectSpread2$1(_objectSpread2$1({ "key": mergedKey }, restProps), {}, { "originItemValue": opt }), { default: () => [label] }); } return null; }).filter((opt) => opt); } function useItems(props2) { const itemsNodes = shallowRef([]); const hasItmes = shallowRef(false); const store = shallowRef(/* @__PURE__ */ new Map()); watch(() => props2.items, () => { const newStore = /* @__PURE__ */ new Map(); hasItmes.value = false; if (props2.items) { hasItmes.value = true; itemsNodes.value = convertItemsToNodes(props2.items, newStore); } else { itemsNodes.value = void 0; } store.value = newStore; }, { immediate: true, deep: true }); return { itemsNodes, store, hasItmes }; } const getHorizontalStyle = (token2) => { const { componentCls, motionDurationSlow, menuHorizontalHeight, colorSplit, lineWidth, lineType, menuItemPaddingInline } = token2; return { [`${componentCls}-horizontal`]: { lineHeight: `${menuHorizontalHeight}px`, border: 0, borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`, boxShadow: "none", "&::after": { display: "block", clear: "both", height: 0, content: '"\\20"' }, // ======================= Item ======================= [`${componentCls}-item, ${componentCls}-submenu`]: { position: "relative", display: "inline-block", verticalAlign: "bottom", paddingInline: menuItemPaddingInline }, [`> ${componentCls}-item:hover, > ${componentCls}-item-active, > ${componentCls}-submenu ${componentCls}-submenu-title:hover`]: { backgroundColor: "transparent" }, [`${componentCls}-item, ${componentCls}-submenu-title`]: { transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`].join(",") }, // ===================== Sub Menu ===================== [`${componentCls}-submenu-arrow`]: { display: "none" } } }; }; const getRTLStyle = (_ref) => { let { componentCls, menuArrowOffset } = _ref; return { [`${componentCls}-rtl`]: { direction: "rtl" }, [`${componentCls}-submenu-rtl`]: { transformOrigin: "100% 0" }, // Vertical Arrow [`${componentCls}-rtl${componentCls}-vertical, ${componentCls}-submenu-rtl ${componentCls}-vertical`]: { [`${componentCls}-submenu-arrow`]: { "&::before": { transform: `rotate(-45deg) translateY(-${menuArrowOffset})` }, "&::after": { transform: `rotate(45deg) translateY(${menuArrowOffset})` } } } }; }; const accessibilityFocus = (token2) => _extends$1({}, genFocusOutline(token2)); const getThemeStyle = (token2, themeSuffix) => { const { componentCls, colorItemText, colorItemTextSelected, colorGroupTitle, colorItemBg, colorSubItemBg, colorItemBgSelected, colorActiveBarHeight, colorActiveBarWidth, colorActiveBarBorderSize, motionDurationSlow, motionEaseInOut, motionEaseOut, menuItemPaddingInline, motionDurationMid, colorItemTextHover, lineType, colorSplit, // Disabled colorItemTextDisabled, // Danger colorDangerItemText, colorDangerItemTextHover, colorDangerItemTextSelected, colorDangerItemBgActive, colorDangerItemBgSelected, colorItemBgHover, menuSubMenuBg, // Horizontal colorItemTextSelectedHorizontal, colorItemBgSelectedHorizontal } = token2; return { [`${componentCls}-${themeSuffix}`]: { color: colorItemText, background: colorItemBg, [`&${componentCls}-root:focus-visible`]: _extends$1({}, accessibilityFocus(token2)), // ======================== Item ======================== [`${componentCls}-item-group-title`]: { color: colorGroupTitle }, [`${componentCls}-submenu-selected`]: { [`> ${componentCls}-submenu-title`]: { color: colorItemTextSelected } }, // Disabled [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: { color: `${colorItemTextDisabled} !important` }, // Hover [`${componentCls}-item:hover, ${componentCls}-submenu-title:hover`]: { [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: { color: colorItemTextHover } }, [`&:not(${componentCls}-horizontal)`]: { [`${componentCls}-item:not(${componentCls}-item-selected)`]: { "&:hover": { backgroundColor: colorItemBgHover }, "&:active": { backgroundColor: colorItemBgSelected } }, [`${componentCls}-submenu-title`]: { "&:hover": { backgroundColor: colorItemBgHover }, "&:active": { backgroundColor: colorItemBgSelected } } }, // Danger - only Item has [`${componentCls}-item-danger`]: { color: colorDangerItemText, [`&${componentCls}-item:hover`]: { [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: { color: colorDangerItemTextHover } }, [`&${componentCls}-item:active`]: { background: colorDangerItemBgActive } }, [`${componentCls}-item a`]: { "&, &:hover": { color: "inherit" } }, [`${componentCls}-item-selected`]: { color: colorItemTextSelected, // Danger [`&${componentCls}-item-danger`]: { color: colorDangerItemTextSelected }, [`a, a:hover`]: { color: "inherit" } }, [`& ${componentCls}-item-selected`]: { backgroundColor: colorItemBgSelected, // Danger [`&${componentCls}-item-danger`]: { backgroundColor: colorDangerItemBgSelected } }, [`${componentCls}-item, ${componentCls}-submenu-title`]: { [`&:not(${componentCls}-item-disabled):focus-visible`]: _extends$1({}, accessibilityFocus(token2)) }, [`&${componentCls}-submenu > ${componentCls}`]: { backgroundColor: menuSubMenuBg }, [`&${componentCls}-popup > ${componentCls}`]: { backgroundColor: colorItemBg }, // ====================== Horizontal ====================== [`&${componentCls}-horizontal`]: _extends$1(_extends$1({}, themeSuffix === "dark" ? { borderBottom: 0 } : {}), { [`> ${componentCls}-item, > ${componentCls}-submenu`]: { top: colorActiveBarBorderSize, marginTop: -colorActiveBarBorderSize, marginBottom: 0, borderRadius: 0, "&::after": { position: "absolute", insetInline: menuItemPaddingInline, bottom: 0, borderBottom: `${colorActiveBarHeight}px solid transparent`, transition: `border-color ${motionDurationSlow} ${motionEaseInOut}`, content: '""' }, [`&:hover, &-active, &-open`]: { "&::after": { borderBottomWidth: colorActiveBarHeight, borderBottomColor: colorItemTextSelectedHorizontal } }, [`&-selected`]: { color: colorItemTextSelectedHorizontal, backgroundColor: colorItemBgSelectedHorizontal, "&::after": { borderBottomWidth: colorActiveBarHeight, borderBottomColor: colorItemTextSelectedHorizontal } } } }), // ================== Inline & Vertical =================== // [`&${componentCls}-root`]: { [`&${componentCls}-inline, &${componentCls}-vertical`]: { borderInlineEnd: `${colorActiveBarBorderSize}px ${lineType} ${colorSplit}` } }, // ======================== Inline ======================== [`&${componentCls}-inline`]: { // Sub [`${componentCls}-sub${componentCls}-inline`]: { background: colorSubItemBg }, // Item [`${componentCls}-item, ${componentCls}-submenu-title`]: colorActiveBarBorderSize && colorActiveBarWidth ? { width: `calc(100% + ${colorActiveBarBorderSize}px)` } : {}, [`${componentCls}-item`]: { position: "relative", "&::after": { position: "absolute", insetBlock: 0, insetInlineEnd: 0, borderInlineEnd: `${colorActiveBarWidth}px solid ${colorItemTextSelected}`, transform: "scaleY(0.0001)", opacity: 0, transition: [`transform ${motionDurationMid} ${motionEaseOut}`, `opacity ${motionDurationMid} ${motionEaseOut}`].join(","), content: '""' }, // Danger [`&${componentCls}-item-danger`]: { "&::after": { borderInlineEndColor: colorDangerItemTextSelected } } }, [`${componentCls}-selected, ${componentCls}-item-selected`]: { "&::after": { transform: "scaleY(1)", opacity: 1, transition: [`transform ${motionDurationMid} ${motionEaseInOut}`, `opacity ${motionDurationMid} ${motionEaseInOut}`].join(",") } } } } }; }; const getVerticalInlineStyle = (token2) => { const { componentCls, menuItemHeight, itemMarginInline, padding, menuArrowSize, marginXS, marginXXS } = token2; const paddingWithArrow = padding + menuArrowSize + marginXS; return { [`${componentCls}-item`]: { position: "relative" }, [`${componentCls}-item, ${componentCls}-submenu-title`]: { height: menuItemHeight, lineHeight: `${menuItemHeight}px`, paddingInline: padding, overflow: "hidden", textOverflow: "ellipsis", marginInline: itemMarginInline, marginBlock: marginXXS, width: `calc(100% - ${itemMarginInline * 2}px)` }, // disable margin collapsed [`${componentCls}-submenu`]: { paddingBottom: 0.02 }, [`> ${componentCls}-item, > ${componentCls}-submenu > ${componentCls}-submenu-title`]: { height: menuItemHeight, lineHeight: `${menuItemHeight}px` }, [`${componentCls}-item-group-list ${componentCls}-submenu-title, ${componentCls}-submenu-title`]: { paddingInlineEnd: paddingWithArrow } }; }; const getVerticalStyle = (token2) => { const { componentCls, iconCls, menuItemHeight, colorTextLightSolid, dropdownWidth, controlHeightLG, motionDurationMid, motionEaseOut, paddingXL, fontSizeSM, fontSizeLG, motionDurationSlow, paddingXS, boxShadowSecondary } = token2; const inlineItemStyle = { height: menuItemHeight, lineHeight: `${menuItemHeight}px`, listStylePosition: "inside", listStyleType: "disc" }; return [ { [componentCls]: { [`&-inline, &-vertical`]: _extends$1({ [`&${componentCls}-root`]: { boxShadow: "none" } }, getVerticalInlineStyle(token2)) }, [`${componentCls}-submenu-popup`]: { [`${componentCls}-vertical`]: _extends$1(_extends$1({}, getVerticalInlineStyle(token2)), { boxShadow: boxShadowSecondary }) } }, // Vertical only { [`${componentCls}-submenu-popup ${componentCls}-vertical${componentCls}-sub`]: { minWidth: dropdownWidth, maxHeight: `calc(100vh - ${controlHeightLG * 2.5}px)`, padding: "0", overflow: "hidden", borderInlineEnd: 0, // https://github.com/ant-design/ant-design/issues/22244 // https://github.com/ant-design/ant-design/issues/26812 "&:not([class*='-active'])": { overflowX: "hidden", overflowY: "auto" } } }, // Inline Only { [`${componentCls}-inline`]: { width: "100%", // Motion enhance for first level [`&${componentCls}-root`]: { [`${componentCls}-item, ${componentCls}-submenu-title`]: { display: "flex", alignItems: "center", transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding ${motionDurationMid} ${motionEaseOut}`].join(","), [`> ${componentCls}-title-content`]: { flex: "auto", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis" }, "> *": { flex: "none" } } }, // >>>>> Sub [`${componentCls}-sub${componentCls}-inline`]: { padding: 0, border: 0, borderRadius: 0, boxShadow: "none", [`& > ${componentCls}-submenu > ${componentCls}-submenu-title`]: inlineItemStyle, [`& ${componentCls}-item-group-title`]: { paddingInlineStart: paddingXL } }, // >>>>> Item [`${componentCls}-item`]: inlineItemStyle } }, // Inline Collapse Only { [`${componentCls}-inline-collapsed`]: { width: menuItemHeight * 2, [`&${componentCls}-root`]: { [`${componentCls}-item, ${componentCls}-submenu ${componentCls}-submenu-title`]: { [`> ${componentCls}-inline-collapsed-noicon`]: { fontSize: fontSizeLG, textAlign: "center" } } }, [`> ${componentCls}-item, > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-item, > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-submenu > ${componentCls}-submenu-title, > ${componentCls}-submenu > ${componentCls}-submenu-title`]: { insetInlineStart: 0, paddingInline: `calc(50% - ${fontSizeSM}px)`, textOverflow: "clip", [` ${componentCls}-submenu-arrow, ${componentCls}-submenu-expand-icon `]: { opacity: 0 }, [`${componentCls}-item-icon, ${iconCls}`]: { margin: 0, fontSize: fontSizeLG, lineHeight: `${menuItemHeight}px`, "+ span": { display: "inline-block", opacity: 0 } } }, [`${componentCls}-item-icon, ${iconCls}`]: { display: "inline-block" }, "&-tooltip": { pointerEvents: "none", [`${componentCls}-item-icon, ${iconCls}`]: { display: "none" }, "a, a:hover": { color: colorTextLightSolid } }, [`${componentCls}-item-group-title`]: _extends$1(_extends$1({}, textEllipsis), { paddingInline: paddingXS }) } } ]; }; const genMenuItemStyle = (token2) => { const { componentCls, fontSize, motionDurationSlow, motionDurationMid, motionEaseInOut, motionEaseOut, iconCls, controlHeightSM } = token2; return { // >>>>> Item [`${componentCls}-item, ${componentCls}-submenu-title`]: { position: "relative", display: "block", margin: 0, whiteSpace: "nowrap", cursor: "pointer", transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(","), [`${componentCls}-item-icon, ${iconCls}`]: { minWidth: fontSize, fontSize, transition: [`font-size ${motionDurationMid} ${motionEaseOut}`, `margin ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow}`].join(","), "+ span": { marginInlineStart: controlHeightSM - fontSize, opacity: 1, transition: [`opacity ${motionDurationSlow} ${motionEaseInOut}`, `margin ${motionDurationSlow}`, `color ${motionDurationSlow}`].join(",") } }, [`${componentCls}-item-icon`]: _extends$1({}, resetIcon()), [`&${componentCls}-item-only-child`]: { [`> ${iconCls}, > ${componentCls}-item-icon`]: { marginInlineEnd: 0 } } }, // Disabled state sets text to gray and nukes hover/tab effects [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: { background: "none !important", cursor: "not-allowed", "&::after": { borderColor: "transparent !important" }, a: { color: "inherit !important" }, [`> ${componentCls}-submenu-title`]: { color: "inherit !important", cursor: "not-allowed" } } }; }; const genSubMenuArrowStyle = (token2) => { const { componentCls, motionDurationSlow, motionEaseInOut, borderRadius, menuArrowSize, menuArrowOffset } = token2; return { [`${componentCls}-submenu`]: { [`&-expand-icon, &-arrow`]: { position: "absolute", top: "50%", insetInlineEnd: token2.margin, width: menuArrowSize, color: "currentcolor", transform: "translateY(-50%)", transition: `transform ${motionDurationSlow} ${motionEaseInOut}, opacity ${motionDurationSlow}` }, "&-arrow": { // → "&::before, &::after": { position: "absolute", width: menuArrowSize * 0.6, height: menuArrowSize * 0.15, backgroundColor: "currentcolor", borderRadius, transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `transform ${motionDurationSlow} ${motionEaseInOut}`, `top ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow} ${motionEaseInOut}`].join(","), content: '""' }, "&::before": { transform: `rotate(45deg) translateY(-${menuArrowOffset})` }, "&::after": { transform: `rotate(-45deg) translateY(${menuArrowOffset})` } } } }; }; const getBaseStyle = (token2) => { const { antCls, componentCls, fontSize, motionDurationSlow, motionDurationMid, motionEaseInOut, lineHeight, paddingXS, padding, colorSplit, lineWidth, zIndexPopup, borderRadiusLG, radiusSubMenuItem, menuArrowSize, menuArrowOffset, lineType, menuPanelMaskInset } = token2; return [ // Misc { "": { [`${componentCls}`]: _extends$1(_extends$1({}, clearFix()), { // Hidden [`&-hidden`]: { display: "none" } }) }, [`${componentCls}-submenu-hidden`]: { display: "none" } }, { [componentCls]: _extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), clearFix()), { marginBottom: 0, paddingInlineStart: 0, // Override default ul/ol fontSize, lineHeight: 0, listStyle: "none", outline: "none", transition: `width ${motionDurationSlow} cubic-bezier(0.2, 0, 0, 1) 0s`, [`ul, ol`]: { margin: 0, padding: 0, listStyle: "none" }, // Overflow ellipsis [`&-overflow`]: { display: "flex", [`${componentCls}-item`]: { flex: "none" } }, [`${componentCls}-item, ${componentCls}-submenu, ${componentCls}-submenu-title`]: { borderRadius: token2.radiusItem }, [`${componentCls}-item-group-title`]: { padding: `${paddingXS}px ${padding}px`, fontSize, lineHeight, transition: `all ${motionDurationSlow}` }, [`&-horizontal ${componentCls}-submenu`]: { transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`].join(",") }, [`${componentCls}-submenu, ${componentCls}-submenu-inline`]: { transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationMid} ${motionEaseInOut}`].join(",") }, [`${componentCls}-submenu ${componentCls}-sub`]: { cursor: "initial", transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(",") }, [`${componentCls}-title-content`]: { transition: `color ${motionDurationSlow}` }, [`${componentCls}-item a`]: { "&::before": { position: "absolute", inset: 0, backgroundColor: "transparent", content: '""' } }, // Removed a Badge related style seems it's safe // https://github.com/ant-design/ant-design/issues/19809 // >>>>> Divider [`${componentCls}-item-divider`]: { overflow: "hidden", lineHeight: 0, borderColor: colorSplit, borderStyle: lineType, borderWidth: 0, borderTopWidth: lineWidth, marginBlock: lineWidth, padding: 0, "&-dashed": { borderStyle: "dashed" } } }), genMenuItemStyle(token2)), { [`${componentCls}-item-group`]: { [`${componentCls}-item-group-list`]: { margin: 0, padding: 0, [`${componentCls}-item, ${componentCls}-submenu-title`]: { paddingInline: `${fontSize * 2}px ${padding}px` } } }, // ======================= Sub Menu ======================= "&-submenu": { "&-popup": { position: "absolute", zIndex: zIndexPopup, background: "transparent", borderRadius: borderRadiusLG, boxShadow: "none", transformOrigin: "0 0", // https://github.com/ant-design/ant-design/issues/13955 "&::before": { position: "absolute", inset: `${menuPanelMaskInset}px 0 0`, zIndex: -1, width: "100%", height: "100%", opacity: 0, content: '""' } }, // https://github.com/ant-design/ant-design/issues/13955 "&-placement-rightTop::before": { top: 0, insetInlineStart: menuPanelMaskInset }, [`> ${componentCls}`]: _extends$1(_extends$1(_extends$1({ borderRadius: borderRadiusLG }, genMenuItemStyle(token2)), genSubMenuArrowStyle(token2)), { [`${componentCls}-item, ${componentCls}-submenu > ${componentCls}-submenu-title`]: { borderRadius: radiusSubMenuItem }, [`${componentCls}-submenu-title::after`]: { transition: `transform ${motionDurationSlow} ${motionEaseInOut}` } }) } }), genSubMenuArrowStyle(token2)), { [`&-inline-collapsed ${componentCls}-submenu-arrow, &-inline ${componentCls}-submenu-arrow`]: { // ↓ "&::before": { transform: `rotate(-45deg) translateX(${menuArrowOffset})` }, "&::after": { transform: `rotate(45deg) translateX(-${menuArrowOffset})` } }, [`${componentCls}-submenu-open${componentCls}-submenu-inline > ${componentCls}-submenu-title > ${componentCls}-submenu-arrow`]: { // ↑ transform: `translateY(-${menuArrowSize * 0.2}px)`, "&::after": { transform: `rotate(-45deg) translateX(-${menuArrowOffset})` }, "&::before": { transform: `rotate(45deg) translateX(${menuArrowOffset})` } } }) }, // Integration with header element so menu items have the same height { [`${antCls}-layout-header`]: { [componentCls]: { lineHeight: "inherit" } } } ]; }; const useStyle$b = (prefixCls, injectStyle) => { const useOriginHook = genComponentStyleHook("Menu", (token2, _ref) => { let { overrideComponentToken } = _ref; if ((injectStyle === null || injectStyle === void 0 ? void 0 : injectStyle.value) === false) { return []; } const { colorBgElevated, colorPrimary, colorError, colorErrorHover, colorTextLightSolid } = token2; const { controlHeightLG, fontSize } = token2; const menuArrowSize = fontSize / 7 * 5; const menuToken = merge(token2, { menuItemHeight: controlHeightLG, menuItemPaddingInline: token2.margin, menuArrowSize, menuHorizontalHeight: controlHeightLG * 1.15, menuArrowOffset: `${menuArrowSize * 0.25}px`, menuPanelMaskInset: -7, menuSubMenuBg: colorBgElevated }); const colorTextDark = new TinyColor(colorTextLightSolid).setAlpha(0.65).toRgbString(); const menuDarkToken = merge(menuToken, { colorItemText: colorTextDark, colorItemTextHover: colorTextLightSolid, colorGroupTitle: colorTextDark, colorItemTextSelected: colorTextLightSolid, colorItemBg: "#001529", colorSubItemBg: "#000c17", colorItemBgActive: "transparent", colorItemBgSelected: colorPrimary, colorActiveBarWidth: 0, colorActiveBarHeight: 0, colorActiveBarBorderSize: 0, // Disabled colorItemTextDisabled: new TinyColor(colorTextLightSolid).setAlpha(0.25).toRgbString(), // Danger colorDangerItemText: colorError, colorDangerItemTextHover: colorErrorHover, colorDangerItemTextSelected: colorTextLightSolid, colorDangerItemBgActive: colorError, colorDangerItemBgSelected: colorError, menuSubMenuBg: "#001529", // Horizontal colorItemTextSelectedHorizontal: colorTextLightSolid, colorItemBgSelectedHorizontal: colorPrimary }, _extends$1({}, overrideComponentToken)); return [ // Basic getBaseStyle(menuToken), // Horizontal getHorizontalStyle(menuToken), // Vertical getVerticalStyle(menuToken), // Theme getThemeStyle(menuToken, "light"), getThemeStyle(menuDarkToken, "dark"), // RTL getRTLStyle(menuToken), // Motion genCollapseMotion(menuToken), initSlideMotion(menuToken, "slide-up"), initSlideMotion(menuToken, "slide-down"), initZoomMotion(menuToken, "zoom-big") ]; }, (token2) => { const { colorPrimary, colorError, colorTextDisabled, colorErrorBg, colorText, colorTextDescription, colorBgContainer, colorFillAlter, colorFillContent, lineWidth, lineWidthBold, controlItemBgActive, colorBgTextHover } = token2; return { dropdownWidth: 160, zIndexPopup: token2.zIndexPopupBase + 50, radiusItem: token2.borderRadiusLG, radiusSubMenuItem: token2.borderRadiusSM, colorItemText: colorText, colorItemTextHover: colorText, colorItemTextHoverHorizontal: colorPrimary, colorGroupTitle: colorTextDescription, colorItemTextSelected: colorPrimary, colorItemTextSelectedHorizontal: colorPrimary, colorItemBg: colorBgContainer, colorItemBgHover: colorBgTextHover, colorItemBgActive: colorFillContent, colorSubItemBg: colorFillAlter, colorItemBgSelected: controlItemBgActive, colorItemBgSelectedHorizontal: "transparent", colorActiveBarWidth: 0, colorActiveBarHeight: lineWidthBold, colorActiveBarBorderSize: lineWidth, // Disabled colorItemTextDisabled: colorTextDisabled, // Danger colorDangerItemText: colorError, colorDangerItemTextHover: colorError, colorDangerItemTextSelected: colorError, colorDangerItemBgActive: colorErrorBg, colorDangerItemBgSelected: colorErrorBg, itemMarginInline: token2.marginXXS }; }); return useOriginHook(prefixCls); }; const menuProps = () => ({ id: String, prefixCls: String, // donot use items, now only support inner use items: Array, disabled: Boolean, inlineCollapsed: Boolean, disabledOverflow: Boolean, forceSubMenuRender: Boolean, openKeys: Array, selectedKeys: Array, activeKey: String, selectable: { type: Boolean, default: true }, multiple: { type: Boolean, default: false }, tabindex: { type: [Number, String] }, motion: Object, role: String, theme: { type: String, default: "light" }, mode: { type: String, default: "vertical" }, inlineIndent: { type: Number, default: 24 }, subMenuOpenDelay: { type: Number, default: 0 }, subMenuCloseDelay: { type: Number, default: 0.1 }, builtinPlacements: { type: Object }, triggerSubMenuAction: { type: String, default: "hover" }, getPopupContainer: Function, expandIcon: Function, onOpenChange: Function, onSelect: Function, onDeselect: Function, onClick: [Function, Array], onFocus: Function, onBlur: Function, onMousedown: Function, "onUpdate:openKeys": Function, "onUpdate:selectedKeys": Function, "onUpdate:activeKey": Function }); const EMPTY_LIST = []; const Menu = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AMenu", inheritAttrs: false, props: menuProps(), slots: Object, setup(props2, _ref) { let { slots, emit: emit2, attrs } = _ref; const { direction, getPrefixCls } = useConfigInject("menu", props2); const override = useInjectOverride(); const prefixCls = computed(() => { var _a; return getPrefixCls("menu", props2.prefixCls || ((_a = override === null || override === void 0 ? void 0 : override.prefixCls) === null || _a === void 0 ? void 0 : _a.value)); }); const [wrapSSR, hashId] = useStyle$b(prefixCls, computed(() => { return !override; })); const store = shallowRef(/* @__PURE__ */ new Map()); const siderCollapsed = inject(SiderCollapsedKey, ref(void 0)); const inlineCollapsed = computed(() => { if (siderCollapsed.value !== void 0) { return siderCollapsed.value; } return props2.inlineCollapsed; }); const { itemsNodes } = useItems(props2); const isMounted = shallowRef(false); onMounted(() => { isMounted.value = true; }); watchEffect(() => { devWarning(!(props2.inlineCollapsed === true && props2.mode !== "inline"), "Menu", "`inlineCollapsed` should only be used when `mode` is inline."); devWarning(!(siderCollapsed.value !== void 0 && props2.inlineCollapsed === true), "Menu", "`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead."); }); const activeKeys = ref([]); const mergedSelectedKeys = ref([]); const keyMapStore = ref({}); watch(store, () => { const newKeyMapStore = {}; for (const menuInfo of store.value.values()) { newKeyMapStore[menuInfo.key] = menuInfo; } keyMapStore.value = newKeyMapStore; }, { flush: "post" }); watchEffect(() => { if (props2.activeKey !== void 0) { let keys2 = []; const menuInfo = props2.activeKey ? keyMapStore.value[props2.activeKey] : void 0; if (menuInfo && props2.activeKey !== void 0) { keys2 = uniq([].concat(unref(menuInfo.parentKeys), props2.activeKey)); } else { keys2 = []; } if (!shallowequal(activeKeys.value, keys2)) { activeKeys.value = keys2; } } }); watch(() => props2.selectedKeys, (selectedKeys) => { if (selectedKeys) { mergedSelectedKeys.value = selectedKeys.slice(); } }, { immediate: true, deep: true }); const selectedSubMenuKeys = ref([]); watch([keyMapStore, mergedSelectedKeys], () => { let subMenuParentKeys = []; mergedSelectedKeys.value.forEach((key2) => { const menuInfo = keyMapStore.value[key2]; if (menuInfo) { subMenuParentKeys = subMenuParentKeys.concat(unref(menuInfo.parentKeys)); } }); subMenuParentKeys = uniq(subMenuParentKeys); if (!shallowequal(selectedSubMenuKeys.value, subMenuParentKeys)) { selectedSubMenuKeys.value = subMenuParentKeys; } }, { immediate: true }); const triggerSelection = (info) => { if (props2.selectable) { const { key: targetKey } = info; const exist = mergedSelectedKeys.value.includes(targetKey); let newSelectedKeys; if (props2.multiple) { if (exist) { newSelectedKeys = mergedSelectedKeys.value.filter((key2) => key2 !== targetKey); } else { newSelectedKeys = [...mergedSelectedKeys.value, targetKey]; } } else { newSelectedKeys = [targetKey]; } const selectInfo = _extends$1(_extends$1({}, info), { selectedKeys: newSelectedKeys }); if (!shallowequal(newSelectedKeys, mergedSelectedKeys.value)) { if (props2.selectedKeys === void 0) { mergedSelectedKeys.value = newSelectedKeys; } emit2("update:selectedKeys", newSelectedKeys); if (exist && props2.multiple) { emit2("deselect", selectInfo); } else { emit2("select", selectInfo); } } } if (mergedMode.value !== "inline" && !props2.multiple && mergedOpenKeys.value.length) { triggerOpenKeys(EMPTY_LIST); } }; const mergedOpenKeys = ref([]); watch(() => props2.openKeys, function() { let openKeys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : mergedOpenKeys.value; if (!shallowequal(mergedOpenKeys.value, openKeys)) { mergedOpenKeys.value = openKeys.slice(); } }, { immediate: true, deep: true }); let timeout; const changeActiveKeys = (keys2) => { clearTimeout(timeout); timeout = setTimeout(() => { if (props2.activeKey === void 0) { activeKeys.value = keys2; } emit2("update:activeKey", keys2[keys2.length - 1]); }); }; const disabled = computed(() => !!props2.disabled); const isRtl = computed(() => direction.value === "rtl"); const mergedMode = ref("vertical"); const mergedInlineCollapsed = shallowRef(false); watchEffect(() => { var _a; if ((props2.mode === "inline" || props2.mode === "vertical") && inlineCollapsed.value) { mergedMode.value = "vertical"; mergedInlineCollapsed.value = inlineCollapsed.value; } else { mergedMode.value = props2.mode; mergedInlineCollapsed.value = false; } if ((_a = override === null || override === void 0 ? void 0 : override.mode) === null || _a === void 0 ? void 0 : _a.value) { mergedMode.value = override.mode.value; } }); const isInlineMode = computed(() => mergedMode.value === "inline"); const triggerOpenKeys = (keys2) => { mergedOpenKeys.value = keys2; emit2("update:openKeys", keys2); emit2("openChange", keys2); }; const inlineCacheOpenKeys = ref(mergedOpenKeys.value); const mountRef = shallowRef(false); watch(mergedOpenKeys, () => { if (isInlineMode.value) { inlineCacheOpenKeys.value = mergedOpenKeys.value; } }, { immediate: true }); watch(isInlineMode, () => { if (!mountRef.value) { mountRef.value = true; return; } if (isInlineMode.value) { mergedOpenKeys.value = inlineCacheOpenKeys.value; } else { triggerOpenKeys(EMPTY_LIST); } }, { immediate: true }); const className = computed(() => { return { [`${prefixCls.value}`]: true, [`${prefixCls.value}-root`]: true, [`${prefixCls.value}-${mergedMode.value}`]: true, [`${prefixCls.value}-inline-collapsed`]: mergedInlineCollapsed.value, [`${prefixCls.value}-rtl`]: isRtl.value, [`${prefixCls.value}-${props2.theme}`]: true }; }); const rootPrefixCls = computed(() => getPrefixCls()); const defaultMotions = computed(() => ({ horizontal: { name: `${rootPrefixCls.value}-slide-up` }, inline: collapseMotion(`${rootPrefixCls.value}-motion-collapse`), other: { name: `${rootPrefixCls.value}-zoom-big` } })); useProvideFirstLevel(true); const getChildrenKeys = function() { let eventKeys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; const keys2 = []; const storeValue = store.value; eventKeys.forEach((eventKey) => { const { key: key2, childrenEventKeys } = storeValue.get(eventKey); keys2.push(key2, ...getChildrenKeys(unref(childrenEventKeys))); }); return keys2; }; const onInternalClick = (info) => { var _a; emit2("click", info); triggerSelection(info); (_a = override === null || override === void 0 ? void 0 : override.onClick) === null || _a === void 0 ? void 0 : _a.call(override); }; const onInternalOpenChange = (key2, open2) => { var _a; const childrenEventKeys = ((_a = keyMapStore.value[key2]) === null || _a === void 0 ? void 0 : _a.childrenEventKeys) || []; let newOpenKeys = mergedOpenKeys.value.filter((k2) => k2 !== key2); if (open2) { newOpenKeys.push(key2); } else if (mergedMode.value !== "inline") { const subPathKeys = getChildrenKeys(unref(childrenEventKeys)); newOpenKeys = uniq(newOpenKeys.filter((k2) => !subPathKeys.includes(k2))); } if (!shallowequal(mergedOpenKeys, newOpenKeys)) { triggerOpenKeys(newOpenKeys); } }; const registerMenuInfo = (key2, info) => { store.value.set(key2, info); store.value = new Map(store.value); }; const unRegisterMenuInfo = (key2) => { store.value.delete(key2); store.value = new Map(store.value); }; const lastVisibleIndex = ref(0); const expandIcon = computed(() => { var _a; return props2.expandIcon || slots.expandIcon || ((_a = override === null || override === void 0 ? void 0 : override.expandIcon) === null || _a === void 0 ? void 0 : _a.value) ? (opt) => { let icon = props2.expandIcon || slots.expandIcon; icon = typeof icon === "function" ? icon(opt) : icon; return cloneElement(icon, { class: `${prefixCls.value}-submenu-expand-icon` }, false); } : null; }); useProvideMenu({ prefixCls, activeKeys, openKeys: mergedOpenKeys, selectedKeys: mergedSelectedKeys, changeActiveKeys, disabled, rtl: isRtl, mode: mergedMode, inlineIndent: computed(() => props2.inlineIndent), subMenuCloseDelay: computed(() => props2.subMenuCloseDelay), subMenuOpenDelay: computed(() => props2.subMenuOpenDelay), builtinPlacements: computed(() => props2.builtinPlacements), triggerSubMenuAction: computed(() => props2.triggerSubMenuAction), getPopupContainer: computed(() => props2.getPopupContainer), inlineCollapsed: mergedInlineCollapsed, theme: computed(() => props2.theme), siderCollapsed, defaultMotions: computed(() => isMounted.value ? defaultMotions.value : null), motion: computed(() => isMounted.value ? props2.motion : null), overflowDisabled: shallowRef(void 0), onOpenChange: onInternalOpenChange, onItemClick: onInternalClick, registerMenuInfo, unRegisterMenuInfo, selectedSubMenuKeys, expandIcon, forceSubMenuRender: computed(() => props2.forceSubMenuRender), rootClassName: hashId }); const getChildrenList = () => { var _a; return itemsNodes.value || flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)); }; return () => { var _a; const childList = getChildrenList(); const allVisible = lastVisibleIndex.value >= childList.length - 1 || mergedMode.value !== "horizontal" || props2.disabledOverflow; const getWrapperList = (childList2) => { return mergedMode.value !== "horizontal" || props2.disabledOverflow ? childList2 : ( // Need wrap for overflow dropdown that do not response for open childList2.map((child, index2) => ( // Always wrap provider to avoid sub node re-mount createVNode(MenuContextProvider, { "key": child.key, "overflowDisabled": index2 > lastVisibleIndex.value }, { default: () => child }) )) ); }; const overflowedIndicator = ((_a = slots.overflowedIndicator) === null || _a === void 0 ? void 0 : _a.call(slots)) || createVNode(EllipsisOutlined, null, null); return wrapSSR(createVNode(Overflow, _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "onMousedown": props2.onMousedown, "prefixCls": `${prefixCls.value}-overflow`, "component": "ul", "itemComponent": MenuItem, "class": [className.value, attrs.class, hashId.value], "role": "menu", "id": props2.id, "data": getWrapperList(childList), "renderRawItem": (node2) => node2, "renderRawRest": (omitItems) => { const len = omitItems.length; const originOmitItems = len ? childList.slice(-len) : null; return createVNode(Fragment, null, [createVNode(SubMenu, { "eventKey": OVERFLOW_KEY, "key": OVERFLOW_KEY, "title": overflowedIndicator, "disabled": allVisible, "internalPopupClose": len === 0 }, { default: () => originOmitItems }), createVNode(PathContext, null, { default: () => [createVNode(SubMenu, { "eventKey": OVERFLOW_KEY, "key": OVERFLOW_KEY, "title": overflowedIndicator, "disabled": allVisible, "internalPopupClose": len === 0 }, { default: () => originOmitItems })] })]); }, "maxCount": mergedMode.value !== "horizontal" || props2.disabledOverflow ? Overflow.INVALIDATE : Overflow.RESPONSIVE, "ssr": "full", "data-menu-list": true, "onVisibleChange": (newLastIndex) => { lastVisibleIndex.value = newLastIndex; } }), { default: () => [createVNode(Teleport, { "to": "body" }, { default: () => [createVNode("div", { "style": { display: "none" }, "aria-hidden": true }, [createVNode(PathContext, null, { default: () => [getWrapperList(getChildrenList())] })])] })] })); }; } }); Menu.install = function(app) { app.component(Menu.name, Menu); app.component(MenuItem.name, MenuItem); app.component(SubMenu.name, SubMenu); app.component(Divider.name, Divider); app.component(ItemGroup.name, ItemGroup); return app; }; Menu.Item = MenuItem; Menu.Divider = Divider; Menu.SubMenu = SubMenu; Menu.ItemGroup = ItemGroup; var __rest$f = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const checkboxProps = { prefixCls: String, name: String, id: String, type: String, defaultChecked: { type: [Boolean, Number], default: void 0 }, checked: { type: [Boolean, Number], default: void 0 }, disabled: Boolean, tabindex: { type: [Number, String] }, readonly: Boolean, autofocus: Boolean, value: PropTypes.any, required: Boolean }; const VcCheckbox = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Checkbox", inheritAttrs: false, props: initDefaultProps(checkboxProps, { prefixCls: "rc-checkbox", type: "checkbox", defaultChecked: false }), emits: ["click", "change"], setup(props2, _ref) { let { attrs, emit: emit2, expose } = _ref; const checked = ref(props2.checked === void 0 ? props2.defaultChecked : props2.checked); const inputRef = ref(); watch(() => props2.checked, () => { checked.value = props2.checked; }); expose({ focus() { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }, blur() { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur(); } }); const eventShiftKey = ref(); const handleChange = (e2) => { if (props2.disabled) { return; } if (props2.checked === void 0) { checked.value = e2.target.checked; } e2.shiftKey = eventShiftKey.value; const eventObj = { target: _extends$1(_extends$1({}, props2), { checked: e2.target.checked }), stopPropagation() { e2.stopPropagation(); }, preventDefault() { e2.preventDefault(); }, nativeEvent: e2 }; if (props2.checked !== void 0) { inputRef.value.checked = !!props2.checked; } emit2("change", eventObj); eventShiftKey.value = false; }; const onClick = (e2) => { emit2("click", e2); eventShiftKey.value = e2.shiftKey; }; return () => { const { prefixCls, name, id, type, disabled, readonly: readonly2, tabindex, autofocus, value, required } = props2, others = __rest$f(props2, ["prefixCls", "name", "id", "type", "disabled", "readonly", "tabindex", "autofocus", "value", "required"]); const { class: className, onFocus, onBlur, onKeydown, onKeypress, onKeyup } = attrs; const othersAndAttrs = _extends$1(_extends$1({}, others), attrs); const globalProps = Object.keys(othersAndAttrs).reduce((prev2, key2) => { if (key2.startsWith("data-") || key2.startsWith("aria-") || key2 === "role") { prev2[key2] = othersAndAttrs[key2]; } return prev2; }, {}); const classString = classNames(prefixCls, className, { [`${prefixCls}-checked`]: checked.value, [`${prefixCls}-disabled`]: disabled }); const inputProps2 = _extends$1(_extends$1({ name, id, type, readonly: readonly2, disabled, tabindex, class: `${prefixCls}-input`, checked: !!checked.value, autofocus, value }, globalProps), { onChange: handleChange, onClick, onFocus, onBlur, onKeydown, onKeypress, onKeyup, required }); return createVNode("span", { "class": classString }, [createVNode("input", _objectSpread2$1({ "ref": inputRef }, inputProps2), null), createVNode("span", { "class": `${prefixCls}-inner` }, null)]); }; } }); const radioGroupContextKey = Symbol("radioGroupContextKey"); const useProvideRadioGroupContext = (props2) => { provide(radioGroupContextKey, props2); }; const useInjectRadioGroupContext = () => { return inject(radioGroupContextKey, void 0); }; const radioOptionTypeContextKey = Symbol("radioOptionTypeContextKey"); const useProvideRadioOptionTypeContext = (props2) => { provide(radioOptionTypeContextKey, props2); }; const useInjectRadioOptionTypeContext = () => { return inject(radioOptionTypeContextKey, void 0); }; const antRadioEffect = new Keyframe("antRadioEffect", { "0%": { transform: "scale(1)", opacity: 0.5 }, "100%": { transform: "scale(1.6)", opacity: 0 } }); const getGroupRadioStyle = (token2) => { const { componentCls, antCls } = token2; const groupPrefixCls = `${componentCls}-group`; return { [groupPrefixCls]: _extends$1(_extends$1({}, resetComponent(token2)), { display: "inline-block", fontSize: 0, // RTL [`&${groupPrefixCls}-rtl`]: { direction: "rtl" }, [`${antCls}-badge ${antCls}-badge-count`]: { zIndex: 1 }, [`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: { borderInlineStart: "none" } }) }; }; const getRadioBasicStyle = (token2) => { const { componentCls, radioWrapperMarginRight, radioCheckedColor, radioSize, motionDurationSlow, motionDurationMid, motionEaseInOut, motionEaseInOutCirc, radioButtonBg, colorBorder, lineWidth, radioDotSize, colorBgContainerDisabled, colorTextDisabled, paddingXS, radioDotDisabledColor, lineType, radioDotDisabledSize, wireframe, colorWhite } = token2; const radioInnerPrefixCls = `${componentCls}-inner`; return { [`${componentCls}-wrapper`]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "relative", display: "inline-flex", alignItems: "baseline", marginInlineStart: 0, marginInlineEnd: radioWrapperMarginRight, cursor: "pointer", // RTL [`&${componentCls}-wrapper-rtl`]: { direction: "rtl" }, "&-disabled": { cursor: "not-allowed", color: token2.colorTextDisabled }, "&::after": { display: "inline-block", width: 0, overflow: "hidden", content: '"\\a0"' }, // hashId 在 wrapper 上,只能铺平 [`${componentCls}-checked::after`]: { position: "absolute", insetBlockStart: 0, insetInlineStart: 0, width: "100%", height: "100%", border: `${lineWidth}px ${lineType} ${radioCheckedColor}`, borderRadius: "50%", visibility: "hidden", animationName: antRadioEffect, animationDuration: motionDurationSlow, animationTimingFunction: motionEaseInOut, animationFillMode: "both", content: '""' }, [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "relative", display: "inline-block", outline: "none", cursor: "pointer", alignSelf: "center" }), [`${componentCls}-wrapper:hover &, &:hover ${radioInnerPrefixCls}`]: { borderColor: radioCheckedColor }, [`${componentCls}-input:focus-visible + ${radioInnerPrefixCls}`]: _extends$1({}, genFocusOutline(token2)), [`${componentCls}:hover::after, ${componentCls}-wrapper:hover &::after`]: { visibility: "visible" }, [`${componentCls}-inner`]: { "&::after": { boxSizing: "border-box", position: "absolute", insetBlockStart: "50%", insetInlineStart: "50%", display: "block", width: radioSize, height: radioSize, marginBlockStart: radioSize / -2, marginInlineStart: radioSize / -2, backgroundColor: wireframe ? radioCheckedColor : colorWhite, borderBlockStart: 0, borderInlineStart: 0, borderRadius: radioSize, transform: "scale(0)", opacity: 0, transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`, content: '""' }, boxSizing: "border-box", position: "relative", insetBlockStart: 0, insetInlineStart: 0, display: "block", width: radioSize, height: radioSize, backgroundColor: radioButtonBg, borderColor: colorBorder, borderStyle: "solid", borderWidth: lineWidth, borderRadius: "50%", transition: `all ${motionDurationMid}` }, [`${componentCls}-input`]: { position: "absolute", insetBlockStart: 0, insetInlineEnd: 0, insetBlockEnd: 0, insetInlineStart: 0, zIndex: 1, cursor: "pointer", opacity: 0 }, // 选中状态 [`${componentCls}-checked`]: { [radioInnerPrefixCls]: { borderColor: radioCheckedColor, backgroundColor: wireframe ? radioButtonBg : radioCheckedColor, "&::after": { transform: `scale(${radioDotSize / radioSize})`, opacity: 1, transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}` } } }, [`${componentCls}-disabled`]: { cursor: "not-allowed", [radioInnerPrefixCls]: { backgroundColor: colorBgContainerDisabled, borderColor: colorBorder, cursor: "not-allowed", "&::after": { backgroundColor: radioDotDisabledColor } }, [`${componentCls}-input`]: { cursor: "not-allowed" }, [`${componentCls}-disabled + span`]: { color: colorTextDisabled, cursor: "not-allowed" }, [`&${componentCls}-checked`]: { [radioInnerPrefixCls]: { "&::after": { transform: `scale(${radioDotDisabledSize / radioSize})` } } } }, [`span${componentCls} + *`]: { paddingInlineStart: paddingXS, paddingInlineEnd: paddingXS } }) }; }; const getRadioButtonStyle = (token2) => { const { radioButtonColor, controlHeight, componentCls, lineWidth, lineType, colorBorder, motionDurationSlow, motionDurationMid, radioButtonPaddingHorizontal, fontSize, radioButtonBg, fontSizeLG, controlHeightLG, controlHeightSM, paddingXS, borderRadius, borderRadiusSM, borderRadiusLG, radioCheckedColor, radioButtonCheckedBg, radioButtonHoverColor, radioButtonActiveColor, radioSolidCheckedColor, colorTextDisabled, colorBgContainerDisabled, radioDisabledButtonCheckedColor, radioDisabledButtonCheckedBg } = token2; return { [`${componentCls}-button-wrapper`]: { position: "relative", display: "inline-block", height: controlHeight, margin: 0, paddingInline: radioButtonPaddingHorizontal, paddingBlock: 0, color: radioButtonColor, fontSize, lineHeight: `${controlHeight - lineWidth * 2}px`, background: radioButtonBg, border: `${lineWidth}px ${lineType} ${colorBorder}`, // strange align fix for chrome but works // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif borderBlockStartWidth: lineWidth + 0.02, borderInlineStartWidth: 0, borderInlineEndWidth: lineWidth, cursor: "pointer", transition: [`color ${motionDurationMid}`, `background ${motionDurationMid}`, `border-color ${motionDurationMid}`, `box-shadow ${motionDurationMid}`].join(","), a: { color: radioButtonColor }, [`> ${componentCls}-button`]: { position: "absolute", insetBlockStart: 0, insetInlineStart: 0, zIndex: -1, width: "100%", height: "100%" }, "&:not(:first-child)": { "&::before": { position: "absolute", insetBlockStart: -lineWidth, insetInlineStart: -lineWidth, display: "block", boxSizing: "content-box", width: 1, height: "100%", paddingBlock: lineWidth, paddingInline: 0, backgroundColor: colorBorder, transition: `background-color ${motionDurationSlow}`, content: '""' } }, "&:first-child": { borderInlineStart: `${lineWidth}px ${lineType} ${colorBorder}`, borderStartStartRadius: borderRadius, borderEndStartRadius: borderRadius }, "&:last-child": { borderStartEndRadius: borderRadius, borderEndEndRadius: borderRadius }, "&:first-child:last-child": { borderRadius }, [`${componentCls}-group-large &`]: { height: controlHeightLG, fontSize: fontSizeLG, lineHeight: `${controlHeightLG - lineWidth * 2}px`, "&:first-child": { borderStartStartRadius: borderRadiusLG, borderEndStartRadius: borderRadiusLG }, "&:last-child": { borderStartEndRadius: borderRadiusLG, borderEndEndRadius: borderRadiusLG } }, [`${componentCls}-group-small &`]: { height: controlHeightSM, paddingInline: paddingXS - lineWidth, paddingBlock: 0, lineHeight: `${controlHeightSM - lineWidth * 2}px`, "&:first-child": { borderStartStartRadius: borderRadiusSM, borderEndStartRadius: borderRadiusSM }, "&:last-child": { borderStartEndRadius: borderRadiusSM, borderEndEndRadius: borderRadiusSM } }, "&:hover": { position: "relative", color: radioCheckedColor }, "&:has(:focus-visible)": _extends$1({}, genFocusOutline(token2)), [`${componentCls}-inner, input[type='checkbox'], input[type='radio']`]: { width: 0, height: 0, opacity: 0, pointerEvents: "none" }, [`&-checked:not(${componentCls}-button-wrapper-disabled)`]: { zIndex: 1, color: radioCheckedColor, background: radioButtonCheckedBg, borderColor: radioCheckedColor, "&::before": { backgroundColor: radioCheckedColor }, "&:first-child": { borderColor: radioCheckedColor }, "&:hover": { color: radioButtonHoverColor, borderColor: radioButtonHoverColor, "&::before": { backgroundColor: radioButtonHoverColor } }, "&:active": { color: radioButtonActiveColor, borderColor: radioButtonActiveColor, "&::before": { backgroundColor: radioButtonActiveColor } } }, [`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: { color: radioSolidCheckedColor, background: radioCheckedColor, borderColor: radioCheckedColor, "&:hover": { color: radioSolidCheckedColor, background: radioButtonHoverColor, borderColor: radioButtonHoverColor }, "&:active": { color: radioSolidCheckedColor, background: radioButtonActiveColor, borderColor: radioButtonActiveColor } }, "&-disabled": { color: colorTextDisabled, backgroundColor: colorBgContainerDisabled, borderColor: colorBorder, cursor: "not-allowed", "&:first-child, &:hover": { color: colorTextDisabled, backgroundColor: colorBgContainerDisabled, borderColor: colorBorder } }, [`&-disabled${componentCls}-button-wrapper-checked`]: { color: radioDisabledButtonCheckedColor, backgroundColor: radioDisabledButtonCheckedBg, borderColor: colorBorder, boxShadow: "none" } } }; }; const useStyle$a = genComponentStyleHook("Radio", (token2) => { const { padding, lineWidth, controlItemBgActiveDisabled, colorTextDisabled, colorBgContainer, fontSizeLG, controlOutline, colorPrimaryHover, colorPrimaryActive, colorText, colorPrimary, marginXS, controlOutlineWidth, colorTextLightSolid, wireframe } = token2; const radioFocusShadow = `0 0 0 ${controlOutlineWidth}px ${controlOutline}`; const radioButtonFocusShadow = radioFocusShadow; const radioSize = fontSizeLG; const dotPadding = 4; const radioDotDisabledSize = radioSize - dotPadding * 2; const radioDotSize = wireframe ? radioDotDisabledSize : radioSize - (dotPadding + lineWidth) * 2; const radioCheckedColor = colorPrimary; const radioButtonColor = colorText; const radioButtonHoverColor = colorPrimaryHover; const radioButtonActiveColor = colorPrimaryActive; const radioButtonPaddingHorizontal = padding - lineWidth; const radioDisabledButtonCheckedColor = colorTextDisabled; const radioWrapperMarginRight = marginXS; const radioToken = merge(token2, { radioFocusShadow, radioButtonFocusShadow, radioSize, radioDotSize, radioDotDisabledSize, radioCheckedColor, radioDotDisabledColor: colorTextDisabled, radioSolidCheckedColor: colorTextLightSolid, radioButtonBg: colorBgContainer, radioButtonCheckedBg: colorBgContainer, radioButtonColor, radioButtonHoverColor, radioButtonActiveColor, radioButtonPaddingHorizontal, radioDisabledButtonCheckedBg: controlItemBgActiveDisabled, radioDisabledButtonCheckedColor, radioWrapperMarginRight }); return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)]; }); var __rest$e = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const radioProps = () => ({ prefixCls: String, checked: booleanType(), disabled: booleanType(), isGroup: booleanType(), value: PropTypes.any, name: String, id: String, autofocus: booleanType(), onChange: functionType(), onFocus: functionType(), onBlur: functionType(), onClick: functionType(), "onUpdate:checked": functionType(), "onUpdate:value": functionType() }); const Radio = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ARadio", inheritAttrs: false, props: radioProps(), setup(props2, _ref) { let { emit: emit2, expose, slots, attrs } = _ref; const formItemContext = useInjectFormItemContext(); const formItemInputContext = FormItemInputContext.useInject(); const radioOptionTypeContext = useInjectRadioOptionTypeContext(); const radioGroupContext = useInjectRadioGroupContext(); const disabledContext = useInjectDisabled(); const mergedDisabled = computed(() => { var _a; return (_a = disabled.value) !== null && _a !== void 0 ? _a : disabledContext.value; }); const vcCheckbox = ref(); const { prefixCls: radioPrefixCls, direction, disabled } = useConfigInject("radio", props2); const prefixCls = computed(() => (radioGroupContext === null || radioGroupContext === void 0 ? void 0 : radioGroupContext.optionType.value) === "button" || radioOptionTypeContext === "button" ? `${radioPrefixCls.value}-button` : radioPrefixCls.value); const contextDisabled = useInjectDisabled(); const [wrapSSR, hashId] = useStyle$a(radioPrefixCls); const focus = () => { vcCheckbox.value.focus(); }; const blur = () => { vcCheckbox.value.blur(); }; expose({ focus, blur }); const handleChange = (event) => { const targetChecked = event.target.checked; emit2("update:checked", targetChecked); emit2("update:value", targetChecked); emit2("change", event); formItemContext.onFieldChange(); }; const onChange = (e2) => { emit2("change", e2); if (radioGroupContext && radioGroupContext.onChange) { radioGroupContext.onChange(e2); } }; return () => { var _a; const radioGroup = radioGroupContext; const { prefixCls: customizePrefixCls, id = formItemContext.id.value } = props2, restProps = __rest$e(props2, ["prefixCls", "id"]); const rProps = _extends$1(_extends$1({ prefixCls: prefixCls.value, id }, omit$1(restProps, ["onUpdate:checked", "onUpdate:value"])), { disabled: (_a = disabled.value) !== null && _a !== void 0 ? _a : contextDisabled.value }); if (radioGroup) { rProps.name = radioGroup.name.value; rProps.onChange = onChange; rProps.checked = props2.value === radioGroup.value.value; rProps.disabled = mergedDisabled.value || radioGroup.disabled.value; } else { rProps.onChange = handleChange; } const wrapperClassString = classNames({ [`${prefixCls.value}-wrapper`]: true, [`${prefixCls.value}-wrapper-checked`]: rProps.checked, [`${prefixCls.value}-wrapper-disabled`]: rProps.disabled, [`${prefixCls.value}-wrapper-rtl`]: direction.value === "rtl", [`${prefixCls.value}-wrapper-in-form-item`]: formItemInputContext.isFormItemInput }, attrs.class, hashId.value); return wrapSSR(createVNode("label", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": wrapperClassString }), [createVNode(VcCheckbox, _objectSpread2$1(_objectSpread2$1({}, rProps), {}, { "type": "radio", "ref": vcCheckbox }), null), slots.default && createVNode("span", null, [slots.default()])])); }; } }); const radioGroupProps = () => ({ prefixCls: String, value: PropTypes.any, size: stringType(), options: arrayType(), disabled: booleanType(), name: String, buttonStyle: stringType("outline"), id: String, optionType: stringType("default"), onChange: functionType(), "onUpdate:value": functionType() }); const Group$2 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ARadioGroup", inheritAttrs: false, props: radioGroupProps(), // emits: ['update:value', 'change'], setup(props2, _ref) { let { slots, emit: emit2, attrs } = _ref; const formItemContext = useInjectFormItemContext(); const { prefixCls, direction, size } = useConfigInject("radio", props2); const [wrapSSR, hashId] = useStyle$a(prefixCls); const stateValue = ref(props2.value); const updatingValue = ref(false); watch(() => props2.value, (val) => { stateValue.value = val; updatingValue.value = false; }); const onRadioChange = (ev) => { const lastValue = stateValue.value; const { value } = ev.target; if (!("value" in props2)) { stateValue.value = value; } if (!updatingValue.value && value !== lastValue) { updatingValue.value = true; emit2("update:value", value); emit2("change", ev); formItemContext.onFieldChange(); } nextTick(() => { updatingValue.value = false; }); }; useProvideRadioGroupContext({ onChange: onRadioChange, value: stateValue, disabled: computed(() => props2.disabled), name: computed(() => props2.name), optionType: computed(() => props2.optionType) }); return () => { var _a; const { options, buttonStyle, id = formItemContext.id.value } = props2; const groupPrefixCls = `${prefixCls.value}-group`; const classString = classNames(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, { [`${groupPrefixCls}-${size.value}`]: size.value, [`${groupPrefixCls}-rtl`]: direction.value === "rtl" }, attrs.class, hashId.value); let children = null; if (options && options.length > 0) { children = options.map((option) => { if (typeof option === "string" || typeof option === "number") { return createVNode(Radio, { "key": option, "prefixCls": prefixCls.value, "disabled": props2.disabled, "value": option, "checked": stateValue.value === option }, { default: () => [option] }); } const { value, disabled, label } = option; return createVNode(Radio, { "key": `radio-group-value-options-${value}`, "prefixCls": prefixCls.value, "disabled": disabled || props2.disabled, "value": value, "checked": stateValue.value === value }, { default: () => [label] }); }); } else { children = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); } return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": classString, "id": id }), [children])); }; } }); const Button = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ARadioButton", inheritAttrs: false, props: radioProps(), setup(props2, _ref) { let { slots, attrs } = _ref; const { prefixCls } = useConfigInject("radio", props2); useProvideRadioOptionTypeContext("button"); return () => { var _a; return createVNode(Radio, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, attrs), props2), {}, { "prefixCls": prefixCls.value }), { default: () => [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)] }); }; } }); Radio.Group = Group$2; Radio.Button = Button; Radio.install = function(app) { app.component(Radio.name, Radio); app.component(Radio.Group.name, Radio.Group); app.component(Radio.Button.name, Radio.Button); return app; }; const genPlaceholderStyle = (color) => ({ // Firefox "&::-moz-placeholder": { opacity: 1 }, "&::placeholder": { color, userSelect: "none" // https://github.com/ant-design/ant-design/pull/32639 }, "&:placeholder-shown": { textOverflow: "ellipsis" } }); const genHoverStyle = (token2) => ({ borderColor: token2.inputBorderHoverColor, borderInlineEndWidth: token2.lineWidth }); const genActiveStyle = (token2) => ({ borderColor: token2.inputBorderHoverColor, boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${token2.controlOutline}`, borderInlineEndWidth: token2.lineWidth, outline: 0 }); const genDisabledStyle = (token2) => ({ color: token2.colorTextDisabled, backgroundColor: token2.colorBgContainerDisabled, borderColor: token2.colorBorder, boxShadow: "none", cursor: "not-allowed", opacity: 1, "&:hover": _extends$1({}, genHoverStyle(merge(token2, { inputBorderHoverColor: token2.colorBorder }))) }); const genInputLargeStyle = (token2) => { const { inputPaddingVerticalLG, fontSizeLG, lineHeightLG, borderRadiusLG, inputPaddingHorizontalLG } = token2; return { padding: `${inputPaddingVerticalLG}px ${inputPaddingHorizontalLG}px`, fontSize: fontSizeLG, lineHeight: lineHeightLG, borderRadius: borderRadiusLG }; }; const genInputSmallStyle = (token2) => ({ padding: `${token2.inputPaddingVerticalSM}px ${token2.controlPaddingHorizontalSM - 1}px`, borderRadius: token2.borderRadiusSM }); const genStatusStyle = (token2, parentCls) => { const { componentCls, colorError, colorWarning, colorErrorOutline, colorWarningOutline, colorErrorBorderHover, colorWarningBorderHover } = token2; return { [`&-status-error:not(${parentCls}-disabled):not(${parentCls}-borderless)${parentCls}`]: { borderColor: colorError, "&:hover": { borderColor: colorErrorBorderHover }, "&:focus, &-focused": _extends$1({}, genActiveStyle(merge(token2, { inputBorderActiveColor: colorError, inputBorderHoverColor: colorError, controlOutline: colorErrorOutline }))), [`${componentCls}-prefix`]: { color: colorError } }, [`&-status-warning:not(${parentCls}-disabled):not(${parentCls}-borderless)${parentCls}`]: { borderColor: colorWarning, "&:hover": { borderColor: colorWarningBorderHover }, "&:focus, &-focused": _extends$1({}, genActiveStyle(merge(token2, { inputBorderActiveColor: colorWarning, inputBorderHoverColor: colorWarning, controlOutline: colorWarningOutline }))), [`${componentCls}-prefix`]: { color: colorWarning } } }; }; const genBasicInputStyle = (token2) => _extends$1(_extends$1({ position: "relative", display: "inline-block", width: "100%", minWidth: 0, padding: `${token2.inputPaddingVertical}px ${token2.inputPaddingHorizontal}px`, color: token2.colorText, fontSize: token2.fontSize, lineHeight: token2.lineHeight, backgroundColor: token2.colorBgContainer, backgroundImage: "none", borderWidth: token2.lineWidth, borderStyle: token2.lineType, borderColor: token2.colorBorder, borderRadius: token2.borderRadius, transition: `all ${token2.motionDurationMid}` }, genPlaceholderStyle(token2.colorTextPlaceholder)), { "&:hover": _extends$1({}, genHoverStyle(token2)), "&:focus, &-focused": _extends$1({}, genActiveStyle(token2)), "&-disabled, &[disabled]": _extends$1({}, genDisabledStyle(token2)), "&-borderless": { "&, &:hover, &:focus, &-focused, &-disabled, &[disabled]": { backgroundColor: "transparent", border: "none", boxShadow: "none" } }, // Reset height for `textarea`s "textarea&": { maxWidth: "100%", height: "auto", minHeight: token2.controlHeight, lineHeight: token2.lineHeight, verticalAlign: "bottom", transition: `all ${token2.motionDurationSlow}, height 0s`, resize: "vertical" }, // Size "&-lg": _extends$1({}, genInputLargeStyle(token2)), "&-sm": _extends$1({}, genInputSmallStyle(token2)), // RTL "&-rtl": { direction: "rtl" }, "&-textarea-rtl": { direction: "rtl" } }); const genInputGroupStyle = (token2) => { const { componentCls, antCls } = token2; return { position: "relative", display: "table", width: "100%", borderCollapse: "separate", borderSpacing: 0, // Undo padding and float of grid classes [`&[class*='col-']`]: { paddingInlineEnd: token2.paddingXS, "&:last-child": { paddingInlineEnd: 0 } }, // Sizing options [`&-lg ${componentCls}, &-lg > ${componentCls}-group-addon`]: _extends$1({}, genInputLargeStyle(token2)), [`&-sm ${componentCls}, &-sm > ${componentCls}-group-addon`]: _extends$1({}, genInputSmallStyle(token2)), [`> ${componentCls}`]: { display: "table-cell", "&:not(:first-child):not(:last-child)": { borderRadius: 0 } }, [`${componentCls}-group`]: { [`&-addon, &-wrap`]: { display: "table-cell", width: 1, whiteSpace: "nowrap", verticalAlign: "middle", "&:not(:first-child):not(:last-child)": { borderRadius: 0 } }, "&-wrap > *": { display: "block !important" }, "&-addon": { position: "relative", padding: `0 ${token2.inputPaddingHorizontal}px`, color: token2.colorText, fontWeight: "normal", fontSize: token2.fontSize, textAlign: "center", backgroundColor: token2.colorFillAlter, border: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`, borderRadius: token2.borderRadius, transition: `all ${token2.motionDurationSlow}`, lineHeight: 1, // Reset Select's style in addon [`${antCls}-select`]: { margin: `-${token2.inputPaddingVertical + 1}px -${token2.inputPaddingHorizontal}px`, [`&${antCls}-select-single:not(${antCls}-select-customize-input)`]: { [`${antCls}-select-selector`]: { backgroundColor: "inherit", border: `${token2.lineWidth}px ${token2.lineType} transparent`, boxShadow: "none" } }, "&-open, &-focused": { [`${antCls}-select-selector`]: { color: token2.colorPrimary } } }, // https://github.com/ant-design/ant-design/issues/31333 [`${antCls}-cascader-picker`]: { margin: `-9px -${token2.inputPaddingHorizontal}px`, backgroundColor: "transparent", [`${antCls}-cascader-input`]: { textAlign: "start", border: 0, boxShadow: "none" } } }, "&-addon:first-child": { borderInlineEnd: 0 }, "&-addon:last-child": { borderInlineStart: 0 } }, [`${componentCls}`]: { float: "inline-start", width: "100%", marginBottom: 0, textAlign: "inherit", "&:focus": { zIndex: 1, borderInlineEndWidth: 1 }, "&:hover": { zIndex: 1, borderInlineEndWidth: 1, [`${componentCls}-search-with-button &`]: { zIndex: 0 } } }, // Reset rounded corners [`> ${componentCls}:first-child, ${componentCls}-group-addon:first-child`]: { borderStartEndRadius: 0, borderEndEndRadius: 0, // Reset Select's style in addon [`${antCls}-select ${antCls}-select-selector`]: { borderStartEndRadius: 0, borderEndEndRadius: 0 } }, [`> ${componentCls}-affix-wrapper`]: { [`&:not(:first-child) ${componentCls}`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 }, [`&:not(:last-child) ${componentCls}`]: { borderStartEndRadius: 0, borderEndEndRadius: 0 } }, [`> ${componentCls}:last-child, ${componentCls}-group-addon:last-child`]: { borderStartStartRadius: 0, borderEndStartRadius: 0, // Reset Select's style in addon [`${antCls}-select ${antCls}-select-selector`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 } }, [`${componentCls}-affix-wrapper`]: { "&:not(:last-child)": { borderStartEndRadius: 0, borderEndEndRadius: 0, [`${componentCls}-search &`]: { borderStartStartRadius: token2.borderRadius, borderEndStartRadius: token2.borderRadius } }, [`&:not(:first-child), ${componentCls}-search &:not(:first-child)`]: { borderStartStartRadius: 0, borderEndStartRadius: 0 } }, [`&${componentCls}-group-compact`]: _extends$1(_extends$1({ display: "block" }, clearFix()), { [`${componentCls}-group-addon, ${componentCls}-group-wrap, > ${componentCls}`]: { "&:not(:first-child):not(:last-child)": { borderInlineEndWidth: token2.lineWidth, "&:hover": { zIndex: 1 }, "&:focus": { zIndex: 1 } } }, "& > *": { display: "inline-block", float: "none", verticalAlign: "top", borderRadius: 0 }, [`& > ${componentCls}-affix-wrapper`]: { display: "inline-flex" }, [`& > ${antCls}-picker-range`]: { display: "inline-flex" }, "& > *:not(:last-child)": { marginInlineEnd: -token2.lineWidth, borderInlineEndWidth: token2.lineWidth }, // Undo float for .ant-input-group .ant-input [`${componentCls}`]: { float: "none" }, // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input [`& > ${antCls}-select > ${antCls}-select-selector, & > ${antCls}-select-auto-complete ${componentCls}, & > ${antCls}-cascader-picker ${componentCls}, & > ${componentCls}-group-wrapper ${componentCls}`]: { borderInlineEndWidth: token2.lineWidth, borderRadius: 0, "&:hover": { zIndex: 1 }, "&:focus": { zIndex: 1 } }, [`& > ${antCls}-select-focused`]: { zIndex: 1 }, // update z-index for arrow icon [`& > ${antCls}-select > ${antCls}-select-arrow`]: { zIndex: 1 // https://github.com/ant-design/ant-design/issues/20371 }, [`& > *:first-child, & > ${antCls}-select:first-child > ${antCls}-select-selector, & > ${antCls}-select-auto-complete:first-child ${componentCls}, & > ${antCls}-cascader-picker:first-child ${componentCls}`]: { borderStartStartRadius: token2.borderRadius, borderEndStartRadius: token2.borderRadius }, [`& > *:last-child, & > ${antCls}-select:last-child > ${antCls}-select-selector, & > ${antCls}-cascader-picker:last-child ${componentCls}, & > ${antCls}-cascader-picker-focused:last-child ${componentCls}`]: { borderInlineEndWidth: token2.lineWidth, borderStartEndRadius: token2.borderRadius, borderEndEndRadius: token2.borderRadius }, // https://github.com/ant-design/ant-design/issues/12493 [`& > ${antCls}-select-auto-complete ${componentCls}`]: { verticalAlign: "top" }, [`${componentCls}-group-wrapper + ${componentCls}-group-wrapper`]: { marginInlineStart: -token2.lineWidth, [`${componentCls}-affix-wrapper`]: { borderRadius: 0 } }, [`${componentCls}-group-wrapper:not(:last-child)`]: { [`&${componentCls}-search > ${componentCls}-group`]: { [`& > ${componentCls}-group-addon > ${componentCls}-search-button`]: { borderRadius: 0 }, [`& > ${componentCls}`]: { borderStartStartRadius: token2.borderRadius, borderStartEndRadius: 0, borderEndEndRadius: 0, borderEndStartRadius: token2.borderRadius } } } }), [`&&-sm ${antCls}-btn`]: { fontSize: token2.fontSizeSM, height: token2.controlHeightSM, lineHeight: "normal" }, [`&&-lg ${antCls}-btn`]: { fontSize: token2.fontSizeLG, height: token2.controlHeightLG, lineHeight: "normal" }, // Fix https://github.com/ant-design/ant-design/issues/5754 [`&&-lg ${antCls}-select-single ${antCls}-select-selector`]: { height: `${token2.controlHeightLG}px`, [`${antCls}-select-selection-item, ${antCls}-select-selection-placeholder`]: { // -2 is for the border size & override default lineHeight: `${token2.controlHeightLG - 2}px` }, [`${antCls}-select-selection-search-input`]: { height: `${token2.controlHeightLG}px` } }, [`&&-sm ${antCls}-select-single ${antCls}-select-selector`]: { height: `${token2.controlHeightSM}px`, [`${antCls}-select-selection-item, ${antCls}-select-selection-placeholder`]: { // -2 is for the border size & override default lineHeight: `${token2.controlHeightSM - 2}px` }, [`${antCls}-select-selection-search-input`]: { height: `${token2.controlHeightSM}px` } } }; }; const genInputStyle = (token2) => { const { componentCls, controlHeightSM, lineWidth } = token2; const FIXED_CHROME_COLOR_HEIGHT = 16; const colorSmallPadding = (controlHeightSM - lineWidth * 2 - FIXED_CHROME_COLOR_HEIGHT) / 2; return { [componentCls]: _extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), genBasicInputStyle(token2)), genStatusStyle(token2, componentCls)), { '&[type="color"]': { height: token2.controlHeight, [`&${componentCls}-lg`]: { height: token2.controlHeightLG }, [`&${componentCls}-sm`]: { height: controlHeightSM, paddingTop: colorSmallPadding, paddingBottom: colorSmallPadding } } }) }; }; const genAllowClearStyle = (token2) => { const { componentCls } = token2; return { // ========================= Input ========================= [`${componentCls}-clear-icon`]: { margin: 0, color: token2.colorTextQuaternary, fontSize: token2.fontSizeIcon, verticalAlign: -1, // https://github.com/ant-design/ant-design/pull/18151 // https://codesandbox.io/s/wizardly-sun-u10br cursor: "pointer", transition: `color ${token2.motionDurationSlow}`, "&:hover": { color: token2.colorTextTertiary }, "&:active": { color: token2.colorText }, "&-hidden": { visibility: "hidden" }, "&-has-suffix": { margin: `0 ${token2.inputAffixPadding}px` } }, // ======================= TextArea ======================== "&-textarea-with-clear-btn": { padding: "0 !important", border: "0 !important", [`${componentCls}-clear-icon`]: { position: "absolute", insetBlockStart: token2.paddingXS, insetInlineEnd: token2.paddingXS, zIndex: 1 } } }; }; const genAffixStyle = (token2) => { const { componentCls, inputAffixPadding, colorTextDescription, motionDurationSlow, colorIcon, colorIconHover, iconCls } = token2; return { [`${componentCls}-affix-wrapper`]: _extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, genBasicInputStyle(token2)), { display: "inline-flex", [`&:not(${componentCls}-affix-wrapper-disabled):hover`]: _extends$1(_extends$1({}, genHoverStyle(token2)), { zIndex: 1, [`${componentCls}-search-with-button &`]: { zIndex: 0 } }), "&-focused, &:focus": { zIndex: 1 }, "&-disabled": { [`${componentCls}[disabled]`]: { background: "transparent" } }, [`> input${componentCls}`]: { padding: 0, fontSize: "inherit", border: "none", borderRadius: 0, outline: "none", "&:focus": { boxShadow: "none !important" } }, "&::before": { width: 0, visibility: "hidden", content: '"\\a0"' }, [`${componentCls}`]: { "&-prefix, &-suffix": { display: "flex", flex: "none", alignItems: "center", "> *:not(:last-child)": { marginInlineEnd: token2.paddingXS } }, "&-show-count-suffix": { color: colorTextDescription }, "&-show-count-has-suffix": { marginInlineEnd: token2.paddingXXS }, "&-prefix": { marginInlineEnd: inputAffixPadding }, "&-suffix": { marginInlineStart: inputAffixPadding } } }), genAllowClearStyle(token2)), { // password [`${iconCls}${componentCls}-password-icon`]: { color: colorIcon, cursor: "pointer", transition: `all ${motionDurationSlow}`, "&:hover": { color: colorIconHover } } }), genStatusStyle(token2, `${componentCls}-affix-wrapper`)) }; }; const genGroupStyle = (token2) => { const { componentCls, colorError, colorSuccess, borderRadiusLG, borderRadiusSM } = token2; return { [`${componentCls}-group`]: _extends$1(_extends$1(_extends$1({}, resetComponent(token2)), genInputGroupStyle(token2)), { "&-rtl": { direction: "rtl" }, "&-wrapper": { display: "inline-block", width: "100%", textAlign: "start", verticalAlign: "top", "&-rtl": { direction: "rtl" }, // Size "&-lg": { [`${componentCls}-group-addon`]: { borderRadius: borderRadiusLG } }, "&-sm": { [`${componentCls}-group-addon`]: { borderRadius: borderRadiusSM } }, // Status "&-status-error": { [`${componentCls}-group-addon`]: { color: colorError, borderColor: colorError } }, "&-status-warning": { [`${componentCls}-group-addon:last-child`]: { color: colorSuccess, borderColor: colorSuccess } } } }) }; }; const genSearchInputStyle = (token2) => { const { componentCls, antCls } = token2; const searchPrefixCls = `${componentCls}-search`; return { [searchPrefixCls]: { [`${componentCls}`]: { "&:hover, &:focus": { borderColor: token2.colorPrimaryHover, [`+ ${componentCls}-group-addon ${searchPrefixCls}-button:not(${antCls}-btn-primary)`]: { borderInlineStartColor: token2.colorPrimaryHover } } }, [`${componentCls}-affix-wrapper`]: { borderRadius: 0 }, // fix slight height diff in Firefox: // https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-certain-category [`${componentCls}-lg`]: { lineHeight: token2.lineHeightLG - 2e-4 }, [`> ${componentCls}-group`]: { [`> ${componentCls}-group-addon:last-child`]: { insetInlineStart: -1, padding: 0, border: 0, [`${searchPrefixCls}-button`]: { paddingTop: 0, paddingBottom: 0, borderStartStartRadius: 0, borderStartEndRadius: token2.borderRadius, borderEndEndRadius: token2.borderRadius, borderEndStartRadius: 0 }, [`${searchPrefixCls}-button:not(${antCls}-btn-primary)`]: { color: token2.colorTextDescription, "&:hover": { color: token2.colorPrimaryHover }, "&:active": { color: token2.colorPrimaryActive }, [`&${antCls}-btn-loading::before`]: { insetInlineStart: 0, insetInlineEnd: 0, insetBlockStart: 0, insetBlockEnd: 0 } } } }, [`${searchPrefixCls}-button`]: { height: token2.controlHeight, "&:hover, &:focus": { zIndex: 1 } }, [`&-large ${searchPrefixCls}-button`]: { height: token2.controlHeightLG }, [`&-small ${searchPrefixCls}-button`]: { height: token2.controlHeightSM }, "&-rtl": { direction: "rtl" }, // ===================== Compact Item Customized Styles ===================== [`&${componentCls}-compact-item`]: { [`&:not(${componentCls}-compact-last-item)`]: { [`${componentCls}-group-addon`]: { [`${componentCls}-search-button`]: { marginInlineEnd: -token2.lineWidth, borderRadius: 0 } } }, [`&:not(${componentCls}-compact-first-item)`]: { [`${componentCls},${componentCls}-affix-wrapper`]: { borderRadius: 0 } }, [`> ${componentCls}-group-addon ${componentCls}-search-button, > ${componentCls}, ${componentCls}-affix-wrapper`]: { "&:hover,&:focus,&:active": { zIndex: 2 } }, [`> ${componentCls}-affix-wrapper-focused`]: { zIndex: 2 } } } }; }; function initInputToken(token2) { return merge(token2, { inputAffixPadding: token2.paddingXXS, inputPaddingVertical: Math.max(Math.round((token2.controlHeight - token2.fontSize * token2.lineHeight) / 2 * 10) / 10 - token2.lineWidth, 3), inputPaddingVerticalLG: Math.ceil((token2.controlHeightLG - token2.fontSizeLG * token2.lineHeightLG) / 2 * 10) / 10 - token2.lineWidth, inputPaddingVerticalSM: Math.max(Math.round((token2.controlHeightSM - token2.fontSize * token2.lineHeight) / 2 * 10) / 10 - token2.lineWidth, 0), inputPaddingHorizontal: token2.paddingSM - token2.lineWidth, inputPaddingHorizontalSM: token2.paddingXS - token2.lineWidth, inputPaddingHorizontalLG: token2.controlPaddingHorizontal - token2.lineWidth, inputBorderHoverColor: token2.colorPrimaryHover, inputBorderActiveColor: token2.colorPrimaryHover }); } const genTextAreaStyle = (token2) => { const { componentCls, inputPaddingHorizontal, paddingLG } = token2; const textareaPrefixCls = `${componentCls}-textarea`; return { [textareaPrefixCls]: { position: "relative", [`${textareaPrefixCls}-suffix`]: { position: "absolute", top: 0, insetInlineEnd: inputPaddingHorizontal, bottom: 0, zIndex: 1, display: "inline-flex", alignItems: "center", margin: "auto" }, [`&-status-error, &-status-warning, &-status-success, &-status-validating`]: { [`&${textareaPrefixCls}-has-feedback`]: { [`${componentCls}`]: { paddingInlineEnd: paddingLG } } }, "&-show-count": { // https://github.com/ant-design/ant-design/issues/33049 [`> ${componentCls}`]: { height: "100%" }, "&::after": { color: token2.colorTextDescription, whiteSpace: "nowrap", content: "attr(data-count)", pointerEvents: "none", float: "right" } }, "&-rtl": { "&::after": { float: "left" } } } }; }; const useStyle$9 = genComponentStyleHook("Input", (token2) => { const inputToken = initInputToken(token2); return [ genInputStyle(inputToken), genTextAreaStyle(inputToken), genAffixStyle(inputToken), genGroupStyle(inputToken), genSearchInputStyle(inputToken), // ===================================================== // == Space Compact == // ===================================================== genCompactItemStyle(inputToken) ]; }); function useRaf(callback) { const rafRef = shallowRef(); const removedRef = shallowRef(false); function trigger2() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (!removedRef.value) { wrapperRaf.cancel(rafRef.value); rafRef.value = wrapperRaf(() => { callback(...args); }); } } onBeforeUnmount(() => { removedRef.value = true; wrapperRaf.cancel(rafRef.value); }); return trigger2; } function useRafState(defaultState) { const batchRef = shallowRef([]); const state = shallowRef(typeof defaultState === "function" ? defaultState() : defaultState); const flushUpdate = useRaf(() => { let value = state.value; batchRef.value.forEach((callback) => { value = callback(value); }); batchRef.value = []; state.value = value; }); function updater(callback) { batchRef.value.push(callback); flushUpdate(); } return [state, updater]; } const TabNode = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "TabNode", props: { id: { type: String }, prefixCls: { type: String }, tab: { type: Object }, active: { type: Boolean }, closable: { type: Boolean }, editable: { type: Object }, onClick: { type: Function }, onResize: { type: Function }, renderWrapper: { type: Function }, removeAriaLabel: { type: String }, // onRemove: { type: Function as PropType<() => void> }, onFocus: { type: Function } }, emits: ["click", "resize", "remove", "focus"], setup(props2, _ref) { let { expose, attrs } = _ref; const domRef = ref(); function onInternalClick(e2) { var _a; if ((_a = props2.tab) === null || _a === void 0 ? void 0 : _a.disabled) { return; } props2.onClick(e2); } expose({ domRef }); function onRemoveTab(event) { var _a; event.preventDefault(); event.stopPropagation(); props2.editable.onEdit("remove", { key: (_a = props2.tab) === null || _a === void 0 ? void 0 : _a.key, event }); } const removable = computed(() => { var _a; return props2.editable && props2.closable !== false && !((_a = props2.tab) === null || _a === void 0 ? void 0 : _a.disabled); }); return () => { var _a; const { prefixCls, id, active, tab: { key: key2, tab, disabled, closeIcon }, renderWrapper, removeAriaLabel, editable, onFocus } = props2; const tabPrefix = `${prefixCls}-tab`; const node2 = createVNode("div", { "key": key2, "ref": domRef, "class": classNames(tabPrefix, { [`${tabPrefix}-with-remove`]: removable.value, [`${tabPrefix}-active`]: active, [`${tabPrefix}-disabled`]: disabled }), "style": attrs.style, "onClick": onInternalClick }, [createVNode("div", { "role": "tab", "aria-selected": active, "id": id && `${id}-tab-${key2}`, "class": `${tabPrefix}-btn`, "aria-controls": id && `${id}-panel-${key2}`, "aria-disabled": disabled, "tabindex": disabled ? null : 0, "onClick": (e2) => { e2.stopPropagation(); onInternalClick(e2); }, "onKeydown": (e2) => { if ([KeyCode.SPACE, KeyCode.ENTER].includes(e2.which)) { e2.preventDefault(); onInternalClick(e2); } }, "onFocus": onFocus }, [typeof tab === "function" ? tab() : tab]), removable.value && createVNode("button", { "type": "button", "aria-label": removeAriaLabel || "remove", "tabindex": 0, "class": `${tabPrefix}-remove`, "onClick": (e2) => { e2.stopPropagation(); onRemoveTab(e2); } }, [(closeIcon === null || closeIcon === void 0 ? void 0 : closeIcon()) || ((_a = editable.removeIcon) === null || _a === void 0 ? void 0 : _a.call(editable)) || "×"])]); return renderWrapper ? renderWrapper(node2) : node2; }; } }); const DEFAULT_SIZE$1 = { width: 0, height: 0, left: 0, top: 0 }; function useOffsets(tabs, tabSizes) { const offsetMap = ref(/* @__PURE__ */ new Map()); watchEffect(() => { var _a, _b; const map = /* @__PURE__ */ new Map(); const tabsValue = tabs.value; const lastOffset = tabSizes.value.get((_a = tabsValue[0]) === null || _a === void 0 ? void 0 : _a.key) || DEFAULT_SIZE$1; const rightOffset = lastOffset.left + lastOffset.width; for (let i2 = 0; i2 < tabsValue.length; i2 += 1) { const { key: key2 } = tabsValue[i2]; let data = tabSizes.value.get(key2); if (!data) { data = tabSizes.value.get((_b = tabsValue[i2 - 1]) === null || _b === void 0 ? void 0 : _b.key) || DEFAULT_SIZE$1; } const entity = map.get(key2) || _extends$1({}, data); entity.right = rightOffset - entity.left - entity.width; map.set(key2, entity); } offsetMap.value = new Map(map); }); return offsetMap; } const AddButton = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AddButton", inheritAttrs: false, props: { prefixCls: String, editable: { type: Object }, locale: { type: Object, default: void 0 } }, setup(props2, _ref) { let { expose, attrs } = _ref; const domRef = ref(); expose({ domRef }); return () => { const { prefixCls, editable, locale: locale2 } = props2; if (!editable || editable.showAdd === false) { return null; } return createVNode("button", { "ref": domRef, "type": "button", "class": `${prefixCls}-nav-add`, "style": attrs.style, "aria-label": (locale2 === null || locale2 === void 0 ? void 0 : locale2.addAriaLabel) || "Add tab", "onClick": (event) => { editable.onEdit("add", { event }); } }, [editable.addIcon ? editable.addIcon() : "+"]); }; } }); const operationNodeProps = { prefixCls: { type: String }, id: { type: String }, tabs: { type: Object }, rtl: { type: Boolean }, tabBarGutter: { type: Number }, activeKey: { type: [String, Number] }, mobile: { type: Boolean }, moreIcon: PropTypes.any, moreTransitionName: { type: String }, editable: { type: Object }, locale: { type: Object, default: void 0 }, removeAriaLabel: String, onTabClick: { type: Function }, popupClassName: String, getPopupContainer: functionType() }; const OperationNode = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "OperationNode", inheritAttrs: false, props: operationNodeProps, emits: ["tabClick"], slots: Object, setup(props2, _ref) { let { attrs, slots } = _ref; const [open2, setOpen] = useState(false); const [selectedKey, setSelectedKey] = useState(null); const selectOffset = (offset2) => { const enabledTabs = props2.tabs.filter((tab) => !tab.disabled); let selectedIndex = enabledTabs.findIndex((tab) => tab.key === selectedKey.value) || 0; const len = enabledTabs.length; for (let i2 = 0; i2 < len; i2 += 1) { selectedIndex = (selectedIndex + offset2 + len) % len; const tab = enabledTabs[selectedIndex]; if (!tab.disabled) { setSelectedKey(tab.key); return; } } }; const onKeyDown = (e2) => { const { which } = e2; if (!open2.value) { if ([KeyCode.DOWN, KeyCode.SPACE, KeyCode.ENTER].includes(which)) { setOpen(true); e2.preventDefault(); } return; } switch (which) { case KeyCode.UP: selectOffset(-1); e2.preventDefault(); break; case KeyCode.DOWN: selectOffset(1); e2.preventDefault(); break; case KeyCode.ESC: setOpen(false); break; case KeyCode.SPACE: case KeyCode.ENTER: if (selectedKey.value !== null) props2.onTabClick(selectedKey.value, e2); break; } }; const popupId = computed(() => `${props2.id}-more-popup`); const selectedItemId = computed(() => selectedKey.value !== null ? `${popupId.value}-${selectedKey.value}` : null); const onRemoveTab = (event, key2) => { event.preventDefault(); event.stopPropagation(); props2.editable.onEdit("remove", { key: key2, event }); }; onMounted(() => { watch(selectedKey, () => { const ele = document.getElementById(selectedItemId.value); if (ele && ele.scrollIntoView) { ele.scrollIntoView(false); } }, { flush: "post", immediate: true }); }); watch(open2, () => { if (!open2.value) { setSelectedKey(null); } }); useProvideOverride({}); return () => { var _a; const { prefixCls, id, tabs, locale: locale2, mobile, moreIcon = ((_a = slots.moreIcon) === null || _a === void 0 ? void 0 : _a.call(slots)) || createVNode(EllipsisOutlined, null, null), moreTransitionName, editable, tabBarGutter, rtl: rtl2, onTabClick, popupClassName } = props2; if (!tabs.length) return null; const dropdownPrefix = `${prefixCls}-dropdown`; const dropdownAriaLabel = locale2 === null || locale2 === void 0 ? void 0 : locale2.dropdownAriaLabel; const moreStyle = { [rtl2 ? "marginRight" : "marginLeft"]: tabBarGutter }; if (!tabs.length) { moreStyle.visibility = "hidden"; moreStyle.order = 1; } const overlayClassName = classNames({ [`${dropdownPrefix}-rtl`]: rtl2, [`${popupClassName}`]: true }); const moreNode = mobile ? null : createVNode(Dropdown, { "prefixCls": dropdownPrefix, "trigger": ["hover"], "visible": open2.value, "transitionName": moreTransitionName, "onVisibleChange": setOpen, "overlayClassName": overlayClassName, "mouseEnterDelay": 0.1, "mouseLeaveDelay": 0.1, "getPopupContainer": props2.getPopupContainer }, { overlay: () => createVNode(Menu, { "onClick": (_ref2) => { let { key: key2, domEvent } = _ref2; onTabClick(key2, domEvent); setOpen(false); }, "id": popupId.value, "tabindex": -1, "role": "listbox", "aria-activedescendant": selectedItemId.value, "selectedKeys": [selectedKey.value], "aria-label": dropdownAriaLabel !== void 0 ? dropdownAriaLabel : "expanded dropdown" }, { default: () => [tabs.map((tab) => { var _a2, _b; const removable = editable && tab.closable !== false && !tab.disabled; return createVNode(MenuItem, { "key": tab.key, "id": `${popupId.value}-${tab.key}`, "role": "option", "aria-controls": id && `${id}-panel-${tab.key}`, "disabled": tab.disabled }, { default: () => [createVNode("span", null, [typeof tab.tab === "function" ? tab.tab() : tab.tab]), removable && createVNode("button", { "type": "button", "aria-label": props2.removeAriaLabel || "remove", "tabindex": 0, "class": `${dropdownPrefix}-menu-item-remove`, "onClick": (e2) => { e2.stopPropagation(); onRemoveTab(e2, tab.key); } }, [((_a2 = tab.closeIcon) === null || _a2 === void 0 ? void 0 : _a2.call(tab)) || ((_b = editable.removeIcon) === null || _b === void 0 ? void 0 : _b.call(editable)) || "×"])] }); })] }), default: () => createVNode("button", { "type": "button", "class": `${prefixCls}-nav-more`, "style": moreStyle, "tabindex": -1, "aria-hidden": "true", "aria-haspopup": "listbox", "aria-controls": popupId.value, "id": `${id}-more`, "aria-expanded": open2.value, "onKeydown": onKeyDown }, [moreIcon]) }); return createVNode("div", { "class": classNames(`${prefixCls}-nav-operations`, attrs.class), "style": attrs.style }, [moreNode, createVNode(AddButton, { "prefixCls": prefixCls, "locale": locale2, "editable": editable }, null)]); }; } }); const TabsContextKey = Symbol("tabsContextKey"); const useProvideTabs = (props2) => { provide(TabsContextKey, props2); }; const useInjectTabs = () => { return inject(TabsContextKey, { tabs: ref([]), prefixCls: ref() }); }; const MIN_SWIPE_DISTANCE = 0.1; const STOP_SWIPE_DISTANCE = 0.01; const REFRESH_INTERVAL = 20; const SPEED_OFF_MULTIPLE = Math.pow(0.995, REFRESH_INTERVAL); function useTouchMove(domRef, onOffset) { const [touchPosition, setTouchPosition] = useState(); const [lastTimestamp, setLastTimestamp] = useState(0); const [lastTimeDiff, setLastTimeDiff] = useState(0); const [lastOffset, setLastOffset] = useState(); const motionInterval = ref(); function onTouchStart(e2) { const { screenX, screenY } = e2.touches[0]; setTouchPosition({ x: screenX, y: screenY }); clearInterval(motionInterval.value); } function onTouchMove(e2) { if (!touchPosition.value) return; e2.preventDefault(); const { screenX, screenY } = e2.touches[0]; const offsetX = screenX - touchPosition.value.x; const offsetY = screenY - touchPosition.value.y; onOffset(offsetX, offsetY); setTouchPosition({ x: screenX, y: screenY }); const now2 = Date.now(); setLastTimeDiff(now2 - lastTimestamp.value); setLastTimestamp(now2); setLastOffset({ x: offsetX, y: offsetY }); } function onTouchEnd() { if (!touchPosition.value) return; const lastOffsetValue = lastOffset.value; setTouchPosition(null); setLastOffset(null); if (lastOffsetValue) { const distanceX = lastOffsetValue.x / lastTimeDiff.value; const distanceY = lastOffsetValue.y / lastTimeDiff.value; const absX = Math.abs(distanceX); const absY = Math.abs(distanceY); if (Math.max(absX, absY) < MIN_SWIPE_DISTANCE) return; let currentX = distanceX; let currentY = distanceY; motionInterval.value = setInterval(() => { if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) { clearInterval(motionInterval.value); return; } currentX *= SPEED_OFF_MULTIPLE; currentY *= SPEED_OFF_MULTIPLE; onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL); }, REFRESH_INTERVAL); } } const lastWheelDirectionRef = ref(); function onWheel(e2) { const { deltaX, deltaY } = e2; let mixed = 0; const absX = Math.abs(deltaX); const absY = Math.abs(deltaY); if (absX === absY) { mixed = lastWheelDirectionRef.value === "x" ? deltaX : deltaY; } else if (absX > absY) { mixed = deltaX; lastWheelDirectionRef.value = "x"; } else { mixed = deltaY; lastWheelDirectionRef.value = "y"; } if (onOffset(-mixed, -mixed)) { e2.preventDefault(); } } const touchEventsRef = ref({ onTouchStart, onTouchMove, onTouchEnd, onWheel }); function onProxyTouchStart(e2) { touchEventsRef.value.onTouchStart(e2); } function onProxyTouchMove(e2) { touchEventsRef.value.onTouchMove(e2); } function onProxyTouchEnd(e2) { touchEventsRef.value.onTouchEnd(e2); } function onProxyWheel(e2) { touchEventsRef.value.onWheel(e2); } onMounted(() => { var _a, _b; document.addEventListener("touchmove", onProxyTouchMove, { passive: false }); document.addEventListener("touchend", onProxyTouchEnd, { passive: false }); (_a = domRef.value) === null || _a === void 0 ? void 0 : _a.addEventListener("touchstart", onProxyTouchStart, { passive: false }); (_b = domRef.value) === null || _b === void 0 ? void 0 : _b.addEventListener("wheel", onProxyWheel, { passive: false }); }); onBeforeUnmount(() => { document.removeEventListener("touchmove", onProxyTouchMove); document.removeEventListener("touchend", onProxyTouchEnd); }); } function useSyncState(defaultState, onChange) { const stateRef = ref(defaultState); function setState(updater) { const newValue = typeof updater === "function" ? updater(stateRef.value) : updater; if (newValue !== stateRef.value) { onChange(newValue, stateRef.value); } stateRef.value = newValue; } return [stateRef, setState]; } const useRefs = () => { const refs = ref(/* @__PURE__ */ new Map()); const setRef2 = (key2) => (el) => { refs.value.set(key2, el); }; onBeforeUpdate(() => { refs.value = /* @__PURE__ */ new Map(); }); return [setRef2, refs]; }; const DEFAULT_SIZE = { width: 0, height: 0, left: 0, top: 0, right: 0 }; const tabNavListProps = () => { return { id: { type: String }, tabPosition: { type: String }, activeKey: { type: [String, Number] }, rtl: { type: Boolean }, animated: objectType(), editable: objectType(), moreIcon: PropTypes.any, moreTransitionName: { type: String }, mobile: { type: Boolean }, tabBarGutter: { type: Number }, renderTabBar: { type: Function }, locale: objectType(), popupClassName: String, getPopupContainer: functionType(), onTabClick: { type: Function }, onTabScroll: { type: Function } }; }; const getTabSize = (tab, containerRect) => { const { offsetWidth, offsetHeight, offsetTop, offsetLeft } = tab; const { width, height, x: x2, y: y2 } = tab.getBoundingClientRect(); if (Math.abs(width - offsetWidth) < 1) { return [width, height, x2 - containerRect.x, y2 - containerRect.y]; } return [offsetWidth, offsetHeight, offsetLeft, offsetTop]; }; const TabNavList = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "TabNavList", inheritAttrs: false, props: tabNavListProps(), slots: Object, emits: ["tabClick", "tabScroll"], setup(props2, _ref) { let { attrs, slots } = _ref; const { tabs, prefixCls } = useInjectTabs(); const tabsWrapperRef = shallowRef(); const tabListRef = shallowRef(); const operationsRef = shallowRef(); const innerAddButtonRef = shallowRef(); const [setRef2, btnRefs] = useRefs(); const tabPositionTopOrBottom = computed(() => props2.tabPosition === "top" || props2.tabPosition === "bottom"); const [transformLeft, setTransformLeft] = useSyncState(0, (next2, prev2) => { if (tabPositionTopOrBottom.value && props2.onTabScroll) { props2.onTabScroll({ direction: next2 > prev2 ? "left" : "right" }); } }); const [transformTop, setTransformTop] = useSyncState(0, (next2, prev2) => { if (!tabPositionTopOrBottom.value && props2.onTabScroll) { props2.onTabScroll({ direction: next2 > prev2 ? "top" : "bottom" }); } }); const [wrapperScrollWidth, setWrapperScrollWidth] = useState(0); const [wrapperScrollHeight, setWrapperScrollHeight] = useState(0); const [wrapperWidth, setWrapperWidth] = useState(null); const [wrapperHeight, setWrapperHeight] = useState(null); const [addWidth, setAddWidth] = useState(0); const [addHeight, setAddHeight] = useState(0); const [tabSizes, setTabSizes] = useRafState(/* @__PURE__ */ new Map()); const tabOffsets = useOffsets(tabs, tabSizes); const operationsHiddenClassName = computed(() => `${prefixCls.value}-nav-operations-hidden`); const transformMin = shallowRef(0); const transformMax = shallowRef(0); watchEffect(() => { if (!tabPositionTopOrBottom.value) { transformMin.value = Math.min(0, wrapperHeight.value - wrapperScrollHeight.value); transformMax.value = 0; } else if (props2.rtl) { transformMin.value = 0; transformMax.value = Math.max(0, wrapperScrollWidth.value - wrapperWidth.value); } else { transformMin.value = Math.min(0, wrapperWidth.value - wrapperScrollWidth.value); transformMax.value = 0; } }); const alignInRange = (value) => { if (value < transformMin.value) { return transformMin.value; } if (value > transformMax.value) { return transformMax.value; } return value; }; const touchMovingRef = shallowRef(); const [lockAnimation, setLockAnimation] = useState(); const doLockAnimation = () => { setLockAnimation(Date.now()); }; const clearTouchMoving = () => { clearTimeout(touchMovingRef.value); }; const doMove = (setState, offset2) => { setState((value) => { const newValue = alignInRange(value + offset2); return newValue; }); }; useTouchMove(tabsWrapperRef, (offsetX, offsetY) => { if (tabPositionTopOrBottom.value) { if (wrapperWidth.value >= wrapperScrollWidth.value) { return false; } doMove(setTransformLeft, offsetX); } else { if (wrapperHeight.value >= wrapperScrollHeight.value) { return false; } doMove(setTransformTop, offsetY); } clearTouchMoving(); doLockAnimation(); return true; }); watch(lockAnimation, () => { clearTouchMoving(); if (lockAnimation.value) { touchMovingRef.value = setTimeout(() => { setLockAnimation(0); }, 100); } }); const scrollToTab = function() { let key2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : props2.activeKey; const tabOffset = tabOffsets.value.get(key2) || { width: 0, height: 0, left: 0, right: 0, top: 0 }; if (tabPositionTopOrBottom.value) { let newTransform = transformLeft.value; if (props2.rtl) { if (tabOffset.right < transformLeft.value) { newTransform = tabOffset.right; } else if (tabOffset.right + tabOffset.width > transformLeft.value + wrapperWidth.value) { newTransform = tabOffset.right + tabOffset.width - wrapperWidth.value; } } else if (tabOffset.left < -transformLeft.value) { newTransform = -tabOffset.left; } else if (tabOffset.left + tabOffset.width > -transformLeft.value + wrapperWidth.value) { newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth.value); } setTransformTop(0); setTransformLeft(alignInRange(newTransform)); } else { let newTransform = transformTop.value; if (tabOffset.top < -transformTop.value) { newTransform = -tabOffset.top; } else if (tabOffset.top + tabOffset.height > -transformTop.value + wrapperHeight.value) { newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight.value); } setTransformLeft(0); setTransformTop(alignInRange(newTransform)); } }; const visibleStart = shallowRef(0); const visibleEnd = shallowRef(0); watchEffect(() => { let unit; let position2; let transformSize; let basicSize; let tabContentSize; let addSize; const tabOffsetsValue = tabOffsets.value; if (["top", "bottom"].includes(props2.tabPosition)) { unit = "width"; basicSize = wrapperWidth.value; tabContentSize = wrapperScrollWidth.value; addSize = addWidth.value; position2 = props2.rtl ? "right" : "left"; transformSize = Math.abs(transformLeft.value); } else { unit = "height"; basicSize = wrapperHeight.value; tabContentSize = wrapperScrollWidth.value; addSize = addHeight.value; position2 = "top"; transformSize = -transformTop.value; } let mergedBasicSize = basicSize; if (tabContentSize + addSize > basicSize && tabContentSize < basicSize) { mergedBasicSize = basicSize - addSize; } const tabsVal = tabs.value; if (!tabsVal.length) { return [visibleStart.value, visibleEnd.value] = [0, 0]; } const len = tabsVal.length; let endIndex = len; for (let i2 = 0; i2 < len; i2 += 1) { const offset2 = tabOffsetsValue.get(tabsVal[i2].key) || DEFAULT_SIZE; if (offset2[position2] + offset2[unit] > transformSize + mergedBasicSize) { endIndex = i2 - 1; break; } } let startIndex = 0; for (let i2 = len - 1; i2 >= 0; i2 -= 1) { const offset2 = tabOffsetsValue.get(tabsVal[i2].key) || DEFAULT_SIZE; if (offset2[position2] < transformSize) { startIndex = i2 + 1; break; } } return [visibleStart.value, visibleEnd.value] = [startIndex, endIndex]; }); const updateTabSizes = () => { setTabSizes(() => { var _a; const newSizes = /* @__PURE__ */ new Map(); const listRect = (_a = tabListRef.value) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); tabs.value.forEach((_ref2) => { let { key: key2 } = _ref2; const btnRef = btnRefs.value.get(key2); const btnNode = (btnRef === null || btnRef === void 0 ? void 0 : btnRef.$el) || btnRef; if (btnNode) { const [width, height, left, top] = getTabSize(btnNode, listRect); newSizes.set(key2, { width, height, left, top }); } }); return newSizes; }); }; watch(() => tabs.value.map((tab) => tab.key).join("%%"), () => { updateTabSizes(); }, { flush: "post" }); const onListHolderResize = () => { var _a, _b, _c, _d, _e; const offsetWidth = ((_a = tabsWrapperRef.value) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0; const offsetHeight = ((_b = tabsWrapperRef.value) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0; const addDom = ((_c = innerAddButtonRef.value) === null || _c === void 0 ? void 0 : _c.$el) || {}; const newAddWidth = addDom.offsetWidth || 0; const newAddHeight = addDom.offsetHeight || 0; setWrapperWidth(offsetWidth); setWrapperHeight(offsetHeight); setAddWidth(newAddWidth); setAddHeight(newAddHeight); const newWrapperScrollWidth = (((_d = tabListRef.value) === null || _d === void 0 ? void 0 : _d.offsetWidth) || 0) - newAddWidth; const newWrapperScrollHeight = (((_e = tabListRef.value) === null || _e === void 0 ? void 0 : _e.offsetHeight) || 0) - newAddHeight; setWrapperScrollWidth(newWrapperScrollWidth); setWrapperScrollHeight(newWrapperScrollHeight); updateTabSizes(); }; const hiddenTabs = computed(() => [...tabs.value.slice(0, visibleStart.value), ...tabs.value.slice(visibleEnd.value + 1)]); const [inkStyle, setInkStyle] = useState(); const activeTabOffset = computed(() => tabOffsets.value.get(props2.activeKey)); const inkBarRafRef = shallowRef(); const cleanInkBarRaf = () => { wrapperRaf.cancel(inkBarRafRef.value); }; watch([activeTabOffset, tabPositionTopOrBottom, () => props2.rtl], () => { const newInkStyle = {}; if (activeTabOffset.value) { if (tabPositionTopOrBottom.value) { if (props2.rtl) { newInkStyle.right = toPx(activeTabOffset.value.right); } else { newInkStyle.left = toPx(activeTabOffset.value.left); } newInkStyle.width = toPx(activeTabOffset.value.width); } else { newInkStyle.top = toPx(activeTabOffset.value.top); newInkStyle.height = toPx(activeTabOffset.value.height); } } cleanInkBarRaf(); inkBarRafRef.value = wrapperRaf(() => { setInkStyle(newInkStyle); }); }); watch([() => props2.activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom], () => { scrollToTab(); }, { flush: "post" }); watch([() => props2.rtl, () => props2.tabBarGutter, () => props2.activeKey, () => tabs.value], () => { onListHolderResize(); }, { flush: "post" }); const ExtraContent = (_ref3) => { let { position: position2, prefixCls: prefixCls2, extra } = _ref3; if (!extra) return null; const content = extra === null || extra === void 0 ? void 0 : extra({ position: position2 }); return content ? createVNode("div", { "class": `${prefixCls2}-extra-content` }, [content]) : null; }; onBeforeUnmount(() => { clearTouchMoving(); cleanInkBarRaf(); }); return () => { const { id, animated, activeKey, rtl: rtl2, editable, locale: locale2, tabPosition, tabBarGutter, onTabClick } = props2; const { class: className, style } = attrs; const pre = prefixCls.value; const hasDropdown = !!hiddenTabs.value.length; const wrapPrefix = `${pre}-nav-wrap`; let pingLeft; let pingRight; let pingTop; let pingBottom; if (tabPositionTopOrBottom.value) { if (rtl2) { pingRight = transformLeft.value > 0; pingLeft = transformLeft.value + wrapperWidth.value < wrapperScrollWidth.value; } else { pingLeft = transformLeft.value < 0; pingRight = -transformLeft.value + wrapperWidth.value < wrapperScrollWidth.value; } } else { pingTop = transformTop.value < 0; pingBottom = -transformTop.value + wrapperHeight.value < wrapperScrollHeight.value; } const tabNodeStyle = {}; if (tabPosition === "top" || tabPosition === "bottom") { tabNodeStyle[rtl2 ? "marginRight" : "marginLeft"] = typeof tabBarGutter === "number" ? `${tabBarGutter}px` : tabBarGutter; } else { tabNodeStyle.marginTop = typeof tabBarGutter === "number" ? `${tabBarGutter}px` : tabBarGutter; } const tabNodes = tabs.value.map((tab, i2) => { const { key: key2 } = tab; return createVNode(TabNode, { "id": id, "prefixCls": pre, "key": key2, "tab": tab, "style": i2 === 0 ? void 0 : tabNodeStyle, "closable": tab.closable, "editable": editable, "active": key2 === activeKey, "removeAriaLabel": locale2 === null || locale2 === void 0 ? void 0 : locale2.removeAriaLabel, "ref": setRef2(key2), "onClick": (e2) => { onTabClick(key2, e2); }, "onFocus": () => { scrollToTab(key2); doLockAnimation(); if (!tabsWrapperRef.value) { return; } if (!rtl2) { tabsWrapperRef.value.scrollLeft = 0; } tabsWrapperRef.value.scrollTop = 0; } }, slots); }); return createVNode("div", { "role": "tablist", "class": classNames(`${pre}-nav`, className), "style": style, "onKeydown": () => { doLockAnimation(); } }, [createVNode(ExtraContent, { "position": "left", "prefixCls": pre, "extra": slots.leftExtra }, null), createVNode(ResizeObserver$1, { "onResize": onListHolderResize }, { default: () => [createVNode("div", { "class": classNames(wrapPrefix, { [`${wrapPrefix}-ping-left`]: pingLeft, [`${wrapPrefix}-ping-right`]: pingRight, [`${wrapPrefix}-ping-top`]: pingTop, [`${wrapPrefix}-ping-bottom`]: pingBottom }), "ref": tabsWrapperRef }, [createVNode(ResizeObserver$1, { "onResize": onListHolderResize }, { default: () => [createVNode("div", { "ref": tabListRef, "class": `${pre}-nav-list`, "style": { transform: `translate(${transformLeft.value}px, ${transformTop.value}px)`, transition: lockAnimation.value ? "none" : void 0 } }, [tabNodes, createVNode(AddButton, { "ref": innerAddButtonRef, "prefixCls": pre, "locale": locale2, "editable": editable, "style": _extends$1(_extends$1({}, tabNodes.length === 0 ? void 0 : tabNodeStyle), { visibility: hasDropdown ? "hidden" : null }) }, null), createVNode("div", { "class": classNames(`${pre}-ink-bar`, { [`${pre}-ink-bar-animated`]: animated.inkBar }), "style": inkStyle.value }, null)])] })])] }), createVNode(OperationNode, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "removeAriaLabel": locale2 === null || locale2 === void 0 ? void 0 : locale2.removeAriaLabel, "ref": operationsRef, "prefixCls": pre, "tabs": hiddenTabs.value, "class": !hasDropdown && operationsHiddenClassName.value }), pick(slots, ["moreIcon"])), createVNode(ExtraContent, { "position": "right", "prefixCls": pre, "extra": slots.rightExtra }, null), createVNode(ExtraContent, { "position": "right", "prefixCls": pre, "extra": slots.tabBarExtraContent }, null)]); }; } }); const TabPanelList = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "TabPanelList", inheritAttrs: false, props: { activeKey: { type: [String, Number] }, id: { type: String }, rtl: { type: Boolean }, animated: { type: Object, default: void 0 }, tabPosition: { type: String }, destroyInactiveTabPane: { type: Boolean } }, setup(props2) { const { tabs, prefixCls } = useInjectTabs(); return () => { const { id, activeKey, animated, tabPosition, rtl: rtl2, destroyInactiveTabPane } = props2; const tabPaneAnimated = animated.tabPane; const pre = prefixCls.value; const activeIndex = tabs.value.findIndex((tab) => tab.key === activeKey); return createVNode("div", { "class": `${pre}-content-holder` }, [createVNode("div", { "class": [`${pre}-content`, `${pre}-content-${tabPosition}`, { [`${pre}-content-animated`]: tabPaneAnimated }], "style": activeIndex && tabPaneAnimated ? { [rtl2 ? "marginRight" : "marginLeft"]: `-${activeIndex}00%` } : null }, [tabs.value.map((tab) => { return cloneElement(tab.node, { key: tab.key, prefixCls: pre, tabKey: tab.key, id, animated: tabPaneAnimated, active: tab.key === activeKey, destroyInactiveTabPane }); })])]); }; } }); var PlusOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" }; function _objectSpread$g(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$g(target, key2, source[key2]); }); } return target; } function _defineProperty$g(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var PlusOutlined = function PlusOutlined2(props2, context2) { var p2 = _objectSpread$g({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$g({}, p2, { "icon": PlusOutlined$1 }), null); }; PlusOutlined.displayName = "PlusOutlined"; PlusOutlined.inheritAttrs = false; const genMotionStyle = (token2) => { const { componentCls, motionDurationSlow } = token2; return [ { [componentCls]: { [`${componentCls}-switch`]: { "&-appear, &-enter": { transition: "none", "&-start": { opacity: 0 }, "&-active": { opacity: 1, transition: `opacity ${motionDurationSlow}` } }, "&-leave": { position: "absolute", transition: "none", inset: 0, "&-start": { opacity: 1 }, "&-active": { opacity: 0, transition: `opacity ${motionDurationSlow}` } } } } }, // Follow code may reuse in other components [initSlideMotion(token2, "slide-up"), initSlideMotion(token2, "slide-down")] ]; }; const genCardStyle = (token2) => { const { componentCls, tabsCardHorizontalPadding, tabsCardHeadBackground, tabsCardGutter, colorSplit } = token2; return { [`${componentCls}-card`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab`]: { margin: 0, padding: tabsCardHorizontalPadding, background: tabsCardHeadBackground, border: `${token2.lineWidth}px ${token2.lineType} ${colorSplit}`, transition: `all ${token2.motionDurationSlow} ${token2.motionEaseInOut}` }, [`${componentCls}-tab-active`]: { color: token2.colorPrimary, background: token2.colorBgContainer }, [`${componentCls}-ink-bar`]: { visibility: "hidden" } }, // ========================== Top & Bottom ========================== [`&${componentCls}-top, &${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: { marginLeft: { _skip_check_: true, value: `${tabsCardGutter}px` } } } }, [`&${componentCls}-top`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab`]: { borderRadius: `${token2.borderRadiusLG}px ${token2.borderRadiusLG}px 0 0` }, [`${componentCls}-tab-active`]: { borderBottomColor: token2.colorBgContainer } } }, [`&${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab`]: { borderRadius: `0 0 ${token2.borderRadiusLG}px ${token2.borderRadiusLG}px` }, [`${componentCls}-tab-active`]: { borderTopColor: token2.colorBgContainer } } }, // ========================== Left & Right ========================== [`&${componentCls}-left, &${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: { marginTop: `${tabsCardGutter}px` } } }, [`&${componentCls}-left`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab`]: { borderRadius: { _skip_check_: true, value: `${token2.borderRadiusLG}px 0 0 ${token2.borderRadiusLG}px` } }, [`${componentCls}-tab-active`]: { borderRightColor: { _skip_check_: true, value: token2.colorBgContainer } } } }, [`&${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab`]: { borderRadius: { _skip_check_: true, value: `0 ${token2.borderRadiusLG}px ${token2.borderRadiusLG}px 0` } }, [`${componentCls}-tab-active`]: { borderLeftColor: { _skip_check_: true, value: token2.colorBgContainer } } } } } }; }; const genDropdownStyle = (token2) => { const { componentCls, tabsHoverColor, dropdownEdgeChildVerticalPadding } = token2; return { [`${componentCls}-dropdown`]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "absolute", top: -9999, left: { _skip_check_: true, value: -9999 }, zIndex: token2.zIndexPopup, display: "block", "&-hidden": { display: "none" }, [`${componentCls}-dropdown-menu`]: { maxHeight: token2.tabsDropdownHeight, margin: 0, padding: `${dropdownEdgeChildVerticalPadding}px 0`, overflowX: "hidden", overflowY: "auto", textAlign: { _skip_check_: true, value: "left" }, listStyleType: "none", backgroundColor: token2.colorBgContainer, backgroundClip: "padding-box", borderRadius: token2.borderRadiusLG, outline: "none", boxShadow: token2.boxShadowSecondary, "&-item": _extends$1(_extends$1({}, textEllipsis), { display: "flex", alignItems: "center", minWidth: token2.tabsDropdownWidth, margin: 0, padding: `${token2.paddingXXS}px ${token2.paddingSM}px`, color: token2.colorText, fontWeight: "normal", fontSize: token2.fontSize, lineHeight: token2.lineHeight, cursor: "pointer", transition: `all ${token2.motionDurationSlow}`, "> span": { flex: 1, whiteSpace: "nowrap" }, "&-remove": { flex: "none", marginLeft: { _skip_check_: true, value: token2.marginSM }, color: token2.colorTextDescription, fontSize: token2.fontSizeSM, background: "transparent", border: 0, cursor: "pointer", "&:hover": { color: tabsHoverColor } }, "&:hover": { background: token2.controlItemBgHover }, "&-disabled": { "&, &:hover": { color: token2.colorTextDisabled, background: "transparent", cursor: "not-allowed" } } }) } }) }; }; const genPositionStyle = (token2) => { const { componentCls, margin, colorSplit } = token2; return { // ========================== Top & Bottom ========================== [`${componentCls}-top, ${componentCls}-bottom`]: { flexDirection: "column", [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { margin: `0 0 ${margin}px 0`, "&::before": { position: "absolute", right: { _skip_check_: true, value: 0 }, left: { _skip_check_: true, value: 0 }, borderBottom: `${token2.lineWidth}px ${token2.lineType} ${colorSplit}`, content: "''" }, [`${componentCls}-ink-bar`]: { height: token2.lineWidthBold, "&-animated": { transition: `width ${token2.motionDurationSlow}, left ${token2.motionDurationSlow}, right ${token2.motionDurationSlow}` } }, [`${componentCls}-nav-wrap`]: { "&::before, &::after": { top: 0, bottom: 0, width: token2.controlHeight }, "&::before": { left: { _skip_check_: true, value: 0 }, boxShadow: token2.boxShadowTabsOverflowLeft }, "&::after": { right: { _skip_check_: true, value: 0 }, boxShadow: token2.boxShadowTabsOverflowRight }, [`&${componentCls}-nav-wrap-ping-left::before`]: { opacity: 1 }, [`&${componentCls}-nav-wrap-ping-right::after`]: { opacity: 1 } } } }, [`${componentCls}-top`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { "&::before": { bottom: 0 }, [`${componentCls}-ink-bar`]: { bottom: 0 } } }, [`${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { order: 1, marginTop: `${margin}px`, marginBottom: 0, "&::before": { top: 0 }, [`${componentCls}-ink-bar`]: { top: 0 } }, [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: { order: 0 } }, // ========================== Left & Right ========================== [`${componentCls}-left, ${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { flexDirection: "column", minWidth: token2.controlHeight * 1.25, // >>>>>>>>>>> Tab [`${componentCls}-tab`]: { padding: `${token2.paddingXS}px ${token2.paddingLG}px`, textAlign: "center" }, [`${componentCls}-tab + ${componentCls}-tab`]: { margin: `${token2.margin}px 0 0 0` }, // >>>>>>>>>>> Nav [`${componentCls}-nav-wrap`]: { flexDirection: "column", "&::before, &::after": { right: { _skip_check_: true, value: 0 }, left: { _skip_check_: true, value: 0 }, height: token2.controlHeight }, "&::before": { top: 0, boxShadow: token2.boxShadowTabsOverflowTop }, "&::after": { bottom: 0, boxShadow: token2.boxShadowTabsOverflowBottom }, [`&${componentCls}-nav-wrap-ping-top::before`]: { opacity: 1 }, [`&${componentCls}-nav-wrap-ping-bottom::after`]: { opacity: 1 } }, // >>>>>>>>>>> Ink Bar [`${componentCls}-ink-bar`]: { width: token2.lineWidthBold, "&-animated": { transition: `height ${token2.motionDurationSlow}, top ${token2.motionDurationSlow}` } }, [`${componentCls}-nav-list, ${componentCls}-nav-operations`]: { flex: "1 0 auto", flexDirection: "column" } } }, [`${componentCls}-left`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-ink-bar`]: { right: { _skip_check_: true, value: 0 } } }, [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: { marginLeft: { _skip_check_: true, value: `-${token2.lineWidth}px` }, borderLeft: { _skip_check_: true, value: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}` }, [`> ${componentCls}-content > ${componentCls}-tabpane`]: { paddingLeft: { _skip_check_: true, value: token2.paddingLG } } } }, [`${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { order: 1, [`${componentCls}-ink-bar`]: { left: { _skip_check_: true, value: 0 } } }, [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: { order: 0, marginRight: { _skip_check_: true, value: -token2.lineWidth }, borderRight: { _skip_check_: true, value: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}` }, [`> ${componentCls}-content > ${componentCls}-tabpane`]: { paddingRight: { _skip_check_: true, value: token2.paddingLG } } } } }; }; const genSizeStyle = (token2) => { const { componentCls, padding } = token2; return { [componentCls]: { "&-small": { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: { padding: `${token2.paddingXS}px 0`, fontSize: token2.fontSize } } }, "&-large": { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: { padding: `${padding}px 0`, fontSize: token2.fontSizeLG } } } }, [`${componentCls}-card`]: { [`&${componentCls}-small`]: { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: { padding: `${token2.paddingXXS * 1.5}px ${padding}px` } }, [`&${componentCls}-bottom`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: `0 0 ${token2.borderRadius}px ${token2.borderRadius}px` } }, [`&${componentCls}-top`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: `${token2.borderRadius}px ${token2.borderRadius}px 0 0` } }, [`&${componentCls}-right`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: { _skip_check_: true, value: `0 ${token2.borderRadius}px ${token2.borderRadius}px 0` } } }, [`&${componentCls}-left`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: { _skip_check_: true, value: `${token2.borderRadius}px 0 0 ${token2.borderRadius}px` } } } }, [`&${componentCls}-large`]: { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: { padding: `${token2.paddingXS}px ${padding}px ${token2.paddingXXS * 1.5}px` } } } } }; }; const genTabStyle = (token2) => { const { componentCls, tabsActiveColor, tabsHoverColor, iconCls, tabsHorizontalGutter } = token2; const tabCls = `${componentCls}-tab`; return { [tabCls]: { position: "relative", display: "inline-flex", alignItems: "center", padding: `${token2.paddingSM}px 0`, fontSize: `${token2.fontSize}px`, background: "transparent", border: 0, outline: "none", cursor: "pointer", "&-btn, &-remove": _extends$1({ "&:focus:not(:focus-visible), &:active": { color: tabsActiveColor } }, genFocusStyle(token2)), "&-btn": { outline: "none", transition: "all 0.3s" }, "&-remove": { flex: "none", marginRight: { _skip_check_: true, value: -token2.marginXXS }, marginLeft: { _skip_check_: true, value: token2.marginXS }, color: token2.colorTextDescription, fontSize: token2.fontSizeSM, background: "transparent", border: "none", outline: "none", cursor: "pointer", transition: `all ${token2.motionDurationSlow}`, "&:hover": { color: token2.colorTextHeading } }, "&:hover": { color: tabsHoverColor }, [`&${tabCls}-active ${tabCls}-btn`]: { color: token2.colorPrimary, textShadow: token2.tabsActiveTextShadow }, [`&${tabCls}-disabled`]: { color: token2.colorTextDisabled, cursor: "not-allowed" }, [`&${tabCls}-disabled ${tabCls}-btn, &${tabCls}-disabled ${componentCls}-remove`]: { "&:focus, &:active": { color: token2.colorTextDisabled } }, [`& ${tabCls}-remove ${iconCls}`]: { margin: 0 }, [iconCls]: { marginRight: { _skip_check_: true, value: token2.marginSM } } }, [`${tabCls} + ${tabCls}`]: { margin: { _skip_check_: true, value: `0 0 0 ${tabsHorizontalGutter}px` } } }; }; const genRtlStyle = (token2) => { const { componentCls, tabsHorizontalGutter, iconCls, tabsCardGutter } = token2; const rtlCls = `${componentCls}-rtl`; return { [rtlCls]: { direction: "rtl", [`${componentCls}-nav`]: { [`${componentCls}-tab`]: { margin: { _skip_check_: true, value: `0 0 0 ${tabsHorizontalGutter}px` }, [`${componentCls}-tab:last-of-type`]: { marginLeft: { _skip_check_: true, value: 0 } }, [iconCls]: { marginRight: { _skip_check_: true, value: 0 }, marginLeft: { _skip_check_: true, value: `${token2.marginSM}px` } }, [`${componentCls}-tab-remove`]: { marginRight: { _skip_check_: true, value: `${token2.marginXS}px` }, marginLeft: { _skip_check_: true, value: `-${token2.marginXXS}px` }, [iconCls]: { margin: 0 } } } }, [`&${componentCls}-left`]: { [`> ${componentCls}-nav`]: { order: 1 }, [`> ${componentCls}-content-holder`]: { order: 0 } }, [`&${componentCls}-right`]: { [`> ${componentCls}-nav`]: { order: 0 }, [`> ${componentCls}-content-holder`]: { order: 1 } }, // ====================== Card ====================== [`&${componentCls}-card${componentCls}-top, &${componentCls}-card${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: { marginRight: { _skip_check_: true, value: `${tabsCardGutter}px` }, marginLeft: { _skip_check_: true, value: 0 } } } } }, [`${componentCls}-dropdown-rtl`]: { direction: "rtl" }, [`${componentCls}-menu-item`]: { [`${componentCls}-dropdown-rtl`]: { textAlign: { _skip_check_: true, value: "right" } } } }; }; const genTabsStyle = (token2) => { const { componentCls, tabsCardHorizontalPadding, tabsCardHeight, tabsCardGutter, tabsHoverColor, tabsActiveColor, colorSplit } = token2; return { [componentCls]: _extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), { display: "flex", // ========================== Navigation ========================== [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { position: "relative", display: "flex", flex: "none", alignItems: "center", [`${componentCls}-nav-wrap`]: { position: "relative", display: "flex", flex: "auto", alignSelf: "stretch", overflow: "hidden", whiteSpace: "nowrap", transform: "translate(0)", // >>>>> Ping shadow "&::before, &::after": { position: "absolute", zIndex: 1, opacity: 0, transition: `opacity ${token2.motionDurationSlow}`, content: "''", pointerEvents: "none" } }, [`${componentCls}-nav-list`]: { position: "relative", display: "flex", transition: `opacity ${token2.motionDurationSlow}` }, // >>>>>>>> Operations [`${componentCls}-nav-operations`]: { display: "flex", alignSelf: "stretch" }, [`${componentCls}-nav-operations-hidden`]: { position: "absolute", visibility: "hidden", pointerEvents: "none" }, [`${componentCls}-nav-more`]: { position: "relative", padding: tabsCardHorizontalPadding, background: "transparent", border: 0, "&::after": { position: "absolute", right: { _skip_check_: true, value: 0 }, bottom: 0, left: { _skip_check_: true, value: 0 }, height: token2.controlHeightLG / 8, transform: "translateY(100%)", content: "''" } }, [`${componentCls}-nav-add`]: _extends$1({ minWidth: `${tabsCardHeight}px`, marginLeft: { _skip_check_: true, value: `${tabsCardGutter}px` }, padding: `0 ${token2.paddingXS}px`, background: "transparent", border: `${token2.lineWidth}px ${token2.lineType} ${colorSplit}`, borderRadius: `${token2.borderRadiusLG}px ${token2.borderRadiusLG}px 0 0`, outline: "none", cursor: "pointer", color: token2.colorText, transition: `all ${token2.motionDurationSlow} ${token2.motionEaseInOut}`, "&:hover": { color: tabsHoverColor }, "&:active, &:focus:not(:focus-visible)": { color: tabsActiveColor } }, genFocusStyle(token2)) }, [`${componentCls}-extra-content`]: { flex: "none" }, // ============================ InkBar ============================ [`${componentCls}-ink-bar`]: { position: "absolute", background: token2.colorPrimary, pointerEvents: "none" } }), genTabStyle(token2)), { // =========================== TabPanes =========================== [`${componentCls}-content`]: { position: "relative", display: "flex", width: "100%", ["&-animated"]: { transition: "margin 0.3s" } }, [`${componentCls}-content-holder`]: { flex: "auto", minWidth: 0, minHeight: 0 }, [`${componentCls}-tabpane`]: { outline: "none", flex: "none", width: "100%" } }), [`${componentCls}-centered`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-nav-wrap`]: { [`&:not([class*='${componentCls}-nav-wrap-ping'])`]: { justifyContent: "center" } } } } }; }; const useStyle$8 = genComponentStyleHook("Tabs", (token2) => { const tabsCardHeight = token2.controlHeightLG; const tabsToken = merge(token2, { tabsHoverColor: token2.colorPrimaryHover, tabsActiveColor: token2.colorPrimaryActive, tabsCardHorizontalPadding: `${(tabsCardHeight - Math.round(token2.fontSize * token2.lineHeight)) / 2 - token2.lineWidth}px ${token2.padding}px`, tabsCardHeight, tabsCardGutter: token2.marginXXS / 2, tabsHorizontalGutter: 32, tabsCardHeadBackground: token2.colorFillAlter, dropdownEdgeChildVerticalPadding: token2.paddingXXS, tabsActiveTextShadow: "0 0 0.25px currentcolor", tabsDropdownHeight: 200, tabsDropdownWidth: 120 }); return [genSizeStyle(tabsToken), genRtlStyle(tabsToken), genPositionStyle(tabsToken), genDropdownStyle(tabsToken), genCardStyle(tabsToken), genTabsStyle(tabsToken), genMotionStyle(tabsToken)]; }, (token2) => ({ zIndexPopup: token2.zIndexPopupBase + 50 })); let uuid$4 = 0; const tabsProps = () => { return { prefixCls: { type: String }, id: { type: String }, popupClassName: String, getPopupContainer: functionType(), activeKey: { type: [String, Number] }, defaultActiveKey: { type: [String, Number] }, direction: stringType(), animated: someType([Boolean, Object]), renderTabBar: functionType(), tabBarGutter: { type: Number }, tabBarStyle: objectType(), tabPosition: stringType(), destroyInactiveTabPane: booleanType(), hideAdd: Boolean, type: stringType(), size: stringType(), centered: Boolean, onEdit: functionType(), onChange: functionType(), onTabClick: functionType(), onTabScroll: functionType(), "onUpdate:activeKey": functionType(), // Accessibility locale: objectType(), onPrevClick: functionType(), onNextClick: functionType(), tabBarExtraContent: PropTypes.any }; }; function parseTabList(children) { return children.map((node2) => { if (isValidElement(node2)) { const props2 = _extends$1({}, node2.props || {}); for (const [k2, v2] of Object.entries(props2)) { delete props2[k2]; props2[camelize(k2)] = v2; } const slots = node2.children || {}; const key2 = node2.key !== void 0 ? node2.key : void 0; const { tab = slots.tab, disabled, forceRender, closable, animated, active, destroyInactiveTabPane } = props2; return _extends$1(_extends$1({ key: key2 }, props2), { node: node2, closeIcon: slots.closeIcon, tab, disabled: disabled === "" || disabled, forceRender: forceRender === "" || forceRender, closable: closable === "" || closable, animated: animated === "" || animated, active: active === "" || active, destroyInactiveTabPane: destroyInactiveTabPane === "" || destroyInactiveTabPane }); } return null; }).filter((tab) => tab); } const InternalTabs = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "InternalTabs", inheritAttrs: false, props: _extends$1(_extends$1({}, initDefaultProps(tabsProps(), { tabPosition: "top", animated: { inkBar: true, tabPane: false } })), { tabs: arrayType() }), slots: Object, // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'], setup(props2, _ref) { let { attrs, slots } = _ref; devWarning(!(props2.onPrevClick !== void 0) && !(props2.onNextClick !== void 0), "Tabs", "`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."); devWarning(!(props2.tabBarExtraContent !== void 0), "Tabs", "`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."); devWarning(!(slots.tabBarExtraContent !== void 0), "Tabs", "`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead."); const { prefixCls, direction, size, rootPrefixCls, getPopupContainer } = useConfigInject("tabs", props2); const [wrapSSR, hashId] = useStyle$8(prefixCls); const rtl2 = computed(() => direction.value === "rtl"); const mergedAnimated = computed(() => { const { animated, tabPosition } = props2; if (animated === false || ["left", "right"].includes(tabPosition)) { return { inkBar: false, tabPane: false }; } else if (animated === true) { return { inkBar: true, tabPane: true }; } else { return _extends$1({ inkBar: true, tabPane: false }, typeof animated === "object" ? animated : {}); } }); const [mobile, setMobile] = useState(false); onMounted(() => { setMobile(isMobile()); }); const [mergedActiveKey, setMergedActiveKey] = useMergedState(() => { var _a; return (_a = props2.tabs[0]) === null || _a === void 0 ? void 0 : _a.key; }, { value: computed(() => props2.activeKey), defaultValue: props2.defaultActiveKey }); const [activeIndex, setActiveIndex] = useState(() => props2.tabs.findIndex((tab) => tab.key === mergedActiveKey.value)); watchEffect(() => { var _a; let newActiveIndex = props2.tabs.findIndex((tab) => tab.key === mergedActiveKey.value); if (newActiveIndex === -1) { newActiveIndex = Math.max(0, Math.min(activeIndex.value, props2.tabs.length - 1)); setMergedActiveKey((_a = props2.tabs[newActiveIndex]) === null || _a === void 0 ? void 0 : _a.key); } setActiveIndex(newActiveIndex); }); const [mergedId, setMergedId] = useMergedState(null, { value: computed(() => props2.id) }); const mergedTabPosition = computed(() => { if (mobile.value && !["left", "right"].includes(props2.tabPosition)) { return "top"; } else { return props2.tabPosition; } }); onMounted(() => { if (!props2.id) { setMergedId(`rc-tabs-${uuid$4}`); uuid$4 += 1; } }); const onInternalTabClick = (key2, e2) => { var _a, _b; (_a = props2.onTabClick) === null || _a === void 0 ? void 0 : _a.call(props2, key2, e2); const isActiveChanged = key2 !== mergedActiveKey.value; setMergedActiveKey(key2); if (isActiveChanged) { (_b = props2.onChange) === null || _b === void 0 ? void 0 : _b.call(props2, key2); } }; useProvideTabs({ tabs: computed(() => props2.tabs), prefixCls }); return () => { const { id, type, tabBarGutter, tabBarStyle, locale: locale2, destroyInactiveTabPane, renderTabBar = slots.renderTabBar, onTabScroll, hideAdd, centered } = props2; const sharedProps = { id: mergedId.value, activeKey: mergedActiveKey.value, animated: mergedAnimated.value, tabPosition: mergedTabPosition.value, rtl: rtl2.value, mobile: mobile.value }; let editable; if (type === "editable-card") { editable = { onEdit: (editType, _ref2) => { let { key: key2, event } = _ref2; var _a; (_a = props2.onEdit) === null || _a === void 0 ? void 0 : _a.call(props2, editType === "add" ? event : key2, editType); }, removeIcon: () => createVNode(CloseOutlined, null, null), addIcon: slots.addIcon ? slots.addIcon : () => createVNode(PlusOutlined, null, null), showAdd: hideAdd !== true }; } let tabNavBar; const tabNavBarProps = _extends$1(_extends$1({}, sharedProps), { moreTransitionName: `${rootPrefixCls.value}-slide-up`, editable, locale: locale2, tabBarGutter, onTabClick: onInternalTabClick, onTabScroll, style: tabBarStyle, getPopupContainer: getPopupContainer.value, popupClassName: classNames(props2.popupClassName, hashId.value) }); if (renderTabBar) { tabNavBar = renderTabBar(_extends$1(_extends$1({}, tabNavBarProps), { DefaultTabBar: TabNavList })); } else { tabNavBar = createVNode(TabNavList, tabNavBarProps, pick(slots, ["moreIcon", "leftExtra", "rightExtra", "tabBarExtraContent"])); } const pre = prefixCls.value; return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "id": id, "class": classNames(pre, `${pre}-${mergedTabPosition.value}`, { [hashId.value]: true, [`${pre}-${size.value}`]: size.value, [`${pre}-card`]: ["card", "editable-card"].includes(type), [`${pre}-editable-card`]: type === "editable-card", [`${pre}-centered`]: centered, [`${pre}-mobile`]: mobile.value, [`${pre}-editable`]: type === "editable-card", [`${pre}-rtl`]: rtl2.value }, attrs.class) }), [tabNavBar, createVNode(TabPanelList, _objectSpread2$1(_objectSpread2$1({ "destroyInactiveTabPane": destroyInactiveTabPane }, sharedProps), {}, { "animated": mergedAnimated.value }), null)])); }; } }); const Tabs = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ATabs", inheritAttrs: false, props: initDefaultProps(tabsProps(), { tabPosition: "top", animated: { inkBar: true, tabPane: false } }), slots: Object, // emits: ['tabClick', 'tabScroll', 'change', 'update:activeKey'], setup(props2, _ref3) { let { attrs, slots, emit: emit2 } = _ref3; const handleChange = (key2) => { emit2("update:activeKey", key2); emit2("change", key2); }; return () => { var _a; const tabs = parseTabList(flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))); return createVNode(InternalTabs, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, omit$1(props2, ["onUpdate:activeKey"])), attrs), {}, { "onChange": handleChange, "tabs": tabs }), slots); }; } }); const tabPaneProps = () => ({ tab: PropTypes.any, disabled: { type: Boolean }, forceRender: { type: Boolean }, closable: { type: Boolean }, animated: { type: Boolean }, active: { type: Boolean }, destroyInactiveTabPane: { type: Boolean }, // Pass by TabPaneList prefixCls: { type: String }, tabKey: { type: [String, Number] }, id: { type: String } // closeIcon: PropTypes.any, }); const TabPane = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ATabPane", inheritAttrs: false, __ANT_TAB_PANE: true, props: tabPaneProps(), slots: Object, setup(props2, _ref) { let { attrs, slots } = _ref; const visited = ref(props2.forceRender); watch([() => props2.active, () => props2.destroyInactiveTabPane], () => { if (props2.active) { visited.value = true; } else if (props2.destroyInactiveTabPane) { visited.value = false; } }, { immediate: true }); const mergedStyle = computed(() => { if (!props2.active) { if (props2.animated) { return { visibility: "hidden", height: 0, overflowY: "hidden" }; } else { return { display: "none" }; } } return {}; }); return () => { var _a; const { prefixCls, forceRender, id, active, tabKey } = props2; return createVNode("div", { "id": id && `${id}-panel-${tabKey}`, "role": "tabpanel", "tabindex": active ? 0 : -1, "aria-labelledby": id && `${id}-tab-${tabKey}`, "aria-hidden": !active, "style": [mergedStyle.value, attrs.style], "class": [`${prefixCls}-tabpane`, active && `${prefixCls}-tabpane-active`, attrs.class] }, [(active || visited.value || forceRender) && ((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))]); }; } }); Tabs.TabPane = TabPane; Tabs.install = function(app) { app.component(Tabs.name, Tabs); app.component(TabPane.name, TabPane); return app; }; const skeletonTitleProps = () => ({ prefixCls: String, width: { type: [Number, String] } }); const SkeletonTitle = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "SkeletonTitle", props: skeletonTitleProps(), setup(props2) { return () => { const { prefixCls, width } = props2; const zWidth = typeof width === "number" ? `${width}px` : width; return createVNode("h3", { "class": prefixCls, "style": { width: zWidth } }, null); }; } }); const skeletonParagraphProps = () => ({ prefixCls: String, width: { type: [Number, String, Array] }, rows: Number }); const SkeletonParagraph = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "SkeletonParagraph", props: skeletonParagraphProps(), setup(props2) { const getWidth = (index2) => { const { width, rows = 2 } = props2; if (Array.isArray(width)) { return width[index2]; } if (rows - 1 === index2) { return width; } return void 0; }; return () => { const { prefixCls, rows } = props2; const rowList = [...Array(rows)].map((_2, index2) => { const width = getWidth(index2); return createVNode("li", { "key": index2, "style": { width: typeof width === "number" ? `${width}px` : width } }, null); }); return createVNode("ul", { "class": prefixCls }, [rowList]); }; } }); const skeletonElementProps = () => ({ prefixCls: String, size: [String, Number], shape: String, active: { type: Boolean, default: void 0 } }); const Element$1 = (props2) => { const { prefixCls, size, shape } = props2; const sizeCls = classNames({ [`${prefixCls}-lg`]: size === "large", [`${prefixCls}-sm`]: size === "small" }); const shapeCls = classNames({ [`${prefixCls}-circle`]: shape === "circle", [`${prefixCls}-square`]: shape === "square", [`${prefixCls}-round`]: shape === "round" }); const sizeStyle = typeof size === "number" ? { width: `${size}px`, height: `${size}px`, lineHeight: `${size}px` } : {}; return createVNode("span", { "class": classNames(prefixCls, sizeCls, shapeCls), "style": sizeStyle }, null); }; Element$1.displayName = "SkeletonElement"; const skeletonClsLoading = new Keyframe(`ant-skeleton-loading`, { "0%": { transform: "translateX(-37.5%)" }, "100%": { transform: "translateX(37.5%)" } }); const genSkeletonElementCommonSize = (size) => ({ height: size, lineHeight: `${size}px` }); const genSkeletonElementAvatarSize = (size) => _extends$1({ width: size }, genSkeletonElementCommonSize(size)); const genSkeletonColor = (token2) => ({ position: "relative", // fix https://github.com/ant-design/ant-design/issues/36444 // https://monshin.github.io/202109/css/safari-border-radius-overflow-hidden/ /* stylelint-disable-next-line property-no-vendor-prefix,value-no-vendor-prefix */ zIndex: 0, overflow: "hidden", background: "transparent", "&::after": { position: "absolute", top: 0, insetInlineEnd: "-150%", bottom: 0, insetInlineStart: "-150%", background: token2.skeletonLoadingBackground, animationName: skeletonClsLoading, animationDuration: token2.skeletonLoadingMotionDuration, animationTimingFunction: "ease", animationIterationCount: "infinite", content: '""' } }); const genSkeletonElementInputSize = (size) => _extends$1({ width: size * 5, minWidth: size * 5 }, genSkeletonElementCommonSize(size)); const genSkeletonElementAvatar = (token2) => { const { skeletonAvatarCls, color, controlHeight, controlHeightLG, controlHeightSM } = token2; return { [`${skeletonAvatarCls}`]: _extends$1({ display: "inline-block", verticalAlign: "top", background: color }, genSkeletonElementAvatarSize(controlHeight)), [`${skeletonAvatarCls}${skeletonAvatarCls}-circle`]: { borderRadius: "50%" }, [`${skeletonAvatarCls}${skeletonAvatarCls}-lg`]: _extends$1({}, genSkeletonElementAvatarSize(controlHeightLG)), [`${skeletonAvatarCls}${skeletonAvatarCls}-sm`]: _extends$1({}, genSkeletonElementAvatarSize(controlHeightSM)) }; }; const genSkeletonElementInput = (token2) => { const { controlHeight, borderRadiusSM, skeletonInputCls, controlHeightLG, controlHeightSM, color } = token2; return { [`${skeletonInputCls}`]: _extends$1({ display: "inline-block", verticalAlign: "top", background: color, borderRadius: borderRadiusSM }, genSkeletonElementInputSize(controlHeight)), [`${skeletonInputCls}-lg`]: _extends$1({}, genSkeletonElementInputSize(controlHeightLG)), [`${skeletonInputCls}-sm`]: _extends$1({}, genSkeletonElementInputSize(controlHeightSM)) }; }; const genSkeletonElementImageSize = (size) => _extends$1({ width: size }, genSkeletonElementCommonSize(size)); const genSkeletonElementImage = (token2) => { const { skeletonImageCls, imageSizeBase, color, borderRadiusSM } = token2; return { [`${skeletonImageCls}`]: _extends$1(_extends$1({ display: "flex", alignItems: "center", justifyContent: "center", verticalAlign: "top", background: color, borderRadius: borderRadiusSM }, genSkeletonElementImageSize(imageSizeBase * 2)), { [`${skeletonImageCls}-path`]: { fill: "#bfbfbf" }, [`${skeletonImageCls}-svg`]: _extends$1(_extends$1({}, genSkeletonElementImageSize(imageSizeBase)), { maxWidth: imageSizeBase * 4, maxHeight: imageSizeBase * 4 }), [`${skeletonImageCls}-svg${skeletonImageCls}-svg-circle`]: { borderRadius: "50%" } }), [`${skeletonImageCls}${skeletonImageCls}-circle`]: { borderRadius: "50%" } }; }; const genSkeletonElementButtonShape = (token2, size, buttonCls) => { const { skeletonButtonCls } = token2; return { [`${buttonCls}${skeletonButtonCls}-circle`]: { width: size, minWidth: size, borderRadius: "50%" }, [`${buttonCls}${skeletonButtonCls}-round`]: { borderRadius: size } }; }; const genSkeletonElementButtonSize = (size) => _extends$1({ width: size * 2, minWidth: size * 2 }, genSkeletonElementCommonSize(size)); const genSkeletonElementButton = (token2) => { const { borderRadiusSM, skeletonButtonCls, controlHeight, controlHeightLG, controlHeightSM, color } = token2; return _extends$1(_extends$1(_extends$1(_extends$1(_extends$1({ [`${skeletonButtonCls}`]: _extends$1({ display: "inline-block", verticalAlign: "top", background: color, borderRadius: borderRadiusSM, width: controlHeight * 2, minWidth: controlHeight * 2 }, genSkeletonElementButtonSize(controlHeight)) }, genSkeletonElementButtonShape(token2, controlHeight, skeletonButtonCls)), { [`${skeletonButtonCls}-lg`]: _extends$1({}, genSkeletonElementButtonSize(controlHeightLG)) }), genSkeletonElementButtonShape(token2, controlHeightLG, `${skeletonButtonCls}-lg`)), { [`${skeletonButtonCls}-sm`]: _extends$1({}, genSkeletonElementButtonSize(controlHeightSM)) }), genSkeletonElementButtonShape(token2, controlHeightSM, `${skeletonButtonCls}-sm`)); }; const genBaseStyle$1 = (token2) => { const { componentCls, skeletonAvatarCls, skeletonTitleCls, skeletonParagraphCls, skeletonButtonCls, skeletonInputCls, skeletonImageCls, controlHeight, controlHeightLG, controlHeightSM, color, padding, marginSM, borderRadius, skeletonTitleHeight, skeletonBlockRadius, skeletonParagraphLineHeight, controlHeightXS, skeletonParagraphMarginTop } = token2; return { [`${componentCls}`]: { display: "table", width: "100%", [`${componentCls}-header`]: { display: "table-cell", paddingInlineEnd: padding, verticalAlign: "top", // Avatar [`${skeletonAvatarCls}`]: _extends$1({ display: "inline-block", verticalAlign: "top", background: color }, genSkeletonElementAvatarSize(controlHeight)), [`${skeletonAvatarCls}-circle`]: { borderRadius: "50%" }, [`${skeletonAvatarCls}-lg`]: _extends$1({}, genSkeletonElementAvatarSize(controlHeightLG)), [`${skeletonAvatarCls}-sm`]: _extends$1({}, genSkeletonElementAvatarSize(controlHeightSM)) }, [`${componentCls}-content`]: { display: "table-cell", width: "100%", verticalAlign: "top", // Title [`${skeletonTitleCls}`]: { width: "100%", height: skeletonTitleHeight, background: color, borderRadius: skeletonBlockRadius, [`+ ${skeletonParagraphCls}`]: { marginBlockStart: controlHeightSM } }, // paragraph [`${skeletonParagraphCls}`]: { padding: 0, "> li": { width: "100%", height: skeletonParagraphLineHeight, listStyle: "none", background: color, borderRadius: skeletonBlockRadius, "+ li": { marginBlockStart: controlHeightXS } } }, [`${skeletonParagraphCls}> li:last-child:not(:first-child):not(:nth-child(2))`]: { width: "61%" } }, [`&-round ${componentCls}-content`]: { [`${skeletonTitleCls}, ${skeletonParagraphCls} > li`]: { borderRadius } } }, [`${componentCls}-with-avatar ${componentCls}-content`]: { // Title [`${skeletonTitleCls}`]: { marginBlockStart: marginSM, [`+ ${skeletonParagraphCls}`]: { marginBlockStart: skeletonParagraphMarginTop } } }, // Skeleton element [`${componentCls}${componentCls}-element`]: _extends$1(_extends$1(_extends$1(_extends$1({ display: "inline-block", width: "auto" }, genSkeletonElementButton(token2)), genSkeletonElementAvatar(token2)), genSkeletonElementInput(token2)), genSkeletonElementImage(token2)), // Skeleton Block Button, Input [`${componentCls}${componentCls}-block`]: { width: "100%", [`${skeletonButtonCls}`]: { width: "100%" }, [`${skeletonInputCls}`]: { width: "100%" } }, // With active animation [`${componentCls}${componentCls}-active`]: { [` ${skeletonTitleCls}, ${skeletonParagraphCls} > li, ${skeletonAvatarCls}, ${skeletonButtonCls}, ${skeletonInputCls}, ${skeletonImageCls} `]: _extends$1({}, genSkeletonColor(token2)) } }; }; const useStyle$7 = genComponentStyleHook("Skeleton", (token2) => { const { componentCls } = token2; const skeletonToken = merge(token2, { skeletonAvatarCls: `${componentCls}-avatar`, skeletonTitleCls: `${componentCls}-title`, skeletonParagraphCls: `${componentCls}-paragraph`, skeletonButtonCls: `${componentCls}-button`, skeletonInputCls: `${componentCls}-input`, skeletonImageCls: `${componentCls}-image`, imageSizeBase: token2.controlHeight * 1.5, skeletonTitleHeight: token2.controlHeight / 2, skeletonBlockRadius: token2.borderRadiusSM, skeletonParagraphLineHeight: token2.controlHeight / 2, skeletonParagraphMarginTop: token2.marginLG + token2.marginXXS, borderRadius: 100, skeletonLoadingBackground: `linear-gradient(90deg, ${token2.color} 25%, ${token2.colorGradientEnd} 37%, ${token2.color} 63%)`, skeletonLoadingMotionDuration: "1.4s" }); return [genBaseStyle$1(skeletonToken)]; }, (token2) => { const { colorFillContent, colorFill } = token2; return { color: colorFillContent, colorGradientEnd: colorFill }; }); const skeletonProps = () => ({ active: { type: Boolean, default: void 0 }, loading: { type: Boolean, default: void 0 }, prefixCls: String, avatar: { type: [Boolean, Object], default: void 0 }, title: { type: [Boolean, Object], default: void 0 }, paragraph: { type: [Boolean, Object], default: void 0 }, round: { type: Boolean, default: void 0 } }); function getComponentProps(prop) { if (prop && typeof prop === "object") { return prop; } return {}; } function getAvatarBasicProps(hasTitle, hasParagraph) { if (hasTitle && !hasParagraph) { return { size: "large", shape: "square" }; } return { size: "large", shape: "circle" }; } function getTitleBasicProps(hasAvatar, hasParagraph) { if (!hasAvatar && hasParagraph) { return { width: "38%" }; } if (hasAvatar && hasParagraph) { return { width: "50%" }; } return {}; } function getParagraphBasicProps(hasAvatar, hasTitle) { const basicProps = {}; if (!hasAvatar || !hasTitle) { basicProps.width = "61%"; } if (!hasAvatar && hasTitle) { basicProps.rows = 3; } else { basicProps.rows = 2; } return basicProps; } const Skeleton = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASkeleton", props: initDefaultProps(skeletonProps(), { avatar: false, title: true, paragraph: true }), setup(props2, _ref) { let { slots } = _ref; const { prefixCls, direction } = useConfigInject("skeleton", props2); const [wrapSSR, hashId] = useStyle$7(prefixCls); return () => { var _a; const { loading, avatar, title, paragraph, active, round } = props2; const pre = prefixCls.value; if (loading || props2.loading === void 0) { const hasAvatar = !!avatar || avatar === ""; const hasTitle = !!title || title === ""; const hasParagraph = !!paragraph || paragraph === ""; let avatarNode; if (hasAvatar) { const avatarProps2 = _extends$1(_extends$1({ prefixCls: `${pre}-avatar` }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar)); avatarNode = createVNode("div", { "class": `${pre}-header` }, [createVNode(Element$1, avatarProps2, null)]); } let contentNode; if (hasTitle || hasParagraph) { let $title; if (hasTitle) { const titleProps = _extends$1(_extends$1({ prefixCls: `${pre}-title` }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title)); $title = createVNode(SkeletonTitle, titleProps, null); } let paragraphNode; if (hasParagraph) { const paragraphProps = _extends$1(_extends$1({ prefixCls: `${pre}-paragraph` }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph)); paragraphNode = createVNode(SkeletonParagraph, paragraphProps, null); } contentNode = createVNode("div", { "class": `${pre}-content` }, [$title, paragraphNode]); } const cls = classNames(pre, { [`${pre}-with-avatar`]: hasAvatar, [`${pre}-active`]: active, [`${pre}-rtl`]: direction.value === "rtl", [`${pre}-round`]: round, [hashId.value]: true }); return wrapSSR(createVNode("div", { "class": cls }, [avatarNode, contentNode])); } return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); const skeletonButtonProps = () => { return _extends$1(_extends$1({}, skeletonElementProps()), { size: String, block: Boolean }); }; const SkeletonButton = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASkeletonButton", props: initDefaultProps(skeletonButtonProps(), { size: "default" }), setup(props2) { const { prefixCls } = useConfigInject("skeleton", props2); const [wrapSSR, hashId] = useStyle$7(prefixCls); const cls = computed(() => classNames(prefixCls.value, `${prefixCls.value}-element`, { [`${prefixCls.value}-active`]: props2.active, [`${prefixCls.value}-block`]: props2.block }, hashId.value)); return () => { return wrapSSR(createVNode("div", { "class": cls.value }, [createVNode(Element$1, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "prefixCls": `${prefixCls.value}-button` }), null)])); }; } }); const SkeletonInput = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASkeletonInput", props: _extends$1(_extends$1({}, omit$1(skeletonElementProps(), ["shape"])), { size: String, block: Boolean }), setup(props2) { const { prefixCls } = useConfigInject("skeleton", props2); const [wrapSSR, hashId] = useStyle$7(prefixCls); const cls = computed(() => classNames(prefixCls.value, `${prefixCls.value}-element`, { [`${prefixCls.value}-active`]: props2.active, [`${prefixCls.value}-block`]: props2.block }, hashId.value)); return () => { return wrapSSR(createVNode("div", { "class": cls.value }, [createVNode(Element$1, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "prefixCls": `${prefixCls.value}-input` }), null)])); }; } }); const path = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z"; const SkeletonImage = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASkeletonImage", props: omit$1(skeletonElementProps(), ["size", "shape", "active"]), setup(props2) { const { prefixCls } = useConfigInject("skeleton", props2); const [wrapSSR, hashId] = useStyle$7(prefixCls); const cls = computed(() => classNames(prefixCls.value, `${prefixCls.value}-element`, hashId.value)); return () => { return wrapSSR(createVNode("div", { "class": cls.value }, [createVNode("div", { "class": `${prefixCls.value}-image` }, [createVNode("svg", { "viewBox": "0 0 1098 1024", "xmlns": "http://www.w3.org/2000/svg", "class": `${prefixCls.value}-image-svg` }, [createVNode("path", { "d": path, "class": `${prefixCls.value}-image-path` }, null)])])])); }; } }); const avatarProps = () => { return _extends$1(_extends$1({}, skeletonElementProps()), { shape: String }); }; const SkeletonAvatar = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASkeletonAvatar", props: initDefaultProps(avatarProps(), { size: "default", shape: "circle" }), setup(props2) { const { prefixCls } = useConfigInject("skeleton", props2); const [wrapSSR, hashId] = useStyle$7(prefixCls); const cls = computed(() => classNames(prefixCls.value, `${prefixCls.value}-element`, { [`${prefixCls.value}-active`]: props2.active }, hashId.value)); return () => { return wrapSSR(createVNode("div", { "class": cls.value }, [createVNode(Element$1, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "prefixCls": `${prefixCls.value}-avatar` }), null)])); }; } }); Skeleton.Button = SkeletonButton; Skeleton.Avatar = SkeletonAvatar; Skeleton.Input = SkeletonInput; Skeleton.Image = SkeletonImage; Skeleton.Title = SkeletonTitle; Skeleton.install = function(app) { app.component(Skeleton.name, Skeleton); app.component(Skeleton.Button.name, SkeletonButton); app.component(Skeleton.Avatar.name, SkeletonAvatar); app.component(Skeleton.Input.name, SkeletonInput); app.component(Skeleton.Image.name, SkeletonImage); app.component(Skeleton.Title.name, SkeletonTitle); return app; }; var LeftOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" }; function _objectSpread$f(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$f(target, key2, source[key2]); }); } return target; } function _defineProperty$f(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var LeftOutlined = function LeftOutlined2(props2, context2) { var p2 = _objectSpread$f({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$f({}, p2, { "icon": LeftOutlined$1 }), null); }; LeftOutlined.displayName = "LeftOutlined"; LeftOutlined.inheritAttrs = false; const canUseDocElement = () => canUseDom$1() && window.document.documentElement; let flexGapSupported; const detectFlexGapSupported = () => { if (!canUseDocElement()) { return false; } if (flexGapSupported !== void 0) { return flexGapSupported; } const flex = document.createElement("div"); flex.style.display = "flex"; flex.style.flexDirection = "column"; flex.style.rowGap = "1px"; flex.appendChild(document.createElement("div")); flex.appendChild(document.createElement("div")); document.body.appendChild(flex); flexGapSupported = flex.scrollHeight === 1; document.body.removeChild(flex); return flexGapSupported; }; const useFlexGapSupport = () => { const flexible = shallowRef(false); onMounted(() => { flexible.value = detectFlexGapSupported(); }); return flexible; }; const RowContextKey = Symbol("rowContextKey"); const useProvideRow = (state) => { provide(RowContextKey, state); }; const useInjectRow = () => { return inject(RowContextKey, { gutter: computed(() => void 0), wrap: computed(() => void 0), supportFlexGap: computed(() => void 0) }); }; const genGridRowStyle = (token2) => { const { componentCls } = token2; return { // Grid system [componentCls]: { display: "flex", flexFlow: "row wrap", minWidth: 0, "&::before, &::after": { display: "flex" }, "&-no-wrap": { flexWrap: "nowrap" }, // The origin of the X-axis "&-start": { justifyContent: "flex-start" }, // The center of the X-axis "&-center": { justifyContent: "center" }, // The opposite of the X-axis "&-end": { justifyContent: "flex-end" }, "&-space-between": { justifyContent: "space-between" }, "&-space-around ": { justifyContent: "space-around" }, "&-space-evenly ": { justifyContent: "space-evenly" }, // Align at the top "&-top": { alignItems: "flex-start" }, // Align at the center "&-middle": { alignItems: "center" }, "&-bottom": { alignItems: "flex-end" } } }; }; const genGridColStyle = (token2) => { const { componentCls } = token2; return { // Grid system [componentCls]: { position: "relative", maxWidth: "100%", // Prevent columns from collapsing when empty minHeight: 1 } }; }; const genLoopGridColumnsStyle = (token2, sizeCls) => { const { componentCls, gridColumns } = token2; const gridColumnsStyle = {}; for (let i2 = gridColumns; i2 >= 0; i2--) { if (i2 === 0) { gridColumnsStyle[`${componentCls}${sizeCls}-${i2}`] = { display: "none" }; gridColumnsStyle[`${componentCls}-push-${i2}`] = { insetInlineStart: "auto" }; gridColumnsStyle[`${componentCls}-pull-${i2}`] = { insetInlineEnd: "auto" }; gridColumnsStyle[`${componentCls}${sizeCls}-push-${i2}`] = { insetInlineStart: "auto" }; gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i2}`] = { insetInlineEnd: "auto" }; gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i2}`] = { marginInlineEnd: 0 }; gridColumnsStyle[`${componentCls}${sizeCls}-order-${i2}`] = { order: 0 }; } else { gridColumnsStyle[`${componentCls}${sizeCls}-${i2}`] = { display: "block", flex: `0 0 ${i2 / gridColumns * 100}%`, maxWidth: `${i2 / gridColumns * 100}%` }; gridColumnsStyle[`${componentCls}${sizeCls}-push-${i2}`] = { insetInlineStart: `${i2 / gridColumns * 100}%` }; gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i2}`] = { insetInlineEnd: `${i2 / gridColumns * 100}%` }; gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i2}`] = { marginInlineStart: `${i2 / gridColumns * 100}%` }; gridColumnsStyle[`${componentCls}${sizeCls}-order-${i2}`] = { order: i2 }; } } return gridColumnsStyle; }; const genGridStyle = (token2, sizeCls) => genLoopGridColumnsStyle(token2, sizeCls); const genGridMediaStyle = (token2, screenSize, sizeCls) => ({ [`@media (min-width: ${screenSize}px)`]: _extends$1({}, genGridStyle(token2, sizeCls)) }); const useRowStyle = genComponentStyleHook("Grid", (token2) => [genGridRowStyle(token2)]); const useColStyle = genComponentStyleHook("Grid", (token2) => { const gridToken = merge(token2, { gridColumns: 24 // Row is divided into 24 parts in Grid }); const gridMediaSizesMap = { "-sm": gridToken.screenSMMin, "-md": gridToken.screenMDMin, "-lg": gridToken.screenLGMin, "-xl": gridToken.screenXLMin, "-xxl": gridToken.screenXXLMin }; return [genGridColStyle(gridToken), genGridStyle(gridToken, ""), genGridStyle(gridToken, "-xs"), Object.keys(gridMediaSizesMap).map((key2) => genGridMediaStyle(gridToken, gridMediaSizesMap[key2], key2)).reduce((pre, cur) => _extends$1(_extends$1({}, pre), cur), {})]; }); const rowProps = () => ({ align: someType([String, Object]), justify: someType([String, Object]), prefixCls: String, gutter: someType([Number, Array, Object], 0), wrap: { type: Boolean, default: void 0 } }); const ARow = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ARow", inheritAttrs: false, props: rowProps(), setup(props2, _ref) { let { slots, attrs } = _ref; const { prefixCls, direction } = useConfigInject("row", props2); const [wrapSSR, hashId] = useRowStyle(prefixCls); let token2; const responsiveObserve = useResponsiveObserver(); const screens = ref({ xs: true, sm: true, md: true, lg: true, xl: true, xxl: true }); const curScreens = ref({ xs: false, sm: false, md: false, lg: false, xl: false, xxl: false }); const mergePropsByScreen = (oriProp) => { return computed(() => { if (typeof props2[oriProp] === "string") { return props2[oriProp]; } if (typeof props2[oriProp] !== "object") { return ""; } for (let i2 = 0; i2 < responsiveArray.length; i2++) { const breakpoint = responsiveArray[i2]; if (!curScreens.value[breakpoint]) continue; const curVal = props2[oriProp][breakpoint]; if (curVal !== void 0) { return curVal; } } return ""; }); }; const mergeAlign = mergePropsByScreen("align"); const mergeJustify = mergePropsByScreen("justify"); const supportFlexGap = useFlexGapSupport(); onMounted(() => { token2 = responsiveObserve.value.subscribe((screen) => { curScreens.value = screen; const currentGutter = props2.gutter || 0; if (!Array.isArray(currentGutter) && typeof currentGutter === "object" || Array.isArray(currentGutter) && (typeof currentGutter[0] === "object" || typeof currentGutter[1] === "object")) { screens.value = screen; } }); }); onBeforeUnmount(() => { responsiveObserve.value.unsubscribe(token2); }); const gutter = computed(() => { const results = [void 0, void 0]; const { gutter: gutter2 = 0 } = props2; const normalizedGutter = Array.isArray(gutter2) ? gutter2 : [gutter2, void 0]; normalizedGutter.forEach((g2, index2) => { if (typeof g2 === "object") { for (let i2 = 0; i2 < responsiveArray.length; i2++) { const breakpoint = responsiveArray[i2]; if (screens.value[breakpoint] && g2[breakpoint] !== void 0) { results[index2] = g2[breakpoint]; break; } } } else { results[index2] = g2; } }); return results; }); useProvideRow({ gutter, supportFlexGap, wrap: computed(() => props2.wrap) }); const classes = computed(() => classNames(prefixCls.value, { [`${prefixCls.value}-no-wrap`]: props2.wrap === false, [`${prefixCls.value}-${mergeJustify.value}`]: mergeJustify.value, [`${prefixCls.value}-${mergeAlign.value}`]: mergeAlign.value, [`${prefixCls.value}-rtl`]: direction.value === "rtl" }, attrs.class, hashId.value)); const rowStyle = computed(() => { const gt = gutter.value; const style = {}; const horizontalGutter = gt[0] != null && gt[0] > 0 ? `${gt[0] / -2}px` : void 0; const verticalGutter = gt[1] != null && gt[1] > 0 ? `${gt[1] / -2}px` : void 0; if (horizontalGutter) { style.marginLeft = horizontalGutter; style.marginRight = horizontalGutter; } if (supportFlexGap.value) { style.rowGap = `${gt[1]}px`; } else if (verticalGutter) { style.marginTop = verticalGutter; style.marginBottom = verticalGutter; } return style; }); return () => { var _a; return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": classes.value, "style": _extends$1(_extends$1({}, rowStyle.value), attrs.style) }), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])); }; } }); 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); } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o2) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o22) { return o22.__proto__ || Object.getPrototypeOf(o22); }; return _getPrototypeOf(o2); } function _setPrototypeOf(o2, p2) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o22, p22) { o22.__proto__ = p22; return o22; }; return _setPrototypeOf(o2, p2); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); return true; } catch (e2) { return false; } } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct2(Parent2, args2, Class2) { var a2 = [null]; a2.push.apply(a2, args2); var Constructor = Function.bind.apply(Parent2, a2); var instance = new Constructor(); if (Class2) _setPrototypeOf(instance, Class2.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; _wrapNativeSuper = function _wrapNativeSuper2(Class2) { if (Class2 === null || !_isNativeFunction(Class2)) return Class2; if (typeof Class2 !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class2)) return _cache.get(Class2); _cache.set(Class2, Wrapper); } function Wrapper() { return _construct(Class2, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class2); }; return _wrapNativeSuper(Class); } var formatRegExp = /%[sdj%]/g; var warning = function warning2() { }; function convertFieldsError(errors) { if (!errors || !errors.length) return null; var fields = {}; errors.forEach(function(error) { var field = error.field; fields[field] = fields[field] || []; fields[field].push(error); }); return fields; } function format(template) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var i2 = 0; var len = args.length; if (typeof template === "function") { return template.apply(null, args); } if (typeof template === "string") { var str = template.replace(formatRegExp, function(x2) { if (x2 === "%%") { return "%"; } if (i2 >= len) { return x2; } switch (x2) { case "%s": return String(args[i2++]); case "%d": return Number(args[i2++]); case "%j": try { return JSON.stringify(args[i2++]); } catch (_2) { return "[Circular]"; } break; default: return x2; } }); return str; } return template; } function isNativeStringType(type4) { return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern"; } function isEmptyValue(value, type4) { if (value === void 0 || value === null) { return true; } if (type4 === "array" && Array.isArray(value) && !value.length) { return true; } if (isNativeStringType(type4) && typeof value === "string" && !value) { return true; } return false; } function asyncParallelArray(arr, func, callback) { var results = []; var total = 0; var arrLength = arr.length; function count(errors) { results.push.apply(results, errors || []); total++; if (total === arrLength) { callback(results); } } arr.forEach(function(a2) { func(a2, count); }); } function asyncSerialArray(arr, func, callback) { var index2 = 0; var arrLength = arr.length; function next2(errors) { if (errors && errors.length) { callback(errors); return; } var original = index2; index2 = index2 + 1; if (original < arrLength) { func(arr[original], next2); } else { callback([]); } } next2([]); } function flattenObjArr(objArr) { var ret = []; Object.keys(objArr).forEach(function(k2) { ret.push.apply(ret, objArr[k2] || []); }); return ret; } var AsyncValidationError = /* @__PURE__ */ function(_Error) { _inheritsLoose(AsyncValidationError2, _Error); function AsyncValidationError2(errors, fields) { var _this; _this = _Error.call(this, "Async Validation Error") || this; _this.errors = errors; _this.fields = fields; return _this; } return AsyncValidationError2; }(/* @__PURE__ */ _wrapNativeSuper(Error)); function asyncMap(objArr, option, func, callback, source) { if (option.first) { var _pending = new Promise(function(resolve2, reject) { var next2 = function next22(errors) { callback(errors); return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve2(source); }; var flattenArr = flattenObjArr(objArr); asyncSerialArray(flattenArr, func, next2); }); _pending["catch"](function(e2) { return e2; }); return _pending; } var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || []; var objArrKeys = Object.keys(objArr); var objArrLength = objArrKeys.length; var total = 0; var results = []; var pending = new Promise(function(resolve2, reject) { var next2 = function next22(errors) { results.push.apply(results, errors); total++; if (total === objArrLength) { callback(results); return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve2(source); } }; if (!objArrKeys.length) { callback(results); resolve2(source); } objArrKeys.forEach(function(key2) { var arr = objArr[key2]; if (firstFields.indexOf(key2) !== -1) { asyncSerialArray(arr, func, next2); } else { asyncParallelArray(arr, func, next2); } }); }); pending["catch"](function(e2) { return e2; }); return pending; } function isErrorObj(obj) { return !!(obj && obj.message !== void 0); } function getValue$1(value, path2) { var v2 = value; for (var i2 = 0; i2 < path2.length; i2++) { if (v2 == void 0) { return v2; } v2 = v2[path2[i2]]; } return v2; } function complementError(rule, source) { return function(oe) { var fieldValue; if (rule.fullFields) { fieldValue = getValue$1(source, rule.fullFields); } else { fieldValue = source[oe.field || rule.fullField]; } if (isErrorObj(oe)) { oe.field = oe.field || rule.fullField; oe.fieldValue = fieldValue; return oe; } return { message: typeof oe === "function" ? oe() : oe, fieldValue, field: oe.field || rule.fullField }; }; } function deepMerge(target, source) { if (source) { for (var s2 in source) { if (source.hasOwnProperty(s2)) { var value = source[s2]; if (typeof value === "object" && typeof target[s2] === "object") { target[s2] = _extends({}, target[s2], value); } else { target[s2] = value; } } } } return target; } var required$1 = function required(rule, value, source, errors, options, type4) { if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) { errors.push(format(options.messages.required, rule.fullField)); } }; var whitespace = function whitespace2(rule, value, source, errors, options) { if (/^\s+$/.test(value) || value === "") { errors.push(format(options.messages.whitespace, rule.fullField)); } }; var urlReg; var getUrlRegex = function() { if (urlReg) { return urlReg; } var word = "[a-fA-F\\d:]"; var b2 = function b22(options) { return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : ""; }; var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"; var v6seg = "[a-fA-F\\d]{1,4}"; var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(); var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)"); var v4exact = new RegExp("^" + v4 + "$"); var v6exact = new RegExp("^" + v6 + "$"); var ip = function ip2(options) { return options && options.exact ? v46Exact : new RegExp("(?:" + b2(options) + v4 + b2(options) + ")|(?:" + b2(options) + v6 + b2(options) + ")", "g"); }; ip.v4 = function(options) { return options && options.exact ? v4exact : new RegExp("" + b2(options) + v4 + b2(options), "g"); }; ip.v6 = function(options) { return options && options.exact ? v6exact : new RegExp("" + b2(options) + v6 + b2(options), "g"); }; var protocol = "(?:(?:[a-z]+:)?//)"; var auth = "(?:\\S+(?::\\S*)?@)?"; var ipv4 = ip.v4().source; var ipv6 = ip.v6().source; var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)"; var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"; var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"; var port = "(?::\\d{2,5})?"; var path2 = '(?:[/?#][^\\s"]*)?'; var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path2; urlReg = new RegExp("(?:^" + regex + "$)", "i"); return urlReg; }; var pattern$2 = { // http://emailregex.com/ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/, // url: new RegExp( // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', // 'i', // ), hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i }; var types = { integer: function integer(value) { return types.number(value) && parseInt(value, 10) === value; }, "float": function float(value) { return types.number(value) && !types.integer(value); }, array: function array(value) { return Array.isArray(value); }, regexp: function regexp(value) { if (value instanceof RegExp) { return true; } try { return !!new RegExp(value); } catch (e2) { return false; } }, date: function date(value) { return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime()); }, number: function number(value) { if (isNaN(value)) { return false; } return typeof value === "number"; }, object: function object(value) { return typeof value === "object" && !types.array(value); }, method: function method(value) { return typeof value === "function"; }, email: function email(value) { return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email); }, url: function url(value) { return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex()); }, hex: function hex(value) { return typeof value === "string" && !!value.match(pattern$2.hex); } }; var type$1 = function type(rule, value, source, errors, options) { if (rule.required && value === void 0) { required$1(rule, value, source, errors, options); return; } var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"]; var ruleType = rule.type; if (custom.indexOf(ruleType) > -1) { if (!types[ruleType](value)) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } } else if (ruleType && typeof value !== rule.type) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } }; var range = function range2(rule, value, source, errors, options) { var len = typeof rule.len === "number"; var min = typeof rule.min === "number"; var max = typeof rule.max === "number"; var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; var val = value; var key2 = null; var num = typeof value === "number"; var str = typeof value === "string"; var arr = Array.isArray(value); if (num) { key2 = "number"; } else if (str) { key2 = "string"; } else if (arr) { key2 = "array"; } if (!key2) { return false; } if (arr) { val = value.length; } if (str) { val = value.replace(spRegexp, "_").length; } if (len) { if (val !== rule.len) { errors.push(format(options.messages[key2].len, rule.fullField, rule.len)); } } else if (min && !max && val < rule.min) { errors.push(format(options.messages[key2].min, rule.fullField, rule.min)); } else if (max && !min && val > rule.max) { errors.push(format(options.messages[key2].max, rule.fullField, rule.max)); } else if (min && max && (val < rule.min || val > rule.max)) { errors.push(format(options.messages[key2].range, rule.fullField, rule.min, rule.max)); } }; var ENUM$1 = "enum"; var enumerable$1 = function enumerable(rule, value, source, errors, options) { rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : []; if (rule[ENUM$1].indexOf(value) === -1) { errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", "))); } }; var pattern$1 = function pattern(rule, value, source, errors, options) { if (rule.pattern) { if (rule.pattern instanceof RegExp) { rule.pattern.lastIndex = 0; if (!rule.pattern.test(value)) { errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); } } else if (typeof rule.pattern === "string") { var _pattern = new RegExp(rule.pattern); if (!_pattern.test(value)) { errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); } } } }; var rules = { required: required$1, whitespace, type: type$1, range, "enum": enumerable$1, pattern: pattern$1 }; var string = function string2(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, "string") && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options, "string"); if (!isEmptyValue(value, "string")) { rules.type(rule, value, source, errors, options); rules.range(rule, value, source, errors, options); rules.pattern(rule, value, source, errors, options); if (rule.whitespace === true) { rules.whitespace(rule, value, source, errors, options); } } } callback(errors); }; var method2 = function method3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); } } callback(errors); }; var number2 = function number3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (value === "") { value = void 0; } if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); rules.range(rule, value, source, errors, options); } } callback(errors); }; var _boolean = function _boolean2(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); } } callback(errors); }; var regexp2 = function regexp3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (!isEmptyValue(value)) { rules.type(rule, value, source, errors, options); } } callback(errors); }; var integer2 = function integer3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); rules.range(rule, value, source, errors, options); } } callback(errors); }; var floatFn = function floatFn2(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); rules.range(rule, value, source, errors, options); } } callback(errors); }; var array2 = function array3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if ((value === void 0 || value === null) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options, "array"); if (value !== void 0 && value !== null) { rules.type(rule, value, source, errors, options); rules.range(rule, value, source, errors, options); } } callback(errors); }; var object2 = function object3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules.type(rule, value, source, errors, options); } } callback(errors); }; var ENUM = "enum"; var enumerable2 = function enumerable3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (value !== void 0) { rules[ENUM](rule, value, source, errors, options); } } callback(errors); }; var pattern2 = function pattern3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, "string") && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (!isEmptyValue(value, "string")) { rules.pattern(rule, value, source, errors, options); } } callback(errors); }; var date2 = function date3(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, "date") && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); if (!isEmptyValue(value, "date")) { var dateObject; if (value instanceof Date) { dateObject = value; } else { dateObject = new Date(value); } rules.type(rule, dateObject, source, errors, options); if (dateObject) { rules.range(rule, dateObject.getTime(), source, errors, options); } } } callback(errors); }; var required2 = function required3(rule, value, callback, source, options) { var errors = []; var type4 = Array.isArray(value) ? "array" : typeof value; rules.required(rule, value, source, errors, options, type4); callback(errors); }; var type2 = function type3(rule, value, callback, source, options) { var ruleType = rule.type; var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value, ruleType) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options, ruleType); if (!isEmptyValue(value, ruleType)) { rules.type(rule, value, source, errors, options); } } callback(errors); }; var any = function any2(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } rules.required(rule, value, source, errors, options); } callback(errors); }; var validators = { string, method: method2, number: number2, "boolean": _boolean, regexp: regexp2, integer: integer2, "float": floatFn, array: array2, object: object2, "enum": enumerable2, pattern: pattern2, date: date2, url: type2, hex: type2, email: type2, required: required2, any }; function newMessages() { return { "default": "Validation error on field %s", required: "%s is required", "enum": "%s must be one of %s", whitespace: "%s cannot be empty", date: { format: "%s date %s is invalid for format %s", parse: "%s date could not be parsed, %s is invalid ", invalid: "%s date %s is invalid" }, types: { string: "%s is not a %s", method: "%s is not a %s (function)", array: "%s is not an %s", object: "%s is not an %s", number: "%s is not a %s", date: "%s is not a %s", "boolean": "%s is not a %s", integer: "%s is not an %s", "float": "%s is not a %s", regexp: "%s is not a valid %s", email: "%s is not a valid %s", url: "%s is not a valid %s", hex: "%s is not a valid %s" }, string: { len: "%s must be exactly %s characters", min: "%s must be at least %s characters", max: "%s cannot be longer than %s characters", range: "%s must be between %s and %s characters" }, number: { len: "%s must equal %s", min: "%s cannot be less than %s", max: "%s cannot be greater than %s", range: "%s must be between %s and %s" }, array: { len: "%s must be exactly %s in length", min: "%s cannot be less than %s in length", max: "%s cannot be greater than %s in length", range: "%s must be between %s and %s in length" }, pattern: { mismatch: "%s value %s does not match pattern %s" }, clone: function clone() { var cloned = JSON.parse(JSON.stringify(this)); cloned.clone = this.clone; return cloned; } }; } var messages = newMessages(); var Schema = /* @__PURE__ */ function() { function Schema2(descriptor) { this.rules = null; this._messages = messages; this.define(descriptor); } var _proto = Schema2.prototype; _proto.define = function define(rules2) { var _this = this; if (!rules2) { throw new Error("Cannot configure a schema with no rules"); } if (typeof rules2 !== "object" || Array.isArray(rules2)) { throw new Error("Rules must be an object"); } this.rules = {}; Object.keys(rules2).forEach(function(name) { var item = rules2[name]; _this.rules[name] = Array.isArray(item) ? item : [item]; }); }; _proto.messages = function messages2(_messages) { if (_messages) { this._messages = deepMerge(newMessages(), _messages); } return this._messages; }; _proto.validate = function validate(source_, o2, oc) { var _this2 = this; if (o2 === void 0) { o2 = {}; } if (oc === void 0) { oc = function oc2() { }; } var source = source_; var options = o2; var callback = oc; if (typeof options === "function") { callback = options; options = {}; } if (!this.rules || Object.keys(this.rules).length === 0) { if (callback) { callback(null, source); } return Promise.resolve(source); } function complete(results) { var errors = []; var fields = {}; function add(e2) { if (Array.isArray(e2)) { var _errors; errors = (_errors = errors).concat.apply(_errors, e2); } else { errors.push(e2); } } for (var i2 = 0; i2 < results.length; i2++) { add(results[i2]); } if (!errors.length) { callback(null, source); } else { fields = convertFieldsError(errors); callback(errors, fields); } } if (options.messages) { var messages$1 = this.messages(); if (messages$1 === messages) { messages$1 = newMessages(); } deepMerge(messages$1, options.messages); options.messages = messages$1; } else { options.messages = this.messages(); } var series = {}; var keys2 = options.keys || Object.keys(this.rules); keys2.forEach(function(z2) { var arr = _this2.rules[z2]; var value = source[z2]; arr.forEach(function(r2) { var rule = r2; if (typeof rule.transform === "function") { if (source === source_) { source = _extends({}, source); } value = source[z2] = rule.transform(value); } if (typeof rule === "function") { rule = { validator: rule }; } else { rule = _extends({}, rule); } rule.validator = _this2.getValidationMethod(rule); if (!rule.validator) { return; } rule.field = z2; rule.fullField = rule.fullField || z2; rule.type = _this2.getType(rule); series[z2] = series[z2] || []; series[z2].push({ rule, value, source, field: z2 }); }); }); var errorFields = {}; return asyncMap(series, options, function(data, doIt) { var rule = data.rule; var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object"); deep = deep && (rule.required || !rule.required && data.value); rule.field = data.field; function addFullField(key2, schema) { return _extends({}, schema, { fullField: rule.fullField + "." + key2, fullFields: rule.fullFields ? [].concat(rule.fullFields, [key2]) : [key2] }); } function cb(e2) { if (e2 === void 0) { e2 = []; } var errorList = Array.isArray(e2) ? e2 : [e2]; if (!options.suppressWarning && errorList.length) { Schema2.warning("async-validator:", errorList); } if (errorList.length && rule.message !== void 0) { errorList = [].concat(rule.message); } var filledErrors = errorList.map(complementError(rule, source)); if (options.first && filledErrors.length) { errorFields[rule.field] = 1; return doIt(filledErrors); } if (!deep) { doIt(filledErrors); } else { if (rule.required && !data.value) { if (rule.message !== void 0) { filledErrors = [].concat(rule.message).map(complementError(rule, source)); } else if (options.error) { filledErrors = [options.error(rule, format(options.messages.required, rule.field))]; } return doIt(filledErrors); } var fieldsSchema = {}; if (rule.defaultField) { Object.keys(data.value).map(function(key2) { fieldsSchema[key2] = rule.defaultField; }); } fieldsSchema = _extends({}, fieldsSchema, data.rule.fields); var paredFieldsSchema = {}; Object.keys(fieldsSchema).forEach(function(field) { var fieldSchema = fieldsSchema[field]; var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema]; paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field)); }); var schema = new Schema2(paredFieldsSchema); schema.messages(options.messages); if (data.rule.options) { data.rule.options.messages = options.messages; data.rule.options.error = options.error; } schema.validate(data.value, data.rule.options || options, function(errs) { var finalErrors = []; if (filledErrors && filledErrors.length) { finalErrors.push.apply(finalErrors, filledErrors); } if (errs && errs.length) { finalErrors.push.apply(finalErrors, errs); } doIt(finalErrors.length ? finalErrors : null); }); } } var res; if (rule.asyncValidator) { res = rule.asyncValidator(rule, data.value, cb, data.source, options); } else if (rule.validator) { try { res = rule.validator(rule, data.value, cb, data.source, options); } catch (error) { console.error == null ? void 0 : console.error(error); if (!options.suppressValidatorError) { setTimeout(function() { throw error; }, 0); } cb(error.message); } if (res === true) { cb(); } else if (res === false) { cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails"); } else if (res instanceof Array) { cb(res); } else if (res instanceof Error) { cb(res.message); } } if (res && res.then) { res.then(function() { return cb(); }, function(e2) { return cb(e2); }); } }, function(results) { complete(results); }, source); }; _proto.getType = function getType(rule) { if (rule.type === void 0 && rule.pattern instanceof RegExp) { rule.type = "pattern"; } if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) { throw new Error(format("Unknown rule type %s", rule.type)); } return rule.type || "string"; }; _proto.getValidationMethod = function getValidationMethod(rule) { if (typeof rule.validator === "function") { return rule.validator; } var keys2 = Object.keys(rule); var messageIndex = keys2.indexOf("message"); if (messageIndex !== -1) { keys2.splice(messageIndex, 1); } if (keys2.length === 1 && keys2[0] === "required") { return validators.required; } return validators[this.getType(rule)] || void 0; }; return Schema2; }(); Schema.register = function register(type4, validator) { if (typeof validator !== "function") { throw new Error("Cannot register a validator by type, validator is not a function"); } validators[type4] = validator; }; Schema.warning = warning; Schema.messages = messages; Schema.validators = validators; function toArray$1(value) { if (value === void 0 || value === null) { return []; } return Array.isArray(value) ? value : [value]; } function get(entity, path2) { let current = entity; for (let i2 = 0; i2 < path2.length; i2 += 1) { if (current === null || current === void 0) { return void 0; } current = current[path2[i2]]; } return current; } function internalSet(entity, paths, value, removeIfUndefined) { if (!paths.length) { return value; } const [path2, ...restPath] = paths; let clone; if (!entity && typeof path2 === "number") { clone = []; } else if (Array.isArray(entity)) { clone = [...entity]; } else { clone = _extends$1({}, entity); } if (removeIfUndefined && value === void 0 && restPath.length === 1) { delete clone[path2][restPath[0]]; } else { clone[path2] = internalSet(clone[path2], restPath, value, removeIfUndefined); } return clone; } function set(entity, paths, value) { let removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) { return entity; } return internalSet(entity, paths, value, removeIfUndefined); } function getNamePath(path2) { return toArray$1(path2); } function getValue(store, namePath) { const value = get(store, namePath); return value; } function setValue(store, namePath, value) { let removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; const newStore = set(store, namePath, value, removeIfUndefined); return newStore; } function containsNamePath(namePathList, namePath) { return namePathList && namePathList.some((path2) => matchNamePath(path2, namePath)); } function isObject$1(obj) { return typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype; } function internalSetValues(store, values) { const newStore = Array.isArray(store) ? [...store] : _extends$1({}, store); if (!values) { return newStore; } Object.keys(values).forEach((key2) => { const prevValue = newStore[key2]; const value = values[key2]; const recursive = isObject$1(prevValue) && isObject$1(value); newStore[key2] = recursive ? internalSetValues(prevValue, value || {}) : value; }); return newStore; } function setValues(store) { for (var _len = arguments.length, restValues = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { restValues[_key - 1] = arguments[_key]; } return restValues.reduce((current, newStore) => internalSetValues(current, newStore), store); } function cloneByNamePathList(store, namePathList) { let newStore = {}; namePathList.forEach((namePath) => { const value = getValue(store, namePath); newStore = setValue(newStore, namePath, value); }); return newStore; } function matchNamePath(namePath, changedNamePath) { if (!namePath || !changedNamePath || namePath.length !== changedNamePath.length) { return false; } return namePath.every((nameUnit, i2) => changedNamePath[i2] === nameUnit); } const typeTemplate$1 = "'${name}' is not a valid ${type}"; const defaultValidateMessages = { default: "Validation error on field '${name}'", required: "'${name}' is required", enum: "'${name}' must be one of [${enum}]", whitespace: "'${name}' cannot be empty", date: { format: "'${name}' is invalid for format date", parse: "'${name}' could not be parsed as date", invalid: "'${name}' is invalid date" }, types: { string: typeTemplate$1, method: typeTemplate$1, array: typeTemplate$1, object: typeTemplate$1, number: typeTemplate$1, date: typeTemplate$1, boolean: typeTemplate$1, integer: typeTemplate$1, float: typeTemplate$1, regexp: typeTemplate$1, email: typeTemplate$1, url: typeTemplate$1, hex: typeTemplate$1 }, string: { len: "'${name}' must be exactly ${len} characters", min: "'${name}' must be at least ${min} characters", max: "'${name}' cannot be longer than ${max} characters", range: "'${name}' must be between ${min} and ${max} characters" }, number: { len: "'${name}' must equal ${len}", min: "'${name}' cannot be less than ${min}", max: "'${name}' cannot be greater than ${max}", range: "'${name}' must be between ${min} and ${max}" }, array: { len: "'${name}' must be exactly ${len} in length", min: "'${name}' cannot be less than ${min} in length", max: "'${name}' cannot be greater than ${max} in length", range: "'${name}' must be between ${min} and ${max} in length" }, pattern: { mismatch: "'${name}' does not match pattern ${pattern}" } }; var __awaiter = function(thisArg, _arguments, P2, generator) { function adopt(value) { return value instanceof P2 ? value : new P2(function(resolve2) { resolve2(value); }); } return new (P2 || (P2 = Promise))(function(resolve2, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e2) { reject(e2); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e2) { reject(e2); } } function step(result) { result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, [])).next()); }); }; const AsyncValidator = Schema; function replaceMessage(template, kv) { return template.replace(/\$\{\w+\}/g, (str) => { const key2 = str.slice(2, -1); return kv[key2]; }); } function validateRule(name, value, rule, options, messageVariables) { return __awaiter(this, void 0, void 0, function* () { const cloneRule = _extends$1({}, rule); delete cloneRule.ruleIndex; delete cloneRule.trigger; let subRuleField = null; if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) { subRuleField = cloneRule.defaultField; delete cloneRule.defaultField; } const validator = new AsyncValidator({ [name]: [cloneRule] }); const messages2 = setValues({}, defaultValidateMessages, options.validateMessages); validator.messages(messages2); let result = []; try { yield Promise.resolve(validator.validate({ [name]: value }, _extends$1({}, options))); } catch (errObj) { if (errObj.errors) { result = errObj.errors.map((_ref, index2) => { let { message } = _ref; return ( // Wrap VueNode with `key` isValidElement(message) ? cloneVNode(message, { key: `error_${index2}` }) : message ); }); } else { console.error(errObj); result = [messages2.default()]; } } if (!result.length && subRuleField) { const subResults = yield Promise.all(value.map((subValue, i2) => validateRule(`${name}.${i2}`, subValue, subRuleField, options, messageVariables))); return subResults.reduce((prev2, errors) => [...prev2, ...errors], []); } const kv = _extends$1(_extends$1(_extends$1({}, rule), { name, enum: (rule.enum || []).join(", ") }), messageVariables); const fillVariableResult = result.map((error) => { if (typeof error === "string") { return replaceMessage(error, kv); } return error; }); return fillVariableResult; }); } function validateRules(namePath, value, rules2, options, validateFirst, messageVariables) { const name = namePath.join("."); const filledRules = rules2.map((currentRule, ruleIndex) => { const originValidatorFunc = currentRule.validator; const cloneRule = _extends$1(_extends$1({}, currentRule), { ruleIndex }); if (originValidatorFunc) { cloneRule.validator = (rule, val, callback) => { let hasPromise = false; const wrappedCallback = function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } Promise.resolve().then(() => { if (!hasPromise) { callback(...args); } }); }; const promise = originValidatorFunc(rule, val, wrappedCallback); hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function"; if (hasPromise) { promise.then(() => { callback(); }).catch((err) => { callback(err || " "); }); } }; } return cloneRule; }).sort((_ref2, _ref3) => { let { warningOnly: w1, ruleIndex: i1 } = _ref2; let { warningOnly: w2, ruleIndex: i2 } = _ref3; if (!!w1 === !!w2) { return i1 - i2; } if (w1) { return 1; } return -1; }); let summaryPromise; if (validateFirst === true) { summaryPromise = new Promise((resolve2, reject) => __awaiter(this, void 0, void 0, function* () { for (let i2 = 0; i2 < filledRules.length; i2 += 1) { const rule = filledRules[i2]; const errors = yield validateRule(name, value, rule, options, messageVariables); if (errors.length) { reject([{ errors, rule }]); return; } } resolve2([]); })); } else { const rulePromises = filledRules.map((rule) => validateRule(name, value, rule, options, messageVariables).then((errors) => ({ errors, rule }))); summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then((errors) => { return Promise.reject(errors); }); } summaryPromise.catch((e2) => e2); return summaryPromise; } function finishOnAllFailed(rulePromises) { return __awaiter(this, void 0, void 0, function* () { return Promise.all(rulePromises).then((errorsList) => { const errors = [].concat(...errorsList); return errors; }); }); } function finishOnFirstFailed(rulePromises) { return __awaiter(this, void 0, void 0, function* () { let count = 0; return new Promise((resolve2) => { rulePromises.forEach((promise) => { promise.then((ruleError) => { if (ruleError.errors.length) { resolve2([ruleError]); } count += 1; if (count === rulePromises.length) { resolve2([]); } }); }); }); }); } const FormContextKey = Symbol("formContextKey"); const useProvideForm = (state) => { provide(FormContextKey, state); }; const useInjectForm = () => { return inject(FormContextKey, { name: computed(() => void 0), labelAlign: computed(() => "right"), vertical: computed(() => false), // eslint-disable-next-line @typescript-eslint/no-unused-vars addField: (_eventKey, _field) => { }, // eslint-disable-next-line @typescript-eslint/no-unused-vars removeField: (_eventKey) => { }, model: computed(() => void 0), rules: computed(() => void 0), colon: computed(() => void 0), labelWrap: computed(() => void 0), labelCol: computed(() => void 0), requiredMark: computed(() => false), validateTrigger: computed(() => void 0), onValidate: () => { }, validateMessages: computed(() => defaultValidateMessages) }); }; const FormItemPrefixContextKey = Symbol("formItemPrefixContextKey"); const useProvideFormItemPrefix = (state) => { provide(FormItemPrefixContextKey, state); }; const useInjectFormItemPrefix = () => { return inject(FormItemPrefixContextKey, { prefixCls: computed(() => "") }); }; function parseFlex(flex) { if (typeof flex === "number") { return `${flex} ${flex} auto`; } if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) { return `0 0 ${flex}`; } return flex; } const colProps = () => ({ span: [String, Number], order: [String, Number], offset: [String, Number], push: [String, Number], pull: [String, Number], xs: { type: [String, Number, Object], default: void 0 }, sm: { type: [String, Number, Object], default: void 0 }, md: { type: [String, Number, Object], default: void 0 }, lg: { type: [String, Number, Object], default: void 0 }, xl: { type: [String, Number, Object], default: void 0 }, xxl: { type: [String, Number, Object], default: void 0 }, prefixCls: String, flex: [String, Number] }); const sizes = ["xs", "sm", "md", "lg", "xl", "xxl"]; const Col$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ACol", inheritAttrs: false, props: colProps(), setup(props2, _ref) { let { slots, attrs } = _ref; const { gutter, supportFlexGap, wrap } = useInjectRow(); const { prefixCls, direction } = useConfigInject("col", props2); const [wrapSSR, hashId] = useColStyle(prefixCls); const classes = computed(() => { const { span, order, offset: offset2, push, pull } = props2; const pre = prefixCls.value; let sizeClassObj = {}; sizes.forEach((size) => { let sizeProps = {}; const propSize = props2[size]; if (typeof propSize === "number") { sizeProps.span = propSize; } else if (typeof propSize === "object") { sizeProps = propSize || {}; } sizeClassObj = _extends$1(_extends$1({}, sizeClassObj), { [`${pre}-${size}-${sizeProps.span}`]: sizeProps.span !== void 0, [`${pre}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0, [`${pre}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0, [`${pre}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0, [`${pre}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0, [`${pre}-rtl`]: direction.value === "rtl" }); }); return classNames(pre, { [`${pre}-${span}`]: span !== void 0, [`${pre}-order-${order}`]: order, [`${pre}-offset-${offset2}`]: offset2, [`${pre}-push-${push}`]: push, [`${pre}-pull-${pull}`]: pull }, sizeClassObj, attrs.class, hashId.value); }); const mergedStyle = computed(() => { const { flex } = props2; const gutterVal = gutter.value; const style = {}; if (gutterVal && gutterVal[0] > 0) { const horizontalGutter = `${gutterVal[0] / 2}px`; style.paddingLeft = horizontalGutter; style.paddingRight = horizontalGutter; } if (gutterVal && gutterVal[1] > 0 && !supportFlexGap.value) { const verticalGutter = `${gutterVal[1] / 2}px`; style.paddingTop = verticalGutter; style.paddingBottom = verticalGutter; } if (flex) { style.flex = parseFlex(flex); if (wrap.value === false && !style.minWidth) { style.minWidth = 0; } } return style; }); return () => { var _a; return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": classes.value, "style": [mergedStyle.value, attrs.style] }), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])); }; } }); var QuestionCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, "name": "question-circle", "theme": "outlined" }; function _objectSpread$e(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$e(target, key2, source[key2]); }); } return target; } function _defineProperty$e(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var QuestionCircleOutlined = function QuestionCircleOutlined2(props2, context2) { var p2 = _objectSpread$e({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$e({}, p2, { "icon": QuestionCircleOutlined$1 }), null); }; QuestionCircleOutlined.displayName = "QuestionCircleOutlined"; QuestionCircleOutlined.inheritAttrs = false; const FormItemLabel = (props2, _ref) => { let { slots, emit: emit2, attrs } = _ref; var _a, _b, _c, _d, _e; const { prefixCls, htmlFor, labelCol, labelAlign, colon, required, requiredMark } = _extends$1(_extends$1({}, props2), attrs); const [formLocale] = useLocaleReceiver("Form"); const label = (_a = props2.label) !== null && _a !== void 0 ? _a : (_b = slots.label) === null || _b === void 0 ? void 0 : _b.call(slots); if (!label) return null; const { vertical, labelAlign: contextLabelAlign, labelCol: contextLabelCol, labelWrap, colon: contextColon } = useInjectForm(); const mergedLabelCol = labelCol || (contextLabelCol === null || contextLabelCol === void 0 ? void 0 : contextLabelCol.value) || {}; const mergedLabelAlign = labelAlign || (contextLabelAlign === null || contextLabelAlign === void 0 ? void 0 : contextLabelAlign.value); const labelClsBasic = `${prefixCls}-item-label`; const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === "left" && `${labelClsBasic}-left`, mergedLabelCol.class, { [`${labelClsBasic}-wrap`]: !!labelWrap.value }); let labelChildren = label; const computedColon = colon === true || (contextColon === null || contextColon === void 0 ? void 0 : contextColon.value) !== false && colon !== false; const haveColon = computedColon && !vertical.value; if (haveColon && typeof label === "string" && label.trim() !== "") { labelChildren = label.replace(/[:|:]\s*$/, ""); } if (props2.tooltip || slots.tooltip) { const tooltipNode = createVNode("span", { "class": `${prefixCls}-item-tooltip` }, [createVNode(Tooltip, { "title": props2.tooltip }, { default: () => [createVNode(QuestionCircleOutlined, null, null)] })]); labelChildren = createVNode(Fragment, null, [labelChildren, slots.tooltip ? (_c = slots.tooltip) === null || _c === void 0 ? void 0 : _c.call(slots, { class: `${prefixCls}-item-tooltip` }) : tooltipNode]); } if (requiredMark === "optional" && !required) { labelChildren = createVNode(Fragment, null, [labelChildren, createVNode("span", { "class": `${prefixCls}-item-optional` }, [((_d = formLocale.value) === null || _d === void 0 ? void 0 : _d.optional) || ((_e = localeValues$1.Form) === null || _e === void 0 ? void 0 : _e.optional)])]); } const labelClassName = classNames({ [`${prefixCls}-item-required`]: required, [`${prefixCls}-item-required-mark-optional`]: requiredMark === "optional", [`${prefixCls}-item-no-colon`]: !computedColon }); return createVNode(Col$1, _objectSpread2$1(_objectSpread2$1({}, mergedLabelCol), {}, { "class": labelColClassName }), { default: () => [createVNode("label", { "for": htmlFor, "class": labelClassName, "title": typeof label === "string" ? label : "", "onClick": (e2) => emit2("click", e2) }, [labelChildren])] }); }; FormItemLabel.displayName = "FormItemLabel"; FormItemLabel.inheritAttrs = false; const genFormValidateMotionStyle = (token2) => { const { componentCls } = token2; const helpCls = `${componentCls}-show-help`; const helpItemCls = `${componentCls}-show-help-item`; return { [helpCls]: { // Explain holder transition: `opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut}`, "&-appear, &-enter": { opacity: 0, "&-active": { opacity: 1 } }, "&-leave": { opacity: 1, "&-active": { opacity: 0 } }, // Explain [helpItemCls]: { overflow: "hidden", transition: `height ${token2.motionDurationSlow} ${token2.motionEaseInOut}, opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut}, transform ${token2.motionDurationSlow} ${token2.motionEaseInOut} !important`, [`&${helpItemCls}-appear, &${helpItemCls}-enter`]: { transform: `translateY(-5px)`, opacity: 0, [`&-active`]: { transform: "translateY(0)", opacity: 1 } }, [`&${helpItemCls}-leave-active`]: { transform: `translateY(-5px)` } } } }; }; const resetForm = (token2) => ({ legend: { display: "block", width: "100%", marginBottom: token2.marginLG, padding: 0, color: token2.colorTextDescription, fontSize: token2.fontSizeLG, lineHeight: "inherit", border: 0, borderBottom: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}` }, label: { fontSize: token2.fontSize }, 'input[type="search"]': { boxSizing: "border-box" }, // Position radios and checkboxes better 'input[type="radio"], input[type="checkbox"]': { lineHeight: "normal" }, 'input[type="file"]': { display: "block" }, // Make range inputs behave like textual form controls 'input[type="range"]': { display: "block", width: "100%" }, // Make multiple select elements height not fixed "select[multiple], select[size]": { height: "auto" }, // Focus for file, radio, and checkbox [`input[type='file']:focus, input[type='radio']:focus, input[type='checkbox']:focus`]: { outline: 0, boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${token2.controlOutline}` }, // Adjust output element output: { display: "block", paddingTop: 15, color: token2.colorText, fontSize: token2.fontSize, lineHeight: token2.lineHeight } }); const genFormSize = (token2, height) => { const { formItemCls } = token2; return { [formItemCls]: { [`${formItemCls}-label > label`]: { height }, [`${formItemCls}-control-input`]: { minHeight: height } } }; }; const genFormStyle = (token2) => { const { componentCls } = token2; return { [token2.componentCls]: _extends$1(_extends$1(_extends$1({}, resetComponent(token2)), resetForm(token2)), { [`${componentCls}-text`]: { display: "inline-block", paddingInlineEnd: token2.paddingSM }, // ================================================================ // = Size = // ================================================================ "&-small": _extends$1({}, genFormSize(token2, token2.controlHeightSM)), "&-large": _extends$1({}, genFormSize(token2, token2.controlHeightLG)) }) }; }; const genFormItemStyle = (token2) => { const { formItemCls, iconCls, componentCls, rootPrefixCls } = token2; return { [formItemCls]: _extends$1(_extends$1({}, resetComponent(token2)), { marginBottom: token2.marginLG, verticalAlign: "top", "&-with-help": { transition: "none" }, [`&-hidden, &-hidden.${rootPrefixCls}-row`]: { // https://github.com/ant-design/ant-design/issues/26141 display: "none" }, "&-has-warning": { [`${formItemCls}-split`]: { color: token2.colorError } }, "&-has-error": { [`${formItemCls}-split`]: { color: token2.colorWarning } }, // ============================================================== // = Label = // ============================================================== [`${formItemCls}-label`]: { display: "inline-block", flexGrow: 0, overflow: "hidden", whiteSpace: "nowrap", textAlign: "end", verticalAlign: "middle", "&-left": { textAlign: "start" }, "&-wrap": { overflow: "unset", lineHeight: `${token2.lineHeight} - 0.25em`, whiteSpace: "unset" }, "> label": { position: "relative", display: "inline-flex", alignItems: "center", maxWidth: "100%", height: token2.controlHeight, color: token2.colorTextHeading, fontSize: token2.fontSize, [`> ${iconCls}`]: { fontSize: token2.fontSize, verticalAlign: "top" }, // Required mark [`&${formItemCls}-required:not(${formItemCls}-required-mark-optional)::before`]: { display: "inline-block", marginInlineEnd: token2.marginXXS, color: token2.colorError, fontSize: token2.fontSize, fontFamily: "SimSun, sans-serif", lineHeight: 1, content: '"*"', [`${componentCls}-hide-required-mark &`]: { display: "none" } }, // Optional mark [`${formItemCls}-optional`]: { display: "inline-block", marginInlineStart: token2.marginXXS, color: token2.colorTextDescription, [`${componentCls}-hide-required-mark &`]: { display: "none" } }, // Optional mark [`${formItemCls}-tooltip`]: { color: token2.colorTextDescription, cursor: "help", writingMode: "horizontal-tb", marginInlineStart: token2.marginXXS }, "&::after": { content: '":"', position: "relative", marginBlock: 0, marginInlineStart: token2.marginXXS / 2, marginInlineEnd: token2.marginXS }, [`&${formItemCls}-no-colon::after`]: { content: '" "' } } }, // ============================================================== // = Input = // ============================================================== [`${formItemCls}-control`]: { display: "flex", flexDirection: "column", flexGrow: 1, [`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: { width: "100%" }, "&-input": { position: "relative", display: "flex", alignItems: "center", minHeight: token2.controlHeight, "&-content": { flex: "auto", maxWidth: "100%" } } }, // ============================================================== // = Explain = // ============================================================== [formItemCls]: { "&-explain, &-extra": { clear: "both", color: token2.colorTextDescription, fontSize: token2.fontSize, lineHeight: token2.lineHeight }, "&-explain-connected": { width: "100%" }, "&-extra": { minHeight: token2.controlHeightSM, transition: `color ${token2.motionDurationMid} ${token2.motionEaseOut}` // sync input color transition }, "&-explain": { "&-error": { color: token2.colorError }, "&-warning": { color: token2.colorWarning } } }, [`&-with-help ${formItemCls}-explain`]: { height: "auto", opacity: 1 }, // ============================================================== // = Feedback Icon = // ============================================================== [`${formItemCls}-feedback-icon`]: { fontSize: token2.fontSize, textAlign: "center", visibility: "visible", animationName: zoomIn, animationDuration: token2.motionDurationMid, animationTimingFunction: token2.motionEaseOutBack, pointerEvents: "none", "&-success": { color: token2.colorSuccess }, "&-error": { color: token2.colorError }, "&-warning": { color: token2.colorWarning }, "&-validating": { color: token2.colorPrimary } } }) }; }; const genHorizontalStyle$1 = (token2) => { const { componentCls, formItemCls, rootPrefixCls } = token2; return { [`${componentCls}-horizontal`]: { [`${formItemCls}-label`]: { flexGrow: 0 }, [`${formItemCls}-control`]: { flex: "1 1 0", // https://github.com/ant-design/ant-design/issues/32777 // https://github.com/ant-design/ant-design/issues/33773 minWidth: 0 }, // https://github.com/ant-design/ant-design/issues/32980 [`${formItemCls}-label.${rootPrefixCls}-col-24 + ${formItemCls}-control`]: { minWidth: "unset" } } }; }; const genInlineStyle = (token2) => { const { componentCls, formItemCls } = token2; return { [`${componentCls}-inline`]: { display: "flex", flexWrap: "wrap", [formItemCls]: { flex: "none", flexWrap: "nowrap", marginInlineEnd: token2.margin, marginBottom: 0, "&-with-help": { marginBottom: token2.marginLG }, [`> ${formItemCls}-label, > ${formItemCls}-control`]: { display: "inline-block", verticalAlign: "top" }, [`> ${formItemCls}-label`]: { flex: "none" }, [`${componentCls}-text`]: { display: "inline-block" }, [`${formItemCls}-has-feedback`]: { display: "inline-block" } } } }; }; const makeVerticalLayoutLabel = (token2) => ({ margin: 0, padding: `0 0 ${token2.paddingXS}px`, whiteSpace: "initial", textAlign: "start", "> label": { margin: 0, "&::after": { display: "none" } } }); const makeVerticalLayout = (token2) => { const { componentCls, formItemCls } = token2; return { [`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token2), [componentCls]: { [formItemCls]: { flexWrap: "wrap", [`${formItemCls}-label, ${formItemCls}-control`]: { flex: "0 0 100%", maxWidth: "100%" } } } }; }; const genVerticalStyle$1 = (token2) => { const { componentCls, formItemCls, rootPrefixCls } = token2; return { [`${componentCls}-vertical`]: { [formItemCls]: { "&-row": { flexDirection: "column" }, "&-label > label": { height: "auto" }, [`${componentCls}-item-control`]: { width: "100%" } } }, [`${componentCls}-vertical ${formItemCls}-label, .${rootPrefixCls}-col-24${formItemCls}-label, .${rootPrefixCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2), [`@media (max-width: ${token2.screenXSMax}px)`]: [makeVerticalLayout(token2), { [componentCls]: { [`.${rootPrefixCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2) } }], [`@media (max-width: ${token2.screenSMMax}px)`]: { [componentCls]: { [`.${rootPrefixCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2) } }, [`@media (max-width: ${token2.screenMDMax}px)`]: { [componentCls]: { [`.${rootPrefixCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2) } }, [`@media (max-width: ${token2.screenLGMax}px)`]: { [componentCls]: { [`.${rootPrefixCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2) } } }; }; const useStyle$6 = genComponentStyleHook("Form", (token2, _ref) => { let { rootPrefixCls } = _ref; const formToken = merge(token2, { formItemCls: `${token2.componentCls}-item`, rootPrefixCls }); return [genFormStyle(formToken), genFormItemStyle(formToken), genFormValidateMotionStyle(formToken), genHorizontalStyle$1(formToken), genInlineStyle(formToken), genVerticalStyle$1(formToken), genCollapseMotion(formToken), zoomIn]; }); const ErrorList = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ErrorList", inheritAttrs: false, props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"], setup(props2, _ref) { let { attrs } = _ref; const { prefixCls, status } = useInjectFormItemPrefix(); const baseClassName = computed(() => `${prefixCls.value}-item-explain`); const visible = computed(() => !!(props2.errors && props2.errors.length)); const innerStatus = ref(status.value); const [, hashId] = useStyle$6(prefixCls); watch([visible, status], () => { if (visible.value) { innerStatus.value = status.value; } }); return () => { var _a, _b; const colMItem = collapseMotion(`${prefixCls.value}-show-help-item`); const transitionGroupProps = getTransitionGroupProps(`${prefixCls.value}-show-help-item`, colMItem); transitionGroupProps.role = "alert"; transitionGroupProps.class = [hashId.value, baseClassName.value, attrs.class, `${prefixCls.value}-show-help`]; return createVNode(Transition, _objectSpread2$1(_objectSpread2$1({}, getTransitionProps(`${prefixCls.value}-show-help`)), {}, { "onAfterEnter": () => props2.onErrorVisibleChanged(true), "onAfterLeave": () => props2.onErrorVisibleChanged(false) }), { default: () => [withDirectives(createVNode(TransitionGroup, _objectSpread2$1(_objectSpread2$1({}, transitionGroupProps), {}, { "tag": "div" }), { default: () => [(_b = props2.errors) === null || _b === void 0 ? void 0 : _b.map((error, index2) => createVNode("div", { "key": index2, "class": innerStatus.value ? `${baseClassName.value}-${innerStatus.value}` : "" }, [error]))] }), [[vShow, !!((_a = props2.errors) === null || _a === void 0 ? void 0 : _a.length)]])] }); }; } }); const FormItemInput = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, slots: Object, inheritAttrs: false, props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"], setup(props2, _ref) { let { slots } = _ref; const formContext = useInjectForm(); const { wrapperCol: contextWrapperCol } = formContext; const subFormContext = _extends$1({}, formContext); delete subFormContext.labelCol; delete subFormContext.wrapperCol; useProvideForm(subFormContext); useProvideFormItemPrefix({ prefixCls: computed(() => props2.prefixCls), status: computed(() => props2.status) }); return () => { var _a, _b, _c; const { prefixCls, wrapperCol, marginBottom, onErrorVisibleChanged, help = (_a = slots.help) === null || _a === void 0 ? void 0 : _a.call(slots), errors = filterEmpty((_b = slots.errors) === null || _b === void 0 ? void 0 : _b.call(slots)), // hasFeedback, // status, extra = (_c = slots.extra) === null || _c === void 0 ? void 0 : _c.call(slots) } = props2; const baseClassName = `${prefixCls}-item`; const mergedWrapperCol = wrapperCol || (contextWrapperCol === null || contextWrapperCol === void 0 ? void 0 : contextWrapperCol.value) || {}; const className = classNames(`${baseClassName}-control`, mergedWrapperCol.class); return createVNode(Col$1, _objectSpread2$1(_objectSpread2$1({}, mergedWrapperCol), {}, { "class": className }), { default: () => { var _a2; return createVNode(Fragment, null, [createVNode("div", { "class": `${baseClassName}-control-input` }, [createVNode("div", { "class": `${baseClassName}-control-input-content` }, [(_a2 = slots.default) === null || _a2 === void 0 ? void 0 : _a2.call(slots)])]), marginBottom !== null || errors.length ? createVNode("div", { "style": { display: "flex", flexWrap: "nowrap" } }, [createVNode(ErrorList, { "errors": errors, "help": help, "class": `${baseClassName}-explain-connected`, "onErrorVisibleChanged": onErrorVisibleChanged }, null), !!marginBottom && createVNode("div", { "style": { width: 0, height: `${marginBottom}px` } }, null)]) : null, extra ? createVNode("div", { "class": `${baseClassName}-extra` }, [extra]) : null]); } }); }; } }); function useDebounce(value) { const cacheValue = shallowRef(value.value.slice()); let timeout = null; watchEffect(() => { clearTimeout(timeout); timeout = setTimeout(() => { cacheValue.value = value.value; }, value.value.length ? 0 : 10); }); return cacheValue; } tuple("success", "warning", "error", "validating", ""); const iconMap = { success: CheckCircleFilled, warning: ExclamationCircleFilled, error: CloseCircleFilled, validating: LoadingOutlined }; function getPropByPath$1(obj, namePathList, strict) { let tempObj = obj; const keyArr = namePathList; let i2 = 0; try { for (let len = keyArr.length; i2 < len - 1; ++i2) { if (!tempObj && !strict) break; const key2 = keyArr[i2]; if (key2 in tempObj) { tempObj = tempObj[key2]; } else { if (strict) { throw Error("please transfer a valid name path to form item!"); } break; } } if (strict && !tempObj) { throw Error("please transfer a valid name path to form item!"); } } catch (error) { console.error("please transfer a valid name path to form item!"); } return { o: tempObj, k: keyArr[i2], v: tempObj ? tempObj[keyArr[i2]] : void 0 }; } const formItemProps = () => ({ htmlFor: String, prefixCls: String, label: PropTypes.any, help: PropTypes.any, extra: PropTypes.any, labelCol: { type: Object }, wrapperCol: { type: Object }, hasFeedback: { type: Boolean, default: false }, colon: { type: Boolean, default: void 0 }, labelAlign: String, prop: { type: [String, Number, Array] }, name: { type: [String, Number, Array] }, rules: [Array, Object], autoLink: { type: Boolean, default: true }, required: { type: Boolean, default: void 0 }, validateFirst: { type: Boolean, default: void 0 }, validateStatus: PropTypes.oneOf(tuple("", "success", "warning", "error", "validating")), validateTrigger: { type: [String, Array] }, messageVariables: { type: Object }, hidden: Boolean, noStyle: Boolean, tooltip: String }); let indexGuid = 0; const defaultItemNamePrefixCls = "form_item"; const FormItem = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AFormItem", inheritAttrs: false, __ANT_NEW_FORM_ITEM: true, props: formItemProps(), slots: Object, setup(props2, _ref) { let { slots, attrs, expose } = _ref; warning$3(props2.prop === void 0); const eventKey = `form-item-${++indexGuid}`; const { prefixCls } = useConfigInject("form", props2); const [wrapSSR, hashId] = useStyle$6(prefixCls); const itemRef = shallowRef(); const formContext = useInjectForm(); const fieldName = computed(() => props2.name || props2.prop); const errors = shallowRef([]); const validateDisabled = shallowRef(false); const inputRef = shallowRef(); const namePath = computed(() => { const val = fieldName.value; return getNamePath(val); }); const fieldId = computed(() => { if (!namePath.value.length) { return void 0; } else { const formName = formContext.name.value; const mergedId = namePath.value.join("_"); return formName ? `${formName}_${mergedId}` : `${defaultItemNamePrefixCls}_${mergedId}`; } }); const getNewFieldValue = () => { const model = formContext.model.value; if (!model || !fieldName.value) { return; } else { return getPropByPath$1(model, namePath.value, true).v; } }; const fieldValue = computed(() => getNewFieldValue()); const initialValue = shallowRef(cloneDeep(fieldValue.value)); const mergedValidateTrigger = computed(() => { let validateTrigger = props2.validateTrigger !== void 0 ? props2.validateTrigger : formContext.validateTrigger.value; validateTrigger = validateTrigger === void 0 ? "change" : validateTrigger; return toArray$1(validateTrigger); }); const rulesRef = computed(() => { let formRules = formContext.rules.value; const selfRules = props2.rules; const requiredRule = props2.required !== void 0 ? { required: !!props2.required, trigger: mergedValidateTrigger.value } : []; const prop = getPropByPath$1(formRules, namePath.value); formRules = formRules ? prop.o[prop.k] || prop.v : []; const rules2 = [].concat(selfRules || formRules || []); if (find(rules2, (rule) => rule.required)) { return rules2; } else { return rules2.concat(requiredRule); } }); const isRequired2 = computed(() => { const rules2 = rulesRef.value; let isRequired3 = false; if (rules2 && rules2.length) { rules2.every((rule) => { if (rule.required) { isRequired3 = true; return false; } return true; }); } return isRequired3 || props2.required; }); const validateState = shallowRef(); watchEffect(() => { validateState.value = props2.validateStatus; }); const messageVariables = computed(() => { let variables = {}; if (typeof props2.label === "string") { variables.label = props2.label; } else if (props2.name) { variables.label = String(props2.name); } if (props2.messageVariables) { variables = _extends$1(_extends$1({}, variables), props2.messageVariables); } return variables; }); const validateRules$1 = (options) => { if (namePath.value.length === 0) { return; } const { validateFirst = false } = props2; const { triggerName } = options || {}; let filteredRules = rulesRef.value; if (triggerName) { filteredRules = filteredRules.filter((rule) => { const { trigger: trigger2 } = rule; if (!trigger2 && !mergedValidateTrigger.value.length) { return true; } const triggerList = toArray$1(trigger2 || mergedValidateTrigger.value); return triggerList.includes(triggerName); }); } if (!filteredRules.length) { return Promise.resolve(); } const promise = validateRules(namePath.value, fieldValue.value, filteredRules, _extends$1({ validateMessages: formContext.validateMessages.value }, options), validateFirst, messageVariables.value); validateState.value = "validating"; errors.value = []; promise.catch((e2) => e2).then(function() { let results = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; if (validateState.value === "validating") { const res = results.filter((result) => result && result.errors.length); validateState.value = res.length ? "error" : "success"; errors.value = res.map((r2) => r2.errors); formContext.onValidate(fieldName.value, !errors.value.length, errors.value.length ? toRaw(errors.value[0]) : null); } }); return promise; }; const onFieldBlur = () => { validateRules$1({ triggerName: "blur" }); }; const onFieldChange = () => { if (validateDisabled.value) { validateDisabled.value = false; return; } validateRules$1({ triggerName: "change" }); }; const clearValidate = () => { validateState.value = props2.validateStatus; validateDisabled.value = false; errors.value = []; }; const resetField = () => { var _a; validateState.value = props2.validateStatus; validateDisabled.value = true; errors.value = []; const model = formContext.model.value || {}; const value = fieldValue.value; const prop = getPropByPath$1(model, namePath.value, true); if (Array.isArray(value)) { prop.o[prop.k] = [].concat((_a = initialValue.value) !== null && _a !== void 0 ? _a : []); } else { prop.o[prop.k] = initialValue.value; } nextTick(() => { validateDisabled.value = false; }); }; const htmlFor = computed(() => { return props2.htmlFor === void 0 ? fieldId.value : props2.htmlFor; }); const onLabelClick = () => { const id = htmlFor.value; if (!id || !inputRef.value) { return; } const control = inputRef.value.$el.querySelector(`[id="${id}"]`); if (control && control.focus) { control.focus(); } }; expose({ onFieldBlur, onFieldChange, clearValidate, resetField }); useProvideFormItemContext({ id: fieldId, onFieldBlur: () => { if (props2.autoLink) { onFieldBlur(); } }, onFieldChange: () => { if (props2.autoLink) { onFieldChange(); } }, clearValidate }, computed(() => { return !!(props2.autoLink && formContext.model.value && fieldName.value); })); let registered = false; watch(fieldName, (val) => { if (val) { if (!registered) { registered = true; formContext.addField(eventKey, { fieldValue, fieldId, fieldName, resetField, clearValidate, namePath, validateRules: validateRules$1, rules: rulesRef }); } } else { registered = false; formContext.removeField(eventKey); } }, { immediate: true }); onBeforeUnmount(() => { formContext.removeField(eventKey); }); const debounceErrors = useDebounce(errors); const mergedValidateStatus = computed(() => { if (props2.validateStatus !== void 0) { return props2.validateStatus; } else if (debounceErrors.value.length) { return "error"; } return validateState.value; }); const itemClassName = computed(() => ({ [`${prefixCls.value}-item`]: true, [hashId.value]: true, // Status [`${prefixCls.value}-item-has-feedback`]: mergedValidateStatus.value && props2.hasFeedback, [`${prefixCls.value}-item-has-success`]: mergedValidateStatus.value === "success", [`${prefixCls.value}-item-has-warning`]: mergedValidateStatus.value === "warning", [`${prefixCls.value}-item-has-error`]: mergedValidateStatus.value === "error", [`${prefixCls.value}-item-is-validating`]: mergedValidateStatus.value === "validating", [`${prefixCls.value}-item-hidden`]: props2.hidden })); const formItemInputContext = reactive({}); FormItemInputContext.useProvide(formItemInputContext); watchEffect(() => { let feedbackIcon; if (props2.hasFeedback) { const IconNode = mergedValidateStatus.value && iconMap[mergedValidateStatus.value]; feedbackIcon = IconNode ? createVNode("span", { "class": classNames(`${prefixCls.value}-item-feedback-icon`, `${prefixCls.value}-item-feedback-icon-${mergedValidateStatus.value}`) }, [createVNode(IconNode, null, null)]) : null; } _extends$1(formItemInputContext, { status: mergedValidateStatus.value, hasFeedback: props2.hasFeedback, feedbackIcon, isFormItemInput: true }); }); const marginBottom = shallowRef(null); const showMarginOffset = shallowRef(false); const updateMarginBottom = () => { if (itemRef.value) { const itemStyle = getComputedStyle(itemRef.value); marginBottom.value = parseInt(itemStyle.marginBottom, 10); } }; onMounted(() => { watch(showMarginOffset, () => { if (showMarginOffset.value) { updateMarginBottom(); } }, { flush: "post", immediate: true }); }); const onErrorVisibleChanged = (nextVisible) => { if (!nextVisible) { marginBottom.value = null; } }; return () => { var _a, _b; if (props2.noStyle) return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); const help = (_b = props2.help) !== null && _b !== void 0 ? _b : slots.help ? filterEmpty(slots.help()) : null; const withHelp = !!(help !== void 0 && help !== null && Array.isArray(help) && help.length || debounceErrors.value.length); showMarginOffset.value = withHelp; return wrapSSR(createVNode("div", { "class": [itemClassName.value, withHelp ? `${prefixCls.value}-item-with-help` : "", attrs.class], "ref": itemRef }, [createVNode(ARow, _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": `${prefixCls.value}-item-row`, "key": "row" }), { default: () => { var _a2, _b2; return createVNode(Fragment, null, [createVNode(FormItemLabel, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "htmlFor": htmlFor.value, "required": isRequired2.value, "requiredMark": formContext.requiredMark.value, "prefixCls": prefixCls.value, "onClick": onLabelClick, "label": props2.label }), { label: slots.label, tooltip: slots.tooltip }), createVNode(FormItemInput, _objectSpread2$1(_objectSpread2$1({}, props2), {}, { "errors": help !== void 0 && help !== null ? toArray$1(help) : debounceErrors.value, "marginBottom": marginBottom.value, "prefixCls": prefixCls.value, "status": mergedValidateStatus.value, "ref": inputRef, "help": help, "extra": (_a2 = props2.extra) !== null && _a2 !== void 0 ? _a2 : (_b2 = slots.extra) === null || _b2 === void 0 ? void 0 : _b2.call(slots), "onErrorVisibleChanged": onErrorVisibleChanged }), { default: slots.default })]); } }), !!marginBottom.value && createVNode("div", { "class": `${prefixCls.value}-margin-offset`, "style": { marginBottom: `-${marginBottom.value}px` } }, null)])); }; } }); function allPromiseFinish(promiseList) { let hasError = false; let count = promiseList.length; const results = []; if (!promiseList.length) { return Promise.resolve([]); } return new Promise((resolve2, reject) => { promiseList.forEach((promise, index2) => { promise.catch((e2) => { hasError = true; return e2; }).then((result) => { count -= 1; results[index2] = result; if (count > 0) { return; } if (hasError) { reject(results); } resolve2(results); }); }); }); } function isRequired(rules2) { let isRequired2 = false; if (rules2 && rules2.length) { rules2.every((rule) => { if (rule.required) { isRequired2 = true; return false; } return true; }); } return isRequired2; } function toArray(value) { if (value === void 0 || value === null) { return []; } return Array.isArray(value) ? value : [value]; } function getPropByPath(obj, path2, strict) { let tempObj = obj; path2 = path2.replace(/\[(\w+)\]/g, ".$1"); path2 = path2.replace(/^\./, ""); const keyArr = path2.split("."); let i2 = 0; for (let len = keyArr.length; i2 < len - 1; ++i2) { if (!tempObj && !strict) break; const key2 = keyArr[i2]; if (key2 in tempObj) { tempObj = tempObj[key2]; } else { if (strict) { throw new Error("please transfer a valid name path to validate!"); } break; } } return { o: tempObj, k: keyArr[i2], v: tempObj ? tempObj[keyArr[i2]] : null, isValid: tempObj && keyArr[i2] in tempObj }; } function useForm(modelRef) { let rulesRef = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ref({}); let options = arguments.length > 2 ? arguments[2] : void 0; const initialModel = cloneDeep(unref(modelRef)); const validateInfos = reactive({}); const rulesKeys = shallowRef([]); const resetFields = (newValues) => { _extends$1(unref(modelRef), _extends$1(_extends$1({}, cloneDeep(initialModel)), newValues)); nextTick(() => { Object.keys(validateInfos).forEach((key2) => { validateInfos[key2] = { autoLink: false, required: isRequired(unref(rulesRef)[key2]) }; }); }); }; const filterRules = function() { let rules2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; let trigger2 = arguments.length > 1 ? arguments[1] : void 0; if (!trigger2.length) { return rules2; } else { return rules2.filter((rule) => { const triggerList = toArray(rule.trigger || "change"); return intersection(triggerList, trigger2).length; }); } }; let lastValidatePromise = null; const validateFields = function(names2) { let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let strict = arguments.length > 2 ? arguments[2] : void 0; const promiseList = []; const values = {}; for (let i2 = 0; i2 < names2.length; i2++) { const name = names2[i2]; const prop = getPropByPath(unref(modelRef), name, strict); if (!prop.isValid) continue; values[name] = prop.v; const rules2 = filterRules(unref(rulesRef)[name], toArray(option && option.trigger)); if (rules2.length) { promiseList.push(validateField(name, prop.v, rules2, option || {}).then(() => ({ name, errors: [], warnings: [] })).catch((ruleErrors) => { const mergedErrors = []; const mergedWarnings = []; ruleErrors.forEach((_ref) => { let { rule: { warningOnly }, errors } = _ref; if (warningOnly) { mergedWarnings.push(...errors); } else { mergedErrors.push(...errors); } }); if (mergedErrors.length) { return Promise.reject({ name, errors: mergedErrors, warnings: mergedWarnings }); } return { name, errors: mergedErrors, warnings: mergedWarnings }; })); } } const summaryPromise = allPromiseFinish(promiseList); lastValidatePromise = summaryPromise; const returnPromise = summaryPromise.then(() => { if (lastValidatePromise === summaryPromise) { return Promise.resolve(values); } return Promise.reject([]); }).catch((results) => { const errorList = results.filter((result) => result && result.errors.length); return errorList.length ? Promise.reject({ values, errorFields: errorList, outOfDate: lastValidatePromise !== summaryPromise }) : Promise.resolve(values); }); returnPromise.catch((e2) => e2); return returnPromise; }; const validateField = function(name, value, rules2) { let option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; const promise = validateRules([name], value, rules2, _extends$1({ validateMessages: defaultValidateMessages }, option), !!option.validateFirst); if (!validateInfos[name]) { return promise.catch((e2) => e2); } validateInfos[name].validateStatus = "validating"; promise.catch((e2) => e2).then(function() { let results = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; var _a; if (validateInfos[name].validateStatus === "validating") { const res = results.filter((result) => result && result.errors.length); validateInfos[name].validateStatus = res.length ? "error" : "success"; validateInfos[name].help = res.length ? res.map((r2) => r2.errors) : null; (_a = options === null || options === void 0 ? void 0 : options.onValidate) === null || _a === void 0 ? void 0 : _a.call(options, name, !res.length, res.length ? toRaw(validateInfos[name].help[0]) : null); } }); return promise; }; const validate = (names2, option) => { let keys2 = []; let strict = true; if (!names2) { strict = false; keys2 = rulesKeys.value; } else if (Array.isArray(names2)) { keys2 = names2; } else { keys2 = [names2]; } const promises = validateFields(keys2, option || {}, strict); promises.catch((e2) => e2); return promises; }; const clearValidate = (names2) => { let keys2 = []; if (!names2) { keys2 = rulesKeys.value; } else if (Array.isArray(names2)) { keys2 = names2; } else { keys2 = [names2]; } keys2.forEach((key2) => { validateInfos[key2] && _extends$1(validateInfos[key2], { validateStatus: "", help: null }); }); }; const mergeValidateInfo = (items) => { const info = { autoLink: false }; const help = []; const infos = Array.isArray(items) ? items : [items]; for (let i2 = 0; i2 < infos.length; i2++) { const arg = infos[i2]; if ((arg === null || arg === void 0 ? void 0 : arg.validateStatus) === "error") { info.validateStatus = "error"; arg.help && help.push(arg.help); } info.required = info.required || (arg === null || arg === void 0 ? void 0 : arg.required); } info.help = help; return info; }; let oldModel = initialModel; let isFirstTime = true; const modelFn = (model) => { const names2 = []; rulesKeys.value.forEach((key2) => { const prop = getPropByPath(model, key2, false); const oldProp = getPropByPath(oldModel, key2, false); const isFirstValidation = isFirstTime && (options === null || options === void 0 ? void 0 : options.immediate) && prop.isValid; if (isFirstValidation || !isEqual(prop.v, oldProp.v)) { names2.push(key2); } }); validate(names2, { trigger: "change" }); isFirstTime = false; oldModel = cloneDeep(toRaw(model)); }; const debounceOptions = options === null || options === void 0 ? void 0 : options.debounce; let first = true; watch(rulesRef, () => { rulesKeys.value = rulesRef ? Object.keys(unref(rulesRef)) : []; if (!first && options && options.validateOnRuleChange) { validate(); } first = false; }, { deep: true, immediate: true }); watch(rulesKeys, () => { const newValidateInfos = {}; rulesKeys.value.forEach((key2) => { newValidateInfos[key2] = _extends$1({}, validateInfos[key2], { autoLink: false, required: isRequired(unref(rulesRef)[key2]) }); delete validateInfos[key2]; }); for (const key2 in validateInfos) { if (Object.prototype.hasOwnProperty.call(validateInfos, key2)) { delete validateInfos[key2]; } } _extends$1(validateInfos, newValidateInfos); }, { immediate: true }); watch(modelRef, debounceOptions && debounceOptions.wait ? debounce(modelFn, debounceOptions.wait, omit(debounceOptions, ["wait"])) : modelFn, { immediate: options && !!options.immediate, deep: true }); return { modelRef, rulesRef, initialModel, validateInfos, resetFields, validate, validateField, mergeValidateInfo, clearValidate }; } const formProps = () => ({ layout: PropTypes.oneOf(tuple("horizontal", "inline", "vertical")), labelCol: objectType(), wrapperCol: objectType(), colon: booleanType(), labelAlign: stringType(), labelWrap: booleanType(), prefixCls: String, requiredMark: someType([String, Boolean]), /** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */ hideRequiredMark: booleanType(), model: PropTypes.object, rules: objectType(), validateMessages: objectType(), validateOnRuleChange: booleanType(), // 提交失败自动滚动到第一个错误字段 scrollToFirstError: anyType(), onSubmit: functionType(), name: String, validateTrigger: someType([String, Array]), size: stringType(), disabled: booleanType(), onValuesChange: functionType(), onFieldsChange: functionType(), onFinish: functionType(), onFinishFailed: functionType(), onValidate: functionType() }); function isEqualName(name1, name2) { return isEqual(toArray$1(name1), toArray$1(name2)); } const Form = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AForm", inheritAttrs: false, props: initDefaultProps(formProps(), { layout: "horizontal", hideRequiredMark: false, colon: true }), Item: FormItem, useForm, // emits: ['finishFailed', 'submit', 'finish', 'validate'], setup(props2, _ref) { let { emit: emit2, slots, expose, attrs } = _ref; const { prefixCls, direction, form: contextForm, size, disabled } = useConfigInject("form", props2); const requiredMark = computed(() => props2.requiredMark === "" || props2.requiredMark); const mergedRequiredMark = computed(() => { var _a; if (requiredMark.value !== void 0) { return requiredMark.value; } if (contextForm && ((_a = contextForm.value) === null || _a === void 0 ? void 0 : _a.requiredMark) !== void 0) { return contextForm.value.requiredMark; } if (props2.hideRequiredMark) { return false; } return true; }); useProviderSize(size); useProviderDisabled(disabled); const mergedColon = computed(() => { var _a, _b; return (_a = props2.colon) !== null && _a !== void 0 ? _a : (_b = contextForm.value) === null || _b === void 0 ? void 0 : _b.colon; }); const { validateMessages: globalValidateMessages } = useInjectGlobalForm(); const validateMessages = computed(() => { return _extends$1(_extends$1(_extends$1({}, defaultValidateMessages), globalValidateMessages.value), props2.validateMessages); }); const [wrapSSR, hashId] = useStyle$6(prefixCls); const formClassName = computed(() => classNames(prefixCls.value, { [`${prefixCls.value}-${props2.layout}`]: true, [`${prefixCls.value}-hide-required-mark`]: mergedRequiredMark.value === false, [`${prefixCls.value}-rtl`]: direction.value === "rtl", [`${prefixCls.value}-${size.value}`]: size.value }, hashId.value)); const lastValidatePromise = ref(); const fields = {}; const addField = (eventKey, field) => { fields[eventKey] = field; }; const removeField = (eventKey) => { delete fields[eventKey]; }; const getFieldsByNameList = (nameList) => { const provideNameList = !!nameList; const namePathList = provideNameList ? toArray$1(nameList).map(getNamePath) : []; if (!provideNameList) { return Object.values(fields); } else { return Object.values(fields).filter((field) => namePathList.findIndex((namePath) => isEqualName(namePath, field.fieldName.value)) > -1); } }; const resetFields = (name) => { if (!props2.model) { return; } getFieldsByNameList(name).forEach((field) => { field.resetField(); }); }; const clearValidate = (name) => { getFieldsByNameList(name).forEach((field) => { field.clearValidate(); }); }; const handleFinishFailed = (errorInfo) => { const { scrollToFirstError } = props2; emit2("finishFailed", errorInfo); if (scrollToFirstError && errorInfo.errorFields.length) { let scrollToFieldOptions = {}; if (typeof scrollToFirstError === "object") { scrollToFieldOptions = scrollToFirstError; } scrollToField(errorInfo.errorFields[0].name, scrollToFieldOptions); } }; const validate = function() { return validateField(...arguments); }; const scrollToField = function(name) { let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; const fields2 = getFieldsByNameList(name ? [name] : void 0); if (fields2.length) { const fieldId = fields2[0].fieldId.value; const node2 = fieldId ? document.getElementById(fieldId) : null; if (node2) { scrollIntoView(node2, _extends$1({ scrollMode: "if-needed", block: "nearest" }, options)); } } }; const getFieldsValue = function() { let nameList = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; if (nameList === true) { const allNameList = []; Object.values(fields).forEach((_ref2) => { let { namePath } = _ref2; allNameList.push(namePath.value); }); return cloneByNamePathList(props2.model, allNameList); } else { return cloneByNamePathList(props2.model, nameList); } }; const validateFields = (nameList, options) => { if (!props2.model) { return Promise.reject("Form `model` is required for validateFields to work."); } const provideNameList = !!nameList; const namePathList = provideNameList ? toArray$1(nameList).map(getNamePath) : []; const promiseList = []; Object.values(fields).forEach((field) => { var _a; if (!provideNameList) { namePathList.push(field.namePath.value); } if (!((_a = field.rules) === null || _a === void 0 ? void 0 : _a.value.length)) { return; } const fieldNamePath = field.namePath.value; if (!provideNameList || containsNamePath(namePathList, fieldNamePath)) { const promise = field.validateRules(_extends$1({ validateMessages: validateMessages.value }, options)); promiseList.push(promise.then(() => ({ name: fieldNamePath, errors: [], warnings: [] })).catch((ruleErrors) => { const mergedErrors = []; const mergedWarnings = []; ruleErrors.forEach((_ref3) => { let { rule: { warningOnly }, errors } = _ref3; if (warningOnly) { mergedWarnings.push(...errors); } else { mergedErrors.push(...errors); } }); if (mergedErrors.length) { return Promise.reject({ name: fieldNamePath, errors: mergedErrors, warnings: mergedWarnings }); } return { name: fieldNamePath, errors: mergedErrors, warnings: mergedWarnings }; })); } }); const summaryPromise = allPromiseFinish(promiseList); lastValidatePromise.value = summaryPromise; const returnPromise = summaryPromise.then(() => { if (lastValidatePromise.value === summaryPromise) { return Promise.resolve(getFieldsValue(namePathList)); } return Promise.reject([]); }).catch((results) => { const errorList = results.filter((result) => result && result.errors.length); return Promise.reject({ values: getFieldsValue(namePathList), errorFields: errorList, outOfDate: lastValidatePromise.value !== summaryPromise }); }); returnPromise.catch((e2) => e2); return returnPromise; }; const validateField = function() { return validateFields(...arguments); }; const handleSubmit = (e2) => { e2.preventDefault(); e2.stopPropagation(); emit2("submit", e2); if (props2.model) { const res = validateFields(); res.then((values) => { emit2("finish", values); }).catch((errors) => { handleFinishFailed(errors); }); } }; expose({ resetFields, clearValidate, validateFields, getFieldsValue, validate, scrollToField }); useProvideForm({ model: computed(() => props2.model), name: computed(() => props2.name), labelAlign: computed(() => props2.labelAlign), labelCol: computed(() => props2.labelCol), labelWrap: computed(() => props2.labelWrap), wrapperCol: computed(() => props2.wrapperCol), vertical: computed(() => props2.layout === "vertical"), colon: mergedColon, requiredMark: mergedRequiredMark, validateTrigger: computed(() => props2.validateTrigger), rules: computed(() => props2.rules), addField, removeField, onValidate: (name, status, errors) => { emit2("validate", name, status, errors); }, validateMessages }); watch(() => props2.rules, () => { if (props2.validateOnRuleChange) { validateFields(); } }); return () => { var _a; return wrapSSR(createVNode("form", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "onSubmit": handleSubmit, "class": [formClassName.value, attrs.class] }), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])); }; } }); Form.useInjectFormItemContext = useInjectFormItemContext; Form.ItemRest = FormItemRest; Form.install = function(app) { app.component(Form.name, Form); app.component(Form.Item.name, Form.Item); app.component(FormItemRest.name, FormItemRest); return app; }; const Col = withInstall(Col$1); let runtimeLocale = _extends$1({}, localeValues$1.Modal); function changeConfirmLocale(newLocale) { if (newLocale) { runtimeLocale = _extends$1(_extends$1({}, runtimeLocale), newLocale); } else { runtimeLocale = _extends$1({}, localeValues$1.Modal); } } function getConfirmLocale() { return runtimeLocale; } const ANT_MARK = "internalMark"; const LocaleProvider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ALocaleProvider", props: { locale: { type: Object }, ANT_MARK__: String }, setup(props2, _ref) { let { slots } = _ref; warning$2(props2.ANT_MARK__ === ANT_MARK); const state = reactive({ antLocale: _extends$1(_extends$1({}, props2.locale), { exist: true }), ANT_MARK__: ANT_MARK }); provide("localeData", state); watch(() => props2.locale, (locale2) => { changeConfirmLocale(locale2 && locale2.Modal); state.antLocale = _extends$1(_extends$1({}, locale2), { exist: true }); }, { immediate: true }); return () => { var _a; return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots); }; } }); LocaleProvider.install = function(app) { app.component(LocaleProvider.name, LocaleProvider); return app; }; const locale$3 = withInstall(LocaleProvider); const Notice = /* @__PURE__ */ defineComponent({ name: "Notice", inheritAttrs: false, props: ["prefixCls", "duration", "updateMark", "noticeKey", "closeIcon", "closable", "props", "onClick", "onClose", "holder", "visible"], setup(props2, _ref) { let { attrs, slots } = _ref; let closeTimer; let isUnMounted = false; const duration = computed(() => props2.duration === void 0 ? 4.5 : props2.duration); const startCloseTimer = () => { if (duration.value && !isUnMounted) { closeTimer = setTimeout(() => { close(); }, duration.value * 1e3); } }; const clearCloseTimer = () => { if (closeTimer) { clearTimeout(closeTimer); closeTimer = null; } }; const close = (e2) => { if (e2) { e2.stopPropagation(); } clearCloseTimer(); const { onClose, noticeKey } = props2; if (onClose) { onClose(noticeKey); } }; const restartCloseTimer = () => { clearCloseTimer(); startCloseTimer(); }; onMounted(() => { startCloseTimer(); }); onUnmounted(() => { isUnMounted = true; clearCloseTimer(); }); watch([duration, () => props2.updateMark, () => props2.visible], (_ref2, _ref3) => { let [preDuration, preUpdateMark, preVisible] = _ref2; let [newDuration, newUpdateMark, newVisible] = _ref3; if (preDuration !== newDuration || preUpdateMark !== newUpdateMark || preVisible !== newVisible && newVisible) { restartCloseTimer(); } }, { flush: "post" }); return () => { var _a, _b; const { prefixCls, closable, closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots), onClick, holder } = props2; const { class: className, style } = attrs; const componentClass = `${prefixCls}-notice`; const dataOrAriaAttributeProps = Object.keys(attrs).reduce((acc, key2) => { if (key2.startsWith("data-") || key2.startsWith("aria-") || key2 === "role") { acc[key2] = attrs[key2]; } return acc; }, {}); const node2 = createVNode("div", _objectSpread2$1({ "class": classNames(componentClass, className, { [`${componentClass}-closable`]: closable }), "style": style, "onMouseenter": clearCloseTimer, "onMouseleave": startCloseTimer, "onClick": onClick }, dataOrAriaAttributeProps), [createVNode("div", { "class": `${componentClass}-content` }, [(_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots)]), closable ? createVNode("a", { "tabindex": 0, "onClick": close, "class": `${componentClass}-close` }, [closeIcon || createVNode("span", { "class": `${componentClass}-close-x` }, null)]) : null]); if (holder) { return createVNode(Teleport, { "to": holder }, { default: () => node2 }); } return node2; }; } }); var __rest$d = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; let seed$1 = 0; const now$1 = Date.now(); function getUuid$1() { const id = seed$1; seed$1 += 1; return `rcNotification_${now$1}_${id}`; } const Notification$1 = /* @__PURE__ */ defineComponent({ name: "Notification", inheritAttrs: false, props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId"], setup(props2, _ref) { let { attrs, expose, slots } = _ref; const hookRefs = /* @__PURE__ */ new Map(); const notices = ref([]); const transitionProps = computed(() => { const { prefixCls, animation = "fade" } = props2; let name = props2.transitionName; if (!name && animation) { name = `${prefixCls}-${animation}`; } return getTransitionGroupProps(name); }); const add = (originNotice, holderCallback) => { const key2 = originNotice.key || getUuid$1(); const notice2 = _extends$1(_extends$1({}, originNotice), { key: key2 }); const { maxCount: maxCount2 } = props2; const noticeIndex = notices.value.map((v2) => v2.notice.key).indexOf(key2); const updatedNotices = notices.value.concat(); if (noticeIndex !== -1) { updatedNotices.splice(noticeIndex, 1, { notice: notice2, holderCallback }); } else { if (maxCount2 && notices.value.length >= maxCount2) { notice2.key = updatedNotices[0].notice.key; notice2.updateMark = getUuid$1(); notice2.userPassKey = key2; updatedNotices.shift(); } updatedNotices.push({ notice: notice2, holderCallback }); } notices.value = updatedNotices; }; const remove2 = (removeKey) => { notices.value = toRaw(notices.value).filter((_ref2) => { let { notice: { key: key2, userPassKey } } = _ref2; const mergedKey = userPassKey || key2; return mergedKey !== removeKey; }); }; expose({ add, remove: remove2, notices }); return () => { var _a; const { prefixCls, closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots, { prefixCls }) } = props2; const noticeNodes = notices.value.map((_ref3, index2) => { let { notice: notice2, holderCallback } = _ref3; const updateMark = index2 === notices.value.length - 1 ? notice2.updateMark : void 0; const { key: key2, userPassKey } = notice2; const { content } = notice2; const noticeProps = _extends$1(_extends$1(_extends$1({ prefixCls, closeIcon: typeof closeIcon === "function" ? closeIcon({ prefixCls }) : closeIcon }, notice2), notice2.props), { key: key2, noticeKey: userPassKey || key2, updateMark, onClose: (noticeKey) => { var _a2; remove2(noticeKey); (_a2 = notice2.onClose) === null || _a2 === void 0 ? void 0 : _a2.call(notice2); }, onClick: notice2.onClick }); if (holderCallback) { return createVNode("div", { "key": key2, "class": `${prefixCls}-hook-holder`, "ref": (div) => { if (typeof key2 === "undefined") { return; } if (div) { hookRefs.set(key2, div); holderCallback(div, noticeProps); } else { hookRefs.delete(key2); } } }, null); } return createVNode(Notice, _objectSpread2$1(_objectSpread2$1({}, noticeProps), {}, { "class": classNames(noticeProps.class, props2.hashId) }), { default: () => [typeof content === "function" ? content({ prefixCls }) : content] }); }); const className = { [prefixCls]: 1, [attrs.class]: !!attrs.class, [props2.hashId]: true }; return createVNode("div", { "class": className, "style": attrs.style || { top: "65px", left: "50%" } }, [createVNode(TransitionGroup, _objectSpread2$1({ "tag": "div" }, transitionProps.value), { default: () => [noticeNodes] })]); }; } }); Notification$1.newInstance = function newNotificationInstance(properties, callback) { const _a = properties || {}, { name = "notification", getContainer: getContainer2, appContext, prefixCls: customizePrefixCls, rootPrefixCls: customRootPrefixCls, transitionName: customTransitionName, hasTransitionName: hasTransitionName2, useStyle: useStyle2 } = _a, props2 = __rest$d(_a, ["name", "getContainer", "appContext", "prefixCls", "rootPrefixCls", "transitionName", "hasTransitionName", "useStyle"]); const div = document.createElement("div"); if (getContainer2) { const root2 = getContainer2(); root2.appendChild(div); } else { document.body.appendChild(div); } const Wrapper = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "NotificationWrapper", setup(_props, _ref4) { let { attrs } = _ref4; const notiRef = shallowRef(); const prefixCls = computed(() => globalConfigForApi.getPrefixCls(name, customizePrefixCls)); const [, hashId] = useStyle2(prefixCls); onMounted(() => { callback({ notice(noticeProps) { var _a2; (_a2 = notiRef.value) === null || _a2 === void 0 ? void 0 : _a2.add(noticeProps); }, removeNotice(key2) { var _a2; (_a2 = notiRef.value) === null || _a2 === void 0 ? void 0 : _a2.remove(key2); }, destroy() { render(null, div); if (div.parentNode) { div.parentNode.removeChild(div); } }, component: notiRef }); }); return () => { const global2 = globalConfigForApi; const rootPrefixCls = global2.getRootPrefixCls(customRootPrefixCls, prefixCls.value); const transitionName2 = hasTransitionName2 ? customTransitionName : `${prefixCls.value}-${customTransitionName}`; return createVNode(ConfigProvider, _objectSpread2$1(_objectSpread2$1({}, global2), {}, { "prefixCls": rootPrefixCls }), { default: () => [createVNode(Notification$1, _objectSpread2$1(_objectSpread2$1({ "ref": notiRef }, attrs), {}, { "prefixCls": prefixCls.value, "transitionName": transitionName2, "hashId": hashId.value }), null)] }); }; } }); const vm = createVNode(Wrapper, props2); vm.appContext = appContext || vm.appContext; render(vm, div); }; let seed = 0; const now = Date.now(); function getUuid() { const id = seed; seed += 1; return `rcNotification_${now}_${id}`; } const Notification = /* @__PURE__ */ defineComponent({ name: "HookNotification", inheritAttrs: false, props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId", "remove", "notices", "getStyles", "getClassName", "onAllRemoved", "getContainer"], setup(props2, _ref) { let { attrs, slots } = _ref; const hookRefs = /* @__PURE__ */ new Map(); const notices = computed(() => props2.notices); const transitionProps = computed(() => { let name = props2.transitionName; if (!name && props2.animation) { switch (typeof props2.animation) { case "string": name = props2.animation; break; case "function": name = props2.animation().name; break; case "object": name = props2.animation.name; break; default: name = `${props2.prefixCls}-fade`; break; } } return getTransitionGroupProps(name); }); const remove2 = (key2) => props2.remove(key2); const placements2 = ref({}); watch(notices, () => { const nextPlacements = {}; Object.keys(placements2.value).forEach((placement) => { nextPlacements[placement] = []; }); props2.notices.forEach((config) => { const { placement = "topRight" } = config.notice; if (placement) { nextPlacements[placement] = nextPlacements[placement] || []; nextPlacements[placement].push(config); } }); placements2.value = nextPlacements; }); const placementList = computed(() => Object.keys(placements2.value)); return () => { var _a; const { prefixCls, closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots, { prefixCls }) } = props2; const noticeNodes = placementList.value.map((placement) => { var _a2, _b; const noticesForPlacement = placements2.value[placement]; const classes = (_a2 = props2.getClassName) === null || _a2 === void 0 ? void 0 : _a2.call(props2, placement); const styles = (_b = props2.getStyles) === null || _b === void 0 ? void 0 : _b.call(props2, placement); const noticeNodesForPlacement = noticesForPlacement.map((_ref2, index2) => { let { notice: notice2, holderCallback } = _ref2; const updateMark = index2 === notices.value.length - 1 ? notice2.updateMark : void 0; const { key: key2, userPassKey } = notice2; const { content } = notice2; const noticeProps = _extends$1(_extends$1(_extends$1({ prefixCls, closeIcon: typeof closeIcon === "function" ? closeIcon({ prefixCls }) : closeIcon }, notice2), notice2.props), { key: key2, noticeKey: userPassKey || key2, updateMark, onClose: (noticeKey) => { var _a3; remove2(noticeKey); (_a3 = notice2.onClose) === null || _a3 === void 0 ? void 0 : _a3.call(notice2); }, onClick: notice2.onClick }); if (holderCallback) { return createVNode("div", { "key": key2, "class": `${prefixCls}-hook-holder`, "ref": (div) => { if (typeof key2 === "undefined") { return; } if (div) { hookRefs.set(key2, div); holderCallback(div, noticeProps); } else { hookRefs.delete(key2); } } }, null); } return createVNode(Notice, _objectSpread2$1(_objectSpread2$1({}, noticeProps), {}, { "class": classNames(noticeProps.class, props2.hashId) }), { default: () => [typeof content === "function" ? content({ prefixCls }) : content] }); }); const className = { [prefixCls]: 1, [`${prefixCls}-${placement}`]: 1, [attrs.class]: !!attrs.class, [props2.hashId]: true, [classes]: !!classes }; function onAfterLeave() { var _a3; if (noticesForPlacement.length > 0) { return; } Reflect.deleteProperty(placements2.value, placement); (_a3 = props2.onAllRemoved) === null || _a3 === void 0 ? void 0 : _a3.call(props2); } return createVNode("div", { "key": placement, "class": className, "style": attrs.style || styles || { top: "65px", left: "50%" } }, [createVNode(TransitionGroup, _objectSpread2$1(_objectSpread2$1({ "tag": "div" }, transitionProps.value), {}, { "onAfterLeave": onAfterLeave }), { default: () => [noticeNodesForPlacement] })]); }); return createVNode(Portal$1, { "getContainer": props2.getContainer }, { default: () => [noticeNodes] }); }; } }); var __rest$c = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const defaultGetContainer$1 = () => document.body; let uniqueKey = 0; function mergeConfig() { const clone = {}; for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) { objList[_key] = arguments[_key]; } objList.forEach((obj) => { if (obj) { Object.keys(obj).forEach((key2) => { const val = obj[key2]; if (val !== void 0) { clone[key2] = val; } }); } }); return clone; } function useNotification$1() { let rootConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; const { getContainer: getContainer2 = defaultGetContainer$1, motion, prefixCls, maxCount: maxCount2, getClassName, getStyles, onAllRemoved } = rootConfig, shareConfig = __rest$c(rootConfig, ["getContainer", "motion", "prefixCls", "maxCount", "getClassName", "getStyles", "onAllRemoved"]); const notices = shallowRef([]); const notificationsRef = shallowRef(); const add = (originNotice, holderCallback) => { const key2 = originNotice.key || getUuid(); const notice2 = _extends$1(_extends$1({}, originNotice), { key: key2 }); const noticeIndex = notices.value.map((v2) => v2.notice.key).indexOf(key2); const updatedNotices = notices.value.concat(); if (noticeIndex !== -1) { updatedNotices.splice(noticeIndex, 1, { notice: notice2, holderCallback }); } else { if (maxCount2 && notices.value.length >= maxCount2) { notice2.key = updatedNotices[0].notice.key; notice2.updateMark = getUuid(); notice2.userPassKey = key2; updatedNotices.shift(); } updatedNotices.push({ notice: notice2, holderCallback }); } notices.value = updatedNotices; }; const removeNotice = (removeKey) => { notices.value = notices.value.filter((_ref) => { let { notice: { key: key2, userPassKey } } = _ref; const mergedKey = userPassKey || key2; return mergedKey !== removeKey; }); }; const destroy = () => { notices.value = []; }; const contextHolder = () => createVNode(Notification, { "ref": notificationsRef, "prefixCls": prefixCls, "maxCount": maxCount2, "notices": notices.value, "remove": removeNotice, "getClassName": getClassName, "getStyles": getStyles, "animation": motion, "hashId": rootConfig.hashId, "onAllRemoved": onAllRemoved, "getContainer": getContainer2 }, null); const taskQueue = shallowRef([]); const api2 = { open: (config) => { const mergedConfig = mergeConfig(shareConfig, config); if (mergedConfig.key === null || mergedConfig.key === void 0) { mergedConfig.key = `vc-notification-${uniqueKey}`; uniqueKey += 1; } taskQueue.value = [...taskQueue.value, { type: "open", config: mergedConfig }]; }, close: (key2) => { taskQueue.value = [...taskQueue.value, { type: "close", key: key2 }]; }, destroy: () => { taskQueue.value = [...taskQueue.value, { type: "destroy" }]; } }; watch(taskQueue, () => { if (taskQueue.value.length) { taskQueue.value.forEach((task) => { switch (task.type) { case "open": add(task.config); break; case "close": removeNotice(task.key); break; case "destroy": destroy(); break; } }); taskQueue.value = []; } }); return [api2, contextHolder]; } const genMessageStyle = (token2) => { const { componentCls, iconCls, boxShadowSecondary, colorBgElevated, colorSuccess, colorError, colorWarning, colorInfo, fontSizeLG, motionEaseInOutCirc, motionDurationSlow, marginXS, paddingXS, borderRadiusLG, zIndexPopup, // Custom token messageNoticeContentPadding } = token2; const messageMoveIn = new Keyframe("MessageMoveIn", { "0%": { padding: 0, transform: "translateY(-100%)", opacity: 0 }, "100%": { padding: paddingXS, transform: "translateY(0)", opacity: 1 } }); const messageMoveOut = new Keyframe("MessageMoveOut", { "0%": { maxHeight: token2.height, padding: paddingXS, opacity: 1 }, "100%": { maxHeight: 0, padding: 0, opacity: 0 } }); return [ // ============================ Holder ============================ { [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "fixed", top: marginXS, left: "50%", transform: "translateX(-50%)", width: "100%", pointerEvents: "none", zIndex: zIndexPopup, [`${componentCls}-move-up`]: { animationFillMode: "forwards" }, [` ${componentCls}-move-up-appear, ${componentCls}-move-up-enter `]: { animationName: messageMoveIn, animationDuration: motionDurationSlow, animationPlayState: "paused", animationTimingFunction: motionEaseInOutCirc }, [` ${componentCls}-move-up-appear${componentCls}-move-up-appear-active, ${componentCls}-move-up-enter${componentCls}-move-up-enter-active `]: { animationPlayState: "running" }, [`${componentCls}-move-up-leave`]: { animationName: messageMoveOut, animationDuration: motionDurationSlow, animationPlayState: "paused", animationTimingFunction: motionEaseInOutCirc }, [`${componentCls}-move-up-leave${componentCls}-move-up-leave-active`]: { animationPlayState: "running" }, "&-rtl": { direction: "rtl", span: { direction: "rtl" } } }) }, // ============================ Notice ============================ { [`${componentCls}-notice`]: { padding: paddingXS, textAlign: "center", [iconCls]: { verticalAlign: "text-bottom", marginInlineEnd: marginXS, fontSize: fontSizeLG }, [`${componentCls}-notice-content`]: { display: "inline-block", padding: messageNoticeContentPadding, background: colorBgElevated, borderRadius: borderRadiusLG, boxShadow: boxShadowSecondary, pointerEvents: "all" }, [`${componentCls}-success ${iconCls}`]: { color: colorSuccess }, [`${componentCls}-error ${iconCls}`]: { color: colorError }, [`${componentCls}-warning ${iconCls}`]: { color: colorWarning }, [` ${componentCls}-info ${iconCls}, ${componentCls}-loading ${iconCls}`]: { color: colorInfo } } }, // ============================= Pure ============================= { [`${componentCls}-notice-pure-panel`]: { padding: 0, textAlign: "start" } } ]; }; const useStyle$5 = genComponentStyleHook("Message", (token2) => { const combinedToken = merge(token2, { messageNoticeContentPadding: `${(token2.controlHeightLG - token2.fontSize * token2.lineHeight) / 2}px ${token2.paddingSM}px` }); return [genMessageStyle(combinedToken)]; }, (token2) => ({ height: 150, zIndexPopup: token2.zIndexPopupBase + 10 })); const TypeIcon = { info: createVNode(InfoCircleFilled, null, null), success: createVNode(CheckCircleFilled, null, null), error: createVNode(CloseCircleFilled, null, null), warning: createVNode(ExclamationCircleFilled, null, null), loading: createVNode(LoadingOutlined, null, null) }; const PureContent$1 = /* @__PURE__ */ defineComponent({ name: "PureContent", inheritAttrs: false, props: ["prefixCls", "type", "icon"], setup(props2, _ref) { let { slots } = _ref; return () => { var _a; return createVNode("div", { "class": classNames(`${props2.prefixCls}-custom-content`, `${props2.prefixCls}-${props2.type}`) }, [props2.icon || TypeIcon[props2.type], createVNode("span", null, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])]); }; } }); var __rest$b = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const DEFAULT_OFFSET$1 = 8; const DEFAULT_DURATION$1 = 3; const Holder$1 = /* @__PURE__ */ defineComponent({ name: "Holder", inheritAttrs: false, props: ["top", "prefixCls", "getContainer", "maxCount", "duration", "rtl", "transitionName", "onAllRemoved", "animation", "staticGetContainer"], setup(props2, _ref) { let { expose } = _ref; var _a, _b; const { getPrefixCls, getPopupContainer } = useConfigInject("message", props2); const prefixCls = computed(() => getPrefixCls("message", props2.prefixCls)); const [, hashId] = useStyle$5(prefixCls); const getStyles = () => { var _a2; const top = (_a2 = props2.top) !== null && _a2 !== void 0 ? _a2 : DEFAULT_OFFSET$1; return { left: "50%", transform: "translateX(-50%)", top: typeof top === "number" ? `${top}px` : top }; }; const getClassName = () => classNames(hashId.value, props2.rtl ? `${prefixCls.value}-rtl` : ""); const getNotificationMotion = () => { var _a2; return getMotion$1({ prefixCls: prefixCls.value, animation: (_a2 = props2.animation) !== null && _a2 !== void 0 ? _a2 : `move-up`, transitionName: props2.transitionName }); }; const mergedCloseIcon = createVNode("span", { "class": `${prefixCls.value}-close-x` }, [createVNode(CloseOutlined, { "class": `${prefixCls.value}-close-icon` }, null)]); const [api2, holder] = useNotification$1({ //@ts-ignore getStyles, prefixCls: prefixCls.value, getClassName, motion: getNotificationMotion, closable: false, closeIcon: mergedCloseIcon, duration: (_a = props2.duration) !== null && _a !== void 0 ? _a : DEFAULT_DURATION$1, getContainer: (_b = props2.staticGetContainer) !== null && _b !== void 0 ? _b : getPopupContainer.value, maxCount: props2.maxCount, onAllRemoved: props2.onAllRemoved }); expose(_extends$1(_extends$1({}, api2), { prefixCls, hashId })); return holder; } }); let keyIndex = 0; function useInternalMessage(messageConfig) { const holderRef = shallowRef(null); const holderKey = Symbol("messageHolderKey"); const close = (key2) => { var _a; (_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.close(key2); }; const open2 = (config) => { if (!holderRef.value) { const fakeResult = () => { }; fakeResult.then = () => { }; return fakeResult; } const { open: originOpen, prefixCls, hashId } = holderRef.value; const noticePrefixCls = `${prefixCls}-notice`; const { content, icon, type, key: key2, class: className, onClose } = config, restConfig = __rest$b(config, ["content", "icon", "type", "key", "class", "onClose"]); let mergedKey = key2; if (mergedKey === void 0 || mergedKey === null) { keyIndex += 1; mergedKey = `antd-message-${keyIndex}`; } return wrapPromiseFn((resolve2) => { originOpen(_extends$1(_extends$1({}, restConfig), { key: mergedKey, content: () => createVNode(PureContent$1, { "prefixCls": prefixCls, "type": type, "icon": typeof icon === "function" ? icon() : icon }, { default: () => [typeof content === "function" ? content() : content] }), placement: "top", // @ts-ignore class: classNames(type && `${noticePrefixCls}-${type}`, hashId, className), onClose: () => { onClose === null || onClose === void 0 ? void 0 : onClose(); resolve2(); } })); return () => { close(mergedKey); }; }); }; const destroy = (key2) => { var _a; if (key2 !== void 0) { close(key2); } else { (_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.destroy(); } }; const wrapAPI = { open: open2, destroy }; const keys2 = ["info", "success", "warning", "error", "loading"]; keys2.forEach((type) => { const typeOpen = (jointContent, duration, onClose) => { let config; if (jointContent && typeof jointContent === "object" && "content" in jointContent) { config = jointContent; } else { config = { content: jointContent }; } let mergedDuration; let mergedOnClose; if (typeof duration === "function") { mergedOnClose = duration; } else { mergedDuration = duration; mergedOnClose = onClose; } const mergedConfig = _extends$1(_extends$1({ onClose: mergedOnClose, duration: mergedDuration }, config), { type }); return open2(mergedConfig); }; wrapAPI[type] = typeOpen; }); return [wrapAPI, () => createVNode(Holder$1, _objectSpread2$1(_objectSpread2$1({ "key": holderKey }, messageConfig), {}, { "ref": holderRef }), null)]; } function useMessage(messageConfig) { return useInternalMessage(messageConfig); } let defaultDuration$1 = 3; let defaultTop$1; let messageInstance; let key = 1; let localPrefixCls = ""; let transitionName = "move-up"; let hasTransitionName = false; let getContainer = () => document.body; let maxCount$1; let rtl$1 = false; function getKeyThenIncreaseKey() { return key++; } function setMessageConfig(options) { if (options.top !== void 0) { defaultTop$1 = options.top; messageInstance = null; } if (options.duration !== void 0) { defaultDuration$1 = options.duration; } if (options.prefixCls !== void 0) { localPrefixCls = options.prefixCls; } if (options.getContainer !== void 0) { getContainer = options.getContainer; messageInstance = null; } if (options.transitionName !== void 0) { transitionName = options.transitionName; messageInstance = null; hasTransitionName = true; } if (options.maxCount !== void 0) { maxCount$1 = options.maxCount; messageInstance = null; } if (options.rtl !== void 0) { rtl$1 = options.rtl; } } function getMessageInstance(args, callback) { if (messageInstance) { callback(messageInstance); return; } Notification$1.newInstance({ appContext: args.appContext, prefixCls: args.prefixCls || localPrefixCls, rootPrefixCls: args.rootPrefixCls, transitionName, hasTransitionName, style: { top: defaultTop$1 }, getContainer: getContainer || args.getPopupContainer, maxCount: maxCount$1, name: "message", useStyle: useStyle$5 }, (instance) => { if (messageInstance) { callback(messageInstance); return; } messageInstance = instance; callback(instance); }); } const typeToIcon$2 = { info: InfoCircleFilled, success: CheckCircleFilled, error: CloseCircleFilled, warning: ExclamationCircleFilled, loading: LoadingOutlined }; const typeList = Object.keys(typeToIcon$2); function notice$1(args) { const duration = args.duration !== void 0 ? args.duration : defaultDuration$1; const target = args.key || getKeyThenIncreaseKey(); const closePromise = new Promise((resolve2) => { const callback = () => { if (typeof args.onClose === "function") { args.onClose(); } return resolve2(true); }; getMessageInstance(args, (instance) => { instance.notice({ key: target, duration, style: args.style || {}, class: args.class, content: (_ref) => { let { prefixCls } = _ref; const Icon2 = typeToIcon$2[args.type]; const iconNode = Icon2 ? createVNode(Icon2, null, null) : ""; const messageClass = classNames(`${prefixCls}-custom-content`, { [`${prefixCls}-${args.type}`]: args.type, [`${prefixCls}-rtl`]: rtl$1 === true }); return createVNode("div", { "class": messageClass }, [typeof args.icon === "function" ? args.icon() : args.icon || iconNode, createVNode("span", null, [typeof args.content === "function" ? args.content() : args.content])]); }, onClose: callback, onClick: args.onClick }); }); }); const result = () => { if (messageInstance) { messageInstance.removeNotice(target); } }; result.then = (filled, rejected) => closePromise.then(filled, rejected); result.promise = closePromise; return result; } function isArgsProps(content) { return Object.prototype.toString.call(content) === "[object Object]" && !!content.content; } const api$1 = { open: notice$1, config: setMessageConfig, destroy(messageKey) { if (messageInstance) { if (messageKey) { const { removeNotice } = messageInstance; removeNotice(messageKey); } else { const { destroy } = messageInstance; destroy(); messageInstance = null; } } } }; function attachTypeApi(originalApi, type) { originalApi[type] = (content, duration, onClose) => { if (isArgsProps(content)) { return originalApi.open(_extends$1(_extends$1({}, content), { type })); } if (typeof duration === "function") { onClose = duration; duration = void 0; } return originalApi.open({ content, duration, type, onClose }); }; } typeList.forEach((type) => attachTypeApi(api$1, type)); api$1.warn = api$1.warning; api$1.useMessage = useMessage; const genNotificationPlacementStyle = (token2) => { const { componentCls, width, notificationMarginEdge } = token2; const notificationTopFadeIn = new Keyframe("antNotificationTopFadeIn", { "0%": { marginTop: "-100%", opacity: 0 }, "100%": { marginTop: 0, opacity: 1 } }); const notificationBottomFadeIn = new Keyframe("antNotificationBottomFadeIn", { "0%": { marginBottom: "-100%", opacity: 0 }, "100%": { marginBottom: 0, opacity: 1 } }); const notificationLeftFadeIn = new Keyframe("antNotificationLeftFadeIn", { "0%": { right: { _skip_check_: true, value: width }, opacity: 0 }, "100%": { right: { _skip_check_: true, value: 0 }, opacity: 1 } }); return { [`&${componentCls}-top, &${componentCls}-bottom`]: { marginInline: 0 }, [`&${componentCls}-top`]: { [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: notificationTopFadeIn } }, [`&${componentCls}-bottom`]: { [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: notificationBottomFadeIn } }, [`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: { marginInlineEnd: 0, marginInlineStart: notificationMarginEdge, [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: notificationLeftFadeIn } } }; }; const genNotificationStyle = (token2) => { const { iconCls, componentCls, // .ant-notification boxShadowSecondary, fontSizeLG, notificationMarginBottom, borderRadiusLG, colorSuccess, colorInfo, colorWarning, colorError, colorTextHeading, notificationBg, notificationPadding, notificationMarginEdge, motionDurationMid, motionEaseInOut, fontSize, lineHeight, width, notificationIconSize } = token2; const noticeCls = `${componentCls}-notice`; const notificationFadeIn = new Keyframe("antNotificationFadeIn", { "0%": { left: { _skip_check_: true, value: width }, opacity: 0 }, "100%": { left: { _skip_check_: true, value: 0 }, opacity: 1 } }); const notificationFadeOut = new Keyframe("antNotificationFadeOut", { "0%": { maxHeight: token2.animationMaxHeight, marginBottom: notificationMarginBottom, opacity: 1 }, "100%": { maxHeight: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, opacity: 0 } }); return [ // ============================ Holder ============================ { [componentCls]: _extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), { position: "fixed", zIndex: token2.zIndexPopup, marginInlineEnd: notificationMarginEdge, [`${componentCls}-hook-holder`]: { position: "relative" }, [`&${componentCls}-top, &${componentCls}-bottom`]: { [`${componentCls}-notice`]: { marginInline: "auto auto" } }, [`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: { [`${componentCls}-notice`]: { marginInlineEnd: "auto", marginInlineStart: 0 } }, // animation [`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: { animationDuration: token2.motionDurationMid, animationTimingFunction: motionEaseInOut, animationFillMode: "both", opacity: 0, animationPlayState: "paused" }, [`${componentCls}-fade-leave`]: { animationTimingFunction: motionEaseInOut, animationFillMode: "both", animationDuration: motionDurationMid, animationPlayState: "paused" }, [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: notificationFadeIn, animationPlayState: "running" }, [`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: { animationName: notificationFadeOut, animationPlayState: "running" } }), genNotificationPlacementStyle(token2)), { // RTL "&-rtl": { direction: "rtl", [`${componentCls}-notice-btn`]: { float: "left" } } }) }, // ============================ Notice ============================ { [noticeCls]: { position: "relative", width, maxWidth: `calc(100vw - ${notificationMarginEdge * 2}px)`, marginBottom: notificationMarginBottom, marginInlineStart: "auto", padding: notificationPadding, overflow: "hidden", lineHeight, wordWrap: "break-word", background: notificationBg, borderRadius: borderRadiusLG, boxShadow: boxShadowSecondary, [`${componentCls}-close-icon`]: { fontSize, cursor: "pointer" }, [`${noticeCls}-message`]: { marginBottom: token2.marginXS, color: colorTextHeading, fontSize: fontSizeLG, lineHeight: token2.lineHeightLG }, [`${noticeCls}-description`]: { fontSize }, [`&${noticeCls}-closable ${noticeCls}-message`]: { paddingInlineEnd: token2.paddingLG }, [`${noticeCls}-with-icon ${noticeCls}-message`]: { marginBottom: token2.marginXS, marginInlineStart: token2.marginSM + notificationIconSize, fontSize: fontSizeLG }, [`${noticeCls}-with-icon ${noticeCls}-description`]: { marginInlineStart: token2.marginSM + notificationIconSize, fontSize }, // Icon & color style in different selector level // https://github.com/ant-design/ant-design/issues/16503 // https://github.com/ant-design/ant-design/issues/15512 [`${noticeCls}-icon`]: { position: "absolute", fontSize: notificationIconSize, lineHeight: 0, // icon-font [`&-success${iconCls}`]: { color: colorSuccess }, [`&-info${iconCls}`]: { color: colorInfo }, [`&-warning${iconCls}`]: { color: colorWarning }, [`&-error${iconCls}`]: { color: colorError } }, [`${noticeCls}-close`]: { position: "absolute", top: token2.notificationPaddingVertical, insetInlineEnd: token2.notificationPaddingHorizontal, color: token2.colorIcon, outline: "none", width: token2.notificationCloseButtonSize, height: token2.notificationCloseButtonSize, borderRadius: token2.borderRadiusSM, transition: `background-color ${token2.motionDurationMid}, color ${token2.motionDurationMid}`, display: "flex", alignItems: "center", justifyContent: "center", "&:hover": { color: token2.colorIconHover, backgroundColor: token2.wireframe ? "transparent" : token2.colorFillContent } }, [`${noticeCls}-btn`]: { float: "right", marginTop: token2.marginSM } } }, // ============================= Pure ============================= { [`${noticeCls}-pure-panel`]: { margin: 0 } } ]; }; const useStyle$4 = genComponentStyleHook("Notification", (token2) => { const notificationPaddingVertical = token2.paddingMD; const notificationPaddingHorizontal = token2.paddingLG; const notificationToken = merge(token2, { // default.less variables notificationBg: token2.colorBgElevated, notificationPaddingVertical, notificationPaddingHorizontal, // index.less variables notificationPadding: `${token2.paddingMD}px ${token2.paddingContentHorizontalLG}px`, notificationMarginBottom: token2.margin, notificationMarginEdge: token2.marginLG, animationMaxHeight: 150, notificationIconSize: token2.fontSizeLG * token2.lineHeightLG, notificationCloseButtonSize: token2.controlHeightLG * 0.55 }); return [genNotificationStyle(notificationToken)]; }, (token2) => ({ zIndexPopup: token2.zIndexPopupBase + 50, width: 384 })); function getCloseIcon(prefixCls, closeIcon) { return closeIcon || createVNode("span", { "class": `${prefixCls}-close-x` }, [createVNode(CloseOutlined, { "class": `${prefixCls}-close-icon` }, null)]); } ({ info: createVNode(InfoCircleFilled, null, null), success: createVNode(CheckCircleFilled, null, null), error: createVNode(CloseCircleFilled, null, null), warning: createVNode(ExclamationCircleFilled, null, null), loading: createVNode(LoadingOutlined, null, null) }); const typeToIcon$1 = { success: CheckCircleFilled, info: InfoCircleFilled, error: CloseCircleFilled, warning: ExclamationCircleFilled }; function PureContent(_ref) { let { prefixCls, icon, type, message, description, btn } = _ref; let iconNode = null; if (icon) { iconNode = createVNode("span", { "class": `${prefixCls}-icon` }, [renderHelper(icon)]); } else if (type) { const Icon2 = typeToIcon$1[type]; iconNode = createVNode(Icon2, { "class": `${prefixCls}-icon ${prefixCls}-icon-${type}` }, null); } return createVNode("div", { "class": classNames({ [`${prefixCls}-with-icon`]: iconNode }), "role": "alert" }, [iconNode, createVNode("div", { "class": `${prefixCls}-message` }, [message]), createVNode("div", { "class": `${prefixCls}-description` }, [description]), btn && createVNode("div", { "class": `${prefixCls}-btn` }, [btn])]); } function getPlacementStyle(placement, top, bottom) { let style; top = typeof top === "number" ? `${top}px` : top; bottom = typeof bottom === "number" ? `${bottom}px` : bottom; switch (placement) { case "top": style = { left: "50%", transform: "translateX(-50%)", right: "auto", top, bottom: "auto" }; break; case "topLeft": style = { left: 0, top, bottom: "auto" }; break; case "topRight": style = { right: 0, top, bottom: "auto" }; break; case "bottom": style = { left: "50%", transform: "translateX(-50%)", right: "auto", top: "auto", bottom }; break; case "bottomLeft": style = { left: 0, top: "auto", bottom }; break; default: style = { right: 0, top: "auto", bottom }; break; } return style; } function getMotion(prefixCls) { return { name: `${prefixCls}-fade` }; } var __rest$a = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const DEFAULT_OFFSET = 24; const DEFAULT_DURATION = 4.5; const Holder = /* @__PURE__ */ defineComponent({ name: "Holder", inheritAttrs: false, props: ["prefixCls", "class", "type", "icon", "content", "onAllRemoved"], setup(props2, _ref) { let { expose } = _ref; const { getPrefixCls, getPopupContainer } = useConfigInject("notification", props2); const prefixCls = computed(() => props2.prefixCls || getPrefixCls("notification")); const getStyles = (placement) => { var _a, _b; return getPlacementStyle(placement, (_a = props2.top) !== null && _a !== void 0 ? _a : DEFAULT_OFFSET, (_b = props2.bottom) !== null && _b !== void 0 ? _b : DEFAULT_OFFSET); }; const [, hashId] = useStyle$4(prefixCls); const getClassName = () => classNames(hashId.value, { [`${prefixCls.value}-rtl`]: props2.rtl }); const getNotificationMotion = () => getMotion(prefixCls.value); const [api2, holder] = useNotification$1({ prefixCls: prefixCls.value, getStyles, getClassName, motion: getNotificationMotion, closable: true, closeIcon: getCloseIcon(prefixCls.value), duration: DEFAULT_DURATION, getContainer: () => { var _a, _b; return ((_a = props2.getPopupContainer) === null || _a === void 0 ? void 0 : _a.call(props2)) || ((_b = getPopupContainer.value) === null || _b === void 0 ? void 0 : _b.call(getPopupContainer)) || document.body; }, maxCount: props2.maxCount, hashId: hashId.value, onAllRemoved: props2.onAllRemoved }); expose(_extends$1(_extends$1({}, api2), { prefixCls: prefixCls.value, hashId })); return holder; } }); function useInternalNotification(notificationConfig) { const holderRef = shallowRef(null); const holderKey = Symbol("notificationHolderKey"); const open2 = (config) => { if (!holderRef.value) { return; } const { open: originOpen, prefixCls, hashId } = holderRef.value; const noticePrefixCls = `${prefixCls}-notice`; const { message, description, icon, type, btn, class: className } = config, restConfig = __rest$a(config, ["message", "description", "icon", "type", "btn", "class"]); return originOpen(_extends$1(_extends$1({ placement: "topRight" }, restConfig), { content: () => createVNode(PureContent, { "prefixCls": noticePrefixCls, "icon": typeof icon === "function" ? icon() : icon, "type": type, "message": typeof message === "function" ? message() : message, "description": typeof description === "function" ? description() : description, "btn": typeof btn === "function" ? btn() : btn }, null), // @ts-ignore class: classNames(type && `${noticePrefixCls}-${type}`, hashId, className) })); }; const destroy = (key2) => { var _a, _b; if (key2 !== void 0) { (_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.close(key2); } else { (_b = holderRef.value) === null || _b === void 0 ? void 0 : _b.destroy(); } }; const wrapAPI = { open: open2, destroy }; const keys2 = ["success", "info", "warning", "error"]; keys2.forEach((type) => { wrapAPI[type] = (config) => open2(_extends$1(_extends$1({}, config), { type })); }); return [wrapAPI, () => createVNode(Holder, _objectSpread2$1(_objectSpread2$1({ "key": holderKey }, notificationConfig), {}, { "ref": holderRef }), null)]; } function useNotification(notificationConfig) { return useInternalNotification(notificationConfig); } const notificationInstance = {}; let defaultDuration = 4.5; let defaultTop = "24px"; let defaultBottom = "24px"; let defaultPrefixCls$1 = ""; let defaultPlacement = "topRight"; let defaultGetContainer = () => document.body; let defaultCloseIcon = null; let rtl = false; let maxCount; function setNotificationConfig(options) { const { duration, placement, bottom, top, getContainer: getContainer2, closeIcon, prefixCls } = options; if (prefixCls !== void 0) { defaultPrefixCls$1 = prefixCls; } if (duration !== void 0) { defaultDuration = duration; } if (placement !== void 0) { defaultPlacement = placement; } if (bottom !== void 0) { defaultBottom = typeof bottom === "number" ? `${bottom}px` : bottom; } if (top !== void 0) { defaultTop = typeof top === "number" ? `${top}px` : top; } if (getContainer2 !== void 0) { defaultGetContainer = getContainer2; } if (closeIcon !== void 0) { defaultCloseIcon = closeIcon; } if (options.rtl !== void 0) { rtl = options.rtl; } if (options.maxCount !== void 0) { maxCount = options.maxCount; } } function getNotificationInstance(_ref, callback) { let { prefixCls: customizePrefixCls, placement = defaultPlacement, getContainer: getContainer2 = defaultGetContainer, top, bottom, closeIcon = defaultCloseIcon, appContext } = _ref; const { getPrefixCls } = globalConfig(); const prefixCls = getPrefixCls("notification", customizePrefixCls || defaultPrefixCls$1); const cacheKey = `${prefixCls}-${placement}-${rtl}`; const cacheInstance = notificationInstance[cacheKey]; if (cacheInstance) { Promise.resolve(cacheInstance).then((instance) => { callback(instance); }); return; } const notificationClass = classNames(`${prefixCls}-${placement}`, { [`${prefixCls}-rtl`]: rtl === true }); Notification$1.newInstance({ name: "notification", prefixCls: customizePrefixCls || defaultPrefixCls$1, useStyle: useStyle$4, class: notificationClass, style: getPlacementStyle(placement, top !== null && top !== void 0 ? top : defaultTop, bottom !== null && bottom !== void 0 ? bottom : defaultBottom), appContext, getContainer: getContainer2, closeIcon: (_ref2) => { let { prefixCls: prefixCls2 } = _ref2; const closeIconToRender = createVNode("span", { "class": `${prefixCls2}-close-x` }, [renderHelper(closeIcon, {}, createVNode(CloseOutlined, { "class": `${prefixCls2}-close-icon` }, null))]); return closeIconToRender; }, maxCount, hasTransitionName: true }, (notification) => { notificationInstance[cacheKey] = notification; callback(notification); }); } const typeToIcon = { success: CheckCircleOutlined, info: InfoCircleOutlined, error: CloseCircleOutlined, warning: ExclamationCircleOutlined }; function notice(args) { const { icon, type, description, message, btn } = args; const duration = args.duration === void 0 ? defaultDuration : args.duration; getNotificationInstance(args, (notification) => { notification.notice({ content: (_ref3) => { let { prefixCls: outerPrefixCls } = _ref3; const prefixCls = `${outerPrefixCls}-notice`; let iconNode = null; if (icon) { iconNode = () => createVNode("span", { "class": `${prefixCls}-icon` }, [renderHelper(icon)]); } else if (type) { const Icon2 = typeToIcon[type]; iconNode = () => createVNode(Icon2, { "class": `${prefixCls}-icon ${prefixCls}-icon-${type}` }, null); } return createVNode("div", { "class": iconNode ? `${prefixCls}-with-icon` : "" }, [iconNode && iconNode(), createVNode("div", { "class": `${prefixCls}-message` }, [!description && iconNode ? createVNode("span", { "class": `${prefixCls}-message-single-line-auto-margin` }, null) : null, renderHelper(message)]), createVNode("div", { "class": `${prefixCls}-description` }, [renderHelper(description)]), btn ? createVNode("span", { "class": `${prefixCls}-btn` }, [renderHelper(btn)]) : null]); }, duration, closable: true, onClose: args.onClose, onClick: args.onClick, key: args.key, style: args.style || {}, class: args.class }); }); } const api = { open: notice, close(key2) { Object.keys(notificationInstance).forEach((cacheKey) => Promise.resolve(notificationInstance[cacheKey]).then((instance) => { instance.removeNotice(key2); })); }, config: setNotificationConfig, destroy() { Object.keys(notificationInstance).forEach((cacheKey) => { Promise.resolve(notificationInstance[cacheKey]).then((instance) => { instance.destroy(); }); delete notificationInstance[cacheKey]; }); } }; const iconTypes = ["success", "info", "warning", "error"]; iconTypes.forEach((type) => { api[type] = (args) => api.open(_extends$1(_extends$1({}, args), { type })); }); api.warn = api.warning; api.useNotification = useNotification; const dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`; function getStyle(globalPrefixCls, theme) { const variables = {}; const formatColor = (color, updater) => { let clone = color.clone(); clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone; return clone.toRgbString(); }; const fillColor = (colorVal, type) => { const baseColor = new TinyColor(colorVal); const colorPalettes = generate$1(baseColor.toRgbString()); variables[`${type}-color`] = formatColor(baseColor); variables[`${type}-color-disabled`] = colorPalettes[1]; variables[`${type}-color-hover`] = colorPalettes[4]; variables[`${type}-color-active`] = colorPalettes[6]; variables[`${type}-color-outline`] = baseColor.clone().setAlpha(0.2).toRgbString(); variables[`${type}-color-deprecated-bg`] = colorPalettes[0]; variables[`${type}-color-deprecated-border`] = colorPalettes[2]; }; if (theme.primaryColor) { fillColor(theme.primaryColor, "primary"); const primaryColor = new TinyColor(theme.primaryColor); const primaryColors = generate$1(primaryColor.toRgbString()); primaryColors.forEach((color, index2) => { variables[`primary-${index2 + 1}`] = color; }); variables["primary-color-deprecated-l-35"] = formatColor(primaryColor, (c2) => c2.lighten(35)); variables["primary-color-deprecated-l-20"] = formatColor(primaryColor, (c2) => c2.lighten(20)); variables["primary-color-deprecated-t-20"] = formatColor(primaryColor, (c2) => c2.tint(20)); variables["primary-color-deprecated-t-50"] = formatColor(primaryColor, (c2) => c2.tint(50)); variables["primary-color-deprecated-f-12"] = formatColor(primaryColor, (c2) => c2.setAlpha(c2.getAlpha() * 0.12)); const primaryActiveColor = new TinyColor(primaryColors[0]); variables["primary-color-active-deprecated-f-30"] = formatColor(primaryActiveColor, (c2) => c2.setAlpha(c2.getAlpha() * 0.3)); variables["primary-color-active-deprecated-d-02"] = formatColor(primaryActiveColor, (c2) => c2.darken(2)); } if (theme.successColor) { fillColor(theme.successColor, "success"); } if (theme.warningColor) { fillColor(theme.warningColor, "warning"); } if (theme.errorColor) { fillColor(theme.errorColor, "error"); } if (theme.infoColor) { fillColor(theme.infoColor, "info"); } const cssList = Object.keys(variables).map((key2) => `--${globalPrefixCls}-${key2}: ${variables[key2]};`); return ` :root { ${cssList.join("\n")} } `.trim(); } function registerTheme(globalPrefixCls, theme) { const style = getStyle(globalPrefixCls, theme); if (canUseDom$1()) { updateCSS$1(style, `${dynamicStyleMark}-dynamic-theme`); } } const useStyle$3 = (iconPrefixCls) => { const [theme, token2] = useToken(); return useStyleRegister(computed(() => ({ theme: theme.value, token: token2.value, hashId: "", path: ["ant-design-icons", iconPrefixCls.value] })), () => [{ [`.${iconPrefixCls.value}`]: _extends$1(_extends$1({}, resetIcon()), { [`.${iconPrefixCls.value} .${iconPrefixCls.value}-icon`]: { display: "block" } }) }]); }; function useTheme(theme, parentTheme) { const themeConfig = computed(() => (theme === null || theme === void 0 ? void 0 : theme.value) || {}); const parentThemeConfig = computed(() => themeConfig.value.inherit === false || !(parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.value) ? defaultConfig : parentTheme.value); const mergedTheme = computed(() => { if (!(theme === null || theme === void 0 ? void 0 : theme.value)) { return parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.value; } const mergedComponents = _extends$1({}, parentThemeConfig.value.components); Object.keys(theme.value.components || {}).forEach((componentName) => { mergedComponents[componentName] = _extends$1(_extends$1({}, mergedComponents[componentName]), theme.value.components[componentName]); }); return _extends$1(_extends$1(_extends$1({}, parentThemeConfig.value), themeConfig.value), { token: _extends$1(_extends$1({}, parentThemeConfig.value.token), themeConfig.value.token), components: mergedComponents }); }); return mergedTheme; } var __rest$9 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const defaultPrefixCls = "ant"; function getGlobalPrefixCls() { return globalConfigForApi.prefixCls || defaultPrefixCls; } function getGlobalIconPrefixCls() { return globalConfigForApi.iconPrefixCls || defaultIconPrefixCls; } const globalConfigBySet = reactive({}); const globalConfigForApi = reactive({}); watchEffect(() => { _extends$1(globalConfigForApi, globalConfigBySet); globalConfigForApi.prefixCls = getGlobalPrefixCls(); globalConfigForApi.iconPrefixCls = getGlobalIconPrefixCls(); globalConfigForApi.getPrefixCls = (suffixCls, customizePrefixCls) => { if (customizePrefixCls) return customizePrefixCls; return suffixCls ? `${globalConfigForApi.prefixCls}-${suffixCls}` : globalConfigForApi.prefixCls; }; globalConfigForApi.getRootPrefixCls = () => { if (globalConfigForApi.prefixCls) { return globalConfigForApi.prefixCls; } return getGlobalPrefixCls(); }; }); let stopWatchEffect; const setGlobalConfig = (params) => { if (stopWatchEffect) { stopWatchEffect(); } stopWatchEffect = watchEffect(() => { _extends$1(globalConfigBySet, reactive(params)); _extends$1(globalConfigForApi, reactive(params)); }); if (params.theme) { registerTheme(getGlobalPrefixCls(), params.theme); } }; const globalConfig = () => ({ getPrefixCls: (suffixCls, customizePrefixCls) => { if (customizePrefixCls) return customizePrefixCls; return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls(); }, getIconPrefixCls: getGlobalIconPrefixCls, getRootPrefixCls: () => { if (globalConfigForApi.prefixCls) { return globalConfigForApi.prefixCls; } return getGlobalPrefixCls(); } }); const ConfigProvider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AConfigProvider", inheritAttrs: false, props: configProviderProps(), setup(props2, _ref) { let { slots } = _ref; const parentContext = useConfigContextInject(); const getPrefixCls = (suffixCls, customizePrefixCls) => { const { prefixCls = "ant" } = props2; if (customizePrefixCls) return customizePrefixCls; const mergedPrefixCls = prefixCls || parentContext.getPrefixCls(""); return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls; }; const iconPrefixCls = computed(() => props2.iconPrefixCls || parentContext.iconPrefixCls.value || defaultIconPrefixCls); const shouldWrapSSR = computed(() => iconPrefixCls.value !== parentContext.iconPrefixCls.value); const csp = computed(() => { var _a; return props2.csp || ((_a = parentContext.csp) === null || _a === void 0 ? void 0 : _a.value); }); const wrapSSR = useStyle$3(iconPrefixCls); const mergedTheme = useTheme(computed(() => props2.theme), computed(() => { var _a; return (_a = parentContext.theme) === null || _a === void 0 ? void 0 : _a.value; })); const renderEmptyComponent = (name) => { const renderEmpty$1 = props2.renderEmpty || slots.renderEmpty || parentContext.renderEmpty || renderEmpty; return renderEmpty$1(name); }; const autoInsertSpaceInButton = computed(() => { var _a, _b; return (_a = props2.autoInsertSpaceInButton) !== null && _a !== void 0 ? _a : (_b = parentContext.autoInsertSpaceInButton) === null || _b === void 0 ? void 0 : _b.value; }); const locale2 = computed(() => { var _a; return props2.locale || ((_a = parentContext.locale) === null || _a === void 0 ? void 0 : _a.value); }); watch(locale2, () => { globalConfigBySet.locale = locale2.value; }, { immediate: true }); const direction = computed(() => { var _a; return props2.direction || ((_a = parentContext.direction) === null || _a === void 0 ? void 0 : _a.value); }); const space = computed(() => { var _a, _b; return (_a = props2.space) !== null && _a !== void 0 ? _a : (_b = parentContext.space) === null || _b === void 0 ? void 0 : _b.value; }); const virtual = computed(() => { var _a, _b; return (_a = props2.virtual) !== null && _a !== void 0 ? _a : (_b = parentContext.virtual) === null || _b === void 0 ? void 0 : _b.value; }); const dropdownMatchSelectWidth = computed(() => { var _a, _b; return (_a = props2.dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : (_b = parentContext.dropdownMatchSelectWidth) === null || _b === void 0 ? void 0 : _b.value; }); const getTargetContainer = computed(() => { var _a; return props2.getTargetContainer !== void 0 ? props2.getTargetContainer : (_a = parentContext.getTargetContainer) === null || _a === void 0 ? void 0 : _a.value; }); const getPopupContainer = computed(() => { var _a; return props2.getPopupContainer !== void 0 ? props2.getPopupContainer : (_a = parentContext.getPopupContainer) === null || _a === void 0 ? void 0 : _a.value; }); const pageHeader = computed(() => { var _a; return props2.pageHeader !== void 0 ? props2.pageHeader : (_a = parentContext.pageHeader) === null || _a === void 0 ? void 0 : _a.value; }); const input = computed(() => { var _a; return props2.input !== void 0 ? props2.input : (_a = parentContext.input) === null || _a === void 0 ? void 0 : _a.value; }); const pagination = computed(() => { var _a; return props2.pagination !== void 0 ? props2.pagination : (_a = parentContext.pagination) === null || _a === void 0 ? void 0 : _a.value; }); const form = computed(() => { var _a; return props2.form !== void 0 ? props2.form : (_a = parentContext.form) === null || _a === void 0 ? void 0 : _a.value; }); const select = computed(() => { var _a; return props2.select !== void 0 ? props2.select : (_a = parentContext.select) === null || _a === void 0 ? void 0 : _a.value; }); const componentSize = computed(() => props2.componentSize); const componentDisabled = computed(() => props2.componentDisabled); const wave = computed(() => { var _a, _b; return (_a = props2.wave) !== null && _a !== void 0 ? _a : (_b = parentContext.wave) === null || _b === void 0 ? void 0 : _b.value; }); const configProvider = { csp, autoInsertSpaceInButton, locale: locale2, direction, space, virtual, dropdownMatchSelectWidth, getPrefixCls, iconPrefixCls, theme: computed(() => { var _a, _b; return (_a = mergedTheme.value) !== null && _a !== void 0 ? _a : (_b = parentContext.theme) === null || _b === void 0 ? void 0 : _b.value; }), renderEmpty: renderEmptyComponent, getTargetContainer, getPopupContainer, pageHeader, input, pagination, form, select, componentSize, componentDisabled, transformCellText: computed(() => props2.transformCellText), wave }; const memoTheme = computed(() => { const _a = mergedTheme.value || {}, { algorithm, token: token2 } = _a, rest = __rest$9(_a, ["algorithm", "token"]); const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : void 0; return _extends$1(_extends$1({}, rest), { theme: themeObj, token: _extends$1(_extends$1({}, seedToken), token2) }); }); const validateMessagesRef = computed(() => { var _a, _b; let validateMessages = {}; if (locale2.value) { validateMessages = ((_a = locale2.value.Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || ((_b = localeValues$1.Form) === null || _b === void 0 ? void 0 : _b.defaultValidateMessages) || {}; } if (props2.form && props2.form.validateMessages) { validateMessages = _extends$1(_extends$1({}, validateMessages), props2.form.validateMessages); } return validateMessages; }); useConfigContextProvider(configProvider); useProvideGlobalForm({ validateMessages: validateMessagesRef }); useProviderSize(componentSize); useProviderDisabled(componentDisabled); const renderProvider = (legacyLocale) => { var _a, _b; let childNode = shouldWrapSSR.value ? wrapSSR((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) : (_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots); if (props2.theme) { const _childNode = /* @__PURE__ */ function() { return childNode; }(); childNode = createVNode(DesignTokenProvider, { "value": memoTheme.value }, { default: () => [_childNode] }); } return createVNode(locale$3, { "locale": locale2.value || legacyLocale, "ANT_MARK__": ANT_MARK }, { default: () => [childNode] }); }; watchEffect(() => { if (direction.value) { api$1.config({ rtl: direction.value === "rtl" }); api.config({ rtl: direction.value === "rtl" }); } }); return () => createVNode(LocaleReceiver, { "children": (_2, __, legacyLocale) => renderProvider(legacyLocale) }, null); } }); ConfigProvider.config = setGlobalConfig; ConfigProvider.install = function(app) { app.component(ConfigProvider.name, ConfigProvider); }; const isValid$1 = (value) => { return value !== void 0 && value !== null && (Array.isArray(value) ? filterEmpty(value).length : true); }; function hasPrefixSuffix(propsAndSlots) { return isValid$1(propsAndSlots.prefix) || isValid$1(propsAndSlots.suffix) || isValid$1(propsAndSlots.allowClear); } function hasAddon$1(propsAndSlots) { return isValid$1(propsAndSlots.addonBefore) || isValid$1(propsAndSlots.addonAfter); } function fixControlledValue(value) { if (typeof value === "undefined" || value === null) { return ""; } return String(value); } function resolveOnChange(target, e2, onChange, targetValue) { if (!onChange) { return; } const event = e2; if (e2.type === "click") { Object.defineProperty(event, "target", { writable: true }); Object.defineProperty(event, "currentTarget", { writable: true }); const currentTarget = target.cloneNode(true); event.target = currentTarget; event.currentTarget = currentTarget; currentTarget.value = ""; onChange(event); return; } if (targetValue !== void 0) { Object.defineProperty(event, "target", { writable: true }); Object.defineProperty(event, "currentTarget", { writable: true }); event.target = target; event.currentTarget = target; target.value = targetValue; onChange(event); return; } onChange(event); } function triggerFocus(element, option) { if (!element) return; element.focus(option); const { cursor } = option || {}; if (cursor) { const len = element.value.length; switch (cursor) { case "start": element.setSelectionRange(0, 0); break; case "end": element.setSelectionRange(len, len); break; default: element.setSelectionRange(0, len); } } } const commonInputProps = () => { return { addonBefore: PropTypes.any, addonAfter: PropTypes.any, prefix: PropTypes.any, suffix: PropTypes.any, clearIcon: PropTypes.any, affixWrapperClassName: String, groupClassName: String, wrapperClassName: String, inputClassName: String, allowClear: { type: Boolean, default: void 0 } }; }; const baseInputProps = () => { return _extends$1(_extends$1({}, commonInputProps()), { value: { type: [String, Number, Symbol], default: void 0 }, defaultValue: { type: [String, Number, Symbol], default: void 0 }, inputElement: PropTypes.any, prefixCls: String, disabled: { type: Boolean, default: void 0 }, focused: { type: Boolean, default: void 0 }, triggerFocus: Function, readonly: { type: Boolean, default: void 0 }, handleReset: Function, hidden: { type: Boolean, default: void 0 } }); }; const inputProps$1 = () => _extends$1(_extends$1({}, baseInputProps()), { id: String, placeholder: { type: [String, Number] }, autocomplete: String, type: stringType("text"), name: String, size: { type: String }, autofocus: { type: Boolean, default: void 0 }, lazy: { type: Boolean, default: true }, maxlength: Number, loading: { type: Boolean, default: void 0 }, bordered: { type: Boolean, default: void 0 }, showCount: { type: [Boolean, Object] }, htmlSize: Number, onPressEnter: Function, onKeydown: Function, onKeyup: Function, onFocus: Function, onBlur: Function, onChange: Function, onInput: Function, "onUpdate:value": Function, onCompositionstart: Function, onCompositionend: Function, valueModifiers: Object, hidden: { type: Boolean, default: void 0 }, status: String }); const BaseInput = /* @__PURE__ */ defineComponent({ name: "BaseInput", inheritAttrs: false, props: baseInputProps(), setup(props2, _ref) { let { slots, attrs } = _ref; const containerRef = ref(); const onInputMouseDown = (e2) => { var _a; if ((_a = containerRef.value) === null || _a === void 0 ? void 0 : _a.contains(e2.target)) { const { triggerFocus: triggerFocus2 } = props2; triggerFocus2 === null || triggerFocus2 === void 0 ? void 0 : triggerFocus2(); } }; const getClearIcon = () => { var _a; const { allowClear, value, disabled, readonly: readonly2, handleReset, suffix = slots.suffix, prefixCls } = props2; if (!allowClear) { return null; } const needClear = !disabled && !readonly2 && value; const className = `${prefixCls}-clear-icon`; const iconNode = ((_a = slots.clearIcon) === null || _a === void 0 ? void 0 : _a.call(slots)) || "*"; return createVNode("span", { "onClick": handleReset, "onMousedown": (e2) => e2.preventDefault(), "class": classNames({ [`${className}-hidden`]: !needClear, [`${className}-has-suffix`]: !!suffix }, className), "role": "button", "tabindex": -1 }, [iconNode]); }; return () => { var _a, _b; const { focused, value, disabled, allowClear, readonly: readonly2, hidden, prefixCls, prefix = (_a = slots.prefix) === null || _a === void 0 ? void 0 : _a.call(slots), suffix = (_b = slots.suffix) === null || _b === void 0 ? void 0 : _b.call(slots), addonAfter = slots.addonAfter, addonBefore = slots.addonBefore, inputElement, affixWrapperClassName, wrapperClassName, groupClassName } = props2; let element = cloneElement(inputElement, { value, hidden }); if (hasPrefixSuffix({ prefix, suffix, allowClear })) { const affixWrapperPrefixCls = `${prefixCls}-affix-wrapper`; const affixWrapperCls = classNames(affixWrapperPrefixCls, { [`${affixWrapperPrefixCls}-disabled`]: disabled, [`${affixWrapperPrefixCls}-focused`]: focused, [`${affixWrapperPrefixCls}-readonly`]: readonly2, [`${affixWrapperPrefixCls}-input-with-clear-btn`]: suffix && allowClear && value }, !hasAddon$1({ addonAfter, addonBefore }) && attrs.class, affixWrapperClassName); const suffixNode = (suffix || allowClear) && createVNode("span", { "class": `${prefixCls}-suffix` }, [getClearIcon(), suffix]); element = createVNode("span", { "class": affixWrapperCls, "style": attrs.style, "hidden": !hasAddon$1({ addonAfter, addonBefore }) && hidden, "onMousedown": onInputMouseDown, "ref": containerRef }, [prefix && createVNode("span", { "class": `${prefixCls}-prefix` }, [prefix]), cloneElement(inputElement, { style: null, value, hidden: null }), suffixNode]); } if (hasAddon$1({ addonAfter, addonBefore })) { const wrapperCls = `${prefixCls}-group`; const addonCls = `${wrapperCls}-addon`; const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, wrapperCls, wrapperClassName); const mergedGroupClassName = classNames(`${prefixCls}-group-wrapper`, attrs.class, groupClassName); return createVNode("span", { "class": mergedGroupClassName, "style": attrs.style, "hidden": hidden }, [createVNode("span", { "class": mergedWrapperClassName }, [addonBefore && createVNode("span", { "class": addonCls }, [addonBefore]), cloneElement(element, { style: null, hidden: null }), addonAfter && createVNode("span", { "class": addonCls }, [addonAfter])])]); } return element; }; } }); var __rest$8 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const VcInput = /* @__PURE__ */ defineComponent({ name: "VCInput", inheritAttrs: false, props: inputProps$1(), setup(props2, _ref) { let { slots, attrs, expose, emit: emit2 } = _ref; const stateValue = shallowRef(props2.value === void 0 ? props2.defaultValue : props2.value); const focused = shallowRef(false); const inputRef = shallowRef(); const rootRef = shallowRef(); watch(() => props2.value, () => { stateValue.value = props2.value; }); watch(() => props2.disabled, () => { if (props2.disabled) { focused.value = false; } }); const focus = (option) => { if (inputRef.value) { triggerFocus(inputRef.value.input, option); } }; const blur = () => { var _a; (_a = inputRef.value.input) === null || _a === void 0 ? void 0 : _a.blur(); }; const setSelectionRange = (start, end, direction) => { var _a; (_a = inputRef.value.input) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end, direction); }; const select = () => { var _a; (_a = inputRef.value.input) === null || _a === void 0 ? void 0 : _a.select(); }; expose({ focus, blur, input: computed(() => { var _a; return (_a = inputRef.value.input) === null || _a === void 0 ? void 0 : _a.input; }), stateValue, setSelectionRange, select }); const triggerChange = (e2) => { emit2("change", e2); }; const setValue2 = (value, callback) => { if (stateValue.value === value) { return; } if (props2.value === void 0) { stateValue.value = value; } else { nextTick(() => { var _a; if (inputRef.value.input.value !== stateValue.value) { (_a = rootRef.value) === null || _a === void 0 ? void 0 : _a.$forceUpdate(); } }); } nextTick(() => { callback && callback(); }); }; const handleChange = (e2) => { const { value } = e2.target; if (stateValue.value === value) return; const newVal = e2.target.value; resolveOnChange(inputRef.value.input, e2, triggerChange); setValue2(newVal); }; const handleKeyDown = (e2) => { if (e2.keyCode === 13) { emit2("pressEnter", e2); } emit2("keydown", e2); }; const handleFocus = (e2) => { focused.value = true; emit2("focus", e2); }; const handleBlur = (e2) => { focused.value = false; emit2("blur", e2); }; const handleReset = (e2) => { resolveOnChange(inputRef.value.input, e2, triggerChange); setValue2("", () => { focus(); }); }; const getInputElement = () => { var _a, _b; const { addonBefore = slots.addonBefore, addonAfter = slots.addonAfter, disabled, valueModifiers = {}, htmlSize, autocomplete, prefixCls, inputClassName, prefix = (_a = slots.prefix) === null || _a === void 0 ? void 0 : _a.call(slots), suffix = (_b = slots.suffix) === null || _b === void 0 ? void 0 : _b.call(slots), allowClear, type = "text" } = props2; const otherProps = omit$1(props2, [ "prefixCls", "onPressEnter", "addonBefore", "addonAfter", "prefix", "suffix", "allowClear", // Input elements must be either controlled or uncontrolled, // specify either the value prop, or the defaultValue prop, but not both. "defaultValue", "size", "bordered", "htmlSize", "lazy", "showCount", "valueModifiers", "showCount", "affixWrapperClassName", "groupClassName", "inputClassName", "wrapperClassName" ]); const inputProps2 = _extends$1(_extends$1(_extends$1({}, otherProps), attrs), { autocomplete, onChange: handleChange, onInput: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeydown: handleKeyDown, class: classNames(prefixCls, { [`${prefixCls}-disabled`]: disabled }, inputClassName, !hasAddon$1({ addonAfter, addonBefore }) && !hasPrefixSuffix({ prefix, suffix, allowClear }) && attrs.class), ref: inputRef, key: "ant-input", size: htmlSize, type, lazy: props2.lazy }); if (valueModifiers.lazy) { delete inputProps2.onInput; } if (!inputProps2.autofocus) { delete inputProps2.autofocus; } const inputNode = createVNode(BaseInput$1, omit$1(inputProps2, ["size"]), null); return inputNode; }; const getSuffix = () => { var _a; const { maxlength, suffix = (_a = slots.suffix) === null || _a === void 0 ? void 0 : _a.call(slots), showCount, prefixCls } = props2; const hasMaxLength = Number(maxlength) > 0; if (suffix || showCount) { const valueLength = [...fixControlledValue(stateValue.value)].length; const dataCount = typeof showCount === "object" ? showCount.formatter({ count: valueLength, maxlength }) : `${valueLength}${hasMaxLength ? ` / ${maxlength}` : ""}`; return createVNode(Fragment, null, [!!showCount && createVNode("span", { "class": classNames(`${prefixCls}-show-count-suffix`, { [`${prefixCls}-show-count-has-suffix`]: !!suffix }) }, [dataCount]), suffix]); } return null; }; onMounted(() => { }); return () => { const { prefixCls, disabled } = props2, rest = __rest$8(props2, ["prefixCls", "disabled"]); return createVNode(BaseInput, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, rest), attrs), {}, { "ref": rootRef, "prefixCls": prefixCls, "inputElement": getInputElement(), "handleReset": handleReset, "value": fixControlledValue(stateValue.value), "focused": focused.value, "triggerFocus": focus, "suffix": getSuffix(), "disabled": disabled }), slots); }; } }); const inputProps = () => { return omit$1(inputProps$1(), ["wrapperClassName", "groupClassName", "inputClassName", "affixWrapperClassName"]); }; const textAreaProps = () => _extends$1(_extends$1({}, omit$1(inputProps(), ["prefix", "addonBefore", "addonAfter", "suffix"])), { rows: Number, autosize: { type: [Boolean, Object], default: void 0 }, autoSize: { type: [Boolean, Object], default: void 0 }, onResize: { type: Function }, onCompositionstart: eventType(), onCompositionend: eventType(), valueModifiers: Object }); var __rest$7 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const Input = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AInput", inheritAttrs: false, props: inputProps(), setup(props2, _ref) { let { slots, attrs, expose, emit: emit2 } = _ref; const inputRef = ref(); const formItemContext = useInjectFormItemContext(); const formItemInputContext = FormItemInputContext.useInject(); const mergedStatus = computed(() => getMergedStatus(formItemInputContext.status, props2.status)); const { direction, prefixCls, size, autocomplete } = useConfigInject("input", props2); const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction); const mergedSize = computed(() => { return compactSize.value || size.value; }); const [wrapSSR, hashId] = useStyle$9(prefixCls); const disabled = useInjectDisabled(); const focus = (option) => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus(option); }; const blur = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; const setSelectionRange = (start, end, direction2) => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.setSelectionRange(start, end, direction2); }; const select = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.select(); }; expose({ focus, blur, input: inputRef, setSelectionRange, select }); const removePasswordTimeoutRef = ref([]); const removePasswordTimeout = () => { removePasswordTimeoutRef.value.push(setTimeout(() => { var _a, _b, _c, _d; if (((_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.value) === null || _b === void 0 ? void 0 : _b.input.getAttribute("type")) === "password" && ((_c = inputRef.value) === null || _c === void 0 ? void 0 : _c.input.hasAttribute("value"))) { (_d = inputRef.value) === null || _d === void 0 ? void 0 : _d.input.removeAttribute("value"); } })); }; onMounted(() => { removePasswordTimeout(); }); onBeforeUpdate(() => { removePasswordTimeoutRef.value.forEach((item) => clearTimeout(item)); }); onBeforeUnmount(() => { removePasswordTimeoutRef.value.forEach((item) => clearTimeout(item)); }); const handleBlur = (e2) => { removePasswordTimeout(); emit2("blur", e2); formItemContext.onFieldBlur(); }; const handleFocus = (e2) => { removePasswordTimeout(); emit2("focus", e2); }; const triggerChange = (e2) => { emit2("update:value", e2.target.value); emit2("change", e2); emit2("input", e2); formItemContext.onFieldChange(); }; return () => { var _a, _b, _c, _d, _e, _f; const { hasFeedback, feedbackIcon } = formItemInputContext; const { allowClear, bordered = true, prefix = (_a = slots.prefix) === null || _a === void 0 ? void 0 : _a.call(slots), suffix = (_b = slots.suffix) === null || _b === void 0 ? void 0 : _b.call(slots), addonAfter = (_c = slots.addonAfter) === null || _c === void 0 ? void 0 : _c.call(slots), addonBefore = (_d = slots.addonBefore) === null || _d === void 0 ? void 0 : _d.call(slots), id = (_e = formItemContext.id) === null || _e === void 0 ? void 0 : _e.value } = props2, rest = __rest$7(props2, ["allowClear", "bordered", "prefix", "suffix", "addonAfter", "addonBefore", "id"]); const suffixNode = (hasFeedback || suffix) && createVNode(Fragment, null, [suffix, hasFeedback && feedbackIcon]); const prefixClsValue = prefixCls.value; const inputHasPrefixSuffix = hasPrefixSuffix({ prefix, suffix }) || !!hasFeedback; const clearIcon = slots.clearIcon || (() => createVNode(CloseCircleFilled, null, null)); return wrapSSR(createVNode(VcInput, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, attrs), omit$1(rest, ["onUpdate:value", "onChange", "onInput"])), {}, { "onChange": triggerChange, "id": id, "disabled": (_f = props2.disabled) !== null && _f !== void 0 ? _f : disabled.value, "ref": inputRef, "prefixCls": prefixClsValue, "autocomplete": autocomplete.value, "onBlur": handleBlur, "onFocus": handleFocus, "prefix": prefix, "suffix": suffixNode, "allowClear": allowClear, "addonAfter": addonAfter && createVNode(NoCompactStyle, null, { default: () => [createVNode(NoFormStatus, null, { default: () => [addonAfter] })] }), "addonBefore": addonBefore && createVNode(NoCompactStyle, null, { default: () => [createVNode(NoFormStatus, null, { default: () => [addonBefore] })] }), "class": [attrs.class, compactItemClassnames.value], "inputClassName": classNames({ [`${prefixClsValue}-sm`]: mergedSize.value === "small", [`${prefixClsValue}-lg`]: mergedSize.value === "large", [`${prefixClsValue}-rtl`]: direction.value === "rtl", [`${prefixClsValue}-borderless`]: !bordered }, !inputHasPrefixSuffix && getStatusClassNames(prefixClsValue, mergedStatus.value), hashId.value), "affixWrapperClassName": classNames({ [`${prefixClsValue}-affix-wrapper-sm`]: mergedSize.value === "small", [`${prefixClsValue}-affix-wrapper-lg`]: mergedSize.value === "large", [`${prefixClsValue}-affix-wrapper-rtl`]: direction.value === "rtl", [`${prefixClsValue}-affix-wrapper-borderless`]: !bordered }, getStatusClassNames(`${prefixClsValue}-affix-wrapper`, mergedStatus.value, hasFeedback), hashId.value), "wrapperClassName": classNames({ [`${prefixClsValue}-group-rtl`]: direction.value === "rtl" }, hashId.value), "groupClassName": classNames({ [`${prefixClsValue}-group-wrapper-sm`]: mergedSize.value === "small", [`${prefixClsValue}-group-wrapper-lg`]: mergedSize.value === "large", [`${prefixClsValue}-group-wrapper-rtl`]: direction.value === "rtl" }, getStatusClassNames(`${prefixClsValue}-group-wrapper`, mergedStatus.value, hasFeedback), hashId.value) }), _extends$1(_extends$1({}, slots), { clearIcon }))); }; } }); const Group$1 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AInputGroup", inheritAttrs: false, props: { prefixCls: String, size: { type: String }, compact: { type: Boolean, default: void 0 } }, setup(props2, _ref) { let { slots, attrs } = _ref; const { prefixCls, direction, getPrefixCls } = useConfigInject("input-group", props2); const formItemInputContext = FormItemInputContext.useInject(); FormItemInputContext.useProvide(formItemInputContext, { isFormItemInput: false }); const inputPrefixCls = computed(() => getPrefixCls("input")); const [wrapSSR, hashId] = useStyle$9(inputPrefixCls); const cls = computed(() => { const pre = prefixCls.value; return { [`${pre}`]: true, [hashId.value]: true, [`${pre}-lg`]: props2.size === "large", [`${pre}-sm`]: props2.size === "small", [`${pre}-compact`]: props2.compact, [`${pre}-rtl`]: direction.value === "rtl" }; }); return () => { var _a; return wrapSSR(createVNode("span", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "class": classNames(cls.value, attrs.class) }), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])); }; } }); var __rest$6 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const Search = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AInputSearch", inheritAttrs: false, props: _extends$1(_extends$1({}, inputProps()), { inputPrefixCls: String, // 不能设置默认值 https://github.com/vueComponent/ant-design-vue/issues/1916 enterButton: PropTypes.any, onSearch: { type: Function } }), setup(props2, _ref) { let { slots, attrs, expose, emit: emit2 } = _ref; const inputRef = shallowRef(); const composedRef = shallowRef(false); const focus = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; expose({ focus, blur }); const onChange = (e2) => { emit2("update:value", e2.target.value); if (e2 && e2.target && e2.type === "click") { emit2("search", e2.target.value, e2); } emit2("change", e2); }; const onMousedown = (e2) => { var _a; if (document.activeElement === ((_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.input)) { e2.preventDefault(); } }; const onSearch = (e2) => { var _a, _b; emit2("search", (_b = (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.stateValue, e2); }; const onPressEnter = (e2) => { if (composedRef.value || props2.loading) { return; } onSearch(e2); }; const handleOnCompositionStart = (e2) => { composedRef.value = true; emit2("compositionstart", e2); }; const handleOnCompositionEnd = (e2) => { composedRef.value = false; emit2("compositionend", e2); }; const { prefixCls, getPrefixCls, direction, size } = useConfigInject("input-search", props2); const inputPrefixCls = computed(() => getPrefixCls("input", props2.inputPrefixCls)); return () => { var _a, _b, _c, _d; const { disabled, loading, addonAfter = (_a = slots.addonAfter) === null || _a === void 0 ? void 0 : _a.call(slots), suffix = (_b = slots.suffix) === null || _b === void 0 ? void 0 : _b.call(slots) } = props2, restProps = __rest$6(props2, ["disabled", "loading", "addonAfter", "suffix"]); let { enterButton = (_d = (_c = slots.enterButton) === null || _c === void 0 ? void 0 : _c.call(slots)) !== null && _d !== void 0 ? _d : false } = props2; enterButton = enterButton || enterButton === ""; const searchIcon = typeof enterButton === "boolean" ? createVNode(SearchOutlined, null, null) : null; const btnClassName = `${prefixCls.value}-button`; const enterButtonAsElement = Array.isArray(enterButton) ? enterButton[0] : enterButton; let button; const isAntdButton = enterButtonAsElement.type && isPlainObject(enterButtonAsElement.type) && enterButtonAsElement.type.__ANT_BUTTON; if (isAntdButton || enterButtonAsElement.tagName === "button") { button = cloneElement(enterButtonAsElement, _extends$1({ onMousedown, onClick: onSearch, key: "enterButton" }, isAntdButton ? { class: btnClassName, size: size.value } : {}), false); } else { const iconOnly = searchIcon && !enterButton; button = createVNode(Button$1, { "class": btnClassName, "type": enterButton ? "primary" : void 0, "size": size.value, "disabled": disabled, "key": "enterButton", "onMousedown": onMousedown, "onClick": onSearch, "loading": loading, "icon": iconOnly ? searchIcon : null }, { default: () => [iconOnly ? null : searchIcon || enterButton] }); } if (addonAfter) { button = [button, addonAfter]; } const cls = classNames(prefixCls.value, { [`${prefixCls.value}-rtl`]: direction.value === "rtl", [`${prefixCls.value}-${size.value}`]: !!size.value, [`${prefixCls.value}-with-button`]: !!enterButton }, attrs.class); return createVNode(Input, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ "ref": inputRef }, omit$1(restProps, ["onUpdate:value", "onSearch", "enterButton"])), attrs), {}, { "onPressEnter": onPressEnter, "onCompositionstart": handleOnCompositionStart, "onCompositionend": handleOnCompositionEnd, "size": size.value, "prefixCls": inputPrefixCls.value, "addonAfter": button, "suffix": suffix, "onChange": onChange, "class": cls, "disabled": disabled }), slots); }; } }); const isValid = (value) => { return value !== void 0 && value !== null && (Array.isArray(value) ? filterEmpty(value).length : true); }; function hasAddon(propsAndSlots) { return isValid(propsAndSlots.addonBefore) || isValid(propsAndSlots.addonAfter); } const ClearableInputType = ["text", "input"]; const ClearableLabeledInput = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ClearableLabeledInput", inheritAttrs: false, props: { prefixCls: String, inputType: PropTypes.oneOf(tuple("text", "input")), value: anyType(), defaultValue: anyType(), allowClear: { type: Boolean, default: void 0 }, element: anyType(), handleReset: Function, disabled: { type: Boolean, default: void 0 }, direction: { type: String }, size: { type: String }, suffix: anyType(), prefix: anyType(), addonBefore: anyType(), addonAfter: anyType(), readonly: { type: Boolean, default: void 0 }, focused: { type: Boolean, default: void 0 }, bordered: { type: Boolean, default: true }, triggerFocus: { type: Function }, hidden: Boolean, status: String, hashId: String }, setup(props2, _ref) { let { slots, attrs } = _ref; const statusContext = FormItemInputContext.useInject(); const renderClearIcon = (prefixCls) => { const { value, disabled, readonly: readonly2, handleReset, suffix = slots.suffix } = props2; const needClear = !disabled && !readonly2 && value; const className = `${prefixCls}-clear-icon`; return createVNode(CloseCircleFilled, { "onClick": handleReset, "onMousedown": (e2) => e2.preventDefault(), "class": classNames({ [`${className}-hidden`]: !needClear, [`${className}-has-suffix`]: !!suffix }, className), "role": "button" }, null); }; const renderTextAreaWithClearIcon = (prefixCls, element) => { const { value, allowClear, direction, bordered, hidden, status: customStatus, addonAfter = slots.addonAfter, addonBefore = slots.addonBefore, hashId } = props2; const { status: contextStatus, hasFeedback } = statusContext; if (!allowClear) { return cloneElement(element, { value, disabled: props2.disabled }); } const affixWrapperCls = classNames(`${prefixCls}-affix-wrapper`, `${prefixCls}-affix-wrapper-textarea-with-clear-btn`, getStatusClassNames(`${prefixCls}-affix-wrapper`, getMergedStatus(contextStatus, customStatus), hasFeedback), { [`${prefixCls}-affix-wrapper-rtl`]: direction === "rtl", [`${prefixCls}-affix-wrapper-borderless`]: !bordered, // className will go to addon wrapper [`${attrs.class}`]: !hasAddon({ addonAfter, addonBefore }) && attrs.class }, hashId); return createVNode("span", { "class": affixWrapperCls, "style": attrs.style, "hidden": hidden }, [cloneElement(element, { style: null, value, disabled: props2.disabled }), renderClearIcon(prefixCls)]); }; return () => { var _a; const { prefixCls, inputType, element = (_a = slots.element) === null || _a === void 0 ? void 0 : _a.call(slots) } = props2; if (inputType === ClearableInputType[0]) { return renderTextAreaWithClearIcon(prefixCls, element); } return null; }; } }); const HIDDEN_TEXTAREA_STYLE = ` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; pointer-events: none !important; `; const SIZING_STYLE = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "font-variant", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break", "white-space"]; const computedStyleCache = {}; let hiddenTextarea; function calculateNodeStyling(node2) { let useCache2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; const nodeRef = node2.getAttribute("id") || node2.getAttribute("data-reactid") || node2.getAttribute("name"); if (useCache2 && computedStyleCache[nodeRef]) { return computedStyleCache[nodeRef]; } const style = window.getComputedStyle(node2); const boxSizing = style.getPropertyValue("box-sizing") || style.getPropertyValue("-moz-box-sizing") || style.getPropertyValue("-webkit-box-sizing"); const paddingSize = parseFloat(style.getPropertyValue("padding-bottom")) + parseFloat(style.getPropertyValue("padding-top")); const borderSize = parseFloat(style.getPropertyValue("border-bottom-width")) + parseFloat(style.getPropertyValue("border-top-width")); const sizingStyle = SIZING_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";"); const nodeInfo = { sizingStyle, paddingSize, borderSize, boxSizing }; if (useCache2 && nodeRef) { computedStyleCache[nodeRef] = nodeInfo; } return nodeInfo; } function calculateAutoSizeStyle(uiTextNode) { let useCache2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; let minRows = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; let maxRows = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; if (!hiddenTextarea) { hiddenTextarea = document.createElement("textarea"); hiddenTextarea.setAttribute("tab-index", "-1"); hiddenTextarea.setAttribute("aria-hidden", "true"); document.body.appendChild(hiddenTextarea); } if (uiTextNode.getAttribute("wrap")) { hiddenTextarea.setAttribute("wrap", uiTextNode.getAttribute("wrap")); } else { hiddenTextarea.removeAttribute("wrap"); } const { paddingSize, borderSize, boxSizing, sizingStyle } = calculateNodeStyling(uiTextNode, useCache2); hiddenTextarea.setAttribute("style", `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`); hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || ""; let minHeight = void 0; let maxHeight = void 0; let overflowY; let height = hiddenTextarea.scrollHeight; if (boxSizing === "border-box") { height += borderSize; } else if (boxSizing === "content-box") { height -= paddingSize; } if (minRows !== null || maxRows !== null) { hiddenTextarea.value = " "; const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize; if (minRows !== null) { minHeight = singleRowHeight * minRows; if (boxSizing === "border-box") { minHeight = minHeight + paddingSize + borderSize; } height = Math.max(minHeight, height); } if (maxRows !== null) { maxHeight = singleRowHeight * maxRows; if (boxSizing === "border-box") { maxHeight = maxHeight + paddingSize + borderSize; } overflowY = height > maxHeight ? "" : "hidden"; height = Math.min(maxHeight, height); } } const style = { height: `${height}px`, overflowY, resize: "none" }; if (minHeight) { style.minHeight = `${minHeight}px`; } if (maxHeight) { style.maxHeight = `${maxHeight}px`; } return style; } const RESIZE_START = 0; const RESIZE_MEASURING = 1; const RESIZE_STABLE = 2; const ResizableTextArea = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ResizableTextArea", inheritAttrs: false, props: textAreaProps(), setup(props2, _ref) { let { attrs, emit: emit2, expose } = _ref; let nextFrameActionId; let resizeFrameId; const textAreaRef = ref(); const textareaStyles = ref({}); const resizeStatus = ref(RESIZE_STABLE); onBeforeUnmount(() => { wrapperRaf.cancel(nextFrameActionId); wrapperRaf.cancel(resizeFrameId); }); const fixFirefoxAutoScroll = () => { try { if (textAreaRef.value && document.activeElement === textAreaRef.value.input) { const currentStart = textAreaRef.value.getSelectionStart(); const currentEnd = textAreaRef.value.getSelectionEnd(); const scrollTop2 = textAreaRef.value.getScrollTop(); textAreaRef.value.setSelectionRange(currentStart, currentEnd); textAreaRef.value.setScrollTop(scrollTop2); } } catch (e2) { } }; const minRows = ref(); const maxRows = ref(); watchEffect(() => { const autoSize = props2.autoSize || props2.autosize; if (autoSize) { minRows.value = autoSize.minRows; maxRows.value = autoSize.maxRows; } else { minRows.value = void 0; maxRows.value = void 0; } }); const needAutoSize = computed(() => !!(props2.autoSize || props2.autosize)); const startResize = () => { resizeStatus.value = RESIZE_START; }; watch([() => props2.value, minRows, maxRows, needAutoSize], () => { if (needAutoSize.value) { startResize(); } }, { immediate: true }); const autoSizeStyle = ref(); watch([resizeStatus, textAreaRef], () => { if (!textAreaRef.value) return; if (resizeStatus.value === RESIZE_START) { resizeStatus.value = RESIZE_MEASURING; } else if (resizeStatus.value === RESIZE_MEASURING) { const textareaStyles2 = calculateAutoSizeStyle(textAreaRef.value.input, false, minRows.value, maxRows.value); resizeStatus.value = RESIZE_STABLE; autoSizeStyle.value = textareaStyles2; } else { fixFirefoxAutoScroll(); } }, { immediate: true, flush: "post" }); const instance = getCurrentInstance(); const resizeRafRef = ref(); const cleanRaf = () => { wrapperRaf.cancel(resizeRafRef.value); }; const onInternalResize = (size) => { if (resizeStatus.value === RESIZE_STABLE) { emit2("resize", size); if (needAutoSize.value) { cleanRaf(); resizeRafRef.value = wrapperRaf(() => { startResize(); }); } } }; onBeforeUnmount(() => { cleanRaf(); }); const resizeTextarea = () => { startResize(); }; expose({ resizeTextarea, textArea: computed(() => { var _a; return (_a = textAreaRef.value) === null || _a === void 0 ? void 0 : _a.input; }), instance }); warning$2(props2.autosize === void 0); const renderTextArea = () => { const { prefixCls, disabled } = props2; const otherProps = omit$1(props2, ["prefixCls", "onPressEnter", "autoSize", "autosize", "defaultValue", "allowClear", "type", "maxlength", "valueModifiers"]); const cls = classNames(prefixCls, attrs.class, { [`${prefixCls}-disabled`]: disabled }); const mergedAutoSizeStyle = needAutoSize.value ? autoSizeStyle.value : null; const style = [attrs.style, textareaStyles.value, mergedAutoSizeStyle]; const textareaProps = _extends$1(_extends$1(_extends$1({}, otherProps), attrs), { style, class: cls }); if (resizeStatus.value === RESIZE_START || resizeStatus.value === RESIZE_MEASURING) { style.push({ overflowX: "hidden", overflowY: "hidden" }); } if (!textareaProps.autofocus) { delete textareaProps.autofocus; } if (textareaProps.rows === 0) { delete textareaProps.rows; } return createVNode(ResizeObserver$1, { "onResize": onInternalResize, "disabled": !needAutoSize.value }, { default: () => [createVNode(BaseInput$1, _objectSpread2$1(_objectSpread2$1({}, textareaProps), {}, { "ref": textAreaRef, "tag": "textarea" }), null)] }); }; return () => { return renderTextArea(); }; } }); function fixEmojiLength(value, maxLength) { return [...value || ""].slice(0, maxLength).join(""); } function setTriggerValue(isCursorInEnd, preValue, triggerValue, maxLength) { let newTriggerValue = triggerValue; if (isCursorInEnd) { newTriggerValue = fixEmojiLength(triggerValue, maxLength); } else if ([...preValue || ""].length < triggerValue.length && [...triggerValue || ""].length > maxLength) { newTriggerValue = preValue; } return newTriggerValue; } const TextArea = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ATextarea", inheritAttrs: false, props: textAreaProps(), setup(props2, _ref) { let { attrs, expose, emit: emit2 } = _ref; var _a; const formItemContext = useInjectFormItemContext(); const formItemInputContext = FormItemInputContext.useInject(); const mergedStatus = computed(() => getMergedStatus(formItemInputContext.status, props2.status)); const stateValue = shallowRef((_a = props2.value) !== null && _a !== void 0 ? _a : props2.defaultValue); const resizableTextArea = shallowRef(); const mergedValue = shallowRef(""); const { prefixCls, size, direction } = useConfigInject("input", props2); const [wrapSSR, hashId] = useStyle$9(prefixCls); const disabled = useInjectDisabled(); const showCount = computed(() => { return props2.showCount === "" || props2.showCount || false; }); const hasMaxLength = computed(() => Number(props2.maxlength) > 0); const compositing = shallowRef(false); const oldCompositionValueRef = shallowRef(); const oldSelectionStartRef = shallowRef(0); const onInternalCompositionStart = (e2) => { compositing.value = true; oldCompositionValueRef.value = mergedValue.value; oldSelectionStartRef.value = e2.currentTarget.selectionStart; emit2("compositionstart", e2); }; const onInternalCompositionEnd = (e2) => { var _a2; compositing.value = false; let triggerValue = e2.currentTarget.value; if (hasMaxLength.value) { const isCursorInEnd = oldSelectionStartRef.value >= props2.maxlength + 1 || oldSelectionStartRef.value === ((_a2 = oldCompositionValueRef.value) === null || _a2 === void 0 ? void 0 : _a2.length); triggerValue = setTriggerValue(isCursorInEnd, oldCompositionValueRef.value, triggerValue, props2.maxlength); } if (triggerValue !== mergedValue.value) { setValue2(triggerValue); resolveOnChange(e2.currentTarget, e2, triggerChange, triggerValue); } emit2("compositionend", e2); }; const instance = getCurrentInstance(); watch(() => props2.value, () => { var _a2; if ("value" in instance.vnode.props || {}) { stateValue.value = (_a2 = props2.value) !== null && _a2 !== void 0 ? _a2 : ""; } }); const focus = (option) => { var _a2; triggerFocus((_a2 = resizableTextArea.value) === null || _a2 === void 0 ? void 0 : _a2.textArea, option); }; const blur = () => { var _a2, _b; (_b = (_a2 = resizableTextArea.value) === null || _a2 === void 0 ? void 0 : _a2.textArea) === null || _b === void 0 ? void 0 : _b.blur(); }; const setValue2 = (value, callback) => { if (stateValue.value === value) { return; } if (props2.value === void 0) { stateValue.value = value; } else { nextTick(() => { var _a2, _b, _c; if (resizableTextArea.value.textArea.value !== mergedValue.value) { (_c = (_a2 = resizableTextArea.value) === null || _a2 === void 0 ? void 0 : (_b = _a2.instance).update) === null || _c === void 0 ? void 0 : _c.call(_b); } }); } nextTick(() => { callback && callback(); }); }; const handleKeyDown = (e2) => { if (e2.keyCode === 13) { emit2("pressEnter", e2); } emit2("keydown", e2); }; const onBlur = (e2) => { const { onBlur: onBlur2 } = props2; onBlur2 === null || onBlur2 === void 0 ? void 0 : onBlur2(e2); formItemContext.onFieldBlur(); }; const triggerChange = (e2) => { emit2("update:value", e2.target.value); emit2("change", e2); emit2("input", e2); formItemContext.onFieldChange(); }; const handleReset = (e2) => { resolveOnChange(resizableTextArea.value.textArea, e2, triggerChange); setValue2("", () => { focus(); }); }; const handleChange = (e2) => { let triggerValue = e2.target.value; if (stateValue.value === triggerValue) return; if (hasMaxLength.value) { const target = e2.target; const isCursorInEnd = target.selectionStart >= props2.maxlength + 1 || target.selectionStart === triggerValue.length || !target.selectionStart; triggerValue = setTriggerValue(isCursorInEnd, mergedValue.value, triggerValue, props2.maxlength); } resolveOnChange(e2.currentTarget, e2, triggerChange, triggerValue); setValue2(triggerValue); }; const renderTextArea = () => { var _a2, _b; const { class: customClass } = attrs; const { bordered = true } = props2; const resizeProps = _extends$1(_extends$1(_extends$1({}, omit$1(props2, ["allowClear"])), attrs), { class: [{ [`${prefixCls.value}-borderless`]: !bordered, [`${customClass}`]: customClass && !showCount.value, [`${prefixCls.value}-sm`]: size.value === "small", [`${prefixCls.value}-lg`]: size.value === "large" }, getStatusClassNames(prefixCls.value, mergedStatus.value), hashId.value], disabled: disabled.value, showCount: null, prefixCls: prefixCls.value, onInput: handleChange, onChange: handleChange, onBlur, onKeydown: handleKeyDown, onCompositionstart: onInternalCompositionStart, onCompositionend: onInternalCompositionEnd }); if ((_a2 = props2.valueModifiers) === null || _a2 === void 0 ? void 0 : _a2.lazy) { delete resizeProps.onInput; } return createVNode(ResizableTextArea, _objectSpread2$1(_objectSpread2$1({}, resizeProps), {}, { "id": (_b = resizeProps === null || resizeProps === void 0 ? void 0 : resizeProps.id) !== null && _b !== void 0 ? _b : formItemContext.id.value, "ref": resizableTextArea, "maxlength": props2.maxlength, "lazy": props2.lazy }), null); }; expose({ focus, blur, resizableTextArea }); watchEffect(() => { let val = fixControlledValue(stateValue.value); if (!compositing.value && hasMaxLength.value && (props2.value === null || props2.value === void 0)) { val = fixEmojiLength(val, props2.maxlength); } mergedValue.value = val; }); return () => { var _a2; const { maxlength, bordered = true, hidden } = props2; const { style, class: customClass } = attrs; const inputProps2 = _extends$1(_extends$1(_extends$1({}, props2), attrs), { prefixCls: prefixCls.value, inputType: "text", handleReset, direction: direction.value, bordered, style: showCount.value ? void 0 : style, hashId: hashId.value, disabled: (_a2 = props2.disabled) !== null && _a2 !== void 0 ? _a2 : disabled.value }); let textareaNode = createVNode(ClearableLabeledInput, _objectSpread2$1(_objectSpread2$1({}, inputProps2), {}, { "value": mergedValue.value, "status": props2.status }), { element: renderTextArea }); if (showCount.value || formItemInputContext.hasFeedback) { const valueLength = [...mergedValue.value].length; let dataCount = ""; if (typeof showCount.value === "object") { dataCount = showCount.value.formatter({ value: mergedValue.value, count: valueLength, maxlength }); } else { dataCount = `${valueLength}${hasMaxLength.value ? ` / ${maxlength}` : ""}`; } textareaNode = createVNode("div", { "hidden": hidden, "class": classNames(`${prefixCls.value}-textarea`, { [`${prefixCls.value}-textarea-rtl`]: direction.value === "rtl", [`${prefixCls.value}-textarea-show-count`]: showCount.value, [`${prefixCls.value}-textarea-in-form-item`]: formItemInputContext.isFormItemInput }, `${prefixCls.value}-textarea-show-count`, customClass, hashId.value), "style": style, "data-count": typeof dataCount !== "object" ? dataCount : void 0 }, [textareaNode, formItemInputContext.hasFeedback && createVNode("span", { "class": `${prefixCls.value}-textarea-suffix` }, [formItemInputContext.feedbackIcon])]); } return wrapSSR(textareaNode); }; } }); var EyeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" }; function _objectSpread$d(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$d(target, key2, source[key2]); }); } return target; } function _defineProperty$d(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var EyeOutlined = function EyeOutlined2(props2, context2) { var p2 = _objectSpread$d({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$d({}, p2, { "icon": EyeOutlined$1 }), null); }; EyeOutlined.displayName = "EyeOutlined"; EyeOutlined.inheritAttrs = false; var EyeInvisibleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" }; function _objectSpread$c(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$c(target, key2, source[key2]); }); } return target; } function _defineProperty$c(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var EyeInvisibleOutlined = function EyeInvisibleOutlined2(props2, context2) { var p2 = _objectSpread$c({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$c({}, p2, { "icon": EyeInvisibleOutlined$1 }), null); }; EyeInvisibleOutlined.displayName = "EyeInvisibleOutlined"; EyeInvisibleOutlined.inheritAttrs = false; var __rest$5 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const ActionMap = { click: "onClick", hover: "onMouseover" }; const defaultIconRender = (visible) => visible ? createVNode(EyeOutlined, null, null) : createVNode(EyeInvisibleOutlined, null, null); const Password = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AInputPassword", inheritAttrs: false, props: _extends$1(_extends$1({}, inputProps()), { prefixCls: String, inputPrefixCls: String, action: { type: String, default: "click" }, visibilityToggle: { type: Boolean, default: true }, visible: { type: Boolean, default: void 0 }, "onUpdate:visible": Function, iconRender: Function }), setup(props2, _ref) { let { slots, attrs, expose, emit: emit2 } = _ref; const visible = shallowRef(false); const onVisibleChange = () => { const { disabled } = props2; if (disabled) { return; } visible.value = !visible.value; emit2("update:visible", visible.value); }; watchEffect(() => { if (props2.visible !== void 0) { visible.value = !!props2.visible; } }); const inputRef = shallowRef(); const focus = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; expose({ focus, blur }); const getIcon = (prefixCls2) => { const { action, iconRender = slots.iconRender || defaultIconRender } = props2; const iconTrigger = ActionMap[action] || ""; const icon = iconRender(visible.value); const iconProps = { [iconTrigger]: onVisibleChange, class: `${prefixCls2}-icon`, key: "passwordIcon", onMousedown: (e2) => { e2.preventDefault(); }, onMouseup: (e2) => { e2.preventDefault(); } }; return cloneElement(isValidElement(icon) ? icon : createVNode("span", null, [icon]), iconProps); }; const { prefixCls, getPrefixCls } = useConfigInject("input-password", props2); const inputPrefixCls = computed(() => getPrefixCls("input", props2.inputPrefixCls)); const renderPassword = () => { const { size, visibilityToggle } = props2, restProps = __rest$5(props2, ["size", "visibilityToggle"]); const suffixIcon = visibilityToggle && getIcon(prefixCls.value); const inputClassName = classNames(prefixCls.value, attrs.class, { [`${prefixCls.value}-${size}`]: !!size }); const omittedProps = _extends$1(_extends$1(_extends$1({}, omit$1(restProps, ["suffix", "iconRender", "action"])), attrs), { type: visible.value ? "text" : "password", class: inputClassName, prefixCls: inputPrefixCls.value, suffix: suffixIcon }); if (size) { omittedProps.size = size; } return createVNode(Input, _objectSpread2$1({ "ref": inputRef }, omittedProps), slots); }; return () => { return renderPassword(); }; } }); Input.Group = Group$1; Input.Search = Search; Input.TextArea = TextArea; Input.Password = Password; Input.install = function(app) { app.component(Input.name, Input); app.component(Input.Group.name, Input.Group); app.component(Input.Search.name, Input.Search); app.component(Input.TextArea.name, Input.TextArea); app.component(Input.Password.name, Input.Password); return app; }; function dialogPropTypes() { return { keyboard: { type: Boolean, default: void 0 }, mask: { type: Boolean, default: void 0 }, afterClose: Function, closable: { type: Boolean, default: void 0 }, maskClosable: { type: Boolean, default: void 0 }, visible: { type: Boolean, default: void 0 }, destroyOnClose: { type: Boolean, default: void 0 }, mousePosition: PropTypes.shape({ x: Number, y: Number }).loose, title: PropTypes.any, footer: PropTypes.any, transitionName: String, maskTransitionName: String, animation: PropTypes.any, maskAnimation: PropTypes.any, wrapStyle: { type: Object, default: void 0 }, bodyStyle: { type: Object, default: void 0 }, maskStyle: { type: Object, default: void 0 }, prefixCls: String, wrapClassName: String, rootClassName: String, width: [String, Number], height: [String, Number], zIndex: Number, bodyProps: PropTypes.any, maskProps: PropTypes.any, wrapProps: PropTypes.any, getContainer: PropTypes.any, dialogStyle: { type: Object, default: void 0 }, dialogClass: String, closeIcon: PropTypes.any, forceRender: { type: Boolean, default: void 0 }, getOpenCount: Function, // https://github.com/ant-design/ant-design/issues/19771 // https://github.com/react-component/dialog/issues/95 focusTriggerAfterClose: { type: Boolean, default: void 0 }, onClose: Function, modalRender: Function }; } function getMotionName(prefixCls, transitionName2, animationName) { let motionName = transitionName2; if (!motionName && animationName) { motionName = `${prefixCls}-${animationName}`; } return motionName; } let uuid$3 = -1; function getUUID() { uuid$3 += 1; return uuid$3; } function getScroll(w2, top) { let ret = w2[`page${top ? "Y" : "X"}Offset`]; const method = `scroll${top ? "Top" : "Left"}`; if (typeof ret !== "number") { const d2 = w2.document; ret = d2.documentElement[method]; if (typeof ret !== "number") { ret = d2.body[method]; } } return ret; } function offset(el) { const rect = el.getBoundingClientRect(); const pos = { left: rect.left, top: rect.top }; const doc2 = el.ownerDocument; const w2 = doc2.defaultView || doc2.parentWindow; pos.left += getScroll(w2); pos.top += getScroll(w2, true); return pos; } const sentinelStyle = { width: 0, height: 0, overflow: "hidden", outline: "none" }; const entityStyle = { outline: "none" }; const Content = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "DialogContent", inheritAttrs: false, props: _extends$1(_extends$1({}, dialogPropTypes()), { motionName: String, ariaId: String, onVisibleChanged: Function, onMousedown: Function, onMouseup: Function }), setup(props2, _ref) { let { expose, slots, attrs } = _ref; const sentinelStartRef = ref(); const sentinelEndRef = ref(); const dialogRef = ref(); expose({ focus: () => { var _a; (_a = sentinelStartRef.value) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true }); }, changeActive: (next2) => { const { activeElement } = document; if (next2 && activeElement === sentinelEndRef.value) { sentinelStartRef.value.focus({ preventScroll: true }); } else if (!next2 && activeElement === sentinelStartRef.value) { sentinelEndRef.value.focus({ preventScroll: true }); } } }); const transformOrigin = ref(); const contentStyleRef = computed(() => { const { width, height } = props2; const contentStyle = {}; if (width !== void 0) { contentStyle.width = typeof width === "number" ? `${width}px` : width; } if (height !== void 0) { contentStyle.height = typeof height === "number" ? `${height}px` : height; } if (transformOrigin.value) { contentStyle.transformOrigin = transformOrigin.value; } return contentStyle; }); const onPrepare = () => { nextTick(() => { if (dialogRef.value) { const elementOffset = offset(dialogRef.value); transformOrigin.value = props2.mousePosition ? `${props2.mousePosition.x - elementOffset.left}px ${props2.mousePosition.y - elementOffset.top}px` : ""; } }); }; const onVisibleChanged = (visible) => { props2.onVisibleChanged(visible); }; return () => { var _a, _b, _c, _d; const { prefixCls, footer = (_a = slots.footer) === null || _a === void 0 ? void 0 : _a.call(slots), title = (_b = slots.title) === null || _b === void 0 ? void 0 : _b.call(slots), ariaId, closable, closeIcon = (_c = slots.closeIcon) === null || _c === void 0 ? void 0 : _c.call(slots), onClose, bodyStyle, bodyProps, onMousedown, onMouseup, visible, modalRender = slots.modalRender, destroyOnClose, motionName } = props2; let footerNode; if (footer) { footerNode = createVNode("div", { "class": `${prefixCls}-footer` }, [footer]); } let headerNode; if (title) { headerNode = createVNode("div", { "class": `${prefixCls}-header` }, [createVNode("div", { "class": `${prefixCls}-title`, "id": ariaId }, [title])]); } let closer; if (closable) { closer = createVNode("button", { "type": "button", "onClick": onClose, "aria-label": "Close", "class": `${prefixCls}-close` }, [closeIcon || createVNode("span", { "class": `${prefixCls}-close-x` }, null)]); } const content = createVNode("div", { "class": `${prefixCls}-content` }, [closer, headerNode, createVNode("div", _objectSpread2$1({ "class": `${prefixCls}-body`, "style": bodyStyle }, bodyProps), [(_d = slots.default) === null || _d === void 0 ? void 0 : _d.call(slots)]), footerNode]); const transitionProps = getTransitionProps(motionName); return createVNode(Transition, _objectSpread2$1(_objectSpread2$1({}, transitionProps), {}, { "onBeforeEnter": onPrepare, "onAfterEnter": () => onVisibleChanged(true), "onAfterLeave": () => onVisibleChanged(false) }), { default: () => [visible || !destroyOnClose ? withDirectives(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "ref": dialogRef, "key": "dialog-element", "role": "document", "style": [contentStyleRef.value, attrs.style], "class": [prefixCls, attrs.class], "onMousedown": onMousedown, "onMouseup": onMouseup }), [createVNode("div", { "tabindex": 0, "ref": sentinelStartRef, "style": entityStyle }, [modalRender ? modalRender({ originVNode: content }) : content]), createVNode("div", { "tabindex": 0, "ref": sentinelEndRef, "style": sentinelStyle }, null)]), [[vShow, visible]]) : null] }); }; } }); const Mask = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "DialogMask", props: { prefixCls: String, visible: Boolean, motionName: String, maskProps: Object }, setup(props2, _ref) { return () => { const { prefixCls, visible, maskProps, motionName } = props2; const transitionProps = getTransitionProps(motionName); return createVNode(Transition, transitionProps, { default: () => [withDirectives(createVNode("div", _objectSpread2$1({ "class": `${prefixCls}-mask` }, maskProps), null), [[vShow, visible]])] }); }; } }); const Dialog = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "VcDialog", inheritAttrs: false, props: initDefaultProps(_extends$1(_extends$1({}, dialogPropTypes()), { getOpenCount: Function, scrollLocker: Object }), { mask: true, visible: false, keyboard: true, closable: true, maskClosable: true, destroyOnClose: false, prefixCls: "rc-dialog", getOpenCount: () => null, focusTriggerAfterClose: true }), setup(props2, _ref) { let { attrs, slots } = _ref; const lastOutSideActiveElementRef = shallowRef(); const wrapperRef = shallowRef(); const contentRef = shallowRef(); const animatedVisible = shallowRef(props2.visible); const ariaIdRef = shallowRef(`vcDialogTitle${getUUID()}`); const onDialogVisibleChanged = (newVisible) => { var _a, _b; if (newVisible) { if (!contains$1(wrapperRef.value, document.activeElement)) { lastOutSideActiveElementRef.value = document.activeElement; (_a = contentRef.value) === null || _a === void 0 ? void 0 : _a.focus(); } } else { const preAnimatedVisible = animatedVisible.value; animatedVisible.value = false; if (props2.mask && lastOutSideActiveElementRef.value && props2.focusTriggerAfterClose) { try { lastOutSideActiveElementRef.value.focus({ preventScroll: true }); } catch (e2) { } lastOutSideActiveElementRef.value = null; } if (preAnimatedVisible) { (_b = props2.afterClose) === null || _b === void 0 ? void 0 : _b.call(props2); } } }; const onInternalClose = (e2) => { var _a; (_a = props2.onClose) === null || _a === void 0 ? void 0 : _a.call(props2, e2); }; const contentClickRef = shallowRef(false); const contentTimeoutRef = shallowRef(); const onContentMouseDown = () => { clearTimeout(contentTimeoutRef.value); contentClickRef.value = true; }; const onContentMouseUp = () => { contentTimeoutRef.value = setTimeout(() => { contentClickRef.value = false; }); }; const onWrapperClick = (e2) => { if (!props2.maskClosable) return null; if (contentClickRef.value) { contentClickRef.value = false; } else if (wrapperRef.value === e2.target) { onInternalClose(e2); } }; const onWrapperKeyDown = (e2) => { if (props2.keyboard && e2.keyCode === KeyCode.ESC) { e2.stopPropagation(); onInternalClose(e2); return; } if (props2.visible) { if (e2.keyCode === KeyCode.TAB) { contentRef.value.changeActive(!e2.shiftKey); } } }; watch(() => props2.visible, () => { if (props2.visible) { animatedVisible.value = true; } }, { flush: "post" }); onBeforeUnmount(() => { var _a; clearTimeout(contentTimeoutRef.value); (_a = props2.scrollLocker) === null || _a === void 0 ? void 0 : _a.unLock(); }); watchEffect(() => { var _a, _b; (_a = props2.scrollLocker) === null || _a === void 0 ? void 0 : _a.unLock(); if (animatedVisible.value) { (_b = props2.scrollLocker) === null || _b === void 0 ? void 0 : _b.lock(); } }); return () => { const { prefixCls, mask, visible, maskTransitionName, maskAnimation, zIndex, wrapClassName, rootClassName, wrapStyle, closable, maskProps, maskStyle, transitionName: transitionName2, animation, wrapProps, title = slots.title } = props2; const { style, class: className } = attrs; return createVNode("div", _objectSpread2$1({ "class": [`${prefixCls}-root`, rootClassName] }, pickAttrs(props2, { data: true })), [createVNode(Mask, { "prefixCls": prefixCls, "visible": mask && visible, "motionName": getMotionName(prefixCls, maskTransitionName, maskAnimation), "style": _extends$1({ zIndex }, maskStyle), "maskProps": maskProps }, null), createVNode("div", _objectSpread2$1({ "tabIndex": -1, "onKeydown": onWrapperKeyDown, "class": classNames(`${prefixCls}-wrap`, wrapClassName), "ref": wrapperRef, "onClick": onWrapperClick, "role": "dialog", "aria-labelledby": title ? ariaIdRef.value : null, "style": _extends$1(_extends$1({ zIndex }, wrapStyle), { display: !animatedVisible.value ? "none" : null }) }, wrapProps), [createVNode(Content, _objectSpread2$1(_objectSpread2$1({}, omit$1(props2, ["scrollLocker"])), {}, { "style": style, "class": className, "onMousedown": onContentMouseDown, "onMouseup": onContentMouseUp, "ref": contentRef, "closable": closable, "ariaId": ariaIdRef.value, "prefixCls": prefixCls, "visible": visible, "onClose": onInternalClose, "onVisibleChanged": onDialogVisibleChanged, "motionName": getMotionName(prefixCls, transitionName2, animation) }), slots)])]); }; } }); const IDialogPropTypes = dialogPropTypes(); const DialogWrap = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "DialogWrap", inheritAttrs: false, props: initDefaultProps(IDialogPropTypes, { visible: false }), setup(props2, _ref) { let { attrs, slots } = _ref; const animatedVisible = ref(props2.visible); useProvidePortal({}, { inTriggerContext: false }); watch(() => props2.visible, () => { if (props2.visible) { animatedVisible.value = true; } }, { flush: "post" }); return () => { const { visible, getContainer: getContainer2, forceRender, destroyOnClose = false, afterClose } = props2; let dialogProps = _extends$1(_extends$1(_extends$1({}, props2), attrs), { ref: "_component", key: "dialog" }); if (getContainer2 === false) { return createVNode(Dialog, _objectSpread2$1(_objectSpread2$1({}, dialogProps), {}, { "getOpenCount": () => 2 }), slots); } if (!forceRender && destroyOnClose && !animatedVisible.value) { return null; } return createVNode(Portal, { "autoLock": true, "visible": visible, "forceRender": forceRender, "getContainer": getContainer2 }, { default: (childProps) => { dialogProps = _extends$1(_extends$1(_extends$1({}, dialogProps), childProps), { afterClose: () => { afterClose === null || afterClose === void 0 ? void 0 : afterClose(); animatedVisible.value = false; } }); return createVNode(Dialog, dialogProps, slots); } }); }; } }); function useFrameSetState(initial) { const frame = ref(null); const state = reactive(_extends$1({}, initial)); const queue2 = ref([]); const setFrameState = (newState) => { if (frame.value === null) { queue2.value = []; frame.value = wrapperRaf(() => { let memoState; queue2.value.forEach((queueState) => { memoState = _extends$1(_extends$1({}, memoState), queueState); }); _extends$1(state, memoState); frame.value = null; }); } queue2.value.push(newState); }; onMounted(() => { frame.value && wrapperRaf.cancel(frame.value); }); return [state, setFrameState]; } function fixPoint(key2, start, width, clientWidth) { const startAddWidth = start + width; const offsetStart = (width - clientWidth) / 2; if (width > clientWidth) { if (start > 0) { return { [key2]: offsetStart }; } if (start < 0 && startAddWidth < clientWidth) { return { [key2]: -offsetStart }; } } else if (start < 0 || startAddWidth > clientWidth) { return { [key2]: start < 0 ? offsetStart : -offsetStart }; } return {}; } function getFixScaleEleTransPosition(width, height, left, top) { const { width: clientWidth, height: clientHeight } = getClientSize(); let fixPos = null; if (width <= clientWidth && height <= clientHeight) { fixPos = { x: 0, y: 0 }; } else if (width > clientWidth || height > clientHeight) { fixPos = _extends$1(_extends$1({}, fixPoint("x", left, width, clientWidth)), fixPoint("y", top, height, clientHeight)); } return fixPos; } var __rest$4 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const previewGroupContext = Symbol("previewGroupContext"); const context = { provide: (val) => { provide(previewGroupContext, val); }, inject: () => { return inject(previewGroupContext, { isPreviewGroup: shallowRef(false), previewUrls: computed(() => /* @__PURE__ */ new Map()), setPreviewUrls: () => { }, current: ref(null), setCurrent: () => { }, setShowPreview: () => { }, setMousePosition: () => { }, registerImage: null, rootClassName: "" }); } }; const imageGroupProps = () => ({ previewPrefixCls: String, preview: { type: [Boolean, Object], default: true }, icons: { type: Object, default: () => ({}) } }); const Group = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "PreviewGroup", inheritAttrs: false, props: imageGroupProps(), setup(props2, _ref) { let { slots } = _ref; const preview = computed(() => { const defaultValues = { visible: void 0, onVisibleChange: () => { }, getContainer: void 0, current: 0 }; return typeof props2.preview === "object" ? mergeDefaultValue(props2.preview, defaultValues) : defaultValues; }); const previewUrls = reactive(/* @__PURE__ */ new Map()); const current = ref(); const previewVisible = computed(() => preview.value.visible); const getPreviewContainer = computed(() => preview.value.getContainer); const onPreviewVisibleChange = (val, preval) => { var _a, _b; (_b = (_a = preview.value).onVisibleChange) === null || _b === void 0 ? void 0 : _b.call(_a, val, preval); }; const [isShowPreview, setShowPreview] = useMergedState(!!previewVisible.value, { value: previewVisible, onChange: onPreviewVisibleChange }); const mousePosition2 = ref(null); const isControlled = computed(() => previewVisible.value !== void 0); const previewUrlsKeys = computed(() => Array.from(previewUrls.keys())); const currentControlledKey = computed(() => previewUrlsKeys.value[preview.value.current]); const canPreviewUrls = computed(() => new Map(Array.from(previewUrls).filter((_ref2) => { let [, { canPreview }] = _ref2; return !!canPreview; }).map((_ref3) => { let [id, { url }] = _ref3; return [id, url]; }))); const setPreviewUrls = function(id, url) { let canPreview = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; previewUrls.set(id, { url, canPreview }); }; const setCurrent = (val) => { current.value = val; }; const setMousePosition = (val) => { mousePosition2.value = val; }; const registerImage = function(id, url) { let canPreview = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; const unRegister = () => { previewUrls.delete(id); }; previewUrls.set(id, { url, canPreview }); return unRegister; }; const onPreviewClose = (e2) => { e2 === null || e2 === void 0 ? void 0 : e2.stopPropagation(); setShowPreview(false); setMousePosition(null); }; watch(currentControlledKey, (val) => { setCurrent(val); }, { immediate: true, flush: "post" }); watchEffect(() => { if (isShowPreview.value && isControlled.value) { setCurrent(currentControlledKey.value); } }, { flush: "post" }); context.provide({ isPreviewGroup: shallowRef(true), previewUrls: canPreviewUrls, setPreviewUrls, current, setCurrent, setShowPreview, setMousePosition, registerImage }); return () => { const dialogProps = __rest$4(preview.value, []); return createVNode(Fragment, null, [slots.default && slots.default(), createVNode(Preview, _objectSpread2$1(_objectSpread2$1({}, dialogProps), {}, { "ria-hidden": !isShowPreview.value, "visible": isShowPreview.value, "prefixCls": props2.previewPrefixCls, "onClose": onPreviewClose, "mousePosition": mousePosition2.value, "src": canPreviewUrls.value.get(current.value), "icons": props2.icons, "getContainer": getPreviewContainer.value }), null)]); }; } }); const initialPosition = { x: 0, y: 0 }; const previewProps = _extends$1(_extends$1({}, dialogPropTypes()), { src: String, alt: String, rootClassName: String, icons: { type: Object, default: () => ({}) } }); const Preview = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Preview", inheritAttrs: false, props: previewProps, emits: ["close", "afterClose"], setup(props2, _ref) { let { emit: emit2, attrs } = _ref; const { rotateLeft, rotateRight, zoomIn: zoomIn2, zoomOut: zoomOut2, close, left, right, flipX, flipY } = reactive(props2.icons); const scale = shallowRef(1); const rotate = shallowRef(0); const flip2 = reactive({ x: 1, y: 1 }); const [position2, setPosition] = useFrameSetState(initialPosition); const onClose = () => emit2("close"); const imgRef = shallowRef(); const originPositionRef = reactive({ originX: 0, originY: 0, deltaX: 0, deltaY: 0 }); const isMoving = shallowRef(false); const groupContext = context.inject(); const { previewUrls, current, isPreviewGroup, setCurrent } = groupContext; const previewGroupCount = computed(() => previewUrls.value.size); const previewUrlsKeys = computed(() => Array.from(previewUrls.value.keys())); const currentPreviewIndex = computed(() => previewUrlsKeys.value.indexOf(current.value)); const combinationSrc = computed(() => { return isPreviewGroup.value ? previewUrls.value.get(current.value) : props2.src; }); const showLeftOrRightSwitches = computed(() => isPreviewGroup.value && previewGroupCount.value > 1); const lastWheelZoomDirection = shallowRef({ wheelDirection: 0 }); const onAfterClose = () => { scale.value = 1; rotate.value = 0; flip2.x = 1; flip2.y = 1; setPosition(initialPosition); emit2("afterClose"); }; const onZoomIn = (isWheel) => { if (!isWheel) { scale.value++; } else { scale.value += 0.5; } setPosition(initialPosition); }; const onZoomOut = (isWheel) => { if (scale.value > 1) { if (!isWheel) { scale.value--; } else { scale.value -= 0.5; } } setPosition(initialPosition); }; const onRotateRight = () => { rotate.value += 90; }; const onRotateLeft = () => { rotate.value -= 90; }; const onFlipX = () => { flip2.x = -flip2.x; }; const onFlipY = () => { flip2.y = -flip2.y; }; const onSwitchLeft = (event) => { event.preventDefault(); event.stopPropagation(); if (currentPreviewIndex.value > 0) { setCurrent(previewUrlsKeys.value[currentPreviewIndex.value - 1]); } }; const onSwitchRight = (event) => { event.preventDefault(); event.stopPropagation(); if (currentPreviewIndex.value < previewGroupCount.value - 1) { setCurrent(previewUrlsKeys.value[currentPreviewIndex.value + 1]); } }; const wrapClassName = classNames({ [`${props2.prefixCls}-moving`]: isMoving.value }); const toolClassName = `${props2.prefixCls}-operations-operation`; const iconClassName = `${props2.prefixCls}-operations-icon`; const tools = [{ icon: close, onClick: onClose, type: "close" }, { icon: zoomIn2, onClick: () => onZoomIn(), type: "zoomIn" }, { icon: zoomOut2, onClick: () => onZoomOut(), type: "zoomOut", disabled: computed(() => scale.value === 1) }, { icon: rotateRight, onClick: onRotateRight, type: "rotateRight" }, { icon: rotateLeft, onClick: onRotateLeft, type: "rotateLeft" }, { icon: flipX, onClick: onFlipX, type: "flipX" }, { icon: flipY, onClick: onFlipY, type: "flipY" }]; const onMouseUp = () => { if (props2.visible && isMoving.value) { const width = imgRef.value.offsetWidth * scale.value; const height = imgRef.value.offsetHeight * scale.value; const { left: left2, top } = getOffset(imgRef.value); const isRotate = rotate.value % 180 !== 0; isMoving.value = false; const fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left2, top); if (fixState) { setPosition(_extends$1({}, fixState)); } } }; const onMouseDown = (event) => { if (event.button !== 0) return; event.preventDefault(); event.stopPropagation(); originPositionRef.deltaX = event.pageX - position2.x; originPositionRef.deltaY = event.pageY - position2.y; originPositionRef.originX = position2.x; originPositionRef.originY = position2.y; isMoving.value = true; }; const onMouseMove = (event) => { if (props2.visible && isMoving.value) { setPosition({ x: event.pageX - originPositionRef.deltaX, y: event.pageY - originPositionRef.deltaY }); } }; const onWheelMove = (event) => { if (!props2.visible) return; event.preventDefault(); const wheelDirection = event.deltaY; lastWheelZoomDirection.value = { wheelDirection }; }; const onKeyDown = (event) => { if (!props2.visible || !showLeftOrRightSwitches.value) return; event.preventDefault(); if (event.keyCode === KeyCode.LEFT) { if (currentPreviewIndex.value > 0) { setCurrent(previewUrlsKeys.value[currentPreviewIndex.value - 1]); } } else if (event.keyCode === KeyCode.RIGHT) { if (currentPreviewIndex.value < previewGroupCount.value - 1) { setCurrent(previewUrlsKeys.value[currentPreviewIndex.value + 1]); } } }; const onDoubleClick = () => { if (props2.visible) { if (scale.value !== 1) { scale.value = 1; } if (position2.x !== initialPosition.x || position2.y !== initialPosition.y) { setPosition(initialPosition); } } }; let removeListeners = () => { }; onMounted(() => { watch([() => props2.visible, isMoving], () => { removeListeners(); let onTopMouseUpListener; let onTopMouseMoveListener; const onMouseUpListener = addEventListenerWrap(window, "mouseup", onMouseUp, false); const onMouseMoveListener = addEventListenerWrap(window, "mousemove", onMouseMove, false); const onScrollWheelListener = addEventListenerWrap(window, "wheel", onWheelMove, { passive: false }); const onKeyDownListener = addEventListenerWrap(window, "keydown", onKeyDown, false); try { if (window.top !== window.self) { onTopMouseUpListener = addEventListenerWrap(window.top, "mouseup", onMouseUp, false); onTopMouseMoveListener = addEventListenerWrap(window.top, "mousemove", onMouseMove, false); } } catch (error) { } removeListeners = () => { onMouseUpListener.remove(); onMouseMoveListener.remove(); onScrollWheelListener.remove(); onKeyDownListener.remove(); if (onTopMouseUpListener) onTopMouseUpListener.remove(); if (onTopMouseMoveListener) onTopMouseMoveListener.remove(); }; }, { flush: "post", immediate: true }); watch([lastWheelZoomDirection], () => { const { wheelDirection } = lastWheelZoomDirection.value; if (wheelDirection > 0) { onZoomOut(true); } else if (wheelDirection < 0) { onZoomIn(true); } }); }); onUnmounted(() => { removeListeners(); }); return () => { const { visible, prefixCls, rootClassName } = props2; return createVNode(DialogWrap, _objectSpread2$1(_objectSpread2$1({}, attrs), {}, { "transitionName": props2.transitionName, "maskTransitionName": props2.maskTransitionName, "closable": false, "keyboard": true, "prefixCls": prefixCls, "onClose": onClose, "afterClose": onAfterClose, "visible": visible, "wrapClassName": wrapClassName, "rootClassName": rootClassName, "getContainer": props2.getContainer }), { default: () => [createVNode("div", { "class": [`${props2.prefixCls}-operations-wrapper`, rootClassName] }, [createVNode("ul", { "class": `${props2.prefixCls}-operations` }, [tools.map((_ref2) => { let { icon: IconType, onClick, type, disabled } = _ref2; return createVNode("li", { "class": classNames(toolClassName, { [`${props2.prefixCls}-operations-operation-disabled`]: disabled && (disabled === null || disabled === void 0 ? void 0 : disabled.value) }), "onClick": onClick, "key": type }, [cloneVNode(IconType, { class: iconClassName })]); })])]), createVNode("div", { "class": `${props2.prefixCls}-img-wrapper`, "style": { transform: `translate3d(${position2.x}px, ${position2.y}px, 0)` } }, [createVNode("img", { "onMousedown": onMouseDown, "onDblclick": onDoubleClick, "ref": imgRef, "class": `${props2.prefixCls}-img`, "src": combinationSrc.value, "alt": props2.alt, "style": { transform: `scale3d(${flip2.x * scale.value}, ${flip2.y * scale.value}, 1) rotate(${rotate.value}deg)` } }, null)]), showLeftOrRightSwitches.value && createVNode("div", { "class": classNames(`${props2.prefixCls}-switch-left`, { [`${props2.prefixCls}-switch-left-disabled`]: currentPreviewIndex.value <= 0 }), "onClick": onSwitchLeft }, [left]), showLeftOrRightSwitches.value && createVNode("div", { "class": classNames(`${props2.prefixCls}-switch-right`, { [`${props2.prefixCls}-switch-right-disabled`]: currentPreviewIndex.value >= previewGroupCount.value - 1 }), "onClick": onSwitchRight }, [right])] }); }; } }); var __rest$3 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const imageProps = () => ({ src: String, wrapperClassName: String, wrapperStyle: { type: Object, default: void 0 }, rootClassName: String, prefixCls: String, previewPrefixCls: String, width: [Number, String], height: [Number, String], previewMask: { type: [Boolean, Function], default: void 0 }, placeholder: PropTypes.any, fallback: String, preview: { type: [Boolean, Object], default: true }, onClick: { type: Function }, onError: { type: Function } }); const mergeDefaultValue = (obj, defaultValues) => { const res = _extends$1({}, obj); Object.keys(defaultValues).forEach((key2) => { if (obj[key2] === void 0) { res[key2] = defaultValues[key2]; } }); return res; }; let uuid$2 = 0; const ImageInternal = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "VcImage", inheritAttrs: false, props: imageProps(), emits: ["click", "error"], setup(props2, _ref) { let { attrs, slots, emit: emit2 } = _ref; const prefixCls = computed(() => props2.prefixCls); const previewPrefixCls = computed(() => `${prefixCls.value}-preview`); const preview = computed(() => { const defaultValues = { visible: void 0, onVisibleChange: () => { }, getContainer: void 0 }; return typeof props2.preview === "object" ? mergeDefaultValue(props2.preview, defaultValues) : defaultValues; }); const src = computed(() => { var _a; return (_a = preview.value.src) !== null && _a !== void 0 ? _a : props2.src; }); const isCustomPlaceholder = computed(() => props2.placeholder && props2.placeholder !== true || slots.placeholder); const previewVisible = computed(() => preview.value.visible); const getPreviewContainer = computed(() => preview.value.getContainer); const isControlled = computed(() => previewVisible.value !== void 0); const onPreviewVisibleChange = (val, preval) => { var _a, _b; (_b = (_a = preview.value).onVisibleChange) === null || _b === void 0 ? void 0 : _b.call(_a, val, preval); }; const [isShowPreview, setShowPreview] = useMergedState(!!previewVisible.value, { value: previewVisible, onChange: onPreviewVisibleChange }); const status = ref(isCustomPlaceholder.value ? "loading" : "normal"); watch(() => props2.src, () => { status.value = isCustomPlaceholder.value ? "loading" : "normal"; }); const mousePosition2 = ref(null); const isError = computed(() => status.value === "error"); const groupContext = context.inject(); const { isPreviewGroup, setCurrent, setShowPreview: setGroupShowPreview, setMousePosition: setGroupMousePosition, registerImage } = groupContext; const currentId = ref(uuid$2++); const canPreview = computed(() => props2.preview && !isError.value); const onLoad = () => { status.value = "normal"; }; const onError = (e2) => { status.value = "error"; emit2("error", e2); }; const onPreview = (e2) => { if (!isControlled.value) { const { left, top } = getOffset(e2.target); if (isPreviewGroup.value) { setCurrent(currentId.value); setGroupMousePosition({ x: left, y: top }); } else { mousePosition2.value = { x: left, y: top }; } } if (isPreviewGroup.value) { setGroupShowPreview(true); } else { setShowPreview(true); } emit2("click", e2); }; const onPreviewClose = () => { setShowPreview(false); if (!isControlled.value) { mousePosition2.value = null; } }; const img = ref(null); watch(() => img, () => { if (status.value !== "loading") return; if (img.value.complete && (img.value.naturalWidth || img.value.naturalHeight)) { onLoad(); } }); let unRegister = () => { }; onMounted(() => { watch([src, canPreview], () => { unRegister(); if (!isPreviewGroup.value) { return () => { }; } unRegister = registerImage(currentId.value, src.value, canPreview.value); if (!canPreview.value) { unRegister(); } }, { flush: "post", immediate: true }); }); onUnmounted(() => { unRegister(); }); const toSizePx = (l2) => { if (isNumber(l2)) return l2 + "px"; return l2; }; return () => { const { prefixCls: prefixCls2, wrapperClassName, fallback, src: imgSrc, placeholder, wrapperStyle, rootClassName, width, height, crossorigin, decoding, alt, sizes: sizes2, srcset, usemap, class: cls, style } = _extends$1(_extends$1({}, props2), attrs); const _a = preview.value, { icons: icons2, maskClassName } = _a, dialogProps = __rest$3(_a, ["icons", "maskClassName"]); const wrappperClass = classNames(prefixCls2, wrapperClassName, rootClassName, { [`${prefixCls2}-error`]: isError.value }); const mergedSrc = isError.value && fallback ? fallback : src.value; const imgCommonProps = { crossorigin, decoding, alt, sizes: sizes2, srcset, usemap, width, height, class: classNames(`${prefixCls2}-img`, { [`${prefixCls2}-img-placeholder`]: placeholder === true }, cls), style: _extends$1({ height: toSizePx(height) }, style) }; return createVNode(Fragment, null, [createVNode("div", { "class": wrappperClass, "onClick": canPreview.value ? onPreview : (e2) => { emit2("click", e2); }, "style": _extends$1({ width: toSizePx(width), height: toSizePx(height) }, wrapperStyle) }, [createVNode("img", _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, imgCommonProps), isError.value && fallback ? { src: fallback } : { onLoad, onError, src: imgSrc }), {}, { "ref": img }), null), status.value === "loading" && createVNode("div", { "aria-hidden": "true", "class": `${prefixCls2}-placeholder` }, [placeholder || slots.placeholder && slots.placeholder()]), slots.previewMask && canPreview.value && createVNode("div", { "class": [`${prefixCls2}-mask`, maskClassName] }, [slots.previewMask()])]), !isPreviewGroup.value && canPreview.value && createVNode(Preview, _objectSpread2$1(_objectSpread2$1({}, dialogProps), {}, { "aria-hidden": !isShowPreview.value, "visible": isShowPreview.value, "prefixCls": previewPrefixCls.value, "onClose": onPreviewClose, "mousePosition": mousePosition2.value, "src": mergedSrc, "alt": alt, "getContainer": getPreviewContainer.value, "icons": icons2, "rootClassName": rootClassName }), null)]); }; } }); ImageInternal.PreviewGroup = Group; var RotateLeftOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z" } }, { "tag": "path", "attrs": { "d": "M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z" } }] }, "name": "rotate-left", "theme": "outlined" }; function _objectSpread$b(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$b(target, key2, source[key2]); }); } return target; } function _defineProperty$b(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var RotateLeftOutlined = function RotateLeftOutlined2(props2, context2) { var p2 = _objectSpread$b({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$b({}, p2, { "icon": RotateLeftOutlined$1 }), null); }; RotateLeftOutlined.displayName = "RotateLeftOutlined"; RotateLeftOutlined.inheritAttrs = false; var RotateRightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z" } }, { "tag": "path", "attrs": { "d": "M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z" } }] }, "name": "rotate-right", "theme": "outlined" }; function _objectSpread$a(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$a(target, key2, source[key2]); }); } return target; } function _defineProperty$a(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var RotateRightOutlined = function RotateRightOutlined2(props2, context2) { var p2 = _objectSpread$a({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$a({}, p2, { "icon": RotateRightOutlined$1 }), null); }; RotateRightOutlined.displayName = "RotateRightOutlined"; RotateRightOutlined.inheritAttrs = false; var ZoomInOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-in", "theme": "outlined" }; function _objectSpread$9(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$9(target, key2, source[key2]); }); } return target; } function _defineProperty$9(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var ZoomInOutlined = function ZoomInOutlined2(props2, context2) { var p2 = _objectSpread$9({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$9({}, p2, { "icon": ZoomInOutlined$1 }), null); }; ZoomInOutlined.displayName = "ZoomInOutlined"; ZoomInOutlined.inheritAttrs = false; var ZoomOutOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-out", "theme": "outlined" }; function _objectSpread$8(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$8(target, key2, source[key2]); }); } return target; } function _defineProperty$8(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var ZoomOutOutlined = function ZoomOutOutlined2(props2, context2) { var p2 = _objectSpread$8({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$8({}, p2, { "icon": ZoomOutOutlined$1 }), null); }; ZoomOutOutlined.displayName = "ZoomOutOutlined"; ZoomOutOutlined.inheritAttrs = false; var SwapOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "swap", "theme": "outlined" }; function _objectSpread$7(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$7(target, key2, source[key2]); }); } return target; } function _defineProperty$7(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var SwapOutlined = function SwapOutlined2(props2, context2) { var p2 = _objectSpread$7({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$7({}, p2, { "icon": SwapOutlined$1 }), null); }; SwapOutlined.displayName = "SwapOutlined"; SwapOutlined.inheritAttrs = false; function box(position2) { return { position: position2, top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0 }; } const genModalMaskStyle = (token2) => { const { componentCls } = token2; return [{ [`${componentCls}-root`]: { [`${componentCls}${token2.antCls}-zoom-enter, ${componentCls}${token2.antCls}-zoom-appear`]: { // reset scale avoid mousePosition bug transform: "none", opacity: 0, animationDuration: token2.motionDurationSlow, // https://github.com/ant-design/ant-design/issues/11777 userSelect: "none" }, [`${componentCls}${token2.antCls}-zoom-leave ${componentCls}-content`]: { pointerEvents: "none" }, [`${componentCls}-mask`]: _extends$1(_extends$1({}, box("fixed")), { zIndex: token2.zIndexPopupBase, height: "100%", backgroundColor: token2.colorBgMask, [`${componentCls}-hidden`]: { display: "none" } }), [`${componentCls}-wrap`]: _extends$1(_extends$1({}, box("fixed")), { overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }) } }, { [`${componentCls}-root`]: initFadeMotion(token2) }]; }; const genModalStyle = (token2) => { const { componentCls } = token2; return [ // ======================== Root ========================= { [`${componentCls}-root`]: { [`${componentCls}-wrap`]: { zIndex: token2.zIndexPopupBase, position: "fixed", inset: 0, overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }, [`${componentCls}-wrap-rtl`]: { direction: "rtl" }, [`${componentCls}-centered`]: { textAlign: "center", "&::before": { display: "inline-block", width: 0, height: "100%", verticalAlign: "middle", content: '""' }, [componentCls]: { top: 0, display: "inline-block", paddingBottom: 0, textAlign: "start", verticalAlign: "middle" } }, [`@media (max-width: ${token2.screenSMMax})`]: { [componentCls]: { maxWidth: "calc(100vw - 16px)", margin: `${token2.marginXS} auto` }, [`${componentCls}-centered`]: { [componentCls]: { flex: 1 } } } } }, // ======================== Modal ======================== { [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { pointerEvents: "none", position: "relative", top: 100, width: "auto", maxWidth: `calc(100vw - ${token2.margin * 2}px)`, margin: "0 auto", paddingBottom: token2.paddingLG, [`${componentCls}-title`]: { margin: 0, color: token2.modalHeadingColor, fontWeight: token2.fontWeightStrong, fontSize: token2.modalHeaderTitleFontSize, lineHeight: token2.modalHeaderTitleLineHeight, wordWrap: "break-word" }, [`${componentCls}-content`]: { position: "relative", backgroundColor: token2.modalContentBg, backgroundClip: "padding-box", border: 0, borderRadius: token2.borderRadiusLG, boxShadow: token2.boxShadowSecondary, pointerEvents: "auto", padding: `${token2.paddingMD}px ${token2.paddingContentHorizontalLG}px` }, [`${componentCls}-close`]: _extends$1({ position: "absolute", top: (token2.modalHeaderCloseSize - token2.modalCloseBtnSize) / 2, insetInlineEnd: (token2.modalHeaderCloseSize - token2.modalCloseBtnSize) / 2, zIndex: token2.zIndexPopupBase + 10, padding: 0, color: token2.modalCloseColor, fontWeight: token2.fontWeightStrong, lineHeight: 1, textDecoration: "none", background: "transparent", borderRadius: token2.borderRadiusSM, width: token2.modalConfirmIconSize, height: token2.modalConfirmIconSize, border: 0, outline: 0, cursor: "pointer", transition: `color ${token2.motionDurationMid}, background-color ${token2.motionDurationMid}`, "&-x": { display: "block", fontSize: token2.fontSizeLG, fontStyle: "normal", lineHeight: `${token2.modalCloseBtnSize}px`, textAlign: "center", textTransform: "none", textRendering: "auto" }, "&:hover": { color: token2.modalIconHoverColor, backgroundColor: token2.wireframe ? "transparent" : token2.colorFillContent, textDecoration: "none" }, "&:active": { backgroundColor: token2.wireframe ? "transparent" : token2.colorFillContentHover } }, genFocusStyle(token2)), [`${componentCls}-header`]: { color: token2.colorText, background: token2.modalHeaderBg, borderRadius: `${token2.borderRadiusLG}px ${token2.borderRadiusLG}px 0 0`, marginBottom: token2.marginXS }, [`${componentCls}-body`]: { fontSize: token2.fontSize, lineHeight: token2.lineHeight, wordWrap: "break-word" }, [`${componentCls}-footer`]: { textAlign: "end", background: token2.modalFooterBg, marginTop: token2.marginSM, [`${token2.antCls}-btn + ${token2.antCls}-btn:not(${token2.antCls}-dropdown-trigger)`]: { marginBottom: 0, marginInlineStart: token2.marginXS } }, [`${componentCls}-open`]: { overflow: "hidden" } }) }, // ======================== Pure ========================= { [`${componentCls}-pure-panel`]: { top: "auto", padding: 0, display: "flex", flexDirection: "column", [`${componentCls}-content, ${componentCls}-body, ${componentCls}-confirm-body-wrapper`]: { display: "flex", flexDirection: "column", flex: "auto" }, [`${componentCls}-confirm-body`]: { marginBottom: "auto" } } } ]; }; const genModalConfirmStyle = (token2) => { const { componentCls } = token2; const confirmComponentCls = `${componentCls}-confirm`; return { [confirmComponentCls]: { "&-rtl": { direction: "rtl" }, [`${token2.antCls}-modal-header`]: { display: "none" }, [`${confirmComponentCls}-body-wrapper`]: _extends$1({}, clearFix()), [`${confirmComponentCls}-body`]: { display: "flex", flexWrap: "wrap", alignItems: "center", [`${confirmComponentCls}-title`]: { flex: "0 0 100%", display: "block", // create BFC to avoid // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png overflow: "hidden", color: token2.colorTextHeading, fontWeight: token2.fontWeightStrong, fontSize: token2.modalHeaderTitleFontSize, lineHeight: token2.modalHeaderTitleLineHeight, [`+ ${confirmComponentCls}-content`]: { marginBlockStart: token2.marginXS, flexBasis: "100%", maxWidth: `calc(100% - ${token2.modalConfirmIconSize + token2.marginSM}px)` } }, [`${confirmComponentCls}-content`]: { color: token2.colorText, fontSize: token2.fontSize }, [`> ${token2.iconCls}`]: { flex: "none", marginInlineEnd: token2.marginSM, fontSize: token2.modalConfirmIconSize, [`+ ${confirmComponentCls}-title`]: { flex: 1 }, // `content` after `icon` should set marginLeft [`+ ${confirmComponentCls}-title + ${confirmComponentCls}-content`]: { marginInlineStart: token2.modalConfirmIconSize + token2.marginSM } } }, [`${confirmComponentCls}-btns`]: { textAlign: "end", marginTop: token2.marginSM, [`${token2.antCls}-btn + ${token2.antCls}-btn`]: { marginBottom: 0, marginInlineStart: token2.marginXS } } }, [`${confirmComponentCls}-error ${confirmComponentCls}-body > ${token2.iconCls}`]: { color: token2.colorError }, [`${confirmComponentCls}-warning ${confirmComponentCls}-body > ${token2.iconCls}, ${confirmComponentCls}-confirm ${confirmComponentCls}-body > ${token2.iconCls}`]: { color: token2.colorWarning }, [`${confirmComponentCls}-info ${confirmComponentCls}-body > ${token2.iconCls}`]: { color: token2.colorInfo }, [`${confirmComponentCls}-success ${confirmComponentCls}-body > ${token2.iconCls}`]: { color: token2.colorSuccess }, // https://github.com/ant-design/ant-design/issues/37329 [`${componentCls}-zoom-leave ${componentCls}-btns`]: { pointerEvents: "none" } }; }; const genRTLStyle = (token2) => { const { componentCls } = token2; return { [`${componentCls}-root`]: { [`${componentCls}-wrap-rtl`]: { direction: "rtl", [`${componentCls}-confirm-body`]: { direction: "rtl" } } } }; }; const genWireframeStyle = (token2) => { const { componentCls, antCls } = token2; const confirmComponentCls = `${componentCls}-confirm`; return { [componentCls]: { [`${componentCls}-content`]: { padding: 0 }, [`${componentCls}-header`]: { padding: token2.modalHeaderPadding, borderBottom: `${token2.modalHeaderBorderWidth}px ${token2.modalHeaderBorderStyle} ${token2.modalHeaderBorderColorSplit}`, marginBottom: 0 }, [`${componentCls}-body`]: { padding: token2.modalBodyPadding }, [`${componentCls}-footer`]: { padding: `${token2.modalFooterPaddingVertical}px ${token2.modalFooterPaddingHorizontal}px`, borderTop: `${token2.modalFooterBorderWidth}px ${token2.modalFooterBorderStyle} ${token2.modalFooterBorderColorSplit}`, borderRadius: `0 0 ${token2.borderRadiusLG}px ${token2.borderRadiusLG}px`, marginTop: 0 } }, [confirmComponentCls]: { [`${antCls}-modal-body`]: { padding: `${token2.padding * 2}px ${token2.padding * 2}px ${token2.paddingLG}px` }, [`${confirmComponentCls}-body`]: { [`> ${token2.iconCls}`]: { marginInlineEnd: token2.margin, // `content` after `icon` should set marginLeft [`+ ${confirmComponentCls}-title + ${confirmComponentCls}-content`]: { marginInlineStart: token2.modalConfirmIconSize + token2.margin } } }, [`${confirmComponentCls}-btns`]: { marginTop: token2.marginLG } } }; }; const useStyle$2 = genComponentStyleHook("Modal", (token2) => { const headerPaddingVertical = token2.padding; const headerFontSize = token2.fontSizeHeading5; const headerLineHeight = token2.lineHeightHeading5; const modalToken = merge(token2, { modalBodyPadding: token2.paddingLG, modalHeaderBg: token2.colorBgElevated, modalHeaderPadding: `${headerPaddingVertical}px ${token2.paddingLG}px`, modalHeaderBorderWidth: token2.lineWidth, modalHeaderBorderStyle: token2.lineType, modalHeaderTitleLineHeight: headerLineHeight, modalHeaderTitleFontSize: headerFontSize, modalHeaderBorderColorSplit: token2.colorSplit, modalHeaderCloseSize: headerLineHeight * headerFontSize + headerPaddingVertical * 2, modalContentBg: token2.colorBgElevated, modalHeadingColor: token2.colorTextHeading, modalCloseColor: token2.colorTextDescription, modalFooterBg: "transparent", modalFooterBorderColorSplit: token2.colorSplit, modalFooterBorderStyle: token2.lineType, modalFooterPaddingVertical: token2.paddingXS, modalFooterPaddingHorizontal: token2.padding, modalFooterBorderWidth: token2.lineWidth, modalConfirmTitleFontSize: token2.fontSizeLG, modalIconHoverColor: token2.colorIconHover, modalConfirmIconSize: token2.fontSize * token2.lineHeight, modalCloseBtnSize: token2.controlHeightLG * 0.55 }); return [genModalStyle(modalToken), genModalConfirmStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), token2.wireframe && genWireframeStyle(modalToken), initZoomMotion(modalToken, "zoom")]; }); const genBoxStyle = (position2) => ({ position: position2 || "absolute", inset: 0 }); const genImageMaskStyle = (token2) => { const { iconCls, motionDurationSlow, paddingXXS, marginXXS, prefixCls } = token2; return { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", color: "#fff", background: new TinyColor("#000").setAlpha(0.5).toRgbString(), cursor: "pointer", opacity: 0, transition: `opacity ${motionDurationSlow}`, [`.${prefixCls}-mask-info`]: _extends$1(_extends$1({}, textEllipsis), { padding: `0 ${paddingXXS}px`, [iconCls]: { marginInlineEnd: marginXXS, svg: { verticalAlign: "baseline" } } }) }; }; const genPreviewOperationsStyle = (token2) => { const { previewCls, modalMaskBg, paddingSM, previewOperationColorDisabled, motionDurationSlow } = token2; const operationBg = new TinyColor(modalMaskBg).setAlpha(0.1); const operationBgHover = operationBg.clone().setAlpha(0.2); return { [`${previewCls}-operations`]: _extends$1(_extends$1({}, resetComponent(token2)), { display: "flex", flexDirection: "row-reverse", alignItems: "center", color: token2.previewOperationColor, listStyle: "none", background: operationBg.toRgbString(), pointerEvents: "auto", "&-operation": { marginInlineStart: paddingSM, padding: paddingSM, cursor: "pointer", transition: `all ${motionDurationSlow}`, userSelect: "none", "&:hover": { background: operationBgHover.toRgbString() }, "&-disabled": { color: previewOperationColorDisabled, pointerEvents: "none" }, "&:last-of-type": { marginInlineStart: 0 } }, "&-progress": { position: "absolute", left: { _skip_check_: true, value: "50%" }, transform: "translateX(-50%)" }, "&-icon": { fontSize: token2.previewOperationSize } }) }; }; const genPreviewSwitchStyle = (token2) => { const { modalMaskBg, iconCls, previewOperationColorDisabled, previewCls, zIndexPopup, motionDurationSlow } = token2; const operationBg = new TinyColor(modalMaskBg).setAlpha(0.1); const operationBgHover = operationBg.clone().setAlpha(0.2); return { [`${previewCls}-switch-left, ${previewCls}-switch-right`]: { position: "fixed", insetBlockStart: "50%", zIndex: zIndexPopup + 1, display: "flex", alignItems: "center", justifyContent: "center", width: token2.imagePreviewSwitchSize, height: token2.imagePreviewSwitchSize, marginTop: -token2.imagePreviewSwitchSize / 2, color: token2.previewOperationColor, background: operationBg.toRgbString(), borderRadius: "50%", transform: `translateY(-50%)`, cursor: "pointer", transition: `all ${motionDurationSlow}`, pointerEvents: "auto", userSelect: "none", "&:hover": { background: operationBgHover.toRgbString() }, [`&-disabled`]: { "&, &:hover": { color: previewOperationColorDisabled, background: "transparent", cursor: "not-allowed", [`> ${iconCls}`]: { cursor: "not-allowed" } } }, [`> ${iconCls}`]: { fontSize: token2.previewOperationSize } }, [`${previewCls}-switch-left`]: { insetInlineStart: token2.marginSM }, [`${previewCls}-switch-right`]: { insetInlineEnd: token2.marginSM } }; }; const genImagePreviewStyle = (token2) => { const { motionEaseOut, previewCls, motionDurationSlow, componentCls } = token2; return [ { [`${componentCls}-preview-root`]: { [previewCls]: { height: "100%", textAlign: "center", pointerEvents: "none" }, [`${previewCls}-body`]: _extends$1(_extends$1({}, genBoxStyle()), { overflow: "hidden" }), [`${previewCls}-img`]: { maxWidth: "100%", maxHeight: "100%", verticalAlign: "middle", transform: "scale3d(1, 1, 1)", cursor: "grab", transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`, userSelect: "none", pointerEvents: "auto", "&-wrapper": _extends$1(_extends$1({}, genBoxStyle()), { transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`, // https://github.com/ant-design/ant-design/issues/39913 // TailwindCSS will reset img default style. // Let's set back. display: "flex", justifyContent: "center", alignItems: "center", "&::before": { display: "inline-block", width: 1, height: "50%", marginInlineEnd: -1, content: '""' } }) }, [`${previewCls}-moving`]: { [`${previewCls}-preview-img`]: { cursor: "grabbing", "&-wrapper": { transitionDuration: "0s" } } } } }, // Override { [`${componentCls}-preview-root`]: { [`${previewCls}-wrap`]: { zIndex: token2.zIndexPopup } } }, // Preview operations & switch { [`${componentCls}-preview-operations-wrapper`]: { position: "fixed", insetBlockStart: 0, insetInlineEnd: 0, zIndex: token2.zIndexPopup + 1, width: "100%" }, "&": [genPreviewOperationsStyle(token2), genPreviewSwitchStyle(token2)] } ]; }; const genImageStyle = (token2) => { const { componentCls } = token2; return { // ============================== image ============================== [componentCls]: { position: "relative", display: "inline-block", [`${componentCls}-img`]: { width: "100%", height: "auto", verticalAlign: "middle" }, [`${componentCls}-img-placeholder`]: { backgroundColor: token2.colorBgContainerDisabled, backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')", backgroundRepeat: "no-repeat", backgroundPosition: "center center", backgroundSize: "30%" }, [`${componentCls}-mask`]: _extends$1({}, genImageMaskStyle(token2)), [`${componentCls}-mask:hover`]: { opacity: 1 }, [`${componentCls}-placeholder`]: _extends$1({}, genBoxStyle()) } }; }; const genPreviewMotion = (token2) => { const { previewCls } = token2; return { [`${previewCls}-root`]: initZoomMotion(token2, "zoom"), [`&`]: initFadeMotion(token2, true) }; }; const useStyle$1 = genComponentStyleHook("Image", (token2) => { const previewCls = `${token2.componentCls}-preview`; const imageToken = merge(token2, { previewCls, modalMaskBg: new TinyColor("#000").setAlpha(0.45).toRgbString(), imagePreviewSwitchSize: token2.controlHeightLG }); return [genImageStyle(imageToken), genImagePreviewStyle(imageToken), genModalMaskStyle(merge(imageToken, { componentCls: previewCls })), genPreviewMotion(imageToken)]; }, (token2) => ({ zIndexPopup: token2.zIndexPopupBase + 80, previewOperationColor: new TinyColor(token2.colorTextLightSolid).toRgbString(), previewOperationColorDisabled: new TinyColor(token2.colorTextLightSolid).setAlpha(0.25).toRgbString(), previewOperationSize: token2.fontSizeIcon * 1.5 // FIXME: fontSizeIconLG })); const icons = { rotateLeft: createVNode(RotateLeftOutlined, null, null), rotateRight: createVNode(RotateRightOutlined, null, null), zoomIn: createVNode(ZoomInOutlined, null, null), zoomOut: createVNode(ZoomOutOutlined, null, null), close: createVNode(CloseOutlined, null, null), left: createVNode(LeftOutlined, null, null), right: createVNode(RightOutlined, null, null), flipX: createVNode(SwapOutlined, null, null), flipY: createVNode(SwapOutlined, { "rotate": 90 }, null) }; const previewGroupProps = () => ({ previewPrefixCls: String, preview: anyType() }); const InternalPreviewGroup = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AImagePreviewGroup", inheritAttrs: false, props: previewGroupProps(), setup(props2, _ref) { let { attrs, slots } = _ref; const { prefixCls, rootPrefixCls } = useConfigInject("image", props2); const previewPrefixCls = computed(() => `${prefixCls.value}-preview`); const [wrapSSR, hashId] = useStyle$1(prefixCls); const mergedPreview = computed(() => { const { preview } = props2; if (preview === false) { return preview; } const _preview = typeof preview === "object" ? preview : {}; return _extends$1(_extends$1({}, _preview), { rootClassName: hashId.value, transitionName: getTransitionName(rootPrefixCls.value, "zoom", _preview.transitionName), maskTransitionName: getTransitionName(rootPrefixCls.value, "fade", _preview.maskTransitionName) }); }); return () => { return wrapSSR(createVNode(Group, _objectSpread2$1(_objectSpread2$1({}, _extends$1(_extends$1({}, attrs), props2)), {}, { "preview": mergedPreview.value, "icons": icons, "previewPrefixCls": previewPrefixCls.value }), slots)); }; } }); const Image = /* @__PURE__ */ defineComponent({ name: "AImage", inheritAttrs: false, props: imageProps(), setup(props2, _ref) { let { slots, attrs } = _ref; const { prefixCls, rootPrefixCls, configProvider } = useConfigInject("image", props2); const [wrapSSR, hashId] = useStyle$1(prefixCls); const mergedPreview = computed(() => { const { preview } = props2; if (preview === false) { return preview; } const _preview = typeof preview === "object" ? preview : {}; return _extends$1(_extends$1({ icons }, _preview), { transitionName: getTransitionName(rootPrefixCls.value, "zoom", _preview.transitionName), maskTransitionName: getTransitionName(rootPrefixCls.value, "fade", _preview.maskTransitionName) }); }); return () => { var _a, _b; const imageLocale = ((_b = (_a = configProvider.locale) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.Image) || localeValues$1.Image; const defaultPreviewMask = () => createVNode("div", { "class": `${prefixCls.value}-mask-info` }, [createVNode(EyeOutlined, null, null), imageLocale === null || imageLocale === void 0 ? void 0 : imageLocale.preview]); const { previewMask = slots.previewMask || defaultPreviewMask } = props2; return wrapSSR(createVNode(ImageInternal, _objectSpread2$1(_objectSpread2$1({}, _extends$1(_extends$1(_extends$1({}, attrs), props2), { prefixCls: prefixCls.value })), {}, { "preview": mergedPreview.value, "rootClassName": classNames(props2.rootClassName, hashId.value) }), _extends$1(_extends$1({}, slots), { previewMask: typeof previewMask === "function" ? previewMask : null }))); }; } }); Image.PreviewGroup = InternalPreviewGroup; Image.install = function(app) { app.component(Image.name, Image); app.component(Image.PreviewGroup.name, Image.PreviewGroup); return app; }; const Pagination = { // Options.jsx items_per_page: "条/页", jump_to: "跳至", jump_to_confirm: "确定", page: "页", // Pagination.jsx prev_page: "上一页", next_page: "下一页", prev_5: "向前 5 页", next_5: "向后 5 页", prev_3: "向前 3 页", next_3: "向后 3 页" }; var __rest$2 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; let mousePosition; const getClickPosition = (e2) => { mousePosition = { x: e2.pageX, y: e2.pageY }; setTimeout(() => mousePosition = null, 100); }; if (canUseDocElement()) { addEventListenerWrap(document.documentElement, "click", getClickPosition, true); } const modalProps = () => ({ prefixCls: String, /** @deprecated Please use `open` instead. */ visible: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, confirmLoading: { type: Boolean, default: void 0 }, title: PropTypes.any, closable: { type: Boolean, default: void 0 }, closeIcon: PropTypes.any, onOk: Function, onCancel: Function, "onUpdate:visible": Function, "onUpdate:open": Function, onChange: Function, afterClose: Function, centered: { type: Boolean, default: void 0 }, width: [String, Number], footer: PropTypes.any, okText: PropTypes.any, okType: String, cancelText: PropTypes.any, icon: PropTypes.any, maskClosable: { type: Boolean, default: void 0 }, forceRender: { type: Boolean, default: void 0 }, okButtonProps: objectType(), cancelButtonProps: objectType(), destroyOnClose: { type: Boolean, default: void 0 }, wrapClassName: String, maskTransitionName: String, transitionName: String, getContainer: { type: [String, Function, Boolean, Object], default: void 0 }, zIndex: Number, bodyStyle: objectType(), maskStyle: objectType(), mask: { type: Boolean, default: void 0 }, keyboard: { type: Boolean, default: void 0 }, wrapProps: Object, focusTriggerAfterClose: { type: Boolean, default: void 0 }, modalRender: Function, mousePosition: objectType() }); const Modal = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "AModal", inheritAttrs: false, props: initDefaultProps(modalProps(), { width: 520, confirmLoading: false, okType: "primary" }), setup(props2, _ref) { let { emit: emit2, slots, attrs } = _ref; const [locale2] = useLocaleReceiver("Modal"); const { prefixCls, rootPrefixCls, direction, getPopupContainer } = useConfigInject("modal", props2); const [wrapSSR, hashId] = useStyle$2(prefixCls); warning$2(props2.visible === void 0); const handleCancel = (e2) => { emit2("update:visible", false); emit2("update:open", false); emit2("cancel", e2); emit2("change", false); }; const handleOk = (e2) => { emit2("ok", e2); }; const renderFooter = () => { var _a, _b; const { okText = (_a = slots.okText) === null || _a === void 0 ? void 0 : _a.call(slots), okType, cancelText = (_b = slots.cancelText) === null || _b === void 0 ? void 0 : _b.call(slots), confirmLoading } = props2; return createVNode(Fragment, null, [createVNode(Button$1, _objectSpread2$1({ "onClick": handleCancel }, props2.cancelButtonProps), { default: () => [cancelText || locale2.value.cancelText] }), createVNode(Button$1, _objectSpread2$1(_objectSpread2$1({}, convertLegacyProps(okType)), {}, { "loading": confirmLoading, "onClick": handleOk }, props2.okButtonProps), { default: () => [okText || locale2.value.okText] })]); }; return () => { var _a, _b; const { prefixCls: customizePrefixCls, visible, open: open2, wrapClassName, centered, getContainer: getContainer2, closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots), focusTriggerAfterClose = true } = props2, restProps = __rest$2(props2, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]); const wrapClassNameExtended = classNames(wrapClassName, { [`${prefixCls.value}-centered`]: !!centered, [`${prefixCls.value}-wrap-rtl`]: direction.value === "rtl" }); return wrapSSR(createVNode(DialogWrap, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, restProps), attrs), {}, { "rootClassName": hashId.value, "class": classNames(hashId.value, attrs.class), "getContainer": getContainer2 || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value), "prefixCls": prefixCls.value, "wrapClassName": wrapClassNameExtended, "visible": open2 !== null && open2 !== void 0 ? open2 : visible, "onClose": handleCancel, "focusTriggerAfterClose": focusTriggerAfterClose, "transitionName": getTransitionName(rootPrefixCls.value, "zoom", props2.transitionName), "maskTransitionName": getTransitionName(rootPrefixCls.value, "fade", props2.maskTransitionName), "mousePosition": (_b = restProps.mousePosition) !== null && _b !== void 0 ? _b : mousePosition }), _extends$1(_extends$1({}, slots), { footer: slots.footer || renderFooter, closeIcon: () => { return createVNode("span", { "class": `${prefixCls.value}-close-x` }, [closeIcon || createVNode(CloseOutlined, { "class": `${prefixCls.value}-close-icon` }, null)]); } }))); }; } }); const useDestroyed = () => { const destroyed = shallowRef(false); onBeforeUnmount(() => { destroyed.value = true; }); return destroyed; }; const actionButtonProps = { type: { type: String }, actionFn: Function, close: Function, autofocus: Boolean, prefixCls: String, buttonProps: objectType(), emitEvent: Boolean, quitOnNullishReturnValue: Boolean }; function isThenable(thing) { return !!(thing && thing.then); } const ActionButton = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ActionButton", props: actionButtonProps, setup(props2, _ref) { let { slots } = _ref; const clickedRef = shallowRef(false); const buttonRef = shallowRef(); const loading = shallowRef(false); let timeoutId; const isDestroyed = useDestroyed(); onMounted(() => { if (props2.autofocus) { timeoutId = setTimeout(() => { var _a, _b; return (_b = (_a = findDOMNode(buttonRef.value)) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a); }); } }); onBeforeUnmount(() => { clearTimeout(timeoutId); }); const onInternalClose = function() { var _a; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } (_a = props2.close) === null || _a === void 0 ? void 0 : _a.call(props2, ...args); }; const handlePromiseOnOk = (returnValueOfOnOk) => { if (!isThenable(returnValueOfOnOk)) { return; } loading.value = true; returnValueOfOnOk.then(function() { if (!isDestroyed.value) { loading.value = false; } onInternalClose(...arguments); clickedRef.value = false; }, (e2) => { if (!isDestroyed.value) { loading.value = false; } clickedRef.value = false; return Promise.reject(e2); }); }; const onClick = (e2) => { const { actionFn } = props2; if (clickedRef.value) { return; } clickedRef.value = true; if (!actionFn) { onInternalClose(); return; } let returnValueOfOnOk; if (props2.emitEvent) { returnValueOfOnOk = actionFn(e2); if (props2.quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) { clickedRef.value = false; onInternalClose(e2); return; } } else if (actionFn.length) { returnValueOfOnOk = actionFn(props2.close); clickedRef.value = false; } else { returnValueOfOnOk = actionFn(); if (!returnValueOfOnOk) { onInternalClose(); return; } } handlePromiseOnOk(returnValueOfOnOk); }; return () => { const { type, prefixCls, buttonProps: buttonProps2 } = props2; return createVNode(Button$1, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, convertLegacyProps(type)), {}, { "onClick": onClick, "loading": loading.value, "prefixCls": prefixCls }, buttonProps2), {}, { "ref": buttonRef }), slots); }; } }); function renderSomeContent(someContent) { if (typeof someContent === "function") { return someContent(); } return someContent; } const ConfirmDialog = /* @__PURE__ */ defineComponent({ name: "ConfirmDialog", inheritAttrs: false, props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"], setup(props2, _ref) { let { attrs } = _ref; const [locale2] = useLocaleReceiver("Modal"); return () => { const { icon, onCancel, onOk, close, okText, closable = false, zIndex, afterClose, keyboard, centered, getContainer: getContainer2, maskStyle, okButtonProps, cancelButtonProps, okCancel, width = 416, mask = true, maskClosable = false, type, open: open2, title, content, direction, closeIcon, modalRender, focusTriggerAfterClose, rootPrefixCls, bodyStyle, wrapClassName, footer } = props2; let mergedIcon = icon; if (!icon && icon !== null) { switch (type) { case "info": mergedIcon = createVNode(InfoCircleFilled, null, null); break; case "success": mergedIcon = createVNode(CheckCircleFilled, null, null); break; case "error": mergedIcon = createVNode(CloseCircleFilled, null, null); break; default: mergedIcon = createVNode(ExclamationCircleFilled, null, null); } } const okType = props2.okType || "primary"; const prefixCls = props2.prefixCls || "ant-modal"; const contentPrefixCls = `${prefixCls}-confirm`; const style = attrs.style || {}; const mergedOkCancel = okCancel !== null && okCancel !== void 0 ? okCancel : type === "confirm"; const autoFocusButton = props2.autoFocusButton === null ? false : props2.autoFocusButton || "ok"; const confirmPrefixCls = `${prefixCls}-confirm`; const classString = classNames(confirmPrefixCls, `${confirmPrefixCls}-${props2.type}`, { [`${confirmPrefixCls}-rtl`]: direction === "rtl" }, attrs.class); const mergedLocal = locale2.value; const cancelButton = mergedOkCancel && createVNode(ActionButton, { "actionFn": onCancel, "close": close, "autofocus": autoFocusButton === "cancel", "buttonProps": cancelButtonProps, "prefixCls": `${rootPrefixCls}-btn` }, { default: () => [renderSomeContent(props2.cancelText) || mergedLocal.cancelText] }); return createVNode(Modal, { "prefixCls": prefixCls, "class": classString, "wrapClassName": classNames({ [`${confirmPrefixCls}-centered`]: !!centered }, wrapClassName), "onCancel": (e2) => close === null || close === void 0 ? void 0 : close({ triggerCancel: true }, e2), "open": open2, "title": "", "footer": "", "transitionName": getTransitionName(rootPrefixCls, "zoom", props2.transitionName), "maskTransitionName": getTransitionName(rootPrefixCls, "fade", props2.maskTransitionName), "mask": mask, "maskClosable": maskClosable, "maskStyle": maskStyle, "style": style, "bodyStyle": bodyStyle, "width": width, "zIndex": zIndex, "afterClose": afterClose, "keyboard": keyboard, "centered": centered, "getContainer": getContainer2, "closable": closable, "closeIcon": closeIcon, "modalRender": modalRender, "focusTriggerAfterClose": focusTriggerAfterClose }, { default: () => [createVNode("div", { "class": `${contentPrefixCls}-body-wrapper` }, [createVNode("div", { "class": `${contentPrefixCls}-body` }, [renderSomeContent(mergedIcon), title === void 0 ? null : createVNode("span", { "class": `${contentPrefixCls}-title` }, [renderSomeContent(title)]), createVNode("div", { "class": `${contentPrefixCls}-content` }, [renderSomeContent(content)])]), footer !== void 0 ? renderSomeContent(footer) : createVNode("div", { "class": `${contentPrefixCls}-btns` }, [cancelButton, createVNode(ActionButton, { "type": okType, "actionFn": onOk, "close": close, "autofocus": autoFocusButton === "ok", "buttonProps": okButtonProps, "prefixCls": `${rootPrefixCls}-btn` }, { default: () => [renderSomeContent(okText) || (mergedOkCancel ? mergedLocal.okText : mergedLocal.justOkText)] })])])] }); }; } }); const destroyFns = []; const confirm = (config) => { const container = document.createDocumentFragment(); let currentConfig = _extends$1(_extends$1({}, omit$1(config, ["parentContext", "appContext"])), { close, open: true }); let confirmDialogInstance = null; function destroy() { if (confirmDialogInstance) { render(null, container); confirmDialogInstance = null; } for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } const triggerCancel = args.some((param) => param && param.triggerCancel); if (config.onCancel && triggerCancel) { config.onCancel(() => { }, ...args.slice(1)); } for (let i2 = 0; i2 < destroyFns.length; i2++) { const fn = destroyFns[i2]; if (fn === close) { destroyFns.splice(i2, 1); break; } } } function close() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } currentConfig = _extends$1(_extends$1({}, currentConfig), { open: false, afterClose: () => { if (typeof config.afterClose === "function") { config.afterClose(); } destroy.apply(this, args); } }); if (currentConfig.visible) { delete currentConfig.visible; } update(currentConfig); } function update(configUpdate) { if (typeof configUpdate === "function") { currentConfig = configUpdate(currentConfig); } else { currentConfig = _extends$1(_extends$1({}, currentConfig), configUpdate); } if (confirmDialogInstance) { triggerVNodeUpdate(confirmDialogInstance, currentConfig, container); } } const Wrapper = (p2) => { const global2 = globalConfigForApi; const rootPrefixCls = global2.prefixCls; const prefixCls = p2.prefixCls || `${rootPrefixCls}-modal`; const iconPrefixCls = global2.iconPrefixCls; const runtimeLocale2 = getConfirmLocale(); return createVNode(ConfigProvider, _objectSpread2$1(_objectSpread2$1({}, global2), {}, { "prefixCls": rootPrefixCls }), { default: () => [createVNode(ConfirmDialog, _objectSpread2$1(_objectSpread2$1({}, p2), {}, { "rootPrefixCls": rootPrefixCls, "prefixCls": prefixCls, "iconPrefixCls": iconPrefixCls, "locale": runtimeLocale2, "cancelText": p2.cancelText || runtimeLocale2.cancelText }), null)] }); }; function render$1(props2) { const vm = createVNode(Wrapper, _extends$1({}, props2)); vm.appContext = config.parentContext || config.appContext || vm.appContext; render(vm, container); return vm; } confirmDialogInstance = render$1(currentConfig); destroyFns.push(close); return { destroy: close, update }; }; function withWarn(props2) { return _extends$1(_extends$1({}, props2), { type: "warning" }); } function withInfo(props2) { return _extends$1(_extends$1({}, props2), { type: "info" }); } function withSuccess(props2) { return _extends$1(_extends$1({}, props2), { type: "success" }); } function withError(props2) { return _extends$1(_extends$1({}, props2), { type: "error" }); } function withConfirm(props2) { return _extends$1(_extends$1({}, props2), { type: "confirm" }); } const comfirmFuncProps = () => ({ config: Object, afterClose: Function, destroyAction: Function, open: Boolean }); const HookModal = /* @__PURE__ */ defineComponent({ name: "HookModal", inheritAttrs: false, props: initDefaultProps(comfirmFuncProps(), { config: { width: 520, okType: "primary" } }), setup(props2, _ref) { let { expose } = _ref; var _a; const open2 = computed(() => props2.open); const innerConfig = computed(() => props2.config); const { direction, getPrefixCls } = useConfigContextInject(); const prefixCls = getPrefixCls("modal"); const rootPrefixCls = getPrefixCls(); const afterClose = () => { var _a2, _b; props2 === null || props2 === void 0 ? void 0 : props2.afterClose(); (_b = (_a2 = innerConfig.value).afterClose) === null || _b === void 0 ? void 0 : _b.call(_a2); }; const close = function() { props2.destroyAction(...arguments); }; expose({ destroy: close }); const mergedOkCancel = (_a = innerConfig.value.okCancel) !== null && _a !== void 0 ? _a : innerConfig.value.type === "confirm"; const [contextLocale] = useLocaleReceiver("Modal", localeValues$1.Modal); return () => createVNode(ConfirmDialog, _objectSpread2$1(_objectSpread2$1({ "prefixCls": prefixCls, "rootPrefixCls": rootPrefixCls }, innerConfig.value), {}, { "close": close, "open": open2.value, "afterClose": afterClose, "okText": innerConfig.value.okText || (mergedOkCancel ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.okText : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.justOkText), "direction": innerConfig.value.direction || direction.value, "cancelText": innerConfig.value.cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.cancelText) }), null); } }); let uuid$1 = 0; const ElementsHolder = /* @__PURE__ */ defineComponent({ name: "ElementsHolder", inheritAttrs: false, setup(_2, _ref) { let { expose } = _ref; const modals = shallowRef([]); const addModal = (modal) => { modals.value.push(modal); modals.value = modals.value.slice(); return () => { modals.value = modals.value.filter((currentModal) => currentModal !== modal); }; }; expose({ addModal }); return () => { return modals.value.map((modal) => modal()); }; } }); function useModal() { const holderRef = shallowRef(null); const actionQueue = shallowRef([]); watch(actionQueue, () => { if (actionQueue.value.length) { const cloneQueue = [...actionQueue.value]; cloneQueue.forEach((action) => { action(); }); actionQueue.value = []; } }, { immediate: true }); const getConfirmFunc = (withFunc) => function hookConfirm(config) { var _a; uuid$1 += 1; const open2 = shallowRef(true); const modalRef = shallowRef(null); const configRef = shallowRef(unref(config)); const updateConfig = shallowRef({}); watch(() => config, (val) => { updateAction(_extends$1(_extends$1({}, isRef(val) ? val.value : val), updateConfig.value)); }); const destroyAction = function() { open2.value = false; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } const triggerCancel = args.some((param) => param && param.triggerCancel); if (configRef.value.onCancel && triggerCancel) { configRef.value.onCancel(() => { }, ...args.slice(1)); } }; let closeFunc; const modal = () => createVNode(HookModal, { "key": `modal-${uuid$1}`, "config": withFunc(configRef.value), "ref": modalRef, "open": open2.value, "destroyAction": destroyAction, "afterClose": () => { closeFunc === null || closeFunc === void 0 ? void 0 : closeFunc(); } }, null); closeFunc = (_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.addModal(modal); if (closeFunc) { destroyFns.push(closeFunc); } const updateAction = (newConfig) => { configRef.value = _extends$1(_extends$1({}, configRef.value), newConfig); }; const destroy = () => { if (modalRef.value) { destroyAction(); } else { actionQueue.value = [...actionQueue.value, destroyAction]; } }; const update = (newConfig) => { updateConfig.value = newConfig; if (modalRef.value) { updateAction(newConfig); } else { actionQueue.value = [...actionQueue.value, () => updateAction(newConfig)]; } }; return { destroy, update }; }; const fns = computed(() => ({ info: getConfirmFunc(withInfo), success: getConfirmFunc(withSuccess), error: getConfirmFunc(withError), warning: getConfirmFunc(withWarn), confirm: getConfirmFunc(withConfirm) })); const holderKey = Symbol("modalHolderKey"); return [fns.value, () => createVNode(ElementsHolder, { "key": holderKey, "ref": holderRef }, null)]; } function modalWarn(props2) { return confirm(withWarn(props2)); } Modal.useModal = useModal; Modal.info = function infoFn(props2) { return confirm(withInfo(props2)); }; Modal.success = function successFn(props2) { return confirm(withSuccess(props2)); }; Modal.error = function errorFn(props2) { return confirm(withError(props2)); }; Modal.warning = modalWarn; Modal.warn = modalWarn; Modal.confirm = function confirmFn(props2) { return confirm(withConfirm(props2)); }; Modal.destroyAll = function destroyAllFn() { while (destroyFns.length) { const close = destroyFns.pop(); if (close) { close(); } } }; Modal.install = function(app) { app.component(Modal.name, Modal); return app; }; const Row = withInstall(ARow); const Track = (_2, _ref) => { let { attrs } = _ref; const { included, vertical, style, class: className } = attrs; let { length: length2, offset: offset2, reverse } = attrs; if (length2 < 0) { reverse = !reverse; length2 = Math.abs(length2); offset2 = 100 - offset2; } const positionStyle = vertical ? { [reverse ? "top" : "bottom"]: `${offset2}%`, [reverse ? "bottom" : "top"]: "auto", height: `${length2}%` } : { [reverse ? "right" : "left"]: `${offset2}%`, [reverse ? "left" : "right"]: "auto", width: `${length2}%` }; const elStyle = _extends$1(_extends$1({}, style), positionStyle); return included ? createVNode("div", { "class": className, "style": elStyle }, null) : null; }; Track.inheritAttrs = false; const calcPoints = (_vertical, marks, dots, step, min, max) => { const points = Object.keys(marks).map(parseFloat).sort((a2, b2) => a2 - b2); if (dots && step) { for (let i2 = min; i2 <= max; i2 += step) { if (points.indexOf(i2) === -1) { points.push(i2); } } } return points; }; const Steps = (_2, _ref) => { let { attrs } = _ref; const { prefixCls, vertical, reverse, marks, dots, step, included, lowerBound, upperBound, max, min, dotStyle, activeDotStyle } = attrs; const range2 = max - min; const elements = calcPoints(vertical, marks, dots, step, min, max).map((point) => { const offset2 = `${Math.abs(point - min) / range2 * 100}%`; const isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound; let style = vertical ? _extends$1(_extends$1({}, dotStyle), { [reverse ? "top" : "bottom"]: offset2 }) : _extends$1(_extends$1({}, dotStyle), { [reverse ? "right" : "left"]: offset2 }); if (isActived) { style = _extends$1(_extends$1({}, style), activeDotStyle); } const pointClassName = classNames({ [`${prefixCls}-dot`]: true, [`${prefixCls}-dot-active`]: isActived, [`${prefixCls}-dot-reverse`]: reverse }); return createVNode("span", { "class": pointClassName, "style": style, "key": point }, null); }); return createVNode("div", { "class": `${prefixCls}-step` }, [elements]); }; Steps.inheritAttrs = false; const Marks = (_2, _ref) => { let { attrs, slots } = _ref; const { class: className, vertical, reverse, marks, included, upperBound, lowerBound, max, min, onClickLabel } = attrs; const marksKeys = Object.keys(marks); const customMark = slots.mark; const range2 = max - min; const elements = marksKeys.map(parseFloat).sort((a2, b2) => a2 - b2).map((point) => { const markPoint = typeof marks[point] === "function" ? marks[point]() : marks[point]; const markPointIsObject = typeof markPoint === "object" && !isValidElement(markPoint); let markLabel = markPointIsObject ? markPoint.label : markPoint; if (!markLabel && markLabel !== 0) { return null; } if (customMark) { markLabel = customMark({ point, label: markLabel }); } const isActive = !included && point === upperBound || included && point <= upperBound && point >= lowerBound; const markClassName = classNames({ [`${className}-text`]: true, [`${className}-text-active`]: isActive }); const bottomStyle = { marginBottom: "-50%", [reverse ? "top" : "bottom"]: `${(point - min) / range2 * 100}%` }; const leftStyle = { transform: `translateX(${reverse ? `50%` : `-50%`})`, msTransform: `translateX(${reverse ? `50%` : `-50%`})`, [reverse ? "right" : "left"]: `${(point - min) / range2 * 100}%` }; const style = vertical ? bottomStyle : leftStyle; const markStyle = markPointIsObject ? _extends$1(_extends$1({}, style), markPoint.style) : style; const touchEvents = { [supportsPassive ? "onTouchstartPassive" : "onTouchstart"]: (e2) => onClickLabel(e2, point) }; return createVNode("span", _objectSpread2$1({ "class": markClassName, "style": markStyle, "key": point, "onMousedown": (e2) => onClickLabel(e2, point) }, touchEvents), [markLabel]); }); return createVNode("div", { "class": className }, [elements]); }; Marks.inheritAttrs = false; const VcHandle = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Handle", inheritAttrs: false, props: { prefixCls: String, vertical: { type: Boolean, default: void 0 }, offset: Number, disabled: { type: Boolean, default: void 0 }, min: Number, max: Number, value: Number, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), reverse: { type: Boolean, default: void 0 }, ariaLabel: String, ariaLabelledBy: String, ariaValueTextFormatter: Function, onMouseenter: { type: Function }, onMouseleave: { type: Function }, onMousedown: { type: Function } }, setup(props2, _ref) { let { attrs, emit: emit2, expose } = _ref; const clickFocused = shallowRef(false); const handle = shallowRef(); const handleMouseUp = () => { if (document.activeElement === handle.value) { clickFocused.value = true; } }; const handleBlur = (e2) => { clickFocused.value = false; emit2("blur", e2); }; const handleKeyDown = () => { clickFocused.value = false; }; const focus = () => { var _a; (_a = handle.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = handle.value) === null || _a === void 0 ? void 0 : _a.blur(); }; const clickFocus = () => { clickFocused.value = true; focus(); }; const handleMousedown = (e2) => { e2.preventDefault(); focus(); emit2("mousedown", e2); }; expose({ focus, blur, clickFocus, ref: handle }); let onMouseUpListener = null; onMounted(() => { onMouseUpListener = addEventListenerWrap(document, "mouseup", handleMouseUp); }); onBeforeUnmount(() => { onMouseUpListener === null || onMouseUpListener === void 0 ? void 0 : onMouseUpListener.remove(); }); const positionStyle = computed(() => { const { vertical, offset: offset2, reverse } = props2; return vertical ? { [reverse ? "top" : "bottom"]: `${offset2}%`, [reverse ? "bottom" : "top"]: "auto", transform: reverse ? null : `translateY(+50%)` } : { [reverse ? "right" : "left"]: `${offset2}%`, [reverse ? "left" : "right"]: "auto", transform: `translateX(${reverse ? "+" : "-"}50%)` }; }); return () => { const { prefixCls, disabled, min, max, value, tabindex, ariaLabel, ariaLabelledBy, ariaValueTextFormatter, onMouseenter, onMouseleave } = props2; const className = classNames(attrs.class, { [`${prefixCls}-handle-click-focused`]: clickFocused.value }); const ariaProps = { "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-disabled": !!disabled }; const elStyle = [attrs.style, positionStyle.value]; let mergedTabIndex = tabindex || 0; if (disabled || tabindex === null) { mergedTabIndex = null; } let ariaValueText; if (ariaValueTextFormatter) { ariaValueText = ariaValueTextFormatter(value); } const handleProps = _extends$1(_extends$1(_extends$1(_extends$1({}, attrs), { role: "slider", tabindex: mergedTabIndex }), ariaProps), { class: className, onBlur: handleBlur, onKeydown: handleKeyDown, onMousedown: handleMousedown, onMouseenter, onMouseleave, ref: handle, style: elStyle }); return createVNode("div", _objectSpread2$1(_objectSpread2$1({}, handleProps), {}, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuetext": ariaValueText }), null); }; } }); function isEventFromHandle(e2, handles) { try { return Object.keys(handles).some((key2) => e2.target === handles[key2].ref); } catch (error) { return false; } } function isValueOutOfRange(value, _ref) { let { min, max } = _ref; return value < min || value > max; } function isNotTouchEvent(e2) { return e2.touches.length > 1 || e2.type.toLowerCase() === "touchend" && e2.touches.length > 0; } function getClosestPoint(val, _ref2) { let { marks, step, min, max } = _ref2; const points = Object.keys(marks).map(parseFloat); if (step !== null) { const baseNum = Math.pow(10, getPrecision(step)); const maxSteps = Math.floor((max * baseNum - min * baseNum) / (step * baseNum)); const steps = Math.min((val - min) / step, maxSteps); const closestStep = Math.round(steps) * step + min; points.push(closestStep); } const diffs = points.map((point) => Math.abs(val - point)); return points[diffs.indexOf(Math.min(...diffs))]; } function getPrecision(step) { const stepString = step.toString(); let precision = 0; if (stepString.indexOf(".") >= 0) { precision = stepString.length - stepString.indexOf(".") - 1; } return precision; } function getMousePosition(vertical, e2) { let zoom = 1; if (window.visualViewport) { zoom = +(window.visualViewport.width / document.body.getBoundingClientRect().width).toFixed(2); } return (vertical ? e2.clientY : e2.pageX) / zoom; } function getTouchPosition(vertical, e2) { let zoom = 1; if (window.visualViewport) { zoom = +(window.visualViewport.width / document.body.getBoundingClientRect().width).toFixed(2); } return (vertical ? e2.touches[0].clientY : e2.touches[0].pageX) / zoom; } function getHandleCenterPosition(vertical, handle) { const coords = handle.getBoundingClientRect(); return vertical ? coords.top + coords.height * 0.5 : window.scrollX + coords.left + coords.width * 0.5; } function ensureValueInRange(val, _ref3) { let { max, min } = _ref3; if (val <= min) { return min; } if (val >= max) { return max; } return val; } function ensureValuePrecision(val, props2) { const { step } = props2; const closestPoint = isFinite(getClosestPoint(val, props2)) ? getClosestPoint(val, props2) : 0; return step === null ? closestPoint : parseFloat(closestPoint.toFixed(getPrecision(step))); } function pauseEvent(e2) { e2.stopPropagation(); e2.preventDefault(); } function calculateNextValue(func, value, props2) { const operations = { increase: (a2, b2) => a2 + b2, decrease: (a2, b2) => a2 - b2 }; const indexToGet = operations[func](Object.keys(props2.marks).indexOf(JSON.stringify(value)), 1); const keyToGet = Object.keys(props2.marks)[indexToGet]; if (props2.step) { return operations[func](value, props2.step); } if (!!Object.keys(props2.marks).length && !!props2.marks[keyToGet]) { return props2.marks[keyToGet]; } return value; } function getKeyboardValueMutator(e2, vertical, reverse) { const increase = "increase"; const decrease = "decrease"; let method = increase; switch (e2.keyCode) { case KeyCode.UP: method = vertical && reverse ? decrease : increase; break; case KeyCode.RIGHT: method = !vertical && reverse ? decrease : increase; break; case KeyCode.DOWN: method = vertical && reverse ? increase : decrease; break; case KeyCode.LEFT: method = !vertical && reverse ? increase : decrease; break; case KeyCode.END: return (_value, props2) => props2.max; case KeyCode.HOME: return (_value, props2) => props2.min; case KeyCode.PAGE_UP: return (value, props2) => value + props2.step * 2; case KeyCode.PAGE_DOWN: return (value, props2) => value - props2.step * 2; default: return void 0; } return (value, props2) => calculateNextValue(method, value, props2); } var __rest$1 = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; function noop() { } function createSlider(Component) { const propTypes = { id: String, min: Number, max: Number, step: Number, marks: PropTypes.object, included: { type: Boolean, default: void 0 }, prefixCls: String, disabled: { type: Boolean, default: void 0 }, handle: Function, dots: { type: Boolean, default: void 0 }, vertical: { type: Boolean, default: void 0 }, reverse: { type: Boolean, default: void 0 }, minimumTrackStyle: PropTypes.object, maximumTrackStyle: PropTypes.object, handleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]), trackStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.arrayOf(PropTypes.object)]), railStyle: PropTypes.object, dotStyle: PropTypes.object, activeDotStyle: PropTypes.object, autofocus: { type: Boolean, default: void 0 }, draggableTrack: { type: Boolean, default: void 0 } }; return /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "CreateSlider", mixins: [BaseMixin, Component], inheritAttrs: false, props: initDefaultProps(propTypes, { prefixCls: "rc-slider", min: 0, max: 100, step: 1, marks: {}, included: true, disabled: false, dots: false, vertical: false, reverse: false, trackStyle: [{}], handleStyle: [{}], railStyle: {}, dotStyle: {}, activeDotStyle: {} }), emits: ["change", "blur", "focus"], data() { const { step, max, min } = this; this.handlesRefs = {}; return {}; }, mounted() { this.$nextTick(() => { this.document = this.sliderRef && this.sliderRef.ownerDocument; const { autofocus, disabled } = this; if (autofocus && !disabled) { this.focus(); } }); }, beforeUnmount() { this.$nextTick(() => { this.removeDocumentEvents(); }); }, methods: { defaultHandle(_a) { var { index: index2, directives, className, style } = _a, restProps = __rest$1(_a, ["index", "directives", "className", "style"]); delete restProps.dragging; if (restProps.value === null) { return null; } const handleProps = _extends$1(_extends$1({}, restProps), { class: className, style, key: index2 }); return createVNode(VcHandle, handleProps, null); }, onDown(e2, position2) { let p2 = position2; const { draggableTrack, vertical: isVertical } = this.$props; const { bounds } = this.$data; const value = draggableTrack && this.positionGetValue ? this.positionGetValue(p2) || [] : []; const inPoint = isEventFromHandle(e2, this.handlesRefs); this.dragTrack = draggableTrack && bounds.length >= 2 && !inPoint && !value.map((n2, i2) => { const v2 = !i2 ? n2 >= bounds[i2] : true; return i2 === value.length - 1 ? n2 <= bounds[i2] : v2; }).some((c2) => !c2); if (this.dragTrack) { this.dragOffset = p2; this.startBounds = [...bounds]; } else { if (!inPoint) { this.dragOffset = 0; } else { const handlePosition = getHandleCenterPosition(isVertical, e2.target); this.dragOffset = p2 - handlePosition; p2 = handlePosition; } this.onStart(p2); } }, onMouseDown(e2) { if (e2.button !== 0) { return; } this.removeDocumentEvents(); const isVertical = this.$props.vertical; const position2 = getMousePosition(isVertical, e2); this.onDown(e2, position2); this.addDocumentMouseEvents(); }, onTouchStart(e2) { if (isNotTouchEvent(e2)) return; const isVertical = this.vertical; const position2 = getTouchPosition(isVertical, e2); this.onDown(e2, position2); this.addDocumentTouchEvents(); pauseEvent(e2); }, onFocus(e2) { const { vertical } = this; if (isEventFromHandle(e2, this.handlesRefs) && !this.dragTrack) { const handlePosition = getHandleCenterPosition(vertical, e2.target); this.dragOffset = 0; this.onStart(handlePosition); pauseEvent(e2); this.$emit("focus", e2); } }, onBlur(e2) { if (!this.dragTrack) { this.onEnd(); } this.$emit("blur", e2); }, onMouseUp() { if (this.handlesRefs[this.prevMovedHandleIndex]) { this.handlesRefs[this.prevMovedHandleIndex].clickFocus(); } }, onMouseMove(e2) { if (!this.sliderRef) { this.onEnd(); return; } const position2 = getMousePosition(this.vertical, e2); this.onMove(e2, position2 - this.dragOffset, this.dragTrack, this.startBounds); }, onTouchMove(e2) { if (isNotTouchEvent(e2) || !this.sliderRef) { this.onEnd(); return; } const position2 = getTouchPosition(this.vertical, e2); this.onMove(e2, position2 - this.dragOffset, this.dragTrack, this.startBounds); }, onKeyDown(e2) { if (this.sliderRef && isEventFromHandle(e2, this.handlesRefs)) { this.onKeyboard(e2); } }, onClickMarkLabel(e2, value) { e2.stopPropagation(); this.onChange({ sValue: value }); this.setState({ sValue: value }, () => this.onEnd(true)); }, getSliderStart() { const slider = this.sliderRef; const { vertical, reverse } = this; const rect = slider.getBoundingClientRect(); if (vertical) { return reverse ? rect.bottom : rect.top; } return window.scrollX + (reverse ? rect.right : rect.left); }, getSliderLength() { const slider = this.sliderRef; if (!slider) { return 0; } const coords = slider.getBoundingClientRect(); return this.vertical ? coords.height : coords.width; }, addDocumentTouchEvents() { this.onTouchMoveListener = addEventListenerWrap(this.document, "touchmove", this.onTouchMove); this.onTouchUpListener = addEventListenerWrap(this.document, "touchend", this.onEnd); }, addDocumentMouseEvents() { this.onMouseMoveListener = addEventListenerWrap(this.document, "mousemove", this.onMouseMove); this.onMouseUpListener = addEventListenerWrap(this.document, "mouseup", this.onEnd); }, removeDocumentEvents() { this.onTouchMoveListener && this.onTouchMoveListener.remove(); this.onTouchUpListener && this.onTouchUpListener.remove(); this.onMouseMoveListener && this.onMouseMoveListener.remove(); this.onMouseUpListener && this.onMouseUpListener.remove(); }, focus() { var _a; if (this.$props.disabled) { return; } (_a = this.handlesRefs[0]) === null || _a === void 0 ? void 0 : _a.focus(); }, blur() { if (this.$props.disabled) { return; } Object.keys(this.handlesRefs).forEach((key2) => { var _a, _b; (_b = (_a = this.handlesRefs[key2]) === null || _a === void 0 ? void 0 : _a.blur) === null || _b === void 0 ? void 0 : _b.call(_a); }); }, calcValue(offset2) { const { vertical, min, max } = this; const ratio = Math.abs(Math.max(offset2, 0) / this.getSliderLength()); const value = vertical ? (1 - ratio) * (max - min) + min : ratio * (max - min) + min; return value; }, calcValueByPos(position2) { const sign = this.reverse ? -1 : 1; const pixelOffset = sign * (position2 - this.getSliderStart()); const nextValue = this.trimAlignValue(this.calcValue(pixelOffset)); return nextValue; }, calcOffset(value) { const { min, max } = this; const ratio = (value - min) / (max - min); return Math.max(0, ratio * 100); }, saveSlider(slider) { this.sliderRef = slider; }, saveHandle(index2, handle) { this.handlesRefs[index2] = handle; } }, render() { const { prefixCls, marks, dots, step, included, disabled, vertical, reverse, min, max, maximumTrackStyle, railStyle, dotStyle, activeDotStyle, id } = this; const { class: className, style } = this.$attrs; const { tracks, handles } = this.renderSlider(); const sliderClassName = classNames(prefixCls, className, { [`${prefixCls}-with-marks`]: Object.keys(marks).length, [`${prefixCls}-disabled`]: disabled, [`${prefixCls}-vertical`]: vertical, [`${prefixCls}-horizontal`]: !vertical }); const markProps = { vertical, marks, included, lowerBound: this.getLowerBound(), upperBound: this.getUpperBound(), max, min, reverse, class: `${prefixCls}-mark`, onClickLabel: disabled ? noop : this.onClickMarkLabel }; const touchEvents = { [supportsPassive ? "onTouchstartPassive" : "onTouchstart"]: disabled ? noop : this.onTouchStart }; return createVNode("div", _objectSpread2$1(_objectSpread2$1({ "id": id, "ref": this.saveSlider, "tabindex": "-1", "class": sliderClassName }, touchEvents), {}, { "onMousedown": disabled ? noop : this.onMouseDown, "onMouseup": disabled ? noop : this.onMouseUp, "onKeydown": disabled ? noop : this.onKeyDown, "onFocus": disabled ? noop : this.onFocus, "onBlur": disabled ? noop : this.onBlur, "style": style }), [createVNode("div", { "class": `${prefixCls}-rail`, "style": _extends$1(_extends$1({}, maximumTrackStyle), railStyle) }, null), tracks, createVNode(Steps, { "prefixCls": prefixCls, "vertical": vertical, "reverse": reverse, "marks": marks, "dots": dots, "step": step, "included": included, "lowerBound": this.getLowerBound(), "upperBound": this.getUpperBound(), "max": max, "min": min, "dotStyle": dotStyle, "activeDotStyle": activeDotStyle }, null), handles, createVNode(Marks, markProps, { mark: this.$slots.mark }), getSlot(this)]); } }); } const Slider$2 = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Slider", mixins: [BaseMixin], inheritAttrs: false, props: { defaultValue: Number, value: Number, disabled: { type: Boolean, default: void 0 }, autofocus: { type: Boolean, default: void 0 }, tabindex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), reverse: { type: Boolean, default: void 0 }, min: Number, max: Number, ariaLabelForHandle: String, ariaLabelledByForHandle: String, ariaValueTextFormatterForHandle: String, startPoint: Number }, emits: ["beforeChange", "afterChange", "change"], data() { const defaultValue = this.defaultValue !== void 0 ? this.defaultValue : this.min; const value = this.value !== void 0 ? this.value : defaultValue; return { sValue: this.trimAlignValue(value), dragging: false }; }, watch: { value: { handler(val) { this.setChangeValue(val); }, deep: true }, min() { const { sValue } = this; this.setChangeValue(sValue); }, max() { const { sValue } = this; this.setChangeValue(sValue); } }, methods: { setChangeValue(value) { const newValue = value !== void 0 ? value : this.sValue; const nextValue = this.trimAlignValue(newValue, this.$props); if (nextValue === this.sValue) return; this.setState({ sValue: nextValue }); if (isValueOutOfRange(newValue, this.$props)) { this.$emit("change", nextValue); } }, onChange(state) { const isNotControlled = !hasProp(this, "value"); const nextState = state.sValue > this.max ? _extends$1(_extends$1({}, state), { sValue: this.max }) : state; if (isNotControlled) { this.setState(nextState); } const changedValue = nextState.sValue; this.$emit("change", changedValue); }, onStart(position2) { this.setState({ dragging: true }); const { sValue } = this; this.$emit("beforeChange", sValue); const value = this.calcValueByPos(position2); this.startValue = value; this.startPosition = position2; if (value === sValue) return; this.prevMovedHandleIndex = 0; this.onChange({ sValue: value }); }, onEnd(force) { const { dragging } = this; this.removeDocumentEvents(); if (dragging || force) { this.$emit("afterChange", this.sValue); } this.setState({ dragging: false }); }, onMove(e2, position2) { pauseEvent(e2); const { sValue } = this; const value = this.calcValueByPos(position2); if (value === sValue) return; this.onChange({ sValue: value }); }, onKeyboard(e2) { const { reverse, vertical } = this.$props; const valueMutator = getKeyboardValueMutator(e2, vertical, reverse); if (valueMutator) { pauseEvent(e2); const { sValue } = this; const mutatedValue = valueMutator(sValue, this.$props); const value = this.trimAlignValue(mutatedValue); if (value === sValue) return; this.onChange({ sValue: value }); this.$emit("afterChange", value); this.onEnd(); } }, getLowerBound() { const minPoint = this.$props.startPoint || this.$props.min; return this.$data.sValue > minPoint ? minPoint : this.$data.sValue; }, getUpperBound() { if (this.$data.sValue < this.$props.startPoint) { return this.$props.startPoint; } return this.$data.sValue; }, trimAlignValue(v2) { let nextProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (v2 === null) { return null; } const mergedProps = _extends$1(_extends$1({}, this.$props), nextProps); const val = ensureValueInRange(v2, mergedProps); return ensureValuePrecision(val, mergedProps); }, getTrack(_ref) { let { prefixCls, reverse, vertical, included, minimumTrackStyle, mergedTrackStyle, length: length2, offset: offset2 } = _ref; return createVNode(Track, { "class": `${prefixCls}-track`, "vertical": vertical, "included": included, "offset": offset2, "reverse": reverse, "length": length2, "style": _extends$1(_extends$1({}, minimumTrackStyle), mergedTrackStyle) }, null); }, renderSlider() { const { prefixCls, vertical, included, disabled, minimumTrackStyle, trackStyle, handleStyle, tabindex, ariaLabelForHandle, ariaLabelledByForHandle, ariaValueTextFormatterForHandle, min, max, startPoint, reverse, handle, defaultHandle } = this; const handleGenerator = handle || defaultHandle; const { sValue, dragging } = this; const offset2 = this.calcOffset(sValue); const handles = handleGenerator({ class: `${prefixCls}-handle`, prefixCls, vertical, offset: offset2, value: sValue, dragging, disabled, min, max, reverse, index: 0, tabindex, ariaLabel: ariaLabelForHandle, ariaLabelledBy: ariaLabelledByForHandle, ariaValueTextFormatter: ariaValueTextFormatterForHandle, style: handleStyle[0] || handleStyle, ref: (h2) => this.saveHandle(0, h2), onFocus: this.onFocus, onBlur: this.onBlur }); const trackOffset = startPoint !== void 0 ? this.calcOffset(startPoint) : 0; const mergedTrackStyle = trackStyle[0] || trackStyle; return { tracks: this.getTrack({ prefixCls, reverse, vertical, included, offset: trackOffset, minimumTrackStyle, mergedTrackStyle, length: offset2 - trackOffset }), handles }; } } }); const VcSlider = createSlider(Slider$2); const trimAlignValue = (_ref) => { let { value, handle, bounds, props: props2 } = _ref; const { allowCross, pushable } = props2; const thershold = Number(pushable); const valInRange = ensureValueInRange(value, props2); let valNotConflict = valInRange; if (!allowCross && handle != null && bounds !== void 0) { if (handle > 0 && valInRange <= bounds[handle - 1] + thershold) { valNotConflict = bounds[handle - 1] + thershold; } if (handle < bounds.length - 1 && valInRange >= bounds[handle + 1] - thershold) { valNotConflict = bounds[handle + 1] - thershold; } } return ensureValuePrecision(valNotConflict, props2); }; const rangeProps = { defaultValue: PropTypes.arrayOf(PropTypes.number), value: PropTypes.arrayOf(PropTypes.number), count: Number, pushable: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.number])), allowCross: { type: Boolean, default: void 0 }, disabled: { type: Boolean, default: void 0 }, reverse: { type: Boolean, default: void 0 }, tabindex: PropTypes.arrayOf(PropTypes.number), prefixCls: String, min: Number, max: Number, autofocus: { type: Boolean, default: void 0 }, ariaLabelGroupForHandles: Array, ariaLabelledByGroupForHandles: Array, ariaValueTextFormatterGroupForHandles: Array, draggableTrack: { type: Boolean, default: void 0 } }; const Range = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "Range", mixins: [BaseMixin], inheritAttrs: false, props: initDefaultProps(rangeProps, { count: 1, allowCross: true, pushable: false, tabindex: [], draggableTrack: false, ariaLabelGroupForHandles: [], ariaLabelledByGroupForHandles: [], ariaValueTextFormatterGroupForHandles: [] }), emits: ["beforeChange", "afterChange", "change"], displayName: "Range", data() { const { count, min, max } = this; const initialValue = Array(...Array(count + 1)).map(() => min); const defaultValue = hasProp(this, "defaultValue") ? this.defaultValue : initialValue; let { value } = this; if (value === void 0) { value = defaultValue; } const bounds = value.map((v2, i2) => trimAlignValue({ value: v2, handle: i2, props: this.$props })); const recent = bounds[0] === max ? 0 : bounds.length - 1; return { sHandle: null, recent, bounds }; }, watch: { value: { handler(val) { const { bounds } = this; this.setChangeValue(val || bounds); }, deep: true }, min() { const { value } = this; this.setChangeValue(value || this.bounds); }, max() { const { value } = this; this.setChangeValue(value || this.bounds); } }, methods: { setChangeValue(value) { const { bounds } = this; let nextBounds = value.map((v2, i2) => trimAlignValue({ value: v2, handle: i2, bounds, props: this.$props })); if (bounds.length === nextBounds.length) { if (nextBounds.every((v2, i2) => v2 === bounds[i2])) { return null; } } else { nextBounds = value.map((v2, i2) => trimAlignValue({ value: v2, handle: i2, props: this.$props })); } this.setState({ bounds: nextBounds }); if (value.some((v2) => isValueOutOfRange(v2, this.$props))) { const newValues = value.map((v2) => { return ensureValueInRange(v2, this.$props); }); this.$emit("change", newValues); } }, onChange(state) { const isNotControlled = !hasProp(this, "value"); if (isNotControlled) { this.setState(state); } else { const controlledState = {}; ["sHandle", "recent"].forEach((item) => { if (state[item] !== void 0) { controlledState[item] = state[item]; } }); if (Object.keys(controlledState).length) { this.setState(controlledState); } } const data = _extends$1(_extends$1({}, this.$data), state); const changedValue = data.bounds; this.$emit("change", changedValue); }, positionGetValue(position2) { const bounds = this.getValue(); const value = this.calcValueByPos(position2); const closestBound = this.getClosestBound(value); const index2 = this.getBoundNeedMoving(value, closestBound); const prevValue = bounds[index2]; if (value === prevValue) return null; const nextBounds = [...bounds]; nextBounds[index2] = value; return nextBounds; }, onStart(position2) { const { bounds } = this; this.$emit("beforeChange", bounds); const value = this.calcValueByPos(position2); this.startValue = value; this.startPosition = position2; const closestBound = this.getClosestBound(value); this.prevMovedHandleIndex = this.getBoundNeedMoving(value, closestBound); this.setState({ sHandle: this.prevMovedHandleIndex, recent: this.prevMovedHandleIndex }); const prevValue = bounds[this.prevMovedHandleIndex]; if (value === prevValue) return; const nextBounds = [...bounds]; nextBounds[this.prevMovedHandleIndex] = value; this.onChange({ bounds: nextBounds }); }, onEnd(force) { const { sHandle } = this; this.removeDocumentEvents(); if (!sHandle) { this.dragTrack = false; } if (sHandle !== null || force) { this.$emit("afterChange", this.bounds); } this.setState({ sHandle: null }); }, onMove(e2, position2, dragTrack, startBounds) { pauseEvent(e2); const { $data: state, $props: props2 } = this; const maxValue = props2.max || 100; const minValue = props2.min || 0; if (dragTrack) { let pos = props2.vertical ? -position2 : position2; pos = props2.reverse ? -pos : pos; const max = maxValue - Math.max(...startBounds); const min = minValue - Math.min(...startBounds); const ratio = Math.min(Math.max(pos / (this.getSliderLength() / 100), min), max); const nextBounds = startBounds.map((v2) => Math.floor(Math.max(Math.min(v2 + ratio, maxValue), minValue))); if (state.bounds.map((c2, i2) => c2 === nextBounds[i2]).some((c2) => !c2)) { this.onChange({ bounds: nextBounds }); } return; } const { bounds, sHandle } = this; const value = this.calcValueByPos(position2); const oldValue = bounds[sHandle]; if (value === oldValue) return; this.moveTo(value); }, onKeyboard(e2) { const { reverse, vertical } = this.$props; const valueMutator = getKeyboardValueMutator(e2, vertical, reverse); if (valueMutator) { pauseEvent(e2); const { bounds, sHandle } = this; const oldValue = bounds[sHandle === null ? this.recent : sHandle]; const mutatedValue = valueMutator(oldValue, this.$props); const value = trimAlignValue({ value: mutatedValue, handle: sHandle, bounds, props: this.$props }); if (value === oldValue) return; const isFromKeyboardEvent = true; this.moveTo(value, isFromKeyboardEvent); } }, getClosestBound(value) { const { bounds } = this; let closestBound = 0; for (let i2 = 1; i2 < bounds.length - 1; i2 += 1) { if (value >= bounds[i2]) { closestBound = i2; } } if (Math.abs(bounds[closestBound + 1] - value) < Math.abs(bounds[closestBound] - value)) { closestBound += 1; } return closestBound; }, getBoundNeedMoving(value, closestBound) { const { bounds, recent } = this; let boundNeedMoving = closestBound; const isAtTheSamePoint = bounds[closestBound + 1] === bounds[closestBound]; if (isAtTheSamePoint && bounds[recent] === bounds[closestBound]) { boundNeedMoving = recent; } if (isAtTheSamePoint && value !== bounds[closestBound + 1]) { boundNeedMoving = value < bounds[closestBound + 1] ? closestBound : closestBound + 1; } return boundNeedMoving; }, getLowerBound() { return this.bounds[0]; }, getUpperBound() { const { bounds } = this; return bounds[bounds.length - 1]; }, /** * Returns an array of possible slider points, taking into account both * `marks` and `step`. The result is cached. */ getPoints() { const { marks, step, min, max } = this; const cache = this.internalPointsCache; if (!cache || cache.marks !== marks || cache.step !== step) { const pointsObject = _extends$1({}, marks); if (step !== null) { for (let point = min; point <= max; point += step) { pointsObject[point] = point; } } const points = Object.keys(pointsObject).map(parseFloat); points.sort((a2, b2) => a2 - b2); this.internalPointsCache = { marks, step, points }; } return this.internalPointsCache.points; }, moveTo(value, isFromKeyboardEvent) { const nextBounds = [...this.bounds]; const { sHandle, recent } = this; const handle = sHandle === null ? recent : sHandle; nextBounds[handle] = value; let nextHandle = handle; if (this.$props.pushable !== false) { this.pushSurroundingHandles(nextBounds, nextHandle); } else if (this.$props.allowCross) { nextBounds.sort((a2, b2) => a2 - b2); nextHandle = nextBounds.indexOf(value); } this.onChange({ recent: nextHandle, sHandle: nextHandle, bounds: nextBounds }); if (isFromKeyboardEvent) { this.$emit("afterChange", nextBounds); this.setState({}, () => { this.handlesRefs[nextHandle].focus(); }); this.onEnd(); } }, pushSurroundingHandles(bounds, handle) { const value = bounds[handle]; const { pushable } = this; const threshold = Number(pushable); let direction = 0; if (bounds[handle + 1] - value < threshold) { direction = 1; } if (value - bounds[handle - 1] < threshold) { direction = -1; } if (direction === 0) { return; } const nextHandle = handle + direction; const diffToNext = direction * (bounds[nextHandle] - value); if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) { bounds[handle] = bounds[nextHandle] - direction * threshold; } }, pushHandle(bounds, handle, direction, amount) { const originalValue = bounds[handle]; let currentValue = bounds[handle]; while (direction * (currentValue - originalValue) < amount) { if (!this.pushHandleOnePoint(bounds, handle, direction)) { bounds[handle] = originalValue; return false; } currentValue = bounds[handle]; } return true; }, pushHandleOnePoint(bounds, handle, direction) { const points = this.getPoints(); const pointIndex = points.indexOf(bounds[handle]); const nextPointIndex = pointIndex + direction; if (nextPointIndex >= points.length || nextPointIndex < 0) { return false; } const nextHandle = handle + direction; const nextValue = points[nextPointIndex]; const { pushable } = this; const threshold = Number(pushable); const diffToNext = direction * (bounds[nextHandle] - nextValue); if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) { return false; } bounds[handle] = nextValue; return true; }, trimAlignValue(value) { const { sHandle, bounds } = this; return trimAlignValue({ value, handle: sHandle, bounds, props: this.$props }); }, ensureValueNotConflict(handle, val, _ref2) { let { allowCross, pushable: thershold } = _ref2; const state = this.$data || {}; const { bounds } = state; handle = handle === void 0 ? state.sHandle : handle; thershold = Number(thershold); if (!allowCross && handle != null && bounds !== void 0) { if (handle > 0 && val <= bounds[handle - 1] + thershold) { return bounds[handle - 1] + thershold; } if (handle < bounds.length - 1 && val >= bounds[handle + 1] - thershold) { return bounds[handle + 1] - thershold; } } return val; }, getTrack(_ref3) { let { bounds, prefixCls, reverse, vertical, included, offsets, trackStyle } = _ref3; return bounds.slice(0, -1).map((_2, index2) => { const i2 = index2 + 1; const trackClassName = classNames({ [`${prefixCls}-track`]: true, [`${prefixCls}-track-${i2}`]: true }); return createVNode(Track, { "class": trackClassName, "vertical": vertical, "reverse": reverse, "included": included, "offset": offsets[i2 - 1], "length": offsets[i2] - offsets[i2 - 1], "style": trackStyle[index2], "key": i2 }, null); }); }, renderSlider() { const { sHandle, bounds, prefixCls, vertical, included, disabled, min, max, reverse, handle, defaultHandle, trackStyle, handleStyle, tabindex, ariaLabelGroupForHandles, ariaLabelledByGroupForHandles, ariaValueTextFormatterGroupForHandles } = this; const handleGenerator = handle || defaultHandle; const offsets = bounds.map((v2) => this.calcOffset(v2)); const handleClassName = `${prefixCls}-handle`; const handles = bounds.map((v2, i2) => { let mergedTabIndex = tabindex[i2] || 0; if (disabled || tabindex[i2] === null) { mergedTabIndex = null; } const dragging = sHandle === i2; return handleGenerator({ class: classNames({ [handleClassName]: true, [`${handleClassName}-${i2 + 1}`]: true, [`${handleClassName}-dragging`]: dragging }), prefixCls, vertical, dragging, offset: offsets[i2], value: v2, index: i2, tabindex: mergedTabIndex, min, max, reverse, disabled, style: handleStyle[i2], ref: (h2) => this.saveHandle(i2, h2), onFocus: this.onFocus, onBlur: this.onBlur, ariaLabel: ariaLabelGroupForHandles[i2], ariaLabelledBy: ariaLabelledByGroupForHandles[i2], ariaValueTextFormatter: ariaValueTextFormatterGroupForHandles[i2] }); }); return { tracks: this.getTrack({ bounds, prefixCls, reverse, vertical, included, offsets, trackStyle }), handles }; } } }); const VcRange = createSlider(Range); const SliderTooltip = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "SliderTooltip", inheritAttrs: false, props: tooltipProps(), setup(props2, _ref) { let { attrs, slots } = _ref; const innerRef = ref(null); const rafRef = ref(null); function cancelKeepAlign() { wrapperRaf.cancel(rafRef.value); rafRef.value = null; } function keepAlign() { rafRef.value = wrapperRaf(() => { var _a; (_a = innerRef.value) === null || _a === void 0 ? void 0 : _a.forcePopupAlign(); rafRef.value = null; }); } const align = () => { cancelKeepAlign(); if (props2.open) { keepAlign(); } }; watch([() => props2.open, () => props2.title], () => { align(); }, { flush: "post", immediate: true }); onActivated(() => { align(); }); onBeforeUnmount(() => { cancelKeepAlign(); }); return () => { return createVNode(Tooltip, _objectSpread2$1(_objectSpread2$1({ "ref": innerRef }, props2), attrs), slots); }; } }); const genBaseStyle = (token2) => { const { componentCls, controlSize, dotSize, marginFull, marginPart, colorFillContentHover } = token2; return { [componentCls]: _extends$1(_extends$1({}, resetComponent(token2)), { position: "relative", height: controlSize, margin: `${marginPart}px ${marginFull}px`, padding: 0, cursor: "pointer", touchAction: "none", [`&-vertical`]: { margin: `${marginFull}px ${marginPart}px` }, [`${componentCls}-rail`]: { position: "absolute", backgroundColor: token2.colorFillTertiary, borderRadius: token2.borderRadiusXS, transition: `background-color ${token2.motionDurationMid}` }, [`${componentCls}-track`]: { position: "absolute", backgroundColor: token2.colorPrimaryBorder, borderRadius: token2.borderRadiusXS, transition: `background-color ${token2.motionDurationMid}` }, "&:hover": { [`${componentCls}-rail`]: { backgroundColor: token2.colorFillSecondary }, [`${componentCls}-track`]: { backgroundColor: token2.colorPrimaryBorderHover }, [`${componentCls}-dot`]: { borderColor: colorFillContentHover }, [`${componentCls}-handle::after`]: { boxShadow: `0 0 0 ${token2.handleLineWidth}px ${token2.colorPrimaryBorderHover}` }, [`${componentCls}-dot-active`]: { borderColor: token2.colorPrimary } }, [`${componentCls}-handle`]: { position: "absolute", width: token2.handleSize, height: token2.handleSize, outline: "none", [`${componentCls}-dragging`]: { zIndex: 1 }, // 扩大选区 "&::before": { content: '""', position: "absolute", insetInlineStart: -token2.handleLineWidth, insetBlockStart: -token2.handleLineWidth, width: token2.handleSize + token2.handleLineWidth * 2, height: token2.handleSize + token2.handleLineWidth * 2, backgroundColor: "transparent" }, "&::after": { content: '""', position: "absolute", insetBlockStart: 0, insetInlineStart: 0, width: token2.handleSize, height: token2.handleSize, backgroundColor: token2.colorBgElevated, boxShadow: `0 0 0 ${token2.handleLineWidth}px ${token2.colorPrimaryBorder}`, borderRadius: "50%", cursor: "pointer", transition: ` inset-inline-start ${token2.motionDurationMid}, inset-block-start ${token2.motionDurationMid}, width ${token2.motionDurationMid}, height ${token2.motionDurationMid}, box-shadow ${token2.motionDurationMid} ` }, "&:hover, &:active, &:focus": { "&::before": { insetInlineStart: -((token2.handleSizeHover - token2.handleSize) / 2 + token2.handleLineWidthHover), insetBlockStart: -((token2.handleSizeHover - token2.handleSize) / 2 + token2.handleLineWidthHover), width: token2.handleSizeHover + token2.handleLineWidthHover * 2, height: token2.handleSizeHover + token2.handleLineWidthHover * 2 }, "&::after": { boxShadow: `0 0 0 ${token2.handleLineWidthHover}px ${token2.colorPrimary}`, width: token2.handleSizeHover, height: token2.handleSizeHover, insetInlineStart: (token2.handleSize - token2.handleSizeHover) / 2, insetBlockStart: (token2.handleSize - token2.handleSizeHover) / 2 } } }, [`${componentCls}-mark`]: { position: "absolute", fontSize: token2.fontSize }, [`${componentCls}-mark-text`]: { position: "absolute", display: "inline-block", color: token2.colorTextDescription, textAlign: "center", wordBreak: "keep-all", cursor: "pointer", userSelect: "none", "&-active": { color: token2.colorText } }, [`${componentCls}-step`]: { position: "absolute", background: "transparent", pointerEvents: "none" }, [`${componentCls}-dot`]: { position: "absolute", width: dotSize, height: dotSize, backgroundColor: token2.colorBgElevated, border: `${token2.handleLineWidth}px solid ${token2.colorBorderSecondary}`, borderRadius: "50%", cursor: "pointer", transition: `border-color ${token2.motionDurationSlow}`, "&-active": { borderColor: token2.colorPrimaryBorder } }, [`&${componentCls}-disabled`]: { cursor: "not-allowed", [`${componentCls}-rail`]: { backgroundColor: `${token2.colorFillSecondary} !important` }, [`${componentCls}-track`]: { backgroundColor: `${token2.colorTextDisabled} !important` }, [` ${componentCls}-dot `]: { backgroundColor: token2.colorBgElevated, borderColor: token2.colorTextDisabled, boxShadow: "none", cursor: "not-allowed" }, [`${componentCls}-handle::after`]: { backgroundColor: token2.colorBgElevated, cursor: "not-allowed", width: token2.handleSize, height: token2.handleSize, boxShadow: `0 0 0 ${token2.handleLineWidth}px ${new TinyColor(token2.colorTextDisabled).onBackground(token2.colorBgContainer).toHexString()}`, insetInlineStart: 0, insetBlockStart: 0 }, [` ${componentCls}-mark-text, ${componentCls}-dot `]: { cursor: `not-allowed !important` } } }) }; }; const genDirectionStyle = (token2, horizontal) => { const { componentCls, railSize, handleSize, dotSize } = token2; const railPadding = horizontal ? "paddingBlock" : "paddingInline"; const full = horizontal ? "width" : "height"; const part = horizontal ? "height" : "width"; const handlePos = horizontal ? "insetBlockStart" : "insetInlineStart"; const markInset = horizontal ? "top" : "insetInlineStart"; return { [railPadding]: railSize, [part]: railSize * 3, [`${componentCls}-rail`]: { [full]: "100%", [part]: railSize }, [`${componentCls}-track`]: { [part]: railSize }, [`${componentCls}-handle`]: { [handlePos]: (railSize * 3 - handleSize) / 2 }, [`${componentCls}-mark`]: { // Reset all insetInlineStart: 0, top: 0, [markInset]: handleSize, [full]: "100%" }, [`${componentCls}-step`]: { // Reset all insetInlineStart: 0, top: 0, [markInset]: railSize, [full]: "100%", [part]: railSize }, [`${componentCls}-dot`]: { position: "absolute", [handlePos]: (railSize - dotSize) / 2 } }; }; const genHorizontalStyle = (token2) => { const { componentCls, marginPartWithMark } = token2; return { [`${componentCls}-horizontal`]: _extends$1(_extends$1({}, genDirectionStyle(token2, true)), { [`&${componentCls}-with-marks`]: { marginBottom: marginPartWithMark } }) }; }; const genVerticalStyle = (token2) => { const { componentCls } = token2; return { [`${componentCls}-vertical`]: _extends$1(_extends$1({}, genDirectionStyle(token2, false)), { height: "100%" }) }; }; const useStyle = genComponentStyleHook("Slider", (token2) => { const sliderToken = merge(token2, { marginPart: (token2.controlHeight - token2.controlSize) / 2, marginFull: token2.controlSize / 2, marginPartWithMark: token2.controlHeightLG - token2.controlSize }); return [genBaseStyle(sliderToken), genHorizontalStyle(sliderToken), genVerticalStyle(sliderToken)]; }, (token2) => { const increaseHandleWidth = 1; const controlSize = token2.controlHeightLG / 4; const controlSizeHover = token2.controlHeightSM / 2; const handleLineWidth = token2.lineWidth + increaseHandleWidth; const handleLineWidthHover = token2.lineWidth + increaseHandleWidth * 3; return { controlSize, railSize: 4, handleSize: controlSize, handleSizeHover: controlSizeHover, dotSize: 8, handleLineWidth, handleLineWidthHover }; }); var __rest = function(s2, e2) { var t2 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t2[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) t2[p2[i2]] = s2[p2[i2]]; } return t2; }; const defaultTipFormatter = (value) => typeof value === "number" ? value.toString() : ""; const sliderProps = () => ({ id: String, prefixCls: String, tooltipPrefixCls: String, range: someType([Boolean, Object]), reverse: booleanType(), min: Number, max: Number, step: someType([Object, Number]), marks: objectType(), dots: booleanType(), value: someType([Array, Number]), defaultValue: someType([Array, Number]), included: booleanType(), disabled: booleanType(), vertical: booleanType(), tipFormatter: someType([Function, Object], () => defaultTipFormatter), tooltipOpen: booleanType(), /** @deprecated `tooltipVisible` is deprecated. Please use `tooltipOpen` instead. */ tooltipVisible: booleanType(), tooltipPlacement: stringType(), getTooltipPopupContainer: functionType(), autofocus: booleanType(), handleStyle: someType([Array, Object]), trackStyle: someType([Array, Object]), onChange: functionType(), onAfterChange: functionType(), onFocus: functionType(), onBlur: functionType(), "onUpdate:value": functionType() }); const Slider = /* @__PURE__ */ defineComponent({ compatConfig: { MODE: 3 }, name: "ASlider", inheritAttrs: false, props: sliderProps(), // emits: ['update:value', 'change', 'afterChange', 'blur'], slots: Object, setup(props2, _ref) { let { attrs, slots, emit: emit2, expose } = _ref; const { prefixCls, rootPrefixCls, direction, getPopupContainer, configProvider } = useConfigInject("slider", props2); const [wrapSSR, hashId] = useStyle(prefixCls); const formItemContext = useInjectFormItemContext(); const sliderRef = ref(); const visibles = ref({}); const toggleTooltipOpen = (index2, visible) => { visibles.value[index2] = visible; }; const tooltipPlacement = computed(() => { if (props2.tooltipPlacement) { return props2.tooltipPlacement; } if (!props2.vertical) { return "top"; } return direction.value === "rtl" ? "left" : "right"; }); const focus = () => { var _a; (_a = sliderRef.value) === null || _a === void 0 ? void 0 : _a.focus(); }; const blur = () => { var _a; (_a = sliderRef.value) === null || _a === void 0 ? void 0 : _a.blur(); }; const handleChange = (val) => { emit2("update:value", val); emit2("change", val); formItemContext.onFieldChange(); }; const handleBlur = (e2) => { emit2("blur", e2); }; expose({ focus, blur }); const handleWithTooltip = (_a) => { var { tooltipPrefixCls } = _a, _b = _a.info, { value, dragging, index: index2 } = _b, restProps = __rest(_b, ["value", "dragging", "index"]); const { tipFormatter, tooltipOpen = props2.tooltipVisible, getTooltipPopupContainer } = props2; const isTipFormatter = tipFormatter ? visibles.value[index2] || dragging : false; const open2 = tooltipOpen || tooltipOpen === void 0 && isTipFormatter; return createVNode(SliderTooltip, { "prefixCls": tooltipPrefixCls, "title": tipFormatter ? tipFormatter(value) : "", "open": open2, "placement": tooltipPlacement.value, "transitionName": `${rootPrefixCls.value}-zoom-down`, "key": index2, "overlayClassName": `${prefixCls.value}-tooltip`, "getPopupContainer": getTooltipPopupContainer || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value) }, { default: () => [createVNode(VcHandle, _objectSpread2$1(_objectSpread2$1({}, restProps), {}, { "value": value, "onMouseenter": () => toggleTooltipOpen(index2, true), "onMouseleave": () => toggleTooltipOpen(index2, false) }), null)] }); }; return () => { const { tooltipPrefixCls: customizeTooltipPrefixCls, range: range2, id = formItemContext.id.value } = props2, restProps = __rest(props2, ["tooltipPrefixCls", "range", "id"]); const tooltipPrefixCls = configProvider.getPrefixCls("tooltip", customizeTooltipPrefixCls); const cls = classNames(attrs.class, { [`${prefixCls.value}-rtl`]: direction.value === "rtl" }, hashId.value); if (direction.value === "rtl" && !restProps.vertical) { restProps.reverse = !restProps.reverse; } let draggableTrack; if (typeof range2 === "object") { draggableTrack = range2.draggableTrack; } if (range2) { return wrapSSR(createVNode(VcRange, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, attrs), restProps), {}, { "step": restProps.step, "draggableTrack": draggableTrack, "class": cls, "ref": sliderRef, "handle": (info) => handleWithTooltip({ tooltipPrefixCls, prefixCls: prefixCls.value, info }), "prefixCls": prefixCls.value, "onChange": handleChange, "onBlur": handleBlur }), { mark: slots.mark })); } return wrapSSR(createVNode(VcSlider, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, attrs), restProps), {}, { "id": id, "step": restProps.step, "class": cls, "ref": sliderRef, "handle": (info) => handleWithTooltip({ tooltipPrefixCls, prefixCls: prefixCls.value, info }), "prefixCls": prefixCls.value, "onChange": handleChange, "onBlur": handleBlur }), { mark: slots.mark })); }; } }); const Slider$1 = withInstall(Slider); var EditOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" }; function _objectSpread$6(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$6(target, key2, source[key2]); }); } return target; } function _defineProperty$6(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var EditOutlined = function EditOutlined2(props2, context2) { var p2 = _objectSpread$6({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$6({}, p2, { "icon": EditOutlined$1 }), null); }; EditOutlined.displayName = "EditOutlined"; EditOutlined.inheritAttrs = false; var DownloadOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "download", "theme": "outlined" }; function _objectSpread$5(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$5(target, key2, source[key2]); }); } return target; } function _defineProperty$5(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var DownloadOutlined = function DownloadOutlined2(props2, context2) { var p2 = _objectSpread$5({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$5({}, p2, { "icon": DownloadOutlined$1 }), null); }; DownloadOutlined.displayName = "DownloadOutlined"; DownloadOutlined.inheritAttrs = false; var BgColorsOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z" } }] }, "name": "bg-colors", "theme": "outlined" }; function _objectSpread$4(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$4(target, key2, source[key2]); }); } return target; } function _defineProperty$4(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var BgColorsOutlined = function BgColorsOutlined2(props2, context2) { var p2 = _objectSpread$4({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$4({}, p2, { "icon": BgColorsOutlined$1 }), null); }; BgColorsOutlined.displayName = "BgColorsOutlined"; BgColorsOutlined.inheritAttrs = false; var FontColorsOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8zm-650.3-80h85c4.2 0 8-2.7 9.3-6.8l53.7-166h219.2l53.2 166c1.3 4 5 6.8 9.3 6.8h89.1c1.1 0 2.2-.2 3.2-.5a9.7 9.7 0 006-12.4L573.6 118.6a9.9 9.9 0 00-9.2-6.6H462.1c-4.2 0-7.9 2.6-9.2 6.6L244.5 723.1c-.4 1-.5 2.1-.5 3.2-.1 5.3 4.3 9.7 9.7 9.7zm255.9-516.1h4.1l83.8 263.8H424.9l84.7-263.8z" } }] }, "name": "font-colors", "theme": "outlined" }; function _objectSpread$3(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$3(target, key2, source[key2]); }); } return target; } function _defineProperty$3(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var FontColorsOutlined = function FontColorsOutlined2(props2, context2) { var p2 = _objectSpread$3({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$3({}, p2, { "icon": FontColorsOutlined$1 }), null); }; FontColorsOutlined.displayName = "FontColorsOutlined"; FontColorsOutlined.inheritAttrs = false; var LineHeightOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M648 160H104c-4.4 0-8 3.6-8 8v128c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-64h168v560h-92c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-92V232h168v64c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V168c0-4.4-3.6-8-8-8zm272.8 546H856V318h64.8c6 0 9.4-7 5.7-11.7L825.7 178.7a7.14 7.14 0 00-11.3 0L713.6 306.3a7.23 7.23 0 005.7 11.7H784v388h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5a7.2 7.2 0 00-5.6-11.7z" } }] }, "name": "line-height", "theme": "outlined" }; function _objectSpread$2(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$2(target, key2, source[key2]); }); } return target; } function _defineProperty$2(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var LineHeightOutlined = function LineHeightOutlined2(props2, context2) { var p2 = _objectSpread$2({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$2({}, p2, { "icon": LineHeightOutlined$1 }), null); }; LineHeightOutlined.displayName = "LineHeightOutlined"; LineHeightOutlined.inheritAttrs = false; var LoginOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M521.7 82c-152.5-.4-286.7 78.5-363.4 197.7-3.4 5.3.4 12.3 6.7 12.3h70.3c4.8 0 9.3-2.1 12.3-5.8 7-8.5 14.5-16.7 22.4-24.5 32.6-32.5 70.5-58.1 112.7-75.9 43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 32.6 32.5 58.1 70.4 76 112.5C865.7 417.8 875 464.1 875 512c0 47.9-9.4 94.2-27.8 137.8-17.8 42.1-43.4 80-76 112.5s-70.5 58.1-112.7 75.9A352.8 352.8 0 01520.6 866c-47.9 0-94.3-9.4-137.9-27.8A353.84 353.84 0 01270 762.3c-7.9-7.9-15.3-16.1-22.4-24.5-3-3.7-7.6-5.8-12.3-5.8H165c-6.3 0-10.2 7-6.7 12.3C234.9 863.2 368.5 942 520.6 942c236.2 0 428-190.1 430.4-425.6C953.4 277.1 761.3 82.6 521.7 82zM395.02 624v-76h-314c-4.4 0-8-3.6-8-8v-56c0-4.4 3.6-8 8-8h314v-76c0-6.7 7.8-10.5 13-6.3l141.9 112a8 8 0 010 12.6l-141.9 112c-5.2 4.1-13 .4-13-6.3z" } }] }, "name": "login", "theme": "outlined" }; function _objectSpread$1(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty$1(target, key2, source[key2]); }); } return target; } function _defineProperty$1(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var LoginOutlined = function LoginOutlined2(props2, context2) { var p2 = _objectSpread$1({}, props2, context2.attrs); return createVNode(Icon, _objectSpread$1({}, p2, { "icon": LoginOutlined$1 }), null); }; LoginOutlined.displayName = "LoginOutlined"; LoginOutlined.inheritAttrs = false; var QuestionCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 00-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z" } }] }, "name": "question-circle", "theme": "filled" }; function _objectSpread(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2] != null ? Object(arguments[i2]) : {}; var ownKeys2 = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys2.forEach(function(key2) { _defineProperty(target, key2, source[key2]); }); } return target; } function _defineProperty(obj, key2, value) { if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } var QuestionCircleFilled = function QuestionCircleFilled2(props2, context2) { var p2 = _objectSpread({}, props2, context2.attrs); return createVNode(Icon, _objectSpread({}, p2, { "icon": QuestionCircleFilled$1 }), null); }; QuestionCircleFilled.displayName = "QuestionCircleFilled"; QuestionCircleFilled.inheritAttrs = false; const useMove = ($dom, style, store) => { const leaveFlag = ref(false); const moveObj = reactive({ sx: 0, sy: 0, mx: 0, my: 0, width: style.width, height: style.height, def_width: style.width, def_height: style.height, def_left: style.left, def_top: style.top, left: style.left, top: style.top }); const wrapStyle = computed(() => { let _style = { left: `${style.left}px`, top: `${style.top}px`, width: `${style.width}px`, height: `${style.height}px` }; let opacity = store.bean.operate.opacity; store.bean.style.xfMode; if (!store.moveFlag && leaveFlag.value && store.bean.operate.mouseLeaveMode === "hide") { opacity = store.bean.operate.hideOpacity; } _style.opacity = opacity; if (store.pageMode !== "read") { _style.backgroundColor = "#fff"; } return _style; }); watch(() => store.bean.operate.mouseLeaveMode, (newVal, oldVal) => { bindVisibilityEvent(newVal); }); const bindVisibilityEvent = (mode) => { if (mode === "none") { window.addEventListener("mouseup", hideByNoneMode); window.removeEventListener("keydown", showByHideMode); } else { window.removeEventListener("mouseup", hideByNoneMode); window.addEventListener("keydown", showByHideMode); } }; const hideByNoneMode = (e2) => { if (store.moveFlag) { return; } if (e2.target.closest(".___read-box___")) { return; } if (e2.target.closest(".___wrap-modal___")) { return; } if (e2.target.closest(".___modal___")) { return; } store.clsoeBook(); }; let keyVnum = 0; let timer; const showByHideMode = (e2) => { if (store.moveFlag) { return; } if (e2.key === "v") { keyVnum++; } clearTimeout(timer); timer = setTimeout(() => { keyVnum = 0; }, 300); if (keyVnum > 2) { leaveFlag.value = false; } }; const moveStart = (e2) => { e2.preventDefault(); store.openMove(); store.openHoverHead(); moveObj.sx = e2.clientX; moveObj.sy = e2.clientY; moveObj.def_left = parseInt(style.left) || 0; moveObj.def_top = parseInt(style.top) || 0; const mask = document.createElement("div"); mask.className = "___read-mask___"; document.body.appendChild(mask); document.body.classList.add("__user-none___"); const onMousemove2 = (e3) => { if (!store.moveFlag) return; const dx = e3.clientX - moveObj.sx; const dy = e3.clientY - moveObj.sy; let left = moveObj.def_left + dx; let top = moveObj.def_top + dy; store.updatexfMode(); const xfSize = 15; if (left < xfSize) { left = 0; } else if (left > store.baseWindowInfo.width - style.width - xfSize) { left = store.baseWindowInfo.width - style.width; store.updatexfMode("r"); } if (top < xfSize) { top = 0; } if (top > store.baseWindowInfo.height - style.height - xfSize) { top = store.baseWindowInfo.height - style.height; store.updatexfMode("b"); } store.updateStyle({ left, top }); }; const onMouseup2 = (e3) => { store.closeMove(); store.closeHoverHead(); window.removeEventListener("mousemove", onMousemove2); window.removeEventListener("mouseup", onMouseup2); removeMask(); e3.stopPropagation(); e3.preventDefault(); return false; }; window.removeEventListener("mousemove", onMousemove2); window.removeEventListener("mouseup", onMouseup2); window.addEventListener("mousemove", onMousemove2); window.addEventListener("mouseup", onMouseup2); }; const resizeStart = (e2) => { const { width, height } = $dom.value.getBoundingClientRect(); moveObj.sx = e2.clientX; moveObj.sy = e2.clientY; moveObj.def_width = width; moveObj.def_height = height; let mask = document.querySelector(".___read-mask___"); if (!mask) { mask = document.createElement("div"); mask.classList.add("___read-mask___"); window.document.body.appendChild(mask); } document.body.classList.add("__user-none___"); window.addEventListener("mousemove", onMousemove); window.addEventListener("mouseup", onMouseup); }; const onMousemove = (e2) => { store.openMove(); moveObj.mx = e2.clientX - moveObj.sx; moveObj.my = e2.clientY - moveObj.sy; moveObj.width = moveObj.def_width - moveObj.mx; moveObj.height = moveObj.def_height - moveObj.my; }; const removeMask = () => { const mask = document.querySelector(".___read-mask___"); mask && mask.remove(); document.body.classList.remove("__user-none___"); }; const onMouseup = () => { store.closeMove(); store.updateStyle({ width: moveObj.width, height: moveObj.height }); window.removeEventListener("mousemove", onMousemove); window.removeEventListener("mouseup", onMouseup); removeMask(); }; const onMouseEnterByWrap = () => { leaveFlag.value = false; }; const onMouseleaveByWrap = () => { if (!store.moveFlag) { leaveFlag.value = true; } store.closeHoverResize(); }; onMounted(() => { bindVisibilityEvent(store.bean.operate.mouseLeaveMode); }); return { moveObj, wrapStyle, moveStart, resizeStart, onMouseEnterByWrap, onMouseleaveByWrap }; }; function uuid() { return Math.random().toString(36).substr(2, 9); } const isObject = (obj) => { return Object.prototype.toString.call(obj) === "[object Object]"; }; const jsonClone = (obj) => { return JSON.parse(JSON.stringify(obj)); }; function extendData(savedData, defaultData) { if (isObject(defaultData)) { for (const key2 in defaultData) { if (savedData.hasOwnProperty(key2)) { if (isObject(defaultData[key2])) { extendData(savedData[key2], defaultData[key2]); } else if (Array.isArray(defaultData[key2])) { defaultData[key2].forEach((def2, idx) => { extendData(savedData[key2][idx], def2); }); } } else { savedData[key2] = defaultData[key2]; } } } } function getBookHtml(url, store, { matchSelector, matchTitleSelector, replaceRules, callback }) { store && store.clearError(); return new Promise((resolve2, reject) => { if (url) { GM_xmlhttpRequest({ method: "GET", url, onload: function(response) { const responseText = response.responseText; const divBook = document.createElement("div"); divBook.innerHTML = responseText; let html = divBook.querySelector(matchSelector) ? divBook.querySelector(matchSelector).innerHTML : ""; html = html.replaceAll("\n", ""); html = html.replaceAll(" ", ""); html = html.replaceAll("<br>", ""); if (replaceRules && replaceRules.length) { replaceRules.forEach((n2) => { if (n2.type === "text") { html = html.replaceAll(n2.replaceStr, n2.newStr); } else if (n2.type === "regex") { html = html.replaceAll(new RegExp(n2.replaceStr, "g"), n2.newStr); } }); } const regex = /addBookmark\('([^']*)','([^']*)','([^']*)'\)/; let arr = responseText.match(regex); if (typeof callback === "function") { html = callback(html, responseText); } let title = ""; if (arr && arr[2]) { title = arr[2]; } else if (matchTitleSelector) { title = divBook.querySelector(matchTitleSelector) ? divBook.querySelector(matchTitleSelector).textContent : "暂无标题"; } resolve2({ html, title, tempPageString: responseText }); }, onerror: function(error) { console.error("获取正文失败:", error); reject("获取正文失:链接可能失效!"); } }); } }); } function getBookIndexHtml(url, store, matchSelector) { store.clearError(); return new Promise((resolve2, reject) => { if (url) { GM_xmlhttpRequest({ method: "GET", url, onload: function(response) { const responseText = response.responseText; const divBook = document.createElement("div"); divBook.innerHTML = responseText; let list = divBook.querySelectorAll(matchSelector); const arr = ["<ul class='___book___index___'>"]; list.forEach((n2) => { if (n2.href) { let href = n2.href.replaceAll(window.origin, ""); let text = n2.textContent.trim(); href = store.getBook.source.baseUrl + href; arr.push(`<li class="___book___item___" a-href="${href}"><span >${text}</span></li>`); } }); arr.push("</ul>"); resolve2(arr.join("")); }, onerror: function(error) { console.error("获取目录失败:", error); reject("获取目录失:链接可能失效!"); } }); } }); } const getUrl = (url) => { if (!url || url == "javascript:void(0);" || url == "#" || url == "javascript:;") { return ""; } return url; }; function getBooJump(html, bookItem) { const { matchJumpPreSelector, matchJumpNextSelector } = bookItem.source; const divBook = document.createElement("div"); divBook.innerHTML = html; const preDom = divBook.querySelector(matchJumpPreSelector); const preValue = preDom ? getUrl(preDom.getAttribute("href")) : ""; const nextDom = divBook.querySelector(matchJumpNextSelector); const nextValue = nextDom ? getUrl(nextDom.getAttribute("href")) : ""; return { preValue, nextValue }; } function scrollTop() { nextTick(() => { const $main = document.querySelector(".___main___"); if ($main) $main.scrollTop = 0; }); } const useStore = /* @__PURE__ */ defineStore("index", { state: () => { const savedData = GM_getValue("bean") || {}; savedData.showBook = false; const defaultData = { showBook: false, style: { width: 400, height: 300, left: null, top: null, xfMode: [] }, operate: { mouseLeaveMode: "none", opacity: 1, hideOpacity: 0 }, readBookId: "001", book: { mainHtml: "", list: [ // { // id: "001", // source: { // libraryName: "XXX书库", // sourceUrl: "http://www.biquxs.com", // baseUrl: "http://www.biquxs.com", // catalogUrl: "http://www.biquxs.com/book/19650", // pageUrl: "http://www.biquxs.com/book/19650/11853015.html", // matchPageTitleSelector: "#title", // matchPageCoverSelector: "#fmimg img", // matchPageSelector: "#content", // matchIndexSelector: ".listmain dd a[href]", // matchJumpPreSelector: "#pre", // matchJumpNextSelector: "#next", // }, // book: { // name: "来自末日", // author: "吃书妖", // cover: "", // title: "", // }, // valueMap: { // nextValue: "", // preValue: "", // }, // }, ], replaceRules: [], style: { fontSize: 14, color: "#888", background: "#fff", opacity: 1, lineHeight: 2 } } }; extendData(savedData, defaultData); return { loading: false, moveFlag: false, hoverResizeFlag: false, hoverHeadFlag: false, bean: savedData, pageMode: "bookList", bookHtml: "", errorMsg: "", baseWindowInfo: { width: 0, height: 0 } }; }, getters: { getBook() { if (this.bean.readBookId) { return this.bean.book.list.find((n2) => n2.id === this.bean.readBookId); } return null; } }, actions: { openMove() { this.moveFlag = true; }, closeMove() { this.moveFlag = false; }, openHoverResize() { this.hoverResizeFlag = true; }, closeHoverResize() { this.hoverResizeFlag = false; }, openHoverHead() { this.hoverHeadFlag = true; }, closeHoverHead() { this.hoverHeadFlag = false; }, initWindow() { this.baseWindowInfo.width = document.documentElement.clientWidth; this.baseWindowInfo.height = document.documentElement.clientHeight; if (this.bean.style.left === null) { this.bean.style.left = (this.baseWindowInfo.width - this.bean.style.width) / 2; } if (this.bean.style.top === null) { this.bean.style.top = (this.baseWindowInfo.height - this.bean.style.height) / 2; } if (this.bean.style.xfMode.indexOf("r") !== -1) { this.bean.style.left = this.baseWindowInfo.width - this.bean.style.width; } if (this.bean.style.xfMode.indexOf("b") !== -1) { this.bean.style.top = this.baseWindowInfo.height - this.bean.style.height; } }, updatexfMode(value) { if (value) { if (this.bean.style.xfMode.indexOf(value) === -1) { this.bean.style.xfMode.push(value); } } else { this.bean.style.xfMode = []; } }, clsoeBook() { this.bean.showBook = false; this.save2GM(); }, showBook() { this.bean.showBook = true; this.save2GM(); }, updateStyle(style) { Object.assign(this.bean.style, style); this.save2GM(); }, updateSetupsModal(operateData) { Object.assign(this.bean.operate, operateData); this.save2GM(); }, save2GM() { GM_setValue("bean", this.bean); }, async readBook(id) { if (id) { this.bean.readBookId = id; } const bookItem = this.getBook; if (!bookItem) { return; } const index2 = this.bean.book.list.findIndex((n2) => n2.id === this.bean.readBookId); if (index2 > 0) { const _book = this.bean.book.list.splice(index2, 1); this.bean.book.list.unshift(_book[0]); } this.loading = true; if (!bookItem.source.pageUrl) { this.readBookIndex(); return; } try { const { html, title, tempPageString } = await getBookHtml(bookItem.source.pageUrl, this, { matchSelector: bookItem.source.matchPageSelector, matchTitleSelector: bookItem.source.matchPageTitleSelector, replaceRules: this.bean.book.replaceRules }); const { nextValue, preValue } = getBooJump(tempPageString, bookItem); this.bookHtml = html; bookItem.book.title = title; if (nextValue) { bookItem.valueMap.nextValue = nextValue === bookItem.source.catalogUrl ? "" : bookItem.source.baseUrl + nextValue; } else { bookItem.valueMap.nextValue = ""; } if (preValue) { bookItem.valueMap.preValue = preValue === bookItem.source.catalogUrl ? "" : bookItem.source.baseUrl + preValue; } else { bookItem.valueMap.preValue = ""; } this.pageMode = "read"; scrollTop(); this.save2GM(); } catch (error) { this.pageMode = "read"; this.setError(error); } this.loading = false; }, async readBookIndex() { const bookItem = this.getBook; if (!bookItem) { return; } this.loading = true; try { const html = await getBookIndexHtml(bookItem.source.catalogUrl, this, bookItem.source.matchIndexSelector); this.bookHtml = html; bookItem.book.title = "书籍目录"; bookItem.valueMap.nextValue = ""; bookItem.valueMap.preValue = ""; this.pageMode = "index"; scrollTop(); } catch (error) { this.pageMode = "index"; this.setError(error); } this.loading = false; }, nextPage() { const bookItem = this.getBook; if (!bookItem) { return; } bookItem.source.pageUrl = bookItem.valueMap.nextValue; this.readBook(); }, prePage() { const bookItem = this.getBook; if (!bookItem) { return; } bookItem.source.pageUrl = bookItem.valueMap.preValue; this.readBook(); }, backIndex() { const bookItem = this.getBook; if (!bookItem) { return; } this.readBookIndex(); }, jumpPage(url) { const bookItem = this.getBook; if (!bookItem) { return; } if (url.indexOf(bookItem.source.baseUrl) !== -1) { bookItem.source.pageUrl = url; } else { bookItem.source.pageUrl = bookItem.source.baseUrl + url; } this.readBook(); }, backRead() { this.readBook(); }, openBookList() { this.pageMode = "bookList"; const bookItem = this.getBook; bookItem.book.title = ""; }, removeBook(id) { const index2 = this.bean.book.list.findIndex((n2) => n2.id === id); if (index2 !== -1) { this.bean.book.list.splice(index2, 1); this.save2GM(); } }, setError(msg) { debugger; this.errorMsg = msg; }, clearError() { this.errorMsg = ""; }, addBook(book) { this.bean.book.list.push(book); this.save2GM(); }, editBook(book) { const index2 = this.bean.book.list.findIndex((n2) => n2.id === book.id); if (index2 !== -1) { this.bean.book.list[index2] = book; this.save2GM(); } }, addReplaceRules() { this.bean.book.replaceRules.push({ type: "text", replaceStr: "", newStr: "" }); }, removeReplaceItem(index2) { this.bean.book.replaceRules.splice(index2, 1); }, removeReplaceItemAll() { this.bean.book.replaceRules = []; }, importBooks(data) { const newIds = data.book.list.map((n2) => n2.id); this.bean.book.list.forEach((n2) => { if (!newIds.some((id) => id === n2.id)) { data.book.list.push(n2); } }); this.bean.book = data.book; }, zoomInFontSize() { this.bean.book.style.fontSize += 1; if (this.bean.book.style.fontSize > 30) { this.bean.book.style.fontSize = 30; } this.save2GM(); }, zoomOutFontSize() { this.bean.book.style.fontSize -= 1; if (this.bean.book.style.fontSize < 10) { this.bean.book.style.fontSize = 10; } this.save2GM(); }, changeLineHeight(lineHeight) { this.bean.book.style.lineHeight = lineHeight; if (lineHeight > 4) { this.bean.book.style.lineHeight = 4; } else if (lineHeight < 1) { this.bean.book.style.lineHeight = 1; } this.save2GM(); }, changeBgOpacity(opacity) { this.bean.book.style.opacity = opacity; if (opacity > 1) { this.bean.book.style.opacity = 1; } else if (opacity < 0) { this.bean.book.style.opacity = 0; } this.save2GM(); }, changeFontColor(color) { this.bean.book.style.color = color; this.save2GM(); }, changeBgColor(color) { this.bean.book.style.background = color; this.save2GM(); } } }); const _export_sfc = (sfc, props2) => { const target = sfc.__vccOpts || sfc; for (const [key2, val] of props2) { target[key2] = val; } return target; }; const _hoisted_1$b = { class: "___left___" }; const _hoisted_2$5 = { class: "___btn___", title: "字体颜色" }; const _hoisted_3$4 = { class: "___btn___", title: "背景颜色" }; const _hoisted_4$3 = { class: "___right___" }; const _hoisted_5$3 = { key: 0, class: "___Slider___" }; const _sfc_main$f = { __name: "ReadStyleStep", setup(__props) { const store = useStore(); const show = ref(false); const showStep = () => { show.value = true; }; const closeStep = () => { show.value = false; }; const sliderData = reactive({ show: false, value: 1, min: 1, max: 4, step: 0.1, type: null }); reactive({ show: false, value: "#000000", type: null }); const openLineHeightSlider = () => { const { lineHeight } = store.bean.book.style; sliderData.show = true; sliderData.value = lineHeight; sliderData.min = 1; sliderData.max = 4; sliderData.step = 0.1; sliderData.type = "lineHeight"; addEventListener2(); }; const openBgOpacitySlider = () => { const { opacity } = store.bean.book.style; sliderData.show = true; sliderData.value = opacity; sliderData.min = 0; sliderData.max = 1; sliderData.step = 0.1; sliderData.type = "opacity"; addEventListener2(); }; const onSliderChange = (value) => { if (sliderData.type === "lineHeight") { store.changeLineHeight(value); } else if (sliderData.type === "opacity") { store.changeBgOpacity(value); } }; const sliderFn = (e2) => { if (!e2.target.closest(".___Slider___")) { sliderData.show = false; sliderData.type = null; removeEventListener2(); } }; const removeEventListener2 = () => { window.removeEventListener("click", sliderFn); }; const addEventListener2 = () => { window.addEventListener("click", sliderFn); }; const changeFontColor = (e2) => { store.changeFontColor(e2.target.value); }; const changeBgColor = (e2) => { store.changeBgColor(e2.target.value); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: "___ReadStyleStep___", onMouseenter: showStep, style: normalizeStyle$1({ opacity: show.value ? 1 : 0 }) }, [ createBaseVNode("div", _hoisted_1$b, [ createBaseVNode("div", { class: "___btn___", title: "字体放大", onClick: _cache[0] || (_cache[0] = (...args) => unref(store).zoomInFontSize && unref(store).zoomInFontSize(...args)) }, [ createVNode(unref(ZoomInOutlined)) ]), createBaseVNode("div", { class: "___btn___", title: "字体缩小", onClick: _cache[1] || (_cache[1] = (...args) => unref(store).zoomOutFontSize && unref(store).zoomOutFontSize(...args)) }, [ createVNode(unref(ZoomOutOutlined)) ]), createBaseVNode("div", { class: "___btn___", title: "字体行高", onClick: withModifiers(openLineHeightSlider, ["stop"]) }, [ createVNode(unref(LineHeightOutlined)) ]), createBaseVNode("div", _hoisted_2$5, [ createVNode(unref(FontColorsOutlined)), _cache[3] || (_cache[3] = createTextVNode()), createBaseVNode("input", { type: "color", class: "ghost", onInput: changeFontColor }, null, 32) ]), createBaseVNode("div", _hoisted_3$4, [ createVNode(unref(BgColorsOutlined)), createBaseVNode("input", { type: "color", class: "ghost", onInput: changeBgColor }, null, 32) ]), createBaseVNode("div", { class: "___btn___", title: "背景透明度", onClick: withModifiers(openBgOpacitySlider, ["stop"]) }, [ createVNode(unref(EyeOutlined)) ]) ]), createBaseVNode("div", _hoisted_4$3, [ createBaseVNode("div", { class: "___close___", onClick: closeStep }, [ createVNode(unref(CloseOutlined)) ]) ]), createVNode(Transition, { name: "fade-up" }, { default: withCtx(() => [ sliderData.show ? (openBlock(), createElementBlock("div", _hoisted_5$3, [ createVNode(unref(Slider$1), { value: sliderData.value, "onUpdate:value": _cache[2] || (_cache[2] = ($event) => sliderData.value = $event), onChange: onSliderChange, min: sliderData.min, max: sliderData.max, step: sliderData.step }, null, 8, ["value", "min", "max", "step"]) ])) : createCommentVNode("", true) ]), _: 1 }) ], 36); }; } }; const ReadStyleStep = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-d37dbcd7"]]); const _hoisted_1$a = { class: "___read-main___" }; const _hoisted_2$4 = { style: { "text-align": "center", "margin-top": "0" } }; const _hoisted_3$3 = ["innerHTML"]; const _sfc_main$e = { __name: "ReadMain", props: { data: Array }, setup(__props) { const mainClass = computed(() => { return store.pageMode === "read" ? "___read___" : "___index___"; }); const store = useStore(); const mainStyle = computed(() => { return { fontSize: store.bean.book.style.fontSize + "px", color: store.bean.book.style.color, lineHeight: store.bean.book.style.lineHeight }; }); const onMainHtmlClick = (event) => { if (store.pageMode === "index") { const target = event.target.closest(".___book___item___"); if (target.className === "___book___item___") { const href = target.getAttribute("a-href"); if (href) { store.jumpPage(href); } } } }; onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1$a, [ createVNode(ReadStyleStep), createBaseVNode("div", { class: "___main___", style: normalizeStyle$1(mainStyle.value) }, [ createBaseVNode("h3", _hoisted_2$4, toDisplayString(unref(store).getBook.book.title), 1), createBaseVNode("div", { innerHTML: unref(store).bookHtml, class: normalizeClass(mainClass.value), onClick: onMainHtmlClick }, null, 10, _hoisted_3$3) ], 4) ]); }; } }; const ReadMain = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-0a1c32de"]]); const _hoisted_1$9 = { style: { "width": "100%", "text-align": "center", "margin-bottom": "15px" } }; const _hoisted_2$3 = { key: 0, style: { "color": "#666" } }; const _sfc_main$d = { __name: "BookItem", props: { mode: { type: String, default: "add" } }, setup(__props, { expose: __expose }) { const props2 = __props; const store = useStore(); const title = computed(() => { return props2.mode === "edit" ? "编辑书籍" : "添加新书"; }); const formRef = ref(null); const form = reactive({ id: "", sourceUrl: "", baseUrl: "", catalogUrl: "", libraryName: "", name: "", author: "", cover: "", matchPageSelector: "", matchPageTitleSelector: "", matchPageCoverSelector: "", matchIndexSelector: "", matchJumpPreSelector: "", matchJumpNextSelector: "", valueMap: { nextValue: "", preValue: "" } }); const bookInfo = reactive({ show: false, text: "" }); const visible = ref(false); const loading = ref(false); const open2 = (data) => { if (data) { Object.assign(form, data); } visible.value = true; }; const fetchBookInfo = async () => { loading.value = true; form.sourceUrl = form.sourceUrl.replace(/\/$/, ""); form.catalogUrl = form.catalogUrl.replace(/\/$/, ""); if (!form.sourceUrl && !form.catalogUrl) { api$1.error("请输入源地址或目录地址"); loading.value = false; return; } if (form.catalogUrl) { GM_xmlhttpRequest({ method: "GET", url: form.catalogUrl, onload: function(response) { const responseText = response.responseText; const divBook = document.createElement("div"); divBook.innerHTML = responseText; if (form.matchPageCoverSelector) { const fmimg = divBook.querySelector(form.matchPageCoverSelector); if (fmimg) { form.cover = fmimg.src; } } if (form.matchIndexSelector) { const indexList = divBook.querySelectorAll(form.matchIndexSelector); const indexListUrl = []; let text = ""; for (let i2 = 0; i2 < 5; i2++) { if (indexList[i2] && indexList[i2].href) { indexListUrl.push(indexList[i2].text + ":" + indexList[i2].href); } } if (indexListUrl.length === 0) { api$1.error("目录列表匹配为空,无法查找到章节url!"); } else { text = indexListUrl.join("\n"); bookInfo.show = true; bookInfo.text = text; } } else { api$1.error("目录列表匹配为空,无法查找到章节url!"); } loading.value = false; }, onerror: function(error) { console.error("请求失败:", error); loading.value = false; api$1.error("获取书籍信息失败!请手动维护数据信息"); } }); } }; const cancelFn = () => { visible.value = false; formRef.value.resetFields(); for (let key2 in form) { form[key2] = ""; } }; const handleOk = async () => { form.sourceUrl = form.sourceUrl.replace(/\/$/, ""); form.catalogUrl = form.catalogUrl.replace(/\/$/, ""); formRef.value.validate().then(() => { const data = { id: form.id || uuid(), source: { libraryName: form.libraryName, sourceUrl: form.sourceUrl, baseUrl: form.baseUrl, catalogUrl: form.catalogUrl, pageUrl: "", matchPageSelector: form.matchPageSelector, matchPageCoverSelector: form.matchPageCoverSelector, matchPageTitleSelector: form.matchPageTitleSelector, matchIndexSelector: form.matchIndexSelector, matchJumpPreSelector: form.matchJumpPreSelector, matchJumpNextSelector: form.matchJumpNextSelector }, book: { name: form.name, author: form.author, cover: form.cover, title: "" }, valueMap: form.valueMap }; if (props2.mode === "add") { store.addBook(data); api$1.success("添加成功"); } else if (props2.mode === "edit") { store.editBook(data); api$1.success("编辑成功"); } cancelFn(); }); }; __expose({ open: open2 }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(Modal), { wrapClassName: "___modal___", zIndex: "9999999", open: visible.value, "onUpdate:open": _cache[12] || (_cache[12] = ($event) => visible.value = $event), width: "950px", title: title.value, onOk: handleOk, onCancel: cancelFn, destroyOnClose: true }, { default: withCtx(() => [ createVNode(unref(Form), { ref_key: "formRef", ref: formRef, model: form, layout: "vertical" }, { default: withCtx(() => [ _cache[23] || (_cache[23] = createBaseVNode("h3", null, "书源信息", -1)), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "sourceUrl", label: "书源地址", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.sourceUrl, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => form.sourceUrl = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[13] || (_cache[13] = [ createTextVNode("书源地址用于获取书籍信息,请确保其有效性。一般为网站的根目录地址,或者首页地址。例如:http://www.xxx.com") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "baseUrl", label: "书籍正文地址", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.baseUrl, "onUpdate:value": _cache[1] || (_cache[1] = ($event) => form.baseUrl = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[14] || (_cache[14] = [ createTextVNode("书籍正文地址用于和书籍目录地址拼接,从而获取正文内容,请确保其有效性。一般为小说的正文地址的前半部分。例如:http://www.xxx.com/book/xxxx http://www.xxx.com/xxxx http://www.xxx.com") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchPageSelector", label: "正文内容匹配选择器", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchPageSelector, "onUpdate:value": _cache[2] || (_cache[2] = ($event) => form.matchPageSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[15] || (_cache[15] = [ createTextVNode("用于获取书籍正文内容,请确保其有效性。一般为小说网站的正文内容所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#content 或 .content 或 div.content") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchPageTitleSelector", label: "正文标题匹配选择器", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchPageTitleSelector, "onUpdate:value": _cache[3] || (_cache[3] = ($event) => form.matchPageTitleSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[16] || (_cache[16] = [ createTextVNode("用于获取书籍正文标题,请确保其有效性。一般为小说网站的正文标题所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#title 或 .title 或 div.title") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchJumpPreSelector", label: "上一页按钮匹配选择器", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchJumpPreSelector, "onUpdate:value": _cache[4] || (_cache[4] = ($event) => form.matchJumpPreSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[17] || (_cache[17] = [ createTextVNode("用于获取书籍上一页按钮的HTML元素,请确保其有效性。一般为小说网站的上一页按钮所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#prev 或 .prev 或 div.prev") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchJumpNextSelector", label: "下一页按钮匹配选择器", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchJumpNextSelector, "onUpdate:value": _cache[5] || (_cache[5] = ($event) => form.matchJumpNextSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[18] || (_cache[18] = [ createTextVNode("用于获取书籍下一页按钮的HTML元素,请确保其有效性。一般为小说网站的下一页按钮所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#next 或 .next 或 div.next") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "catalogUrl", label: "目录地址", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.catalogUrl, "onUpdate:value": _cache[6] || (_cache[6] = ($event) => form.catalogUrl = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[19] || (_cache[19] = [ createTextVNode("目录地址用于获取书籍目录列表和基本信息,请确保其有效性。一般为同一个小说网站的特定小说目录地址。例如:http://www.xxx.com/book/xxxx/ http://www.xxx.com/xxxx/") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchIndexSelector", label: "目录列表匹配选择器", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchIndexSelector, "onUpdate:value": _cache[7] || (_cache[7] = ($event) => form.matchIndexSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[20] || (_cache[20] = [ createTextVNode("用于获取书籍目录列表,请确保其有效性。一般为小说网站的目录内容所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#content 或 .content 或 div.content") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "matchPageCoverSelector", label: "封面匹配选择器" }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.matchPageCoverSelector, "onUpdate:value": _cache[8] || (_cache[8] = ($event) => form.matchPageCoverSelector = $event), placeholder: "请输入" }, { addonAfter: withCtx(() => [ createVNode(unref(Tooltip), { placement: "topLeft" }, { title: withCtx(() => _cache[21] || (_cache[21] = [ createTextVNode("用于获取书籍封面图片,请确保其有效性。一般为小说网站的封面图片所在的HTML元素或者class选择器,id选择器,属性选择器。例如:#cover 或 .cover 或 div.cover") ])), default: withCtx(() => [ createVNode(unref(QuestionCircleFilled)) ]), _: 1 }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 24 }, { default: withCtx(() => [ createBaseVNode("div", _hoisted_1$9, [ createVNode(unref(Button$1), { type: "primary", size: "small", onClick: fetchBookInfo, loading: loading.value }, { default: withCtx(() => _cache[22] || (_cache[22] = [ createTextVNode("测试目录地址,并获取封面") ])), _: 1, __: [22] }, 8, ["loading"]) ]), bookInfo.show ? (openBlock(), createBlock(unref(Alert$1), { key: 0, class: "___alert___", message: "目录列表匹配结果", description: bookInfo.text, type: "info" }, null, 8, ["description"])) : createCommentVNode("", true) ]), _: 1 }) ]), _: 1 }), _cache[24] || (_cache[24] = createBaseVNode("h3", null, "书籍信息", -1)), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 7 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "name", label: "书籍名称", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.name, "onUpdate:value": _cache[9] || (_cache[9] = ($event) => form.name = $event), placeholder: "请输入" }, null, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 7 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "author", label: "作者名称", rules: [{ required: true }] }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.author, "onUpdate:value": _cache[10] || (_cache[10] = ($event) => form.author = $event), placeholder: "请输入" }, null, 8, ["value"]) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Col), { span: 8 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "libraryName", label: "书库名称" }, { default: withCtx(() => [ createVNode(unref(Input), { value: form.libraryName, "onUpdate:value": _cache[11] || (_cache[11] = ($event) => form.libraryName = $event), placeholder: "请输入" }, null, 8, ["value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(unref(Row), { gutter: 24 }, { default: withCtx(() => [ createVNode(unref(Col), { span: 24 }, { default: withCtx(() => [ createVNode(unref(Form).Item, { name: "cover", label: "封面预览" }, { default: withCtx(() => [ !form.cover ? (openBlock(), createElementBlock("span", _hoisted_2$3, "请填写目录地址,并配置封面选择器后测试获取封面地址")) : createCommentVNode("", true), createVNode(unref(Image), { width: 80, src: form.cover }, null, 8, ["src"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1, __: [23, 24] }, 8, ["model"]) ]), _: 1 }, 8, ["open", "title"]); }; } }; const BookItem = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-a668a0f3"]]); const _hoisted_1$8 = { class: "___book-list___" }; const _hoisted_2$2 = { class: "___head___" }; const _hoisted_3$2 = { class: "___tools___" }; const _hoisted_4$2 = { class: "___list___" }; const _hoisted_5$2 = ["onClick"]; const _hoisted_6$2 = { class: "___tools___" }; const _hoisted_7$1 = { key: 0, class: "___cover___" }; const _hoisted_8$1 = ["src"]; const _hoisted_9 = { key: 1, class: "___cover___def___" }; const _hoisted_10 = { class: "___info___" }; const _hoisted_11 = { class: "___name___" }; const _hoisted_12 = { class: "___author___" }; const _hoisted_13 = { key: 0, style: { "text-align": "center", "color": "#666", "position": "absolute", "width": "100%", "top": "66px" } }; const _sfc_main$c = { __name: "BookList", setup(__props) { const store = useStore(); const bookList = computed(() => { return store.bean.book.list; }); const addNewBook = ref(null); const bookItemMode = ref("add"); const openAddBook = () => { bookItemMode.value = "add"; addNewBook.value.open(); }; const removeBook = (id) => { store.removeBook(id); }; const readBook = (id) => { store.readBook(id); }; const openEditBook = (id) => { bookItemMode.value = "edit"; const data = bookList.value.find((item) => item.id === id); const bookItemData = { id: data.id, sourceUrl: data.source.sourceUrl, baseUrl: data.source.baseUrl, catalogUrl: data.source.catalogUrl, libraryName: data.source.libraryName, cover: data.book.cover, name: data.book.name, author: data.book.author, cover: data.book.cover, matchPageSelector: data.source.matchPageSelector, matchPageTitleSelector: data.source.matchPageTitleSelector, matchPageCoverSelector: data.source.matchPageCoverSelector, matchIndexSelector: data.source.matchIndexSelector, matchJumpPreSelector: data.source.matchJumpPreSelector, matchJumpNextSelector: data.source.matchJumpNextSelector }; addNewBook.value.open(bookItemData); }; const importBookList = () => { const input = document.createElement("input"); input.type = "file"; input.accept = ".json"; input.onchange = (e2) => { const file = e2.target.files[0]; const reader = new FileReader(); reader.onload = (event) => { try { const data = JSON.parse(event.target.result); store.importBooks(data); api$1.success("导入成功"); } catch (error) { api$1.error("文件解析失败"); } }; reader.readAsText(file); }; input.click(); }; const exportBookList = () => { if (bookList.value.length === 0) { api$1.warning("没有可导出的书籍列表"); return; } const data = jsonClone(store.bean); data.book.mainHtml = ""; const str = JSON.stringify(data, null, 2); const blob = new Blob([str], { type: "application/json" }); const url = URL.createObjectURL(blob); const a2 = document.createElement("a"); a2.href = url; const now2 = /* @__PURE__ */ new Date(); const formattedDate = `${now2.getFullYear()}-${now2.getMonth() + 1}-${now2.getDate()} ${now2.getHours()}:${now2.getMinutes()}:${now2.getSeconds()}`; a2.download = `书籍列表_${formattedDate}.json`; a2.click(); URL.revokeObjectURL(url); api$1.success("导出成功"); }; return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ createBaseVNode("div", _hoisted_1$8, [ createBaseVNode("div", _hoisted_2$2, [ _cache[4] || (_cache[4] = createBaseVNode("div", { class: "___title___" }, "书籍列表", -1)), createBaseVNode("div", _hoisted_3$2, [ createVNode(unref(Button$1), { class: "___btn___", icon: h$1(unref(LoginOutlined)), onClick: importBookList, size: "small" }, { default: withCtx(() => _cache[0] || (_cache[0] = [ createTextVNode("导入") ])), _: 1, __: [0] }, 8, ["icon"]), createVNode(unref(Button$1), { class: "___btn___", icon: h$1(unref(DownloadOutlined)), onClick: exportBookList, size: "small" }, { default: withCtx(() => _cache[1] || (_cache[1] = [ createTextVNode("导出") ])), _: 1, __: [1] }, 8, ["icon"]), _cache[3] || (_cache[3] = createBaseVNode("span", { class: "___line___" }, null, -1)), createVNode(unref(Button$1), { class: "___btn___", type: "primary", icon: h$1(unref(PlusOutlined)), onClick: openAddBook, size: "small" }, { default: withCtx(() => _cache[2] || (_cache[2] = [ createTextVNode("新书") ])), _: 1, __: [2] }, 8, ["icon"]) ]) ]), createBaseVNode("div", _hoisted_4$2, [ (openBlock(true), createElementBlock(Fragment, null, renderList(bookList.value, (item, index2) => { return openBlock(), createElementBlock("div", { key: item.id, class: "___item___", onClick: ($event) => readBook(item.id) }, [ createBaseVNode("div", _hoisted_6$2, [ createVNode(unref(EditOutlined), { class: "___edit___", onClick: withModifiers(($event) => openEditBook(item.id), ["stop"]) }, null, 8, ["onClick"]), createVNode(unref(CloseOutlined), { class: "___close___", onClick: withModifiers(($event) => removeBook(item.id), ["stop"]) }, null, 8, ["onClick"]) ]), item.book.cover ? (openBlock(), createElementBlock("div", _hoisted_7$1, [ createBaseVNode("img", { src: item.book.cover, alt: "书籍封面" }, null, 8, _hoisted_8$1) ])) : (openBlock(), createElementBlock("div", _hoisted_9, _cache[5] || (_cache[5] = [ createBaseVNode("span", null, "暂无封面", -1) ]))), createBaseVNode("div", _hoisted_10, [ createBaseVNode("span", _hoisted_11, toDisplayString(item.book.name), 1), createBaseVNode("span", _hoisted_12, toDisplayString(item.book.author), 1) ]) ], 8, _hoisted_5$2); }), 128)) ]), bookList.value.length === 0 ? (openBlock(), createElementBlock("span", _hoisted_13, "暂无书籍,请增加新书")) : createCommentVNode("", true) ]), createVNode(BookItem, { ref_key: "addNewBook", ref: addNewBook, mode: bookItemMode.value }, null, 8, ["mode"]) ], 64); }; } }; const BookList = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-293136fa"]]); const _hoisted_1$7 = { class: "___errorMsg___" }; const _sfc_main$b = { __name: "ErrorMsg", setup(__props) { const store = useStore(); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1$7, toDisplayString(unref(store).errorMsg), 1); }; } }; const ErrorMsg = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-5c2f34e7"]]); const _sfc_main$a = { __name: "ResizeSize", setup(__props) { const store = useStore(); const resizeStart = (e2) => { document.body.classList.add("__user-none___"); store.openMove(); const sx = e2.clientX; const sy = e2.clientY; const defWidth = store.bean.style.width; const defHeight = store.bean.style.height; const resizeMove = (e3) => { const dx = e3.clientX - sx; const dy = e3.clientY - sy; const width = defWidth + dx; const height = defHeight + dy; store.updateStyle({ width, height }); }; const resizeEnd = (e3) => { store.closeMove(); store.closeHoverResize(); document.body.classList.remove("__user-none___"); window.removeEventListener("mousemove", resizeMove); window.removeEventListener("mouseup", resizeEnd); e3.preventDefault(); e3.stopPropagation(); }; window.addEventListener("mousemove", resizeMove); window.addEventListener("mouseup", resizeEnd); e2.preventDefault(); e2.stopPropagation(); }; const onMouseEnter = (e2) => { store.openHoverResize(); }; const onMouseLeave = (e2) => { store.closeHoverResize(); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: "___resize___", onMousedown: resizeStart, onMouseenter: onMouseEnter, onMouseleave: onMouseLeave }, null, 32); }; } }; const ResizeSize = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-21c1a3cf"]]); const _sfc_main$9 = { __name: "Header", props: { moveStart: Function, resizeStart: Function }, setup(__props) { const props2 = __props; const store = useStore(); onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(["___head___", { "___hover___": unref(store).hoverHeadFlag }]), onMousedown: _cache[0] || (_cache[0] = (...args) => props2.moveStart && props2.moveStart(...args)) }, _cache[1] || (_cache[1] = [ createBaseVNode("div", { class: "bg" }, null, -1) ]), 34); }; } }; const Header = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-02221de2"]]); const _hoisted_1$6 = { class: "box" }; const _sfc_main$8 = { __name: "OperateForm", setup(__props, { expose: __expose }) { const store = useStore(); const formState = reactive({}); Object.assign(formState, store.bean.operate); function getData() { return formState; } __expose({ getData }); onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1$6, [ createVNode(unref(Form), { model: formState, "label-col": { span: 6 }, "wrapper-col": { span: 18 } }, { default: withCtx(() => [ createVNode(unref(Form).Item, { label: "鼠标移出逻辑" }, { default: withCtx(() => [ createVNode(unref(Radio).Group, { value: formState.mouseLeaveMode, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => formState.mouseLeaveMode = $event) }, { default: withCtx(() => [ createVNode(unref(Radio), { value: "none" }, { default: withCtx(() => _cache[3] || (_cache[3] = [ createTextVNode("什么都不做,此时点击阅读窗口外可以手动隐藏") ])), _: 1, __: [3] }), createVNode(unref(Radio), { value: "hide" }, { default: withCtx(() => _cache[4] || (_cache[4] = [ createTextVNode("移出隐藏,如果找不到了可以连读"), createBaseVNode("b", { style: { "color": "red" } }, "敲击三次键盘“V”", -1), createTextVNode("按键,即可显示") ])), _: 1, __: [4] }) ]), _: 1 }, 8, ["value"]) ]), _: 1 }), createVNode(unref(Form).Item, { label: "默认透明度" }, { default: withCtx(() => [ createVNode(unref(Slider$1), { style: { "width": "240px" }, value: formState.opacity, "onUpdate:value": _cache[1] || (_cache[1] = ($event) => formState.opacity = $event), min: 0.3, max: 1, step: 0.1 }, null, 8, ["value"]) ]), _: 1 }), formState.mouseLeaveMode === "hide" ? (openBlock(), createBlock(unref(Form).Item, { key: 0, label: "移出后透明度" }, { default: withCtx(() => [ createVNode(unref(Slider$1), { style: { "width": "240px" }, value: formState.hideOpacity, "onUpdate:value": _cache[2] || (_cache[2] = ($event) => formState.hideOpacity = $event), min: 0, max: 1, step: 0.1 }, null, 8, ["value"]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 }, 8, ["model"]) ]); }; } }; const OperateForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-dff95206"]]); const _hoisted_1$5 = { class: "___replace-list___" }; const _hoisted_2$1 = { class: "___replace-item___" }; const _hoisted_3$1 = { class: "___replace-item-left___" }; const _hoisted_4$1 = { class: "___replace-item-left-content___" }; const _hoisted_5$1 = { class: "___replace-item-right___" }; const _hoisted_6$1 = { class: "___replace-item-right-content___" }; const _hoisted_7 = { class: "___tools___" }; const _hoisted_8 = { class: "___add-btn___" }; const _sfc_main$7 = { __name: "ReplaceList", props: { data: Array }, setup(__props) { const store = useStore(); const addReplaceItem = () => { store.addReplaceRules(); }; const removeReplaceItem = (index2) => { store.removeReplaceItem(index2); }; const removeReplaceItemAll = () => { store.removeReplaceItemAll(); }; onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1$5, [ createBaseVNode("ul", null, [ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(store).bean.book.replaceRules, (item, index2) => { return openBlock(), createElementBlock("li", { key: index2 }, [ createBaseVNode("div", _hoisted_2$1, [ createBaseVNode("div", _hoisted_3$1, [ _cache[2] || (_cache[2] = createBaseVNode("div", { class: "___replace-item-left-title___" }, "原始内容", -1)), createBaseVNode("div", _hoisted_4$1, [ createVNode(unref(Input).Group, { compact: "" }, { default: withCtx(() => [ createVNode(unref(Select), { size: "small", value: item.type, "onUpdate:value": ($event) => item.type = $event }, { default: withCtx(() => [ createVNode(unref(Select).Option, { value: "text" }, { default: withCtx(() => _cache[0] || (_cache[0] = [ createTextVNode("文本") ])), _: 1, __: [0] }), createVNode(unref(Select).Option, { value: "regex" }, { default: withCtx(() => _cache[1] || (_cache[1] = [ createTextVNode("正则") ])), _: 1, __: [1] }) ]), _: 2 }, 1032, ["value", "onUpdate:value"]), createVNode(unref(Input), { size: "small", value: item.replaceStr, "onUpdate:value": ($event) => item.replaceStr = $event, style: { "width": "calc(100% - 65px)" } }, null, 8, ["value", "onUpdate:value"]) ]), _: 2 }, 1024) ]) ]), createBaseVNode("div", _hoisted_5$1, [ _cache[3] || (_cache[3] = createBaseVNode("div", { class: "___replace-item-right-title___" }, "替换内容", -1)), createBaseVNode("div", _hoisted_6$1, [ createVNode(unref(Input), { size: "small", value: item.newStr, "onUpdate:value": ($event) => item.newStr = $event, style: { "width": "100%" } }, null, 8, ["value", "onUpdate:value"]) ]) ]), createBaseVNode("div", _hoisted_7, [ createVNode(unref(Button$1), { size: "small", danger: "", type: "primary", shape: "circle", icon: h$1(unref(CloseOutlined)), onClick: ($event) => removeReplaceItem(index2) }, null, 8, ["icon", "onClick"]) ]) ]) ]); }), 128)) ]), createBaseVNode("div", _hoisted_8, [ createVNode(unref(Button$1), { size: "small", icon: h$1(unref(PlusOutlined)), onClick: addReplaceItem, type: "primary" }, { default: withCtx(() => _cache[4] || (_cache[4] = [ createTextVNode("增加替换规则") ])), _: 1, __: [4] }, 8, ["icon"]), unref(store).bean.book.replaceRules.length > 0 ? (openBlock(), createBlock(unref(Button$1), { key: 0, size: "small", type: "primary", danger: "", icon: h$1(unref(CloseOutlined)), onClick: removeReplaceItemAll }, { default: withCtx(() => _cache[5] || (_cache[5] = [ createTextVNode("删除全部") ])), _: 1, __: [5] }, 8, ["icon"])) : createCommentVNode("", true) ]) ]); }; } }; const ReplaceList = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-1c212655"]]); const _sfc_main$6 = { __name: "SetupsModal", props: { data: Array }, setup(__props, { expose: __expose }) { const store = useStore(); const visible = ref(false); const operateFormRef = ref(null); const activeKey = ref("1"); function show() { visible.value = true; } function onSetupOk() { store.updateSetupsModal(operateFormRef.value.getData()); visible.value = false; } __expose({ show }); onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(Modal), { width: "600px", open: visible.value, "onUpdate:open": _cache[1] || (_cache[1] = ($event) => visible.value = $event), title: "设置", wrapClassName: "___wrap-modal___", onOk: onSetupOk }, { default: withCtx(() => [ createVNode(unref(Tabs), { activeKey: activeKey.value, "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event) }, { default: withCtx(() => [ createVNode(unref(Tabs).TabPane, { key: "1", tab: "基础操作设置" }, { default: withCtx(() => [ createVNode(OperateForm, { ref_key: "operateFormRef", ref: operateFormRef }, null, 512) ]), _: 1 }), createVNode(unref(Tabs).TabPane, { key: "2", tab: "正文替换规则" }, { default: withCtx(() => [ createVNode(ReplaceList) ]), _: 1 }) ]), _: 1 }, 8, ["activeKey"]) ]), _: 1 }, 8, ["open"]); }; } }; const _sfc_main$5 = {}; const _hoisted_1$4 = { class: "___svg-icon___", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }; function _sfc_render$2(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [ createBaseVNode("path", { class: "___path___", d: "M973.024495 273.115429q22.820571 32.548571 10.313143 73.728l-157.110857 517.705143q-10.825143 36.571429-43.739429 61.44t-69.997714 24.868571l-527.433143 0q-44.032 0-84.845714-30.573714t-56.832-75.117714q-13.677714-38.253714-1.170286-72.557714 0-2.267429 1.682286-15.433143t2.267429-21.138286q0.585143-4.534857-1.682286-12.288t-1.682286-11.117714q1.170286-6.290286 4.534857-11.995429t9.435429-13.458286 9.435429-13.458286q13.165714-21.723429 25.746286-52.297143t17.115429-52.297143q1.682286-5.705143 0.292571-17.115429t-0.292571-16.018286q1.682286-6.290286 9.728-16.018286t9.728-13.165714q11.995429-20.553143 23.990857-52.589714t14.262857-51.419429q0.585143-5.12-1.462857-18.285714t0.292571-16.018286q2.267429-7.460571 12.580571-17.408t12.580571-12.873143q10.825143-14.848 24.283429-48.274286t15.725714-55.149714q0.585143-4.534857-1.682286-14.555429t-1.170286-15.140571q1.170286-4.534857 5.12-10.313143t10.313143-13.165714 9.728-11.995429q4.534857-6.875429 9.435429-17.408t8.557714-19.968 9.142857-20.553143 11.117714-18.285714 15.140571-13.458286 20.553143-6.582857 27.136 3.145143l-0.585143 1.682286q21.723429-5.12 29.110857-5.12l434.834286 0q42.276571 0 65.170286 32.036571t10.313143 74.313143l-156.598857 517.705143q-20.553143 68.022857-40.886857 87.698286t-73.435429 19.748571l-496.566857 0q-15.433143 0-21.723429 8.557714-6.290286 9.142857-0.585143 24.576 13.677714 40.009143 82.285714 40.009143l527.433143 0q16.603429 0 32.036571-8.850286t19.968-23.698286l171.446857-564.004571q4.022857-12.580571 2.852571-32.548571 21.723429 8.557714 33.718857 24.576zM364.987924 274.285714q-2.267429 7.460571 1.170286 12.873143t11.410286 5.412571l347.428571 0q7.460571 0 14.555429-5.412571t9.435429-12.873143l11.995429-36.571429q2.267429-7.460571-1.170286-12.873143t-11.410286-5.412571l-347.428571 0q-7.460571 0-14.555429 5.412571t-9.435429 12.873143zM317.591352 420.571429q-2.267429 7.460571 1.170286 12.873143t11.410286 5.412571l347.428571 0q7.460571 0 14.555429-5.412571t9.435429-12.873143l11.995429-36.571429q2.267429-7.460571-1.170286-12.873143t-11.410286-5.412571l-347.428571 0q-7.460571 0-14.555429 5.412571t-9.435429 12.873143z" }, null, -1) ])); } const IconBook = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2], ["__scopeId", "data-v-6f5f5641"]]); const _sfc_main$4 = {}; const _hoisted_1$3 = { class: "___svg-icon___", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }; function _sfc_render$1(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [ createBaseVNode("path", { class: "___path___", d: "M482.88 112l-17.28 90.688-20.64 4.512a309.696 309.696 0 0 0-99.776 41.088l-18.688 11.84-73.28-55.04-44.64 44.64 51.904 76.416-11.392 17.76a310.016 310.016 0 0 0-41.568 99.584l-4.8 21.6-90.72 12.896v63.104l90.688 17.312 4.512 20.64a309.984 309.984 0 0 0 41.088 99.776l11.84 18.688-55.04 73.28 44.64 44.64 76.416-51.904 17.76 11.392a310.016 310.016 0 0 0 99.584 41.568l21.6 4.8 12.896 90.72h63.104l17.312-90.688 20.64-4.512a309.984 309.984 0 0 0 99.776-41.088l18.688-11.84 73.28 55.04 44.64-44.64-51.904-76.416 11.392-17.76a310.016 310.016 0 0 0 41.568-99.584l4.8-21.6 90.72-12.896V482.88l-90.688-17.312-4.512-20.64a309.984 309.984 0 0 0-41.088-99.776l-11.84-18.688 55.04-73.28-44.64-44.64-76.416 51.904-17.76-11.392a310.144 310.144 0 0 0-99.584-41.568l-21.6-4.8-12.896-90.72H482.88zM410.56 149.856l19.424-101.856h171.584l14.624 102.624c28 8.064 54.848 19.328 80.128 33.568l85.792-58.304 121.344 121.344-62.272 82.88c14.08 25.408 25.152 52.352 32.96 80.416l101.888 19.424v171.584l-102.624 14.624a373.92 373.92 0 0 1-33.568 80.128l58.304 85.792-121.344 121.344-82.88-62.272c-25.408 14.08-52.352 25.152-80.416 32.96l-19.424 101.888h-171.584l-14.624-102.624a373.92 373.92 0 0 1-80.128-33.568L241.92 898.112l-121.344-121.344 62.272-82.88a373.824 373.824 0 0 1-32.96-80.416L48 594.048v-171.584l102.624-14.624c8.064-27.968 19.328-54.848 33.568-80.128L125.888 241.92l121.344-121.344 82.88 62.272a373.856 373.856 0 0 1 80.416-32.96z" }, null, -1), createBaseVNode("path", { class: "___path___", d: "M512 704a192 192 0 1 1 0-384 192 192 0 0 1 0 384z m0-64a128 128 0 1 0 0-256 128 128 0 0 0 0 256z" }, null, -1) ])); } const IconSetup = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-ec40ad8f"]]); const _sfc_main$3 = {}; const _hoisted_1$2 = { class: "___svg-icon___", viewBox: "0 0 1170 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }; function _sfc_render(_ctx, _cache) { return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [ createStaticVNode('<path class="___path___" d="M507.201829 25.044114c18.929371 0 34.523429 14.394514 36.395885 32.855772l0.175543 3.715657v905.157486h-73.142857V98.186971h-89.000229v868.586058h-73.142857V61.615543c0-18.929371 14.394514-34.523429 32.855772-36.366629l3.744914-0.2048h162.113829z" data-v-22ae5d75></path><path class="___path___" d="M462.701714 206.584686v350.237257h-73.142857V206.613943zM903.168 1002.642286l173.992229-31.597715a36.571429 36.571429 0 0 0 29.403428-42.715428L966.626743 182.564571a36.571429 36.571429 0 0 0-42.481372-29.198628l-173.992228 31.597714a36.571429 36.571429 0 0 0-29.403429 42.715429l139.936915 745.764571a36.571429 36.571429 0 0 0 42.481371 29.198629z m124.7232-96.987429l-102.019657 18.549029-126.390857-673.821257 101.9904-18.549029 126.420114 673.821257z" data-v-22ae5d75></path><path class="___path___" d="M921.951086 424.023771l55.296 294.590172-71.8848 13.487543-55.296-294.590172zM264.689371 325.749029v73.142857H156.584229v-73.142857zM264.689371 416.5632v73.142857H156.584229v-73.142857zM264.689371 503.222857v73.142857H156.584229v-73.142857z" data-v-22ae5d75></path><path class="___path___" d="M264.689371 195.437714v73.142857H129.024v635.026286h-73.142857V232.0384c0-18.958629 14.394514-34.523429 32.855771-36.395886l3.744915-0.175543h172.207542zM1149.015771 926.281143v73.142857H0v-73.142857z" data-v-22ae5d75></path><path class="___path___" d="M779.527314 414.573714c18.958629 0 34.523429 14.365257 36.395886 32.826515l0.175543 3.715657v515.657143h-73.142857V487.687314h-155.530972v-73.142857h192.1024z" data-v-22ae5d75></path><path class="___path___" d="M728.707657 519.168h-156.613486v246.052571h156.613486v-246.052571z m-73.172114 73.1136v99.796114h-10.298514v-99.796114h10.298514z" data-v-22ae5d75></path>', 6) ])); } const IconBookList = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render], ["__scopeId", "data-v-22ae5d75"]]); const _hoisted_1$1 = { class: "___footer___" }; const _hoisted_2 = { class: "___box___" }; const _hoisted_3 = { class: "___operate___" }; const _hoisted_4 = { class: "___info___" }; const _hoisted_5 = { class: "___name___" }; const _hoisted_6 = { class: "___tools___" }; const _sfc_main$2 = { __name: "Footer", setup(__props) { const store = useStore(); const modal = ref(null); const bookName = computed(() => { if (store.getBook) { return store.getBook.book.title + " (" + store.getBook.book.name + ")"; } }); const hasPrev = computed(() => { if (store.getBook) { return store.pageMode === "read" && !!store.getBook.valueMap.preValue; } }); const hasNext = computed(() => { if (store.getBook) { return store.pageMode === "read" && !!store.getBook.valueMap.nextValue; } }); const openSetup = () => { modal.value.show(); }; const prePage = () => { store.prePage(); }; const nextPage = () => { store.nextPage(); }; const backIndex = () => { store.backIndex(); }; const backRead = () => { store.backRead(); }; const openBookList = () => { store.openBookList(); }; onMounted(() => { }); return (_ctx, _cache) => { return openBlock(), createElementBlock(Fragment, null, [ createBaseVNode("div", _hoisted_1$1, [ createBaseVNode("div", _hoisted_2, [ createBaseVNode("div", _hoisted_3, [ hasPrev.value ? (openBlock(), createElementBlock("div", { key: 0, class: "___btn___", onClick: prePage }, "上一页")) : createCommentVNode("", true), hasNext.value ? (openBlock(), createElementBlock("div", { key: 1, class: "___btn___", onClick: nextPage }, "下一页")) : createCommentVNode("", true), unref(store).getBook && unref(store).pageMode !== "index" ? (openBlock(), createElementBlock("div", { key: 2, class: "___btn___", onClick: backIndex }, "返回目录")) : createCommentVNode("", true), unref(store).getBook && (unref(store).pageMode === "index" || unref(store).pageMode === "bookList") ? (openBlock(), createElementBlock("div", { key: 3, class: "___btn___", onClick: backRead }, "返回阅读")) : createCommentVNode("", true) ]), createBaseVNode("div", _hoisted_4, [ createBaseVNode("div", _hoisted_5, toDisplayString(bookName.value), 1) ]), createBaseVNode("div", _hoisted_6, [ createBaseVNode("div", { class: "___icon___", title: "书架", onClick: openBookList }, [ createVNode(unref(IconBookList)) ]), createBaseVNode("div", { class: "___icon___", title: "设置", onClick: openSetup }, [ createVNode(unref(IconSetup)) ]) ]) ]) ]), createVNode(_sfc_main$6, { ref_key: "modal", ref: modal }, null, 512) ], 64); }; } }; const Footer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-56b53ae7"]]); const _hoisted_1 = { key: 0, class: "___loading___" }; const _sfc_main$1 = { __name: "ReadBox", setup(__props) { const store = useStore(); const wrap = ref(null); const { wrapStyle, moveStart, resizeStart, onMouseEnterByWrap, onMouseleaveByWrap } = useMove(wrap, store.bean.style, store); const bgStyle = computed(() => { if (store.bean.book.style) { return { opacity: store.bean.book.style.opacity, background: store.bean.book.style.background }; } return { opacity: 1, background: "#fff" }; }); onMounted(() => { store.readBook(); }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(["___read-wrap___", { "___hover-resize___": unref(store).hoverResizeFlag, "___hover-move___": unref(store).hoverHeadFlag }]), style: normalizeStyle$1(unref(wrapStyle)), ref_key: "wrap", ref: wrap, onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(onMouseEnterByWrap) && unref(onMouseEnterByWrap)(...args)), onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(onMouseleaveByWrap) && unref(onMouseleaveByWrap)(...args)) }, [ unref(store).pageMode === "read" ? (openBlock(), createElementBlock("div", { key: 0, class: "bg", style: normalizeStyle$1(bgStyle.value) }, null, 4)) : createCommentVNode("", true), createVNode(Header, { moveStart: unref(moveStart), resizeStart: unref(resizeStart) }, null, 8, ["moveStart", "resizeStart"]), unref(store).pageMode === "bookList" ? (openBlock(), createBlock(BookList, { key: 1 })) : (openBlock(), createBlock(ReadMain, { key: 2 })), createVNode(Transition, { name: "fade" }, { default: withCtx(() => [ unref(store).loading ? (openBlock(), createElementBlock("div", _hoisted_1, [ createVNode(unref(Skeleton), { active: "" }) ])) : createCommentVNode("", true) ]), _: 1 }), unref(store).errorMsg ? (openBlock(), createBlock(ErrorMsg, { key: 3 })) : createCommentVNode("", true), createVNode(Footer), createVNode(ResizeSize) ], 38); }; } }; const ReadBox = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0096aa60"]]); const locale$2 = { locale: "zh_CN", today: "今天", now: "此刻", backToToday: "返回今天", ok: "确定", timeSelect: "选择时间", dateSelect: "选择日期", weekSelect: "选择周", clear: "清除", month: "月", year: "年", previousMonth: "上个月 (翻页上键)", nextMonth: "下个月 (翻页下键)", monthSelect: "选择月份", yearSelect: "选择年份", decadeSelect: "选择年代", yearFormat: "YYYY年", dayFormat: "D日", dateFormat: "YYYY年M月D日", dateTimeFormat: "YYYY年M月D日 HH时mm分ss秒", previousYear: "上一年 (Control键加左方向键)", nextYear: "下一年 (Control键加右方向键)", previousDecade: "上一年代", nextDecade: "下一年代", previousCentury: "上一世纪", nextCentury: "下一世纪" }; const locale$1 = { placeholder: "请选择时间", rangePlaceholder: ["开始时间", "结束时间"] }; const locale = { lang: _extends$1({ placeholder: "请选择日期", yearPlaceholder: "请选择年份", quarterPlaceholder: "请选择季度", monthPlaceholder: "请选择月份", weekPlaceholder: "请选择周", rangePlaceholder: ["开始日期", "结束日期"], rangeYearPlaceholder: ["开始年份", "结束年份"], rangeMonthPlaceholder: ["开始月份", "结束月份"], rangeQuarterPlaceholder: ["开始季度", "结束季度"], rangeWeekPlaceholder: ["开始周", "结束周"] }, locale$2), timePickerLocale: _extends$1({}, locale$1) }; locale.lang.ok = "确定"; const typeTemplate = "${label}不是一个有效的${type}"; const localeValues = { locale: "zh-cn", Pagination, DatePicker: locale, TimePicker: locale$1, Calendar: locale, // locales for all components global: { placeholder: "请选择" }, Table: { filterTitle: "筛选", filterConfirm: "确定", filterReset: "重置", filterEmptyText: "无筛选项", filterCheckall: "全选", filterSearchPlaceholder: "在筛选项中搜索", selectAll: "全选当页", selectInvert: "反选当页", selectNone: "清空所有", selectionAll: "全选所有", sortTitle: "排序", expand: "展开行", collapse: "关闭行", triggerDesc: "点击降序", triggerAsc: "点击升序", cancelSort: "取消排序" }, Tour: { Next: "下一步", Previous: "上一步", Finish: "结束导览" }, Modal: { okText: "确定", cancelText: "取消", justOkText: "知道了" }, Popconfirm: { cancelText: "取消", okText: "确定" }, Transfer: { searchPlaceholder: "请输入搜索内容", itemUnit: "项", itemsUnit: "项", remove: "删除", selectCurrent: "全选当页", removeCurrent: "删除当页", selectAll: "全选所有", removeAll: "删除全部", selectInvert: "反选当页" }, Upload: { uploading: "文件上传中", removeFile: "删除文件", uploadError: "上传错误", previewFile: "预览文件", downloadFile: "下载文件" }, Empty: { description: "暂无数据" }, Icon: { icon: "图标" }, Text: { edit: "编辑", copy: "复制", copied: "复制成功", expand: "展开" }, PageHeader: { back: "返回" }, Form: { optional: "(可选)", defaultValidateMessages: { default: "字段验证错误${label}", required: "请输入${label}", enum: "${label}必须是其中一个[${enum}]", whitespace: "${label}不能为空字符", date: { format: "${label}日期格式无效", parse: "${label}不能转换为日期", invalid: "${label}是一个无效日期" }, types: { string: typeTemplate, method: typeTemplate, array: typeTemplate, object: typeTemplate, number: typeTemplate, date: typeTemplate, boolean: typeTemplate, integer: typeTemplate, float: typeTemplate, regexp: typeTemplate, email: typeTemplate, url: typeTemplate, hex: typeTemplate }, string: { len: "${label}须为${len}个字符", min: "${label}最少${min}个字符", max: "${label}最多${max}个字符", range: "${label}须在${min}-${max}字符之间" }, number: { len: "${label}必须等于${len}", min: "${label}最小值为${min}", max: "${label}最大值为${max}", range: "${label}须在${min}-${max}之间" }, array: { len: "须为${len}个${label}", min: "最少${min}个${label}", max: "最多${max}个${label}", range: "${label}数量须在${min}-${max}之间" }, pattern: { mismatch: "${label}与模式不匹配${pattern}" } } }, Image: { preview: "预览" }, QRCode: { expired: "二维码已过期", refresh: "点击刷新", scanned: "已扫描" } }; const _sfc_main = { __name: "App", setup(__props) { const locale2 = ref(localeValues); const store = useStore(); const showBook = computed(() => { return store.bean.showBook; }); const vBody = { mounted(el) { document.body.appendChild(el); }, beforeUnmount(el) { if (el.parentNode === document.body) { document.body.removeChild(el); } } }; function showBookFn() { store.showBook(); } onMounted(() => { store.initWindow(); window.addEventListener("resize", (e2) => { store.initWindow(); }); }); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ConfigProvider), { locale: locale2.value }, { default: withCtx(() => [ withDirectives(createVNode(ReadBox, null, null, 512), [ [vShow, showBook.value] ]), withDirectives((openBlock(), createElementBlock("div", { class: "___showBtn___", onClick: withModifiers(showBookFn, ["stop"]) }, [ createVNode(unref(IconBook)) ])), [ [vShow, !showBook.value], [vBody] ]) ]), _: 1 }, 8, ["locale"]); }; } }; const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-457c95a3"]]); const pinia = createPinia(); createApp(App).use(pinia).mount( (() => { const app = document.createElement("div"); app.classList.add("___read-box___"); document.body.append(app); return app; })() ); } }); require_main_001(); })();