// ==UserScript== // @name ptools-vite // @namespace http://tampermonkey.net/ // @version 2023.09.06.1 // @author ngfchl // @icon https://vitejs.dev/logo.svg // @match https://ptchdbits.co/* // @match https://www.gamegamept.com/* // @match https://www.ptlsp.com/* // @match https://ptcafe.club/* // @match https://shadowflow.org/* // @match https://rousi.zip/* // @match https://www.torrentleech.org/* // @match https://hd-space.org/* // @match https://www.biho.xyz/* // @match https://pt.dhtclub.com/* // @match https://ubits.club/* // @match https://kufei.org/* // @match https://pandapt.net/* // @match https://www.okpt.net/* // @match https://share.ilolicon.com/* // @match https://hdfun.me/* // @match http://hdfun.me/* // @match https://wukongwendao.top/* // @match https://1ptba.com/* // @match https://52pt.site/* // @match https://audiences.me/* // @match https://byr.pt/* // @match https://ccfbits.org/* // @match https://club.hares.top/* // @match https://discfan.net/* // @match https://et8.org/* // @match https://filelist.io/* // @match https://hdatmos.club/* // @match https://hdchina.org/* // @match https://hdcity.leniter.org/* // @match https://hdhome.org/* // @match https://hdmayi.com/* // @match https://hdsky.me/* // @match https://hdtime.org/* // @match https://hudbt.hust.edu.cn/* // @match https://iptorrents.com/t // @match https://xp.m-team.io/* // @match https://lemonhd.org/* // @match https://nanyangpt.com/* // @match https://npupt.com/* // @match https://ourbits.club/* // @match https://pt.btschool.club/* // @match https://pt.eastgame.org/* // @match https://pt.hdbd.us/* // @match https://pt.keepfrds.com/* // @match https://pterclub.com/* // @match https://pthome.net/* // @match https://springsunday.net/* // @match https://totheglory.im/* // @match https://u2.dmhy.org/* // @match https://www.beitai.pt/* // @match https://www.haidan.video/userdetails.php?id=* // @match https://www.haidan.video/usercp.php // @match https://hdarea.club/* // @match https://www.hddolby.com/* // @match https://www.htpt.cc/* // @match https://www.nicept.net/* // @match https://www.pttime.org // @match https://www.tjupt.org/* // @match https://www.torrentleech.org // @match https://www.carpet.net/* // @match https://wintersakura.net/* // @match https://hhanclub.top/* // @match https://www.hdpt.xyz/* // @match https://ptchina.org/* // @match http://www.oshen.win/* // @match https://www.hd.ai/* // @match http://ihdbits.me/* // @match https://zmpt.cc/* // @match https://leaves.red/* // @match https://piggo.me/* // @match https://pt.2xfree.org/* // @match https://sharkpt.net/* // @match https://www.dragonhd.xyz/* // @match https://oldtoons.world/* // @match http://hdmayi.com/* // @match https://www.3wmg.com/* // @match https://carpt.net/* // @match https://pt.0ff.cc/* // @match https://hdpt.xyz/* // @match https://azusa.wiki/* // @match https://pt.itzmx.com/* // @match https://gamegamept.cn/* // @match https://srvfi.top/* // @match https://www.icc2022.com/* // @match http://leaves.red/* // @match https://xingtan.one/* // @match http://uploads.ltd/* // @match https://cyanbug.net/* // @match https://ptsbao.club/* // @match https://greatposterwall.com/* // @match https://gainbound.net/* // @match http://hdzone.me/* // @match https://www.pttime.org/* // @match https://pt.msg.vg/* // @match https://pt.soulvoice.club/* // @match https://www.hitpt.com/* // @match https://hdfans.org/* // @match https://www.joyhd.net/* // @match https://hdzone.me/* // @match https://reelflix.xyz/* // @match https://pt.hdpost.top/* // @match https://monikadesign.uk/* // @match https://exoticaz.to/* // @match https://cinemaz.to/* // @match https://avistaz.to/* // @match https://iptorrents.com/* // @match https://pt.hdupt.com/* // @match https://www.oshen.win/* // @match https://hdcity.city/* // @match https://hdvideo.one/* // @match https://chdbits.co/* // @match https://kamept.com/* // @match https://ultrahd.net/* // @match http://pt.tu88.men/* // @match https://pt.hd4fans.org/* // @match https://hd-torrents.org/* // @match https://fsm.name/* // @match https://dajiao.cyou/* // @match https://hudbt.hust.edu.cn/* // @match https://dicmusic.com/* // @match https://open.cd/* // @match https://www.open.cd/* // @require https://cdn.jsdelivr.net/npm/vue@3.3.4/dist/vue.global.prod.js // @grant GM_addStyle // @grant GM_cookie // @grant GM_xmlhttpRequest // @description PT站点cookie等信息发送到Ptools // @downloadURL none // ==/UserScript== (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const e=document.createElement("style");e.textContent=t,document.head.append(e)})(' #app{padding:2rem;text-align:center;position:fixed;top:0;z-index:9999;width:100px;margin-right:0;margin-left:0;margin-top:240px;float:left;opacity:.8;font-size:12px;background-color:#fff}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}.wrap[data-v-05d5b1fd]{position:fixed;top:0;z-index:99999;width:110px;margin-right:0;margin-left:0;margin-top:240px;float:left;opacity:.8;font-size:12px;background-color:#fff}.wrap[data-v-05d5b1fd]:hover{opacity:1}.wrap>img[data-v-05d5b1fd],.image[data-v-05d5b1fd]{border-radius:2px;width:100%} '); (function (vue) { '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-8c678ed8.js"(exports, module) { 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(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== void 0) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _toPropertyKey(arg) { var key2 = _toPrimitive(arg, "string"); return _typeof$1(key2) === "symbol" ? key2 : String(key2); } function _defineProperty$q(obj, key2, value) { key2 = _toPropertyKey(key2); if (key2 in obj) { Object.defineProperty(obj, key2, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key2] = value; } return obj; } 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$q(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() { _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); } const isFunction$1 = (val) => typeof val === "function"; const isArray$2 = Array.isArray; const isString = (val) => typeof val === "string"; const isObject$1 = (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$a = Object.prototype.hasOwnProperty; const hasOwn = (val, key2) => hasOwnProperty$a.call(val, key2); function resolvePropValue(options, props, 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(props, key2) && !hasDefault) { value = false; } else if (value === "") { value = true; } } } return value; } function getDataAndAriaProps(props) { return Object.keys(props).reduce((memo, key2) => { if (key2.startsWith("data-") || key2.startsWith("aria-")) { memo[key2] = props[key2]; } return memo; }, {}); } function renderHelper(v2) { let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let defaultV = arguments.length > 2 ? arguments[2] : void 0; if (typeof v2 === "function") { return v2(props); } return v2 !== null && v2 !== void 0 ? v2 : defaultV; } function wrapPromiseFn(openFn) { let closeFn; const closePromise = new Promise((resolve) => { closeFn = openFn(() => { resolve(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$2(value)) { for (let i3 = 0; i3 < value.length; i3++) { const inner = classNames(value[i3]); if (inner) { classes.push(inner); } } } else if (isObject$1(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, props) { for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { var key2 = _a[_i]; Object.defineProperty(target, key2, { value: props[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 */ function() { function ResizeObserverEntry2(target, rectInit) { var contentRect = createReadOnlyRect(rectInit); defineConfigurable(this, { target, contentRect }); } return ResizeObserverEntry2; }() ); var ResizeObserverSPI = ( /** @class */ function() { function ResizeObserverSPI2(callback, controller, callbackCtx) { this.activeObservations_ = []; this.observations_ = new MapShim(); if (typeof callback !== "function") { throw new TypeError("The callback provided as parameter 1 is not a function."); } this.callback_ = callback; this.controller_ = controller; this.callbackCtx_ = callbackCtx; } ResizeObserverSPI2.prototype.observe = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (observations.has(target)) { return; } observations.set(target, new ResizeObservation(target)); this.controller_.addObserver(this); this.controller_.refresh(); }; ResizeObserverSPI2.prototype.unobserve = function(target) { if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } if (typeof Element === "undefined" || !(Element instanceof Object)) { return; } if (!(target instanceof getWindowOf(target).Element)) { throw new TypeError('parameter 1 is not of type "Element".'); } var observations = this.observations_; if (!observations.has(target)) { return; } observations.delete(target); if (!observations.size) { this.controller_.removeObserver(this); } }; ResizeObserverSPI2.prototype.disconnect = function() { this.clearActive(); this.observations_.clear(); this.controller_.removeObserver(this); }; ResizeObserverSPI2.prototype.gatherActive = function() { var _this = this; this.clearActive(); this.observations_.forEach(function(observation) { if (observation.isActive()) { _this.activeObservations_.push(observation); } }); }; ResizeObserverSPI2.prototype.broadcastActive = function() { if (!this.hasActive()) { return; } var ctx = this.callbackCtx_; var entries = this.activeObservations_.map(function(observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx, entries, ctx); this.clearActive(); }; ResizeObserverSPI2.prototype.clearActive = function() { this.activeObservations_.splice(0); }; ResizeObserverSPI2.prototype.hasActive = function() { return this.activeObservations_.length > 0; }; return ResizeObserverSPI2; }() ); var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim(); var ResizeObserver$2 = ( /** @class */ function() { function ResizeObserver2(callback) { if (!(this instanceof ResizeObserver2)) { throw new TypeError("Cannot call a class as a function."); } if (!arguments.length) { throw new TypeError("1 argument required, but only 0 present."); } var controller = ResizeObserverController.getInstance(); var observer = new ResizeObserverSPI(callback, controller, this); observers.set(this, observer); } return ResizeObserver2; }() ); [ "observe", "unobserve", "disconnect" ].forEach(function(method) { ResizeObserver$2.prototype[method] = function() { var _a; return (_a = observers.get(this))[method].apply(_a, arguments); }; }); var index = function() { if (typeof global$1.ResizeObserver !== "undefined") { return global$1.ResizeObserver; } return ResizeObserver$2; }(); const isValid = (value) => { return value !== void 0 && value !== null && value !== ""; }; const isValid$1 = isValid; const initDefaultProps = (types, defaultProps) => { const propTypes = _extends({}, types); 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 initDefaultProps$1 = initDefaultProps; 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 === vue.Fragment) { if (child.key === skipFlattenKey) { res.push(child); } else { res.push(...flattenChildren(child.children, filterEmpty2)); } } else if (child && vue.isVNode(child)) { if (filterEmpty2 && !isEmptyElement(child)) { res.push(child); } else if (!filterEmpty2) { res.push(child); } } else if (isValid$1(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 (vue.isVNode(self2)) { if (self2.type === vue.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 props = instance.$.vnode.props || {}; Object.keys(instance.$props).forEach((k2) => { const v2 = instance.$props[k2]; const hyphenateKey = hyphenate(k2); if (v2 !== void 0 || hyphenateKey in props) { res[k2] = v2; } }); } else if (vue.isVNode(instance) && typeof instance.type === "object") { const originProps = instance.props || {}; const props = {}; Object.keys(originProps).forEach((key2) => { props[camelize(key2)] = originProps[key2]; }); const options = instance.type.props || {}; Object.keys(options).forEach((k2) => { const v2 = resolvePropValue(options, props, k2, props[k2]); if (v2 !== void 0 || k2 in props) { 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 (vue.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 === vue.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 props = {}; if (ele.$) { props = _extends(_extends({}, props), ele.$attrs); } else { props = _extends(_extends({}, props), ele.props); } return splitAttrs(props)[on ? "onEvents" : "events"]; } function getStyle$1(ele, camel) { const props = (vue.isVNode(ele) ? ele.props : ele.$attrs) || {}; let style2 = props.style || {}; if (typeof style2 === "string") { style2 = parseStyleText(style2, camel); } else if (camel && style2) { const res = {}; Object.keys(style2).forEach((k2) => res[camelize(k2)] = style2[k2]); return res; } return style2; } function isFragment(c2) { return c2.length === 1 && c2[0].type === vue.Fragment; } function isEmptyElement(c2) { return c2 && (c2.type === vue.Comment || c2.type === vue.Fragment && c2.children.length === 0 || c2.type === vue.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) === vue.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, props) { let prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default"; var _a, _b; return (_a = props[prop]) !== null && _a !== void 0 ? _a : (_b = slots[prop]) === null || _b === void 0 ? void 0 : _b.call(slots); } const ResizeObserver$1 = vue.defineComponent({ compatConfig: { MODE: 3 }, name: "ResizeObserver", props: { disabled: Boolean, onResize: Function }, emits: ["resize"], setup(props, _ref) { let { slots } = _ref; const state = vue.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 } = props; 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(state, size); if (onResize2) { Promise.resolve().then(() => { onResize2(_extends(_extends({}, size), { offsetWidth, offsetHeight }), target); }); } } }; const instance = vue.getCurrentInstance(); const registerObserver = () => { const { disabled } = props; 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); } }; vue.onMounted(() => { registerObserver(); }); vue.onUpdated(() => { registerObserver(); }); vue.onUnmounted(() => { destroyObserver(); }); vue.watch(() => props.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 required ? type : type; } function arrayType(defaultVal) { return { type: Array, default: defaultVal }; } function stringType(defaultVal) { return { type: String, default: defaultVal }; } function someType(types, defaultVal) { return types ? { type: types, 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) { } const supportsPassive$1 = supportsPassive; function addEventListenerWrap(target, eventType2, cb, option) { if (target && target.addEventListener) { let opt = option; if (opt === void 0 && supportsPassive$1 && (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) => { vue.provide(GlobalFormContextKey, state); }; 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() }); const configProviderKey = Symbol("configProvider"); const defaultConfigProvider = { getPrefixCls: (suffixCls, customizePrefixCls) => { if (customizePrefixCls) return customizePrefixCls; return suffixCls ? `ant-${suffixCls}` : "ant"; }, iconPrefixCls: vue.computed(() => defaultIconPrefixCls), getPopupContainer: vue.computed(() => () => document.body), direction: vue.computed(() => "ltr") }; const useConfigContextInject = () => { return vue.inject(configProviderKey, defaultConfigProvider); }; const useConfigContextProvider = (props) => { return vue.provide(configProviderKey, props); }; const DisabledContextKey = Symbol("DisabledContextKey"); const useInjectDisabled = () => { return vue.inject(DisabledContextKey, vue.ref(void 0)); }; const useProviderDisabled = (disabled) => { const parentDisabled = useInjectDisabled(); vue.provide(DisabledContextKey, vue.computed(() => { var _a; return (_a = disabled.value) !== null && _a !== void 0 ? _a : parentDisabled.value; })); return disabled; }; const enUS$1 = { // 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$3 = { 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 CalendarLocale = locale$3; const locale$2 = { placeholder: "Select time", rangePlaceholder: ["Start time", "End time"] }; const TimePicker = locale$2; const locale$1 = { lang: _extends({ 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"] }, CalendarLocale), timePickerLocale: _extends({}, TimePicker) }; const enUS = locale$1; const typeTemplate = "${label} is not a valid ${type}"; const localeValues = { locale: "en", Pagination: enUS$1, DatePicker: enUS, TimePicker, Calendar: enUS, 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, 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} 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" } }; const defaultLocale = localeValues; const LocaleReceiver = vue.defineComponent({ compatConfig: { MODE: 3 }, name: "LocaleReceiver", props: { componentName: String, defaultLocale: { type: [Object, Function] }, children: { type: Function } }, setup(props, _ref) { let { slots } = _ref; const localeData = vue.inject("localeData", {}); const locale2 = vue.computed(() => { const { componentName = "global", defaultLocale: defaultLocale$1 } = props; const locale3 = defaultLocale$1 || defaultLocale[componentName || "global"]; const { antLocale } = localeData; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; return _extends(_extends({}, typeof locale3 === "function" ? locale3() : locale3), localeFromContext || {}); }); const localeCode = vue.computed(() => { const { antLocale } = localeData; const localeCode2 = antLocale && antLocale.locale; if (antLocale && antLocale.exist && !localeCode2) { return defaultLocale.locale; } return localeCode2; }); return () => { const children = props.children || slots.default; const { antLocale } = localeData; return children === null || children === void 0 ? void 0 : children(locale2.value, localeCode.value, antLocale); }; } }); function useLocaleReceiver(componentName, defaultLocale$1, propsLocale) { const localeData = vue.inject("localeData", {}); const componentLocale = vue.computed(() => { const { antLocale } = localeData; const locale2 = vue.unref(defaultLocale$1) || defaultLocale[componentName || "global"]; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; return _extends(_extends(_extends({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {}), vue.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); } class Entity { constructor() { this.cache = /* @__PURE__ */ new Map(); } get(keys2) { return this.cache.get(Array.isArray(keys2) ? keys2.join("%") : keys2) || null; } update(keys2, valueFn) { const path = Array.isArray(keys2) ? keys2.join("%") : keys2; const prevValue = this.cache.get(path); const nextValue = valueFn(prevValue); if (nextValue === null) { this.cache.delete(path); } else { this.cache.set(path, nextValue); } } } const CacheEntity = Entity; const ATTR_TOKEN = "data-token-hash"; const ATTR_MARK = "data-css-hash"; const CSS_IN_JS_INSTANCE = "__cssinjs_instance__"; const CSS_IN_JS_INSTANCE_ID = Math.random().toString(12).slice(2); function createCache() { if (typeof document !== "undefined" && document.head && document.body) { const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || []; const { firstChild } = document.head; Array.from(styles).forEach((style2) => { style2[CSS_IN_JS_INSTANCE] = style2[CSS_IN_JS_INSTANCE] || CSS_IN_JS_INSTANCE_ID; document.head.insertBefore(style2, firstChild); }); const styleHash = {}; Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach((style2) => { var _a; const hash = style2.getAttribute(ATTR_MARK); if (styleHash[hash]) { if (style2[CSS_IN_JS_INSTANCE] === CSS_IN_JS_INSTANCE_ID) { (_a = style2.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style2); } } else { styleHash[hash] = true; } }); } return new CacheEntity(); } const StyleContextKey = Symbol("StyleContextKey"); const defaultStyleContext = { cache: createCache(), defaultCache: true, hashPriority: "low" }; const useStyleInject = () => { return vue.inject(StyleContextKey, vue.shallowRef(_extends({}, defaultStyleContext))); }; const useStyleProvider = (props) => { const parentContext = useStyleInject(); const context2 = vue.shallowRef(_extends({}, defaultStyleContext)); vue.watch([() => vue.unref(props), parentContext], () => { const mergedContext = _extends({}, parentContext.value); const propsValue = vue.unref(props); 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 }); vue.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