@gkd-kit/inspect 0.0.1752070310937 → 0.0.1753028381144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/404.html +3 -3
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-Ty29aYPP.js → ActionCard.vue_vue_type_script_setup_true_lang-B7S-VTA3.js} +2 -2
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-Ty29aYPP.js.map → ActionCard.vue_vue_type_script_setup_true_lang-B7S-VTA3.js.map} +1 -1
- package/dist/assets/{DevicePage-BdIyGBJk.js → DevicePage-BQttw_6E.js} +2 -2
- package/dist/assets/{DevicePage-BdIyGBJk.js.map → DevicePage-BQttw_6E.js.map} +1 -1
- package/dist/assets/{HomePage-yZHTOdMp.js → HomePage-D9Ik-HGs.js} +2 -2
- package/dist/assets/{HomePage-yZHTOdMp.js.map → HomePage-D9Ik-HGs.js.map} +1 -1
- package/dist/assets/{ImportPage-B4R4HC5V.js → ImportPage-BLF9OImk.js} +2 -2
- package/dist/assets/ImportPage-BLF9OImk.js.map +1 -0
- package/dist/assets/{Input-Bk8bdGMS.js → Input-CzEJSguQ.js} +2 -2
- package/dist/assets/{Input-Bk8bdGMS.js.map → Input-CzEJSguQ.js.map} +1 -1
- package/dist/assets/{SelectorPage-BlwOzYVI.js → SelectorPage-B27QFokd.js} +2 -2
- package/dist/assets/SelectorPage-B27QFokd.js.map +1 -0
- package/dist/assets/{SnapshotPage-DyUguSTB.js → SnapshotPage-BEzXjGby.js} +4 -4
- package/dist/assets/SnapshotPage-BEzXjGby.js.map +1 -0
- package/dist/assets/SnapshotPage-BrBfbf_-.css +1 -0
- package/dist/assets/{SvgPage-Be8ycG44.js → SvgPage-DwkvL-Gx.js} +2 -2
- package/dist/assets/SvgPage-DwkvL-Gx.js.map +1 -0
- package/dist/assets/{TrackGraph-Ob15lkU2.js → TrackGraph-q0uH8jpX.js} +3 -3
- package/dist/assets/{TrackGraph-Ob15lkU2.js.map → TrackGraph-q0uH8jpX.js.map} +1 -1
- package/dist/assets/{_404Page-CKvcJiRM.js → _404Page-DYpO65R_.js} +2 -2
- package/dist/assets/_404Page-DYpO65R_.js.map +1 -0
- package/dist/assets/chunk-DdgSTfiH.js +3 -0
- package/dist/assets/{chunk-CtRPo5RW.js.map → chunk-DdgSTfiH.js.map} +1 -1
- package/dist/assets/{dayjs.min-CyAldp6t.js → dayjs.min-CFH-tBEB.js} +2 -2
- package/dist/assets/{dayjs.min-CyAldp6t.js.map → dayjs.min-CFH-tBEB.js.map} +1 -1
- package/dist/assets/{error-DpTgrFm-.js → error-CJaI662_.js} +2 -2
- package/dist/assets/{error-DpTgrFm-.js.map → error-CJaI662_.js.map} +1 -1
- package/dist/assets/{import-CuhzaDuU.js → import-BcXe5qnO.js} +2 -2
- package/dist/assets/{import-CuhzaDuU.js.map → import-BcXe5qnO.js.map} +1 -1
- package/dist/assets/{index-9mQFtWcN.js → index-Bt3DBEMh.js} +7 -7
- package/dist/assets/{index-9mQFtWcN.js.map → index-Bt3DBEMh.js.map} +1 -1
- package/dist/assets/{index-BQMm0AFu.js → index-DSzD-9Kt.js} +3 -3
- package/dist/assets/{index-BQMm0AFu.js.map → index-DSzD-9Kt.js.map} +1 -1
- package/dist/assets/{jszip.min-DdPYUj_o.js → jszip.min-C_1FOOoT.js} +2 -2
- package/dist/assets/{jszip.min-DdPYUj_o.js.map → jszip.min-C_1FOOoT.js.map} +1 -1
- package/dist/assets/{node-DBRfL1Df.js → node-MBU4fJb_.js} +2 -2
- package/dist/assets/{node-DBRfL1Df.js.map → node-MBU4fJb_.js.map} +1 -1
- package/dist/assets/{snapshot-BsGby2EL.js → snapshot-D6DjTREF.js} +2 -2
- package/dist/assets/{snapshot-BsGby2EL.js.map → snapshot-D6DjTREF.js.map} +1 -1
- package/dist/assets/{table-BkCrffsZ.js → table-B3igD-SS.js} +2 -2
- package/dist/assets/{table-BkCrffsZ.js.map → table-B3igD-SS.js.map} +1 -1
- package/dist/index.html +3 -3
- package/package.json +2 -2
- package/dist/assets/ImportPage-B4R4HC5V.js.map +0 -1
- package/dist/assets/SelectorPage-BlwOzYVI.js.map +0 -1
- package/dist/assets/SnapshotPage-DYZIR4dQ.css +0 -1
- package/dist/assets/SnapshotPage-DyUguSTB.js.map +0 -1
- package/dist/assets/SvgPage-Be8ycG44.js.map +0 -1
- package/dist/assets/_404Page-CKvcJiRM.js.map +0 -1
- package/dist/assets/chunk-CtRPo5RW.js +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{bN as T,a_ as w,bO as k,bP as U,b7 as G,bQ as E,aO as x,aN as q,aM as S,bE as y}from"./index-
|
|
1
|
+
import{bN as T,a_ as w,bO as k,bP as U,b7 as G,bQ as E,aO as x,aN as q,aM as S,bE as y}from"./index-Bt3DBEMh.js";class O{value;next;constructor(t){this.value=t}}class H{#e;#t;#s;constructor(){this.clear()}enqueue(t){const s=new O(t);this.#e?(this.#t.next=s,this.#t=s):(this.#e=s,this.#t=s),this.#s++}dequeue(){const t=this.#e;if(t)return this.#e=this.#e.next,this.#s--,t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#s=0}get size(){return this.#s}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}}function X(e){P(e);const t=new H;let s=0;const r=()=>{s<e&&t.size>0&&(t.dequeue()(),s++)},n=()=>{s--,r()},i=async(o,a,c)=>{const u=(async()=>o(...c))();a(u);try{await u}catch{}n()},d=(o,a,c)=>{new Promise(u=>{t.enqueue(u)}).then(i.bind(void 0,o,a,c)),(async()=>(await Promise.resolve(),s<e&&r()))()},m=(o,...a)=>new Promise(c=>{d(o,c,a)});return Object.defineProperties(m,{activeCount:{get:()=>s},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(o){P(o),e=o,queueMicrotask(()=>{for(;s<e&&t.size>0;)r()})}}}),m}function P(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const M=e=>(...t)=>e()(...t),A=M(()=>{var e;return(e=window.__NetworkExtension__)==null?void 0:e.GM_xmlhttpRequest}),C=()=>{var e;return!!((e=window.__NetworkExtension__)!=null&&e.GM_xmlhttpRequest)},D=(e="")=>{const t=new Headers;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(r){return r.startsWith(`
|
|
2
2
|
`)?r.substring(1):r}).forEach(function(r){var d;let n=r.split(":"),i=(d=n.shift())==null?void 0:d.trim();if(i){let m=n.join(":").trim();try{t.append(i,m)}catch{}}}),t},z=(e="")=>{try{return e===""&&location.href?location.href:e}catch{return e}},L=async(e,t={},s={})=>{var a;const r=new Request(e,t).clone();if((a=r.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");const n=r.method.toUpperCase(),i=z(r.url),d=new Headers(r.headers);new Headers(t.headers).forEach((c,u)=>{d.set(u,c)});let m=!1,o;return n!=="GET"&&t.body&&(typeof t.body=="string"||t.body instanceof URLSearchParams?o=t.body:t.body instanceof FormData?(o=t.body,d.delete("content-type")):(m=!0,o=await r.blob())),new Promise((c,u)=>{var g;let h={method:n,url:i,headers:T(d),data:o,binary:m,responseType:n==="GET"?"blob":void 0,async onload(l){await w();let f=!1;l.response instanceof Blob&&(f=l.response.size===0);const v=new Response((f?null:l.response)||null,{status:l.status,statusText:l.statusText,headers:D(l.responseHeaders)});Object.defineProperty(v,"url",{value:l.finalUrl}),c(v)},async onerror(l){await w(),u(new TypeError("Network request onerror failed",{cause:l}))},async ontimeout(){await w(),u(new TypeError("Network request ontimeout failed"))},async onabort(){await w(),u(new DOMException("Aborted","AbortError"))},async onreadystatechange(l){var f;l.readyState===4&&((f=r.signal)==null||f.removeEventListener("abort",I))}};typeof s=="function"?h=s(h):h={...h,...s};const R=A(h);function I(){R.abort()}(g=r.signal)==null||g.addEventListener("abort",I)})},F=(e,t)=>((t==null?void 0:t.method)||e.method).toUpperCase()==="GET",B=async(e,t)=>{const s=new Request(e),r=new URL(s.url);if(k(r))return fetch(e,t);if(C())return L(e,t);if(F(s,t)&&U(r.href)){const n=new URL("https://proxy.gkd.li");n.searchParams.set("proxyUrl",r.href);const i=new Request(e,t);return fetch(n,{method:i.method,headers:i.headers,body:i.body})}else throw G().networkErrorDlgVisible=!0,new Error("gm is not supported")},b=(e={})=>{e.driver??=E.INDEXEDDB;const t=E.createInstance(e);return{keys:async()=>t.keys(),hasItem:async o=>{const a=o.toString();return t.keys().then(c=>c.includes(a))},getItem:async o=>t.getItem(o.toString()),setItem:async(o,a)=>t.setItem(o.toString(),a),removeItem:async o=>t.removeItem(o.toString()),getAllItems:async()=>Promise.all((await t.keys()).map(o=>t.getItem(o)))}},p=b({name:"snapshot",version:1}),j=p.setItem;p.setItem=async(e,t)=>{const s={...t,nodes:[]};return await N.setItem(e,s),j(e,t)};const Q=p.removeItem;p.removeItem=async e=>{await Promise.all([Q(e),N.removeItem(e),_.removeItem(e),y[e]&&delete y[e]])};const N=b({name:"shallowSnapshot",version:1}),_=b({name:"screenshot",version:1}),W=async(e,t)=>{Object.entries(x).forEach(([s,r])=>{r==e.id&&delete x[s]}),q[e.id]&&delete q[e.id],S[e.id]&&delete S[e.id],y[e.id]=Date.now(),await Promise.all([p.setItem(e.id,e),_.setItem(e.id,t)])};export{p as a,_ as b,W as c,B as e,C as g,X as p,N as s};
|
|
3
|
-
//# sourceMappingURL=snapshot-
|
|
3
|
+
//# sourceMappingURL=snapshot-D6DjTREF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-BsGby2EL.js","sources":["../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js","../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js","../../src/utils/gm.ts","../../src/utils/fetch.ts","../../src/utils/snapshot.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tvalidateConcurrency(concurrency);\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst resumeNext = () => {\n\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t\t// Since `pendingCount` has been decreased by one, increase `activeCount` by one.\n\t\t\tactiveCount++;\n\t\t}\n\t};\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tresumeNext();\n\t};\n\n\tconst run = async (function_, resolve, arguments_) => {\n\t\tconst result = (async () => function_(...arguments_))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (function_, resolve, arguments_) => {\n\t\t// Queue `internalResolve` instead of the `run` function\n\t\t// to preserve asynchronous context.\n\t\tnew Promise(internalResolve => {\n\t\t\tqueue.enqueue(internalResolve);\n\t\t}).then(\n\t\t\trun.bind(undefined, function_, resolve, arguments_),\n\t\t);\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// after the `internalResolve` function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency) {\n\t\t\t\tresumeNext();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (function_, ...arguments_) => new Promise(resolve => {\n\t\tenqueue(function_, resolve, arguments_);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue() {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t\tconcurrency: {\n\t\t\tget: () => concurrency,\n\n\t\t\tset(newConcurrency) {\n\t\t\t\tvalidateConcurrency(newConcurrency);\n\t\t\t\tconcurrency = newConcurrency;\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\twhile (activeCount < concurrency && queue.size > 0) {\n\t\t\t\t\t\tresumeNext();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n\nexport function limitFunction(function_, option) {\n\tconst {concurrency} = option;\n\tconst limit = pLimit(concurrency);\n\n\treturn (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n}\n","import { delay } from './others';\nimport { headers2obj } from './others';\n\ntype GmXhrOptions =\n import('vite-plugin-monkey/dist/client').GmXmlhttpRequestOption<\n 'blob',\n undefined\n >;\nconst proxyFc = <T extends (...args: any[]) => any>(getFc: () => T) => {\n return ((...args: any[]) => getFc()(...args)) as T;\n};\n\nexport const GM_xmlhttpRequest = proxyFc(\n () => window.__NetworkExtension__?.GM_xmlhttpRequest,\n);\n\nexport const gmOk = () => {\n return !!window.__NetworkExtension__?.GM_xmlhttpRequest;\n};\n\n/**\n * https://github.com/github/fetch/blob/fb5b0cf42b470faf8c5448ab461d561f34380a30/fetch.js#L422\n */\nexport const parseHeaders = (rawHeaders = '') => {\n const headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n const preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function (header) {\n return header.startsWith(`\\n`) ? header.substring(1) : header;\n })\n .forEach(function (line) {\n let parts = line.split(':');\n let key = parts.shift()?.trim();\n if (key) {\n let value = parts.join(':').trim();\n try {\n // https://github.com/gkd-kit/subscription/pull/762#discussion_r1349695154\n headers.append(key, value);\n } catch {}\n }\n });\n return headers;\n};\n\n/**\n * https://github.com/github/fetch/blob/9a6d748b394a2c16b250262fcaf46afd5364b415/fetch.js#L555\n */\nconst fixUrl = (url = '') => {\n try {\n return url === '' && location.href ? location.href : url;\n } catch {\n return url;\n }\n};\n\n/**\n * simulate window.fetch with GM_xmlhttpRequest\n *\n * because [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) will delete [Forbidden_header_name](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name)\n *\n * so you must manually modify these headers by set the second parameter of GM_fetch\n * @example\n * GM_fetch(\n * new Request('https://www.pixiv.net/', {\n * headers: { referer: 'https://www.pixiv.net/' }, // it will not work !!!\n * }),\n * );\n * GM_fetch(new Request('https://www.pixiv.net/'), {\n * headers: { referer: 'https://www.pixiv.net/' }, // it will work\n * headers: new Headers({ referer: 'https://www.pixiv.net/' }), // it will also work\n * });\n */\nexport const GM_fetch = async (\n input: RequestInfo | URL,\n init: RequestInit = {},\n xhrDetails:\n | Partial<GmXhrOptions>\n | ((arg: GmXhrOptions) => GmXhrOptions) = {},\n): Promise<Response> => {\n const request = new Request(input, init).clone();\n if (request.signal?.aborted) {\n throw new DOMException('Aborted', 'AbortError');\n }\n\n const method = request.method.toUpperCase();\n const url = fixUrl(request.url);\n\n // headers\n const sendHeaders = new Headers(request.headers);\n new Headers(init.headers).forEach((value, key) => {\n sendHeaders.set(key, value);\n });\n\n let binary = false;\n let data: URLSearchParams | FormData | Blob | string | undefined = undefined;\n\n if (method !== 'GET') {\n if (init.body) {\n if (\n typeof init.body == 'string' ||\n init.body instanceof URLSearchParams\n ) {\n data = init.body;\n } else if (init.body instanceof FormData) {\n data = init.body;\n sendHeaders.delete(`content-type`);\n } else {\n binary = true;\n data = await request.blob();\n }\n }\n }\n return new Promise<Response>((resolve, reject) => {\n let initXhrDetails: GmXhrOptions = {\n method,\n url,\n headers: headers2obj(sendHeaders),\n data,\n binary,\n // temporarily fix tampermonkey bug when post github api\n responseType: method === 'GET' ? 'blob' : undefined,\n async onload(e) {\n await delay();\n let useNull = false;\n if (e.response instanceof Blob) {\n useNull = e.response.size === 0;\n }\n const resp = new Response((useNull ? null : e.response) || null, {\n status: e.status,\n statusText: e.statusText,\n headers: parseHeaders(e.responseHeaders),\n });\n Object.defineProperty(resp, 'url', { value: e.finalUrl });\n resolve(resp);\n },\n async onerror(e) {\n await delay();\n reject(new TypeError('Network request onerror failed', { cause: e }));\n },\n async ontimeout() {\n await delay();\n reject(new TypeError('Network request ontimeout failed'));\n },\n async onabort() {\n await delay();\n reject(new DOMException('Aborted', 'AbortError'));\n },\n async onreadystatechange(response) {\n if (response.readyState === 4) {\n request.signal?.removeEventListener('abort', abortXhr);\n }\n },\n };\n if (typeof xhrDetails == 'function') {\n initXhrDetails = xhrDetails(initXhrDetails);\n } else {\n initXhrDetails = { ...initXhrDetails, ...xhrDetails };\n }\n const handle = GM_xmlhttpRequest(initXhrDetails);\n function abortXhr() {\n handle.abort();\n }\n request.signal?.addEventListener('abort', abortXhr);\n });\n};\n","import { GM_fetch, gmOk } from './gm';\nimport { isCanProxyImportFileUrl, isAllowCorsUrl } from './url';\n\nconst isGetReq = (req: Request, init?: RequestInit) => {\n return (init?.method || req.method).toUpperCase() === 'GET';\n};\n\nexport const enhanceFetch = async (\n input: RequestInfo | URL,\n init?: RequestInit,\n): Promise<Response> => {\n const req = new Request(input);\n const u = new URL(req.url);\n if (isAllowCorsUrl(u)) return fetch(input, init);\n if (gmOk()) {\n // with cookie\n // export snapshot need\n return GM_fetch(input, init);\n } else if (isGetReq(req, init) && isCanProxyImportFileUrl(u.href)) {\n const proxyUrl = new URL(`https://proxy.gkd.li`);\n proxyUrl.searchParams.set(`proxyUrl`, u.href);\n const request = new Request(input, init);\n return fetch(proxyUrl, {\n method: request.method,\n headers: request.headers,\n body: request.body,\n });\n } else {\n useGlobalStore().networkErrorDlgVisible = true;\n throw new Error(`gm is not supported`);\n }\n};\n","import localforage from 'localforage';\n\nconst useStorage = <T>(options: LocalForageOptions = {}) => {\n options.driver ??= localforage.INDEXEDDB;\n const storage = localforage.createInstance(options);\n const setItem = async (key: string | number, value: T) => {\n return storage.setItem(key.toString(), value);\n };\n const getItem = async (key: string | number) => {\n return storage.getItem<T>(key.toString());\n };\n const getAllItems = async (): Promise<T[]> => {\n return Promise.all(\n (await storage.keys()).map((k) => storage.getItem(k) as Promise<T>),\n );\n };\n const removeItem = async (key: string | number) => {\n return storage.removeItem(key.toString());\n };\n\n const hasItem = async (key: string | number) => {\n const keyStr = key.toString();\n return storage.keys().then((r) => r.includes(keyStr));\n };\n const keys = async () => {\n return storage.keys();\n };\n\n return {\n keys,\n hasItem,\n getItem,\n setItem,\n removeItem,\n getAllItems,\n };\n};\n\nexport const snapshotStorage = useStorage<Snapshot>({\n name: `snapshot`,\n version: 1,\n});\n\nconst snapshotSetItem = snapshotStorage.setItem;\nsnapshotStorage.setItem = async (key, value) => {\n const shallowValue = { ...value, nodes: [] };\n await shallowSnapshotStorage.setItem(key, shallowValue);\n return snapshotSetItem(key, value);\n};\n\nconst snapshotRemoveItem = snapshotStorage.removeItem;\nsnapshotStorage.removeItem = async (key) => {\n await Promise.all([\n snapshotRemoveItem(key),\n shallowSnapshotStorage.removeItem(key),\n screenshotStorage.removeItem(key),\n snapshotImportTime[key] && delete snapshotImportTime[key],\n ]);\n};\n\nexport const shallowSnapshotStorage = useStorage<Snapshot>({\n name: `shallowSnapshot`,\n version: 1,\n});\n\nexport const screenshotStorage = useStorage<ArrayBuffer>({\n name: `screenshot`,\n version: 1,\n});\n\nexport const setSnapshot = async (snapshot: Snapshot, bf: ArrayBuffer) => {\n Object.entries(importSnapshotId).forEach(([k, v]) => {\n if (v == snapshot.id) {\n delete importSnapshotId[k];\n }\n });\n if (snapshotImageId[snapshot.id]) {\n delete snapshotImageId[snapshot.id];\n }\n if (snapshotImportId[snapshot.id]) {\n delete snapshotImportId[snapshot.id];\n }\n snapshotImportTime[snapshot.id] = Date.now();\n await Promise.all([\n snapshotStorage.setItem(snapshot.id, snapshot),\n screenshotStorage.setItem(snapshot.id, bf),\n ]);\n};\n"],"names":["Node","value","Queue","#head","#tail","#size","node","current","pLimit","concurrency","validateConcurrency","queue","activeCount","resumeNext","next","run","function_","resolve","arguments_","result","enqueue","internalResolve","generator","newConcurrency","proxyFc","getFc","args","GM_xmlhttpRequest","_a","gmOk","parseHeaders","rawHeaders","headers","header","line","parts","key","fixUrl","url","GM_fetch","input","init","xhrDetails","request","method","sendHeaders","binary","data","reject","initXhrDetails","headers2obj","e","delay","useNull","resp","response","abortXhr","handle","isGetReq","req","enhanceFetch","u","isAllowCorsUrl","isCanProxyImportFileUrl","proxyUrl","useGlobalStore","useStorage","options","localforage","storage","keyStr","r","k","snapshotStorage","snapshotSetItem","shallowValue","shallowSnapshotStorage","snapshotRemoveItem","screenshotStorage","snapshotImportTime","setSnapshot","snapshot","bf","importSnapshotId","v","snapshotImageId","snapshotImportId"],"mappings":"iHAKA,MAAMA,CAAK,CACV,MACA,KAEA,YAAYC,EAAO,CAClB,KAAK,MAAQA,CACf,CACA,CAEe,MAAMC,CAAM,CAC1BC,GACAC,GACAC,GAEA,aAAc,CACb,KAAK,MAAK,CACZ,CAEC,QAAQJ,EAAO,CACd,MAAMK,EAAO,IAAIN,EAAKC,CAAK,EAEvB,KAAKE,IACR,KAAKC,GAAM,KAAOE,EAClB,KAAKF,GAAQE,IAEb,KAAKH,GAAQG,EACb,KAAKF,GAAQE,GAGd,KAAKD,IACP,CAEC,SAAU,CACT,MAAME,EAAU,KAAKJ,GACrB,GAAKI,EAIL,YAAKJ,GAAQ,KAAKA,GAAM,KACxB,KAAKE,KACEE,EAAQ,KACjB,CAEC,MAAO,CACN,GAAK,KAAKJ,GAIV,OAAO,KAAKA,GAAM,KAIpB,CAEC,OAAQ,CACP,KAAKA,GAAQ,OACb,KAAKC,GAAQ,OACb,KAAKC,GAAQ,CACf,CAEC,IAAI,MAAO,CACV,OAAO,KAAKA,EACd,CAEC,EAAG,OAAO,QAAQ,GAAI,CACrB,IAAIE,EAAU,KAAKJ,GAEnB,KAAOI,GACN,MAAMA,EAAQ,MACdA,EAAUA,EAAQ,IAErB,CACA,CC3Ee,SAASC,EAAOC,EAAa,CAC3CC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B,OAAOK,EAAiBL,EAAS,EAAE,EAErCF,EAAmBE,EAAS,EAAE,EAAI,KAAK,IAAA,EACvC,MAAM,QAAQ,IAAI,CAChBR,EAAgB,QAAQQ,EAAS,GAAIA,CAAQ,EAC7CH,EAAkB,QAAQG,EAAS,GAAIC,CAAE,CAAA,CAC1C,CACH","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"snapshot-D6DjTREF.js","sources":["../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js","../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js","../../src/utils/gm.ts","../../src/utils/fetch.ts","../../src/utils/snapshot.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tvalidateConcurrency(concurrency);\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst resumeNext = () => {\n\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t\t// Since `pendingCount` has been decreased by one, increase `activeCount` by one.\n\t\t\tactiveCount++;\n\t\t}\n\t};\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tresumeNext();\n\t};\n\n\tconst run = async (function_, resolve, arguments_) => {\n\t\tconst result = (async () => function_(...arguments_))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (function_, resolve, arguments_) => {\n\t\t// Queue `internalResolve` instead of the `run` function\n\t\t// to preserve asynchronous context.\n\t\tnew Promise(internalResolve => {\n\t\t\tqueue.enqueue(internalResolve);\n\t\t}).then(\n\t\t\trun.bind(undefined, function_, resolve, arguments_),\n\t\t);\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// after the `internalResolve` function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency) {\n\t\t\t\tresumeNext();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (function_, ...arguments_) => new Promise(resolve => {\n\t\tenqueue(function_, resolve, arguments_);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue() {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t\tconcurrency: {\n\t\t\tget: () => concurrency,\n\n\t\t\tset(newConcurrency) {\n\t\t\t\tvalidateConcurrency(newConcurrency);\n\t\t\t\tconcurrency = newConcurrency;\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\twhile (activeCount < concurrency && queue.size > 0) {\n\t\t\t\t\t\tresumeNext();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n\nexport function limitFunction(function_, option) {\n\tconst {concurrency} = option;\n\tconst limit = pLimit(concurrency);\n\n\treturn (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n}\n","import { delay } from './others';\nimport { headers2obj } from './others';\n\ntype GmXhrOptions =\n import('vite-plugin-monkey/dist/client').GmXmlhttpRequestOption<\n 'blob',\n undefined\n >;\nconst proxyFc = <T extends (...args: any[]) => any>(getFc: () => T) => {\n return ((...args: any[]) => getFc()(...args)) as T;\n};\n\nexport const GM_xmlhttpRequest = proxyFc(\n () => window.__NetworkExtension__?.GM_xmlhttpRequest,\n);\n\nexport const gmOk = () => {\n return !!window.__NetworkExtension__?.GM_xmlhttpRequest;\n};\n\n/**\n * https://github.com/github/fetch/blob/fb5b0cf42b470faf8c5448ab461d561f34380a30/fetch.js#L422\n */\nexport const parseHeaders = (rawHeaders = '') => {\n const headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n const preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function (header) {\n return header.startsWith(`\\n`) ? header.substring(1) : header;\n })\n .forEach(function (line) {\n let parts = line.split(':');\n let key = parts.shift()?.trim();\n if (key) {\n let value = parts.join(':').trim();\n try {\n // https://github.com/gkd-kit/subscription/pull/762#discussion_r1349695154\n headers.append(key, value);\n } catch {}\n }\n });\n return headers;\n};\n\n/**\n * https://github.com/github/fetch/blob/9a6d748b394a2c16b250262fcaf46afd5364b415/fetch.js#L555\n */\nconst fixUrl = (url = '') => {\n try {\n return url === '' && location.href ? location.href : url;\n } catch {\n return url;\n }\n};\n\n/**\n * simulate window.fetch with GM_xmlhttpRequest\n *\n * because [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) will delete [Forbidden_header_name](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name)\n *\n * so you must manually modify these headers by set the second parameter of GM_fetch\n * @example\n * GM_fetch(\n * new Request('https://www.pixiv.net/', {\n * headers: { referer: 'https://www.pixiv.net/' }, // it will not work !!!\n * }),\n * );\n * GM_fetch(new Request('https://www.pixiv.net/'), {\n * headers: { referer: 'https://www.pixiv.net/' }, // it will work\n * headers: new Headers({ referer: 'https://www.pixiv.net/' }), // it will also work\n * });\n */\nexport const GM_fetch = async (\n input: RequestInfo | URL,\n init: RequestInit = {},\n xhrDetails:\n | Partial<GmXhrOptions>\n | ((arg: GmXhrOptions) => GmXhrOptions) = {},\n): Promise<Response> => {\n const request = new Request(input, init).clone();\n if (request.signal?.aborted) {\n throw new DOMException('Aborted', 'AbortError');\n }\n\n const method = request.method.toUpperCase();\n const url = fixUrl(request.url);\n\n // headers\n const sendHeaders = new Headers(request.headers);\n new Headers(init.headers).forEach((value, key) => {\n sendHeaders.set(key, value);\n });\n\n let binary = false;\n let data: URLSearchParams | FormData | Blob | string | undefined = undefined;\n\n if (method !== 'GET') {\n if (init.body) {\n if (\n typeof init.body == 'string' ||\n init.body instanceof URLSearchParams\n ) {\n data = init.body;\n } else if (init.body instanceof FormData) {\n data = init.body;\n sendHeaders.delete(`content-type`);\n } else {\n binary = true;\n data = await request.blob();\n }\n }\n }\n return new Promise<Response>((resolve, reject) => {\n let initXhrDetails: GmXhrOptions = {\n method,\n url,\n headers: headers2obj(sendHeaders),\n data,\n binary,\n // temporarily fix tampermonkey bug when post github api\n responseType: method === 'GET' ? 'blob' : undefined,\n async onload(e) {\n await delay();\n let useNull = false;\n if (e.response instanceof Blob) {\n useNull = e.response.size === 0;\n }\n const resp = new Response((useNull ? null : e.response) || null, {\n status: e.status,\n statusText: e.statusText,\n headers: parseHeaders(e.responseHeaders),\n });\n Object.defineProperty(resp, 'url', { value: e.finalUrl });\n resolve(resp);\n },\n async onerror(e) {\n await delay();\n reject(new TypeError('Network request onerror failed', { cause: e }));\n },\n async ontimeout() {\n await delay();\n reject(new TypeError('Network request ontimeout failed'));\n },\n async onabort() {\n await delay();\n reject(new DOMException('Aborted', 'AbortError'));\n },\n async onreadystatechange(response) {\n if (response.readyState === 4) {\n request.signal?.removeEventListener('abort', abortXhr);\n }\n },\n };\n if (typeof xhrDetails == 'function') {\n initXhrDetails = xhrDetails(initXhrDetails);\n } else {\n initXhrDetails = { ...initXhrDetails, ...xhrDetails };\n }\n const handle = GM_xmlhttpRequest(initXhrDetails);\n function abortXhr() {\n handle.abort();\n }\n request.signal?.addEventListener('abort', abortXhr);\n });\n};\n","import { GM_fetch, gmOk } from './gm';\nimport { isCanProxyImportFileUrl, isAllowCorsUrl } from './url';\n\nconst isGetReq = (req: Request, init?: RequestInit) => {\n return (init?.method || req.method).toUpperCase() === 'GET';\n};\n\nexport const enhanceFetch = async (\n input: RequestInfo | URL,\n init?: RequestInit,\n): Promise<Response> => {\n const req = new Request(input);\n const u = new URL(req.url);\n if (isAllowCorsUrl(u)) return fetch(input, init);\n if (gmOk()) {\n // with cookie\n // export snapshot need\n return GM_fetch(input, init);\n } else if (isGetReq(req, init) && isCanProxyImportFileUrl(u.href)) {\n const proxyUrl = new URL(`https://proxy.gkd.li`);\n proxyUrl.searchParams.set(`proxyUrl`, u.href);\n const request = new Request(input, init);\n return fetch(proxyUrl, {\n method: request.method,\n headers: request.headers,\n body: request.body,\n });\n } else {\n useGlobalStore().networkErrorDlgVisible = true;\n throw new Error(`gm is not supported`);\n }\n};\n","import localforage from 'localforage';\n\nconst useStorage = <T>(options: LocalForageOptions = {}) => {\n options.driver ??= localforage.INDEXEDDB;\n const storage = localforage.createInstance(options);\n const setItem = async (key: string | number, value: T) => {\n return storage.setItem(key.toString(), value);\n };\n const getItem = async (key: string | number) => {\n return storage.getItem<T>(key.toString());\n };\n const getAllItems = async (): Promise<T[]> => {\n return Promise.all(\n (await storage.keys()).map((k) => storage.getItem(k) as Promise<T>),\n );\n };\n const removeItem = async (key: string | number) => {\n return storage.removeItem(key.toString());\n };\n\n const hasItem = async (key: string | number) => {\n const keyStr = key.toString();\n return storage.keys().then((r) => r.includes(keyStr));\n };\n const keys = async () => {\n return storage.keys();\n };\n\n return {\n keys,\n hasItem,\n getItem,\n setItem,\n removeItem,\n getAllItems,\n };\n};\n\nexport const snapshotStorage = useStorage<Snapshot>({\n name: `snapshot`,\n version: 1,\n});\n\nconst snapshotSetItem = snapshotStorage.setItem;\nsnapshotStorage.setItem = async (key, value) => {\n const shallowValue = { ...value, nodes: [] };\n await shallowSnapshotStorage.setItem(key, shallowValue);\n return snapshotSetItem(key, value);\n};\n\nconst snapshotRemoveItem = snapshotStorage.removeItem;\nsnapshotStorage.removeItem = async (key) => {\n await Promise.all([\n snapshotRemoveItem(key),\n shallowSnapshotStorage.removeItem(key),\n screenshotStorage.removeItem(key),\n snapshotImportTime[key] && delete snapshotImportTime[key],\n ]);\n};\n\nexport const shallowSnapshotStorage = useStorage<Snapshot>({\n name: `shallowSnapshot`,\n version: 1,\n});\n\nexport const screenshotStorage = useStorage<ArrayBuffer>({\n name: `screenshot`,\n version: 1,\n});\n\nexport const setSnapshot = async (snapshot: Snapshot, bf: ArrayBuffer) => {\n Object.entries(importSnapshotId).forEach(([k, v]) => {\n if (v == snapshot.id) {\n delete importSnapshotId[k];\n }\n });\n if (snapshotImageId[snapshot.id]) {\n delete snapshotImageId[snapshot.id];\n }\n if (snapshotImportId[snapshot.id]) {\n delete snapshotImportId[snapshot.id];\n }\n snapshotImportTime[snapshot.id] = Date.now();\n await Promise.all([\n snapshotStorage.setItem(snapshot.id, snapshot),\n screenshotStorage.setItem(snapshot.id, bf),\n ]);\n};\n"],"names":["Node","value","Queue","#head","#tail","#size","node","current","pLimit","concurrency","validateConcurrency","queue","activeCount","resumeNext","next","run","function_","resolve","arguments_","result","enqueue","internalResolve","generator","newConcurrency","proxyFc","getFc","args","GM_xmlhttpRequest","_a","gmOk","parseHeaders","rawHeaders","headers","header","line","parts","key","fixUrl","url","GM_fetch","input","init","xhrDetails","request","method","sendHeaders","binary","data","reject","initXhrDetails","headers2obj","e","delay","useNull","resp","response","abortXhr","handle","isGetReq","req","enhanceFetch","u","isAllowCorsUrl","isCanProxyImportFileUrl","proxyUrl","useGlobalStore","useStorage","options","localforage","storage","keyStr","r","k","snapshotStorage","snapshotSetItem","shallowValue","shallowSnapshotStorage","snapshotRemoveItem","screenshotStorage","snapshotImportTime","setSnapshot","snapshot","bf","importSnapshotId","v","snapshotImageId","snapshotImportId"],"mappings":"iHAKA,MAAMA,CAAK,CACV,MACA,KAEA,YAAYC,EAAO,CAClB,KAAK,MAAQA,CACf,CACA,CAEe,MAAMC,CAAM,CAC1BC,GACAC,GACAC,GAEA,aAAc,CACb,KAAK,MAAK,CACZ,CAEC,QAAQJ,EAAO,CACd,MAAMK,EAAO,IAAIN,EAAKC,CAAK,EAEvB,KAAKE,IACR,KAAKC,GAAM,KAAOE,EAClB,KAAKF,GAAQE,IAEb,KAAKH,GAAQG,EACb,KAAKF,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,EAAkB,WAAW1C,CAAG,EAChC2C,EAAmB3C,CAAG,GAAK,OAAO2C,EAAmB3C,CAAG,CAAA,CACzD,CACH,EAEO,MAAMwC,EAAyBV,EAAqB,CACzD,KAAM,kBACN,QAAS,CACX,CAAC,EAEYY,EAAoBZ,EAAwB,CACvD,KAAM,aACN,QAAS,CACX,CAAC,EAEYc,EAAc,MAAOC,EAAoBC,IAAoB,CACxE,OAAO,QAAQC,CAAgB,EAAE,QAAQ,CAAC,CAACX,EAAGY,CAAC,IAAM,CAC/CA,GAAKH,EAAS,IAChB,OAAOE,EAAiBX,CAAC,CAC3B,CACD,EACGa,EAAgBJ,EAAS,EAAE,GAC7B,OAAOI,EAAgBJ,EAAS,EAAE,EAEhCK,EAAiBL,EAAS,EAAE,GAC9B,OAAOK,EAAiBL,EAAS,EAAE,EAErCF,EAAmBE,EAAS,EAAE,EAAI,KAAK,IAAA,EACvC,MAAM,QAAQ,IAAI,CAChBR,EAAgB,QAAQQ,EAAS,GAAIA,CAAQ,EAC7CH,EAAkB,QAAQG,EAAS,GAAIC,CAAE,CAAA,CAC1C,CACH","x_google_ignoreList":[0,1]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as Yn,be as er,bf as tr,bg as Vt,bh as ft,bi as or,bj as kt,H as Xe,o as H,h as he,au as ht,k as i,aH as nr,bk as rr,A as qt,bl as uo,ai as yt,aj as sn,d as vt,ao as lt,ae as Oe,ad as Ue,bm as Gt,ag as ot,a as z,b as ue,f as j,e as ae,g as Ge,bn as Xt,r as Dt,l as Co,al as wo,at as Zt,u as Qe,a1 as zt,m as Ae,t as re,q as S,w as Lt,s as fe,ar as Pt,a2 as nt,x as gt,c as ye,bo as ir,bp as To,y as de,a5 as Mt,bq as ar,S as xt,E as Ft,b2 as lr,b4 as dn,b5 as cn,a7 as un,a8 as sr,br as Io,p as pt,n as dr,bs as cr,bt as ur,bu as fr,ak as hr,b1 as pr,ah as Se,W as So,aE as Kt,bv as vr,a0 as gr,N as br,bw as mr,R as Bo,bx as fn,by as xo,as as xr,bz as yr,bA as Cr,v as qe,bB as wr,bC as Sr,aF as Rr,aq as kr,bD as Pr,am as Fr,an as zr,i as It,ac as Mr,B as Et,G as Ht,aQ as fo,bE as ho}from"./index-9mQFtWcN.js";import{j as Or,k as Tr,m as Ro,n as Ir,p as Jt,_ as Qt,i as jt,B as hn,V as pn,o as vn,u as Ut,q as Br,r as Ze,s as $o,N as $r,t as _r,v as _o,e as Ao,g as Bt}from"./node-DBRfL1Df.js";import{e as gn,V as ko,b as Ar,N as bn,h as Je,c as Yt,l as Nr,r as Lr,j as mn,m as Er,d as At,s as Hr,n as Dr,o as Kr,C as xn,i as jr,g as No}from"./dayjs.min-CyAldp6t.js";import{N as Ur,u as Po,i as Wr,_ as Lo,C as Vr}from"./Input-Bk8bdGMS.js";function qr(e={},t){const o=Yn({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:n,keyup:r}=e,a=d=>{switch(d.key){case"Control":o.ctrl=!0;break;case"Meta":o.command=!0,o.win=!0;break;case"Shift":o.shift=!0;break;case"Tab":o.tab=!0;break}n!==void 0&&Object.keys(n).forEach(s=>{if(s!==d.key)return;const p=n[s];if(typeof p=="function")p(d);else{const{stop:b=!1,prevent:m=!1}=p;b&&d.stopPropagation(),m&&d.preventDefault(),p.handler(d)}})},c=d=>{switch(d.key){case"Control":o.ctrl=!1;break;case"Meta":o.command=!1,o.win=!1;break;case"Shift":o.shift=!1;break;case"Tab":o.tab=!1;break}r!==void 0&&Object.keys(r).forEach(s=>{if(s!==d.key)return;const p=r[s];if(typeof p=="function")p(d);else{const{stop:b=!1,prevent:m=!1}=p;b&&d.stopPropagation(),m&&d.preventDefault(),p.handler(d)}})},l=()=>{(t===void 0||t.value)&&(kt("keydown",document,a),kt("keyup",document,c)),t!==void 0&&Xe(t,d=>{d?(kt("keydown",document,a),kt("keyup",document,c)):(ft("keydown",document,a),ft("keyup",document,c))})};return er()?(tr(l),Vt(()=>{(t===void 0||t.value)&&(ft("keydown",document,a),ft("keyup",document,c))})):l(),or(o)}function Gr(e,t,o){const n=H(e.value);let r=null;return Xe(e,a=>{r!==null&&window.clearTimeout(r),a===!0?o&&!o.value?n.value=!0:r=window.setTimeout(()=>{n.value=!0},t):n.value=!1}),n}const st="v-hidden",Xr=Or("[v-hidden]",{display:"none!important"}),Eo=he({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const o=H(null),n=H(null);function r(c){const{value:l}=o,{getCounter:d,getTail:s}=e;let p;if(d!==void 0?p=d():p=n.value,!l||!p)return;p.hasAttribute(st)&&p.removeAttribute(st);const{children:b}=l;if(c.showAllItemsBeforeCalculate)for(const P of b)P.hasAttribute(st)&&P.removeAttribute(st);const m=l.offsetWidth,h=[],u=t.tail?s==null?void 0:s():null;let g=u?u.offsetWidth:0,x=!1;const R=l.children.length-(t.tail?1:0);for(let P=0;P<R-1;++P){if(P<0)continue;const N=b[P];if(x){N.hasAttribute(st)||N.setAttribute(st,"");continue}else N.hasAttribute(st)&&N.removeAttribute(st);const I=N.offsetWidth;if(g+=I,h[P]=I,g>m){const{updateCounter:K}=e;for(let E=P;E>=0;--E){const oe=R-1-E;K!==void 0?K(oe):p.textContent=`${oe}`;const O=p.offsetWidth;if(g-=h[E],g+O<=m||E===0){x=!0,P=E-1,u&&(P===-1?(u.style.maxWidth=`${m-O}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:T}=e;T&&T(oe);break}}}}const{onUpdateOverflow:M}=e;x?M!==void 0&&M(!0):(M!==void 0&&M(!1),p.setAttribute(st,""))}const a=rr();return Xr.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Tr,ssr:a}),qt(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:o,counterRef:n,sync:r}},render(){const{$slots:e}=this;return ht(()=>this.sync({showAllItemsBeforeCalculate:!1})),i("div",{class:"v-overflow",ref:"selfRef"},[nr(e,"default"),e.counter?e.counter():i("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function yn(e,t){t&&(qt(()=>{const{value:o}=e;o&&uo.registerHandler(o,t)}),Xe(e,(o,n)=>{n&&uo.unregisterHandler(n)},{deep:!1}),Vt(()=>{const{value:o}=e;o&&uo.unregisterHandler(o)}))}function Zr(e,t){if(!e)return;const o=document.createElement("a");o.href=e,t!==void 0&&(o.download=t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}function Ho(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Do(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw new Error(`${e} has no smaller size.`)}function Cn(e){return t=>{t?e.value=t.$el:e.value=null}}function _t(e){const t=e.filter(o=>o!==void 0);if(t.length!==0)return t.length===1?t[0]:o=>{e.forEach(n=>{n&&n(o)})}}const Jr=he({name:"ArrowDown",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),Ko=he({name:"Backward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",fill:"currentColor"}))}}),Qr=he({name:"Checkmark",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i("g",{fill:"none"},i("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),jo=he({name:"FastBackward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),Uo=he({name:"FastForward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),Yr=he({name:"Filter",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z"}))))}}),Wo=he({name:"Forward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),Vo=he({name:"More",render(){return i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),ei=he({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),ti={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function oi(e){const{borderRadius:t,popoverColor:o,textColor3:n,dividerColor:r,textColor2:a,primaryColorPressed:c,textColorDisabled:l,primaryColor:d,opacityDisabled:s,hoverColor:p,fontSizeTiny:b,fontSizeSmall:m,fontSizeMedium:h,fontSizeLarge:u,fontSizeHuge:g,heightTiny:x,heightSmall:R,heightMedium:M,heightLarge:P,heightHuge:N}=e;return Object.assign(Object.assign({},ti),{optionFontSizeTiny:b,optionFontSizeSmall:m,optionFontSizeMedium:h,optionFontSizeLarge:u,optionFontSizeHuge:g,optionHeightTiny:x,optionHeightSmall:R,optionHeightMedium:M,optionHeightLarge:P,optionHeightHuge:N,borderRadius:t,color:o,groupHeaderTextColor:n,actionDividerColor:r,optionTextColor:a,optionTextColorPressed:c,optionTextColorDisabled:l,optionTextColorActive:d,optionOpacityDisabled:s,optionCheckColor:d,optionColorPending:p,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:p,actionTextColor:a,loadingColor:d})}const Fo=yt({name:"InternalSelectMenu",common:vt,peers:{Scrollbar:sn,Empty:gn},self:oi}),qo=he({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:o,nodePropsRef:n}=Oe(Ro);return{labelField:o,nodeProps:n,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:o,nodeProps:n,tmNode:{rawNode:r}}=this,a=n==null?void 0:n(r),c=t?t(r,!1):lt(r[this.labelField],r,!1),l=i("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),c);return r.render?r.render({node:l,option:r}):o?o({node:l,option:r,selected:!1}):l}});function ni(e,t){return i(Gt,{name:"fade-in-scale-up-transition"},{default:()=>e?i(ot,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i(Qr)}):null})}const Go=he({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:o,multipleRef:n,valueSetRef:r,renderLabelRef:a,renderOptionRef:c,labelFieldRef:l,valueFieldRef:d,showCheckmarkRef:s,nodePropsRef:p,handleOptionClick:b,handleOptionMouseEnter:m}=Oe(Ro),h=Ue(()=>{const{value:R}=o;return R?e.tmNode.key===R.key:!1});function u(R){const{tmNode:M}=e;M.disabled||b(R,M)}function g(R){const{tmNode:M}=e;M.disabled||m(R,M)}function x(R){const{tmNode:M}=e,{value:P}=h;M.disabled||P||m(R,M)}return{multiple:n,isGrouped:Ue(()=>{const{tmNode:R}=e,{parent:M}=R;return M&&M.rawNode.type==="group"}),showCheckmark:s,nodeProps:p,isPending:h,isSelected:Ue(()=>{const{value:R}=t,{value:M}=n;if(R===null)return!1;const P=e.tmNode.rawNode[d.value];if(M){const{value:N}=r;return N.has(P)}else return R===P}),labelField:l,renderLabel:a,renderOption:c,handleMouseMove:x,handleMouseEnter:g,handleClick:u}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:o,isPending:n,isGrouped:r,showCheckmark:a,nodeProps:c,renderOption:l,renderLabel:d,handleClick:s,handleMouseEnter:p,handleMouseMove:b}=this,m=ni(o,e),h=d?[d(t,o),a&&m]:[lt(t[this.labelField],t,o),a&&m],u=c==null?void 0:c(t),g=i("div",Object.assign({},u,{class:[`${e}-base-select-option`,t.class,u==null?void 0:u.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:o,[`${e}-base-select-option--grouped`]:r,[`${e}-base-select-option--pending`]:n,[`${e}-base-select-option--show-checkmark`]:a}],style:[(u==null?void 0:u.style)||"",t.style||""],onClick:_t([s,u==null?void 0:u.onClick]),onMouseenter:_t([p,u==null?void 0:u.onMouseenter]),onMousemove:_t([b,u==null?void 0:u.onMousemove])}),i("div",{class:`${e}-base-select-option__content`},h));return t.render?t.render({node:g,option:t,selected:o}):l?l({node:g,option:t,selected:o}):g}}),ri=z("base-select-menu",`
|
|
1
|
+
import{F as Yn,be as er,bf as tr,bg as Vt,bh as ft,bi as or,bj as kt,H as Xe,o as H,h as he,au as ht,k as i,aH as nr,bk as rr,A as qt,bl as uo,ai as yt,aj as sn,d as vt,ao as lt,ae as Oe,ad as Ue,bm as Gt,ag as ot,a as z,b as ue,f as j,e as ae,g as Ge,bn as Xt,r as Dt,l as Co,al as wo,at as Zt,u as Qe,a1 as zt,m as Ae,t as re,q as S,w as Lt,s as fe,ar as Pt,a2 as nt,x as gt,c as ye,bo as ir,bp as To,y as de,a5 as Mt,bq as ar,S as xt,E as Ft,b2 as lr,b4 as dn,b5 as cn,a7 as un,a8 as sr,br as Io,p as pt,n as dr,bs as cr,bt as ur,bu as fr,ak as hr,b1 as pr,ah as Se,W as So,aE as Kt,bv as vr,a0 as gr,N as br,bw as mr,R as Bo,bx as fn,by as xo,as as xr,bz as yr,bA as Cr,v as qe,bB as wr,bC as Sr,aF as Rr,aq as kr,bD as Pr,am as Fr,an as zr,i as It,ac as Mr,B as Et,G as Ht,aQ as fo,bE as ho}from"./index-Bt3DBEMh.js";import{j as Or,k as Tr,m as Ro,n as Ir,p as Jt,_ as Qt,i as jt,B as hn,V as pn,o as vn,u as Ut,q as Br,r as Ze,s as $o,N as $r,t as _r,v as _o,e as Ao,g as Bt}from"./node-MBU4fJb_.js";import{e as gn,V as ko,b as Ar,N as bn,h as Je,c as Yt,l as Nr,r as Lr,j as mn,m as Er,d as At,s as Hr,n as Dr,o as Kr,C as xn,i as jr,g as No}from"./dayjs.min-CFH-tBEB.js";import{N as Ur,u as Po,i as Wr,_ as Lo,C as Vr}from"./Input-CzEJSguQ.js";function qr(e={},t){const o=Yn({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:n,keyup:r}=e,a=d=>{switch(d.key){case"Control":o.ctrl=!0;break;case"Meta":o.command=!0,o.win=!0;break;case"Shift":o.shift=!0;break;case"Tab":o.tab=!0;break}n!==void 0&&Object.keys(n).forEach(s=>{if(s!==d.key)return;const p=n[s];if(typeof p=="function")p(d);else{const{stop:b=!1,prevent:m=!1}=p;b&&d.stopPropagation(),m&&d.preventDefault(),p.handler(d)}})},c=d=>{switch(d.key){case"Control":o.ctrl=!1;break;case"Meta":o.command=!1,o.win=!1;break;case"Shift":o.shift=!1;break;case"Tab":o.tab=!1;break}r!==void 0&&Object.keys(r).forEach(s=>{if(s!==d.key)return;const p=r[s];if(typeof p=="function")p(d);else{const{stop:b=!1,prevent:m=!1}=p;b&&d.stopPropagation(),m&&d.preventDefault(),p.handler(d)}})},l=()=>{(t===void 0||t.value)&&(kt("keydown",document,a),kt("keyup",document,c)),t!==void 0&&Xe(t,d=>{d?(kt("keydown",document,a),kt("keyup",document,c)):(ft("keydown",document,a),ft("keyup",document,c))})};return er()?(tr(l),Vt(()=>{(t===void 0||t.value)&&(ft("keydown",document,a),ft("keyup",document,c))})):l(),or(o)}function Gr(e,t,o){const n=H(e.value);let r=null;return Xe(e,a=>{r!==null&&window.clearTimeout(r),a===!0?o&&!o.value?n.value=!0:r=window.setTimeout(()=>{n.value=!0},t):n.value=!1}),n}const st="v-hidden",Xr=Or("[v-hidden]",{display:"none!important"}),Eo=he({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const o=H(null),n=H(null);function r(c){const{value:l}=o,{getCounter:d,getTail:s}=e;let p;if(d!==void 0?p=d():p=n.value,!l||!p)return;p.hasAttribute(st)&&p.removeAttribute(st);const{children:b}=l;if(c.showAllItemsBeforeCalculate)for(const P of b)P.hasAttribute(st)&&P.removeAttribute(st);const m=l.offsetWidth,h=[],u=t.tail?s==null?void 0:s():null;let g=u?u.offsetWidth:0,x=!1;const R=l.children.length-(t.tail?1:0);for(let P=0;P<R-1;++P){if(P<0)continue;const N=b[P];if(x){N.hasAttribute(st)||N.setAttribute(st,"");continue}else N.hasAttribute(st)&&N.removeAttribute(st);const I=N.offsetWidth;if(g+=I,h[P]=I,g>m){const{updateCounter:K}=e;for(let E=P;E>=0;--E){const oe=R-1-E;K!==void 0?K(oe):p.textContent=`${oe}`;const O=p.offsetWidth;if(g-=h[E],g+O<=m||E===0){x=!0,P=E-1,u&&(P===-1?(u.style.maxWidth=`${m-O}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:T}=e;T&&T(oe);break}}}}const{onUpdateOverflow:M}=e;x?M!==void 0&&M(!0):(M!==void 0&&M(!1),p.setAttribute(st,""))}const a=rr();return Xr.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Tr,ssr:a}),qt(()=>r({showAllItemsBeforeCalculate:!1})),{selfRef:o,counterRef:n,sync:r}},render(){const{$slots:e}=this;return ht(()=>this.sync({showAllItemsBeforeCalculate:!1})),i("div",{class:"v-overflow",ref:"selfRef"},[nr(e,"default"),e.counter?e.counter():i("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function yn(e,t){t&&(qt(()=>{const{value:o}=e;o&&uo.registerHandler(o,t)}),Xe(e,(o,n)=>{n&&uo.unregisterHandler(n)},{deep:!1}),Vt(()=>{const{value:o}=e;o&&uo.unregisterHandler(o)}))}function Zr(e,t){if(!e)return;const o=document.createElement("a");o.href=e,t!==void 0&&(o.download=t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}function Ho(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Do(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw new Error(`${e} has no smaller size.`)}function Cn(e){return t=>{t?e.value=t.$el:e.value=null}}function _t(e){const t=e.filter(o=>o!==void 0);if(t.length!==0)return t.length===1?t[0]:o=>{e.forEach(n=>{n&&n(o)})}}const Jr=he({name:"ArrowDown",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),Ko=he({name:"Backward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",fill:"currentColor"}))}}),Qr=he({name:"Checkmark",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i("g",{fill:"none"},i("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),jo=he({name:"FastBackward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),Uo=he({name:"FastForward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),Yr=he({name:"Filter",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z"}))))}}),Wo=he({name:"Forward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),Vo=he({name:"More",render(){return i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),ei=he({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),ti={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function oi(e){const{borderRadius:t,popoverColor:o,textColor3:n,dividerColor:r,textColor2:a,primaryColorPressed:c,textColorDisabled:l,primaryColor:d,opacityDisabled:s,hoverColor:p,fontSizeTiny:b,fontSizeSmall:m,fontSizeMedium:h,fontSizeLarge:u,fontSizeHuge:g,heightTiny:x,heightSmall:R,heightMedium:M,heightLarge:P,heightHuge:N}=e;return Object.assign(Object.assign({},ti),{optionFontSizeTiny:b,optionFontSizeSmall:m,optionFontSizeMedium:h,optionFontSizeLarge:u,optionFontSizeHuge:g,optionHeightTiny:x,optionHeightSmall:R,optionHeightMedium:M,optionHeightLarge:P,optionHeightHuge:N,borderRadius:t,color:o,groupHeaderTextColor:n,actionDividerColor:r,optionTextColor:a,optionTextColorPressed:c,optionTextColorDisabled:l,optionTextColorActive:d,optionOpacityDisabled:s,optionCheckColor:d,optionColorPending:p,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:p,actionTextColor:a,loadingColor:d})}const Fo=yt({name:"InternalSelectMenu",common:vt,peers:{Scrollbar:sn,Empty:gn},self:oi}),qo=he({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:o,nodePropsRef:n}=Oe(Ro);return{labelField:o,nodeProps:n,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:o,nodeProps:n,tmNode:{rawNode:r}}=this,a=n==null?void 0:n(r),c=t?t(r,!1):lt(r[this.labelField],r,!1),l=i("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),c);return r.render?r.render({node:l,option:r}):o?o({node:l,option:r,selected:!1}):l}});function ni(e,t){return i(Gt,{name:"fade-in-scale-up-transition"},{default:()=>e?i(ot,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i(Qr)}):null})}const Go=he({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:o,multipleRef:n,valueSetRef:r,renderLabelRef:a,renderOptionRef:c,labelFieldRef:l,valueFieldRef:d,showCheckmarkRef:s,nodePropsRef:p,handleOptionClick:b,handleOptionMouseEnter:m}=Oe(Ro),h=Ue(()=>{const{value:R}=o;return R?e.tmNode.key===R.key:!1});function u(R){const{tmNode:M}=e;M.disabled||b(R,M)}function g(R){const{tmNode:M}=e;M.disabled||m(R,M)}function x(R){const{tmNode:M}=e,{value:P}=h;M.disabled||P||m(R,M)}return{multiple:n,isGrouped:Ue(()=>{const{tmNode:R}=e,{parent:M}=R;return M&&M.rawNode.type==="group"}),showCheckmark:s,nodeProps:p,isPending:h,isSelected:Ue(()=>{const{value:R}=t,{value:M}=n;if(R===null)return!1;const P=e.tmNode.rawNode[d.value];if(M){const{value:N}=r;return N.has(P)}else return R===P}),labelField:l,renderLabel:a,renderOption:c,handleMouseMove:x,handleMouseEnter:g,handleClick:u}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:o,isPending:n,isGrouped:r,showCheckmark:a,nodeProps:c,renderOption:l,renderLabel:d,handleClick:s,handleMouseEnter:p,handleMouseMove:b}=this,m=ni(o,e),h=d?[d(t,o),a&&m]:[lt(t[this.labelField],t,o),a&&m],u=c==null?void 0:c(t),g=i("div",Object.assign({},u,{class:[`${e}-base-select-option`,t.class,u==null?void 0:u.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:o,[`${e}-base-select-option--grouped`]:r,[`${e}-base-select-option--pending`]:n,[`${e}-base-select-option--show-checkmark`]:a}],style:[(u==null?void 0:u.style)||"",t.style||""],onClick:_t([s,u==null?void 0:u.onClick]),onMouseenter:_t([p,u==null?void 0:u.onMouseenter]),onMousemove:_t([b,u==null?void 0:u.onMousemove])}),i("div",{class:`${e}-base-select-option__content`},h));return t.render?t.render({node:g,option:t,selected:o}):l?l({node:g,option:t,selected:o}):g}}),ri=z("base-select-menu",`
|
|
2
2
|
line-height: 1.5;
|
|
3
3
|
outline: none;
|
|
4
4
|
z-index: 0;
|
|
@@ -980,4 +980,4 @@ import{F as Yn,be as er,bf as tr,bg as Vt,bh as ft,bi as or,bj as kt,H as Xe,o a
|
|
|
980
980
|
transition: box-shadow .2s var(--n-bezier);
|
|
981
981
|
left: -36px;
|
|
982
982
|
`)])]}function Ra(e,t){const{paginatedDataRef:o,treeMateRef:n,selectionColumnRef:r}=t,a=H(e.defaultCheckedRowKeys),c=S(()=>{var I;const{checkedRowKeys:K}=e,E=K===void 0?a.value:K;return((I=r.value)===null||I===void 0?void 0:I.multiple)===!1?{checkedKeys:E.slice(0,1),indeterminateKeys:[]}:n.value.getCheckedKeys(E,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),l=S(()=>c.value.checkedKeys),d=S(()=>c.value.indeterminateKeys),s=S(()=>new Set(l.value)),p=S(()=>new Set(d.value)),b=S(()=>{const{value:I}=s;return o.value.reduce((K,E)=>{const{key:oe,disabled:O}=E;return K+(!O&&I.has(oe)?1:0)},0)}),m=S(()=>o.value.filter(I=>I.disabled).length),h=S(()=>{const{length:I}=o.value,{value:K}=p;return b.value>0&&b.value<I-m.value||o.value.some(E=>K.has(E.key))}),u=S(()=>{const{length:I}=o.value;return b.value!==0&&b.value===I-m.value}),g=S(()=>o.value.length===0);function x(I,K,E){const{"onUpdate:checkedRowKeys":oe,onUpdateCheckedRowKeys:O,onCheckedRowKeysChange:T}=e,q=[],{value:{getNode:y}}=n;I.forEach(A=>{var L;const $=(L=y(A))===null||L===void 0?void 0:L.rawNode;q.push($)}),oe&&de(oe,I,q,{row:K,action:E}),O&&de(O,I,q,{row:K,action:E}),T&&de(T,I,q,{row:K,action:E}),a.value=I}function R(I,K=!1,E){if(!e.loading){if(K){x(Array.isArray(I)?I.slice(0,1):[I],E,"check");return}x(n.value.check(I,l.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,E,"check")}}function M(I,K){e.loading||x(n.value.uncheck(I,l.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,K,"uncheck")}function P(I=!1){const{value:K}=r;if(!K||e.loading)return;const E=[];(I?n.value.treeNodes:o.value).forEach(oe=>{oe.disabled||E.push(oe.key)}),x(n.value.check(E,l.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"checkAll")}function N(I=!1){const{value:K}=r;if(!K||e.loading)return;const E=[];(I?n.value.treeNodes:o.value).forEach(oe=>{oe.disabled||E.push(oe.key)}),x(n.value.uncheck(E,l.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"uncheckAll")}return{mergedCheckedRowKeySetRef:s,mergedCheckedRowKeysRef:l,mergedInderminateRowKeySetRef:p,someRowsCheckedRef:h,allRowsCheckedRef:u,headerCheckboxDisabledRef:g,doUpdateCheckedRowKeys:x,doCheckAll:P,doUncheckAll:N,doCheck:R,doUncheck:M}}function ka(e,t){const o=Ue(()=>{for(const s of e.columns)if(s.type==="expand")return s.renderExpand}),n=Ue(()=>{let s;for(const p of e.columns)if(p.type==="expand"){s=p.expandable;break}return s}),r=H(e.defaultExpandAll?o!=null&&o.value?(()=>{const s=[];return t.value.treeNodes.forEach(p=>{var b;!((b=n.value)===null||b===void 0)&&b.call(n,p.rawNode)&&s.push(p.key)}),s})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=re(e,"expandedRowKeys"),c=re(e,"stickyExpandedRows"),l=pt(a,r);function d(s){const{onUpdateExpandedRowKeys:p,"onUpdate:expandedRowKeys":b}=e;p&&de(p,s),b&&de(b,s),r.value=s}return{stickyExpandedRowsRef:c,mergedExpandedRowKeysRef:l,renderExpandRef:o,expandableRef:n,doUpdateExpandedRowKeys:d}}function Pa(e,t){const o=[],n=[],r=[],a=new WeakMap;let c=-1,l=0,d=!1,s=0;function p(m,h){h>c&&(o[h]=[],c=h),m.forEach(u=>{if("children"in u)p(u.children,h+1);else{const g="key"in u?u.key:void 0;n.push({key:tt(u),style:Ki(u,g!==void 0?Ze(t(g)):void 0),column:u,index:s++,width:u.width===void 0?128:Number(u.width)}),l+=1,d||(d=!!u.ellipsis),r.push(u)}})}p(e,0),s=0;function b(m,h){let u=0;m.forEach(g=>{var x;if("children"in g){const R=s,M={column:g,colIndex:s,colSpan:0,rowSpan:1,isLast:!1};b(g.children,h+1),g.children.forEach(P=>{var N,I;M.colSpan+=(I=(N=a.get(P))===null||N===void 0?void 0:N.colSpan)!==null&&I!==void 0?I:0}),R+M.colSpan===l&&(M.isLast=!0),a.set(g,M),o[h].push(M)}else{if(s<u){s+=1;return}let R=1;"titleColSpan"in g&&(R=(x=g.titleColSpan)!==null&&x!==void 0?x:1),R>1&&(u=s+R);const M=s+R===l,P={column:g,colSpan:R,colIndex:s,rowSpan:c-h+1,isLast:M};a.set(g,P),o[h].push(P),s+=1}})}return b(e,0),{hasEllipsis:d,rows:o,cols:n,dataRelatedCols:r}}function Fa(e,t){const o=S(()=>Pa(e.columns,t));return{rowsRef:S(()=>o.value.rows),colsRef:S(()=>o.value.cols),hasEllipsisRef:S(()=>o.value.hasEllipsis),dataRelatedColsRef:S(()=>o.value.dataRelatedCols)}}function za(){const e=H({});function t(r){return e.value[r]}function o(r,a){Bn(r)&&"key"in r&&(e.value[r.key]=a)}function n(){e.value={}}return{getResizableWidth:t,doUpdateResizableWidth:o,clearResizableWidth:n}}function Ma(e,{mainTableInstRef:t,mergedCurrentPageRef:o,bodyWidthRef:n}){let r=0;const a=H(),c=H(null),l=H([]),d=H(null),s=H([]),p=S(()=>Ze(e.scrollX)),b=S(()=>e.columns.filter(O=>O.fixed==="left")),m=S(()=>e.columns.filter(O=>O.fixed==="right")),h=S(()=>{const O={};let T=0;function q(y){y.forEach(A=>{const L={start:T,end:0};O[tt(A)]=L,"children"in A?(q(A.children),L.end=T):(T+=Yo(A)||0,L.end=T)})}return q(b.value),O}),u=S(()=>{const O={};let T=0;function q(y){for(let A=y.length-1;A>=0;--A){const L=y[A],$={start:T,end:0};O[tt(L)]=$,"children"in L?(q(L.children),$.end=T):(T+=Yo(L)||0,$.end=T)}}return q(m.value),O});function g(){var O,T;const{value:q}=b;let y=0;const{value:A}=h;let L=null;for(let $=0;$<q.length;++$){const V=tt(q[$]);if(r>(((O=A[V])===null||O===void 0?void 0:O.start)||0)-y)L=V,y=((T=A[V])===null||T===void 0?void 0:T.end)||0;else break}c.value=L}function x(){l.value=[];let O=e.columns.find(T=>tt(T)===c.value);for(;O&&"children"in O;){const T=O.children.length;if(T===0)break;const q=O.children[T-1];l.value.push(tt(q)),O=q}}function R(){var O,T;const{value:q}=m,y=Number(e.scrollX),{value:A}=n;if(A===null)return;let L=0,$=null;const{value:V}=u;for(let D=q.length-1;D>=0;--D){const U=tt(q[D]);if(Math.round(r+(((O=V[U])===null||O===void 0?void 0:O.start)||0)+A-L)<y)$=U,L=((T=V[U])===null||T===void 0?void 0:T.end)||0;else break}d.value=$}function M(){s.value=[];let O=e.columns.find(T=>tt(T)===d.value);for(;O&&"children"in O&&O.children.length;){const T=O.children[0];s.value.push(tt(T)),O=T}}function P(){const O=t.value?t.value.getHeaderElement():null,T=t.value?t.value.getBodyElement():null;return{header:O,body:T}}function N(){const{body:O}=P();O&&(O.scrollTop=0)}function I(){a.value!=="body"?_o(E):a.value=void 0}function K(O){var T;(T=e.onScroll)===null||T===void 0||T.call(e,O),a.value!=="head"?_o(E):a.value=void 0}function E(){const{header:O,body:T}=P();if(!T)return;const{value:q}=n;if(q!==null){if(e.maxHeight||e.flexHeight){if(!O)return;const y=r-O.scrollLeft;a.value=y!==0?"head":"body",a.value==="head"?(r=O.scrollLeft,T.scrollLeft=r):(r=T.scrollLeft,O.scrollLeft=r)}else r=T.scrollLeft;g(),x(),R(),M()}}function oe(O){const{header:T}=P();T&&(T.scrollLeft=O,E())}return Xe(o,()=>{N()}),{styleScrollXRef:p,fixedColumnLeftMapRef:h,fixedColumnRightMapRef:u,leftFixedColumnsRef:b,rightFixedColumnsRef:m,leftActiveFixedColKeyRef:c,leftActiveFixedChildrenColKeysRef:l,rightActiveFixedColKeyRef:d,rightActiveFixedChildrenColKeysRef:s,syncScrollState:E,handleTableBodyScroll:K,handleTableHeaderScroll:I,setHeaderScrollLeft:oe}}function Nt(e){return typeof e=="object"&&typeof e.multiple=="number"?e.multiple:!1}function Oa(e,t){return t&&(e===void 0||e==="default"||typeof e=="object"&&e.compare==="default")?Ta(t):typeof e=="function"?e:e&&typeof e=="object"&&e.compare&&e.compare!=="default"?e.compare:!1}function Ta(e){return(t,o)=>{const n=t[e],r=o[e];return n==null?r==null?0:-1:r==null?1:typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}}function Ia(e,{dataRelatedColsRef:t,filteredDataRef:o}){const n=[];t.value.forEach(h=>{var u;h.sorter!==void 0&&m(n,{columnKey:h.key,sorter:h.sorter,order:(u=h.defaultSortOrder)!==null&&u!==void 0?u:!1})});const r=H(n),a=S(()=>{const h=t.value.filter(x=>x.type!=="selection"&&x.sorter!==void 0&&(x.sortOrder==="ascend"||x.sortOrder==="descend"||x.sortOrder===!1)),u=h.filter(x=>x.sortOrder!==!1);if(u.length)return u.map(x=>({columnKey:x.key,order:x.sortOrder,sorter:x.sorter}));if(h.length)return[];const{value:g}=r;return Array.isArray(g)?g:g?[g]:[]}),c=S(()=>{const h=a.value.slice().sort((u,g)=>{const x=Nt(u.sorter)||0;return(Nt(g.sorter)||0)-x});return h.length?o.value.slice().sort((g,x)=>{let R=0;return h.some(M=>{const{columnKey:P,sorter:N,order:I}=M,K=Oa(N,P);return K&&I&&(R=K(g.rawNode,x.rawNode),R!==0)?(R=R*Hi(I),!0):!1}),R}):o.value});function l(h){let u=a.value.slice();return h&&Nt(h.sorter)!==!1?(u=u.filter(g=>Nt(g.sorter)!==!1),m(u,h),u):h||null}function d(h){const u=l(h);s(u)}function s(h){const{"onUpdate:sorter":u,onUpdateSorter:g,onSorterChange:x}=e;u&&de(u,h),g&&de(g,h),x&&de(x,h),r.value=h}function p(h,u="ascend"){if(!h)b();else{const g=t.value.find(R=>R.type!=="selection"&&R.type!=="expand"&&R.key===h);if(!(g!=null&&g.sorter))return;const x=g.sorter;d({columnKey:h,sorter:x,order:u})}}function b(){s(null)}function m(h,u){const g=h.findIndex(x=>(u==null?void 0:u.columnKey)&&x.columnKey===u.columnKey);g!==void 0&&g>=0?h[g]=u:h.push(u)}return{clearSorter:b,sort:p,sortedDataRef:c,mergedSortStateRef:a,deriveNextSorter:d}}function Ba(e,{dataRelatedColsRef:t}){const o=S(()=>{const F=v=>{for(let w=0;w<v.length;++w){const _=v[w];if("children"in _)return F(_.children);if(_.type==="selection")return _}return null};return F(e.columns)}),n=S(()=>{const{childrenKey:F}=e;return Yt(e.data,{ignoreEmptyChildren:!0,getKey:e.rowKey,getChildren:v=>v[F],getDisabled:v=>{var w,_;return!!(!((_=(w=o.value)===null||w===void 0?void 0:w.disabled)===null||_===void 0)&&_.call(w,v))}})}),r=Ue(()=>{const{columns:F}=e,{length:v}=F;let w=null;for(let _=0;_<v;++_){const X=F[_];if(!X.type&&w===null&&(w=_),"tree"in X&&X.tree)return _}return w||0}),a=H({}),{pagination:c}=e,l=H(c&&c.defaultPage||1),d=H(Mn(c)),s=S(()=>{const F=t.value.filter(_=>_.filterOptionValues!==void 0||_.filterOptionValue!==void 0),v={};return F.forEach(_=>{var X;_.type==="selection"||_.type==="expand"||(_.filterOptionValues===void 0?v[_.key]=(X=_.filterOptionValue)!==null&&X!==void 0?X:null:v[_.key]=_.filterOptionValues)}),Object.assign(en(a.value),v)}),p=S(()=>{const F=s.value,{columns:v}=e;function w(be){return(ne,pe)=>!!~String(pe[be]).indexOf(String(ne))}const{value:{treeNodes:_}}=n,X=[];return v.forEach(be=>{be.type==="selection"||be.type==="expand"||"children"in be||X.push([be.key,be])}),_?_.filter(be=>{const{rawNode:ne}=be;for(const[pe,k]of X){let J=F[pe];if(J==null||(Array.isArray(J)||(J=[J]),!J.length))continue;const me=k.filter==="default"?w(pe):k.filter;if(k&&typeof me=="function")if(k.filterMode==="and"){if(J.some(Ce=>!me(Ce,ne)))return!1}else{if(J.some(Ce=>me(Ce,ne)))continue;return!1}}return!0}):[]}),{sortedDataRef:b,deriveNextSorter:m,mergedSortStateRef:h,sort:u,clearSorter:g}=Ia(e,{dataRelatedColsRef:t,filteredDataRef:p});t.value.forEach(F=>{var v;if(F.filter){const w=F.defaultFilterOptionValues;F.filterMultiple?a.value[F.key]=w||[]:w!==void 0?a.value[F.key]=w===null?[]:w:a.value[F.key]=(v=F.defaultFilterOptionValue)!==null&&v!==void 0?v:null}});const x=S(()=>{const{pagination:F}=e;if(F!==!1)return F.page}),R=S(()=>{const{pagination:F}=e;if(F!==!1)return F.pageSize}),M=pt(x,l),P=pt(R,d),N=Ue(()=>{const F=M.value;return e.remote?F:Math.max(1,Math.min(Math.ceil(p.value.length/P.value),F))}),I=S(()=>{const{pagination:F}=e;if(F){const{pageCount:v}=F;if(v!==void 0)return v}}),K=S(()=>{if(e.remote)return n.value.treeNodes;if(!e.pagination)return b.value;const F=P.value,v=(N.value-1)*F;return b.value.slice(v,v+F)}),E=S(()=>K.value.map(F=>F.rawNode));function oe(F){const{pagination:v}=e;if(v){const{onChange:w,"onUpdate:page":_,onUpdatePage:X}=v;w&&de(w,F),X&&de(X,F),_&&de(_,F),y(F)}}function O(F){const{pagination:v}=e;if(v){const{onPageSizeChange:w,"onUpdate:pageSize":_,onUpdatePageSize:X}=v;w&&de(w,F),X&&de(X,F),_&&de(_,F),A(F)}}const T=S(()=>{if(e.remote){const{pagination:F}=e;if(F){const{itemCount:v}=F;if(v!==void 0)return v}return}return p.value.length}),q=S(()=>Object.assign(Object.assign({},e.pagination),{onChange:void 0,onUpdatePage:void 0,onUpdatePageSize:void 0,onPageSizeChange:void 0,"onUpdate:page":oe,"onUpdate:pageSize":O,page:N.value,pageSize:P.value,pageCount:T.value===void 0?I.value:void 0,itemCount:T.value}));function y(F){const{"onUpdate:page":v,onPageChange:w,onUpdatePage:_}=e;_&&de(_,F),v&&de(v,F),w&&de(w,F),l.value=F}function A(F){const{"onUpdate:pageSize":v,onPageSizeChange:w,onUpdatePageSize:_}=e;w&&de(w,F),_&&de(_,F),v&&de(v,F),d.value=F}function L(F,v){const{onUpdateFilters:w,"onUpdate:filters":_,onFiltersChange:X}=e;w&&de(w,F,v),_&&de(_,F,v),X&&de(X,F,v),a.value=F}function $(F,v,w,_){var X;(X=e.onUnstableColumnResize)===null||X===void 0||X.call(e,F,v,w,_)}function V(F){y(F)}function D(){U()}function U(){ce({})}function ce(F){Q(F)}function Q(F){F?F&&(a.value=en(F)):a.value={}}return{treeMateRef:n,mergedCurrentPageRef:N,mergedPaginationRef:q,paginatedDataRef:K,rawPaginatedDataRef:E,mergedFilterStateRef:s,mergedSortStateRef:h,hoverKeyRef:H(null),selectionColumnRef:o,childTriggerColIndexRef:r,doUpdateFilters:L,deriveNextSorter:m,doUpdatePageSize:A,doUpdatePage:y,onUnstableColumnResize:$,filter:Q,filters:ce,clearFilter:D,clearFilters:U,clearSorter:g,page:V,sort:u}}const Ea=he({name:"DataTable",alias:["AdvancedTable"],props:Li,slots:Object,setup(e,{slots:t}){const{mergedBorderedRef:o,mergedClsPrefixRef:n,inlineThemeDisabled:r,mergedRtlRef:a}=Qe(e),c=zt("DataTable",a,n),l=S(()=>{const{bottomBordered:f}=e;return o.value?!1:f!==void 0?f:!0}),d=Ae("DataTable","-data-table",wa,Ni,e,n),s=H(null),p=H(null),{getResizableWidth:b,clearResizableWidth:m,doUpdateResizableWidth:h}=za(),{rowsRef:u,colsRef:g,dataRelatedColsRef:x,hasEllipsisRef:R}=Fa(e,b),{treeMateRef:M,mergedCurrentPageRef:P,paginatedDataRef:N,rawPaginatedDataRef:I,selectionColumnRef:K,hoverKeyRef:E,mergedPaginationRef:oe,mergedFilterStateRef:O,mergedSortStateRef:T,childTriggerColIndexRef:q,doUpdatePage:y,doUpdateFilters:A,onUnstableColumnResize:L,deriveNextSorter:$,filter:V,filters:D,clearFilter:U,clearFilters:ce,clearSorter:Q,page:F,sort:v}=Ba(e,{dataRelatedColsRef:x}),w=f=>{const{fileName:C="data.csv",keepOriginalData:W=!1}=f||{},Y=W?e.data:I.value,ee=Vi(e.columns,Y,e.getCsvCell,e.getCsvHeader),le=new Blob([ee],{type:"text/csv;charset=utf-8"}),se=URL.createObjectURL(le);Zr(se,C.endsWith(".csv")?C:`${C}.csv`),URL.revokeObjectURL(se)},{doCheckAll:_,doUncheckAll:X,doCheck:be,doUncheck:ne,headerCheckboxDisabledRef:pe,someRowsCheckedRef:k,allRowsCheckedRef:J,mergedCheckedRowKeySetRef:me,mergedInderminateRowKeySetRef:Ce}=Ra(e,{selectionColumnRef:K,treeMateRef:M,paginatedDataRef:N}),{stickyExpandedRowsRef:Te,mergedExpandedRowKeysRef:Ne,renderExpandRef:De,expandableRef:Ie,doUpdateExpandedRowKeys:Be}=ka(e,M),{handleTableBodyScroll:He,handleTableHeaderScroll:te,syncScrollState:ve,setHeaderScrollLeft:Pe,leftActiveFixedColKeyRef:Re,leftActiveFixedChildrenColKeysRef:ke,rightActiveFixedColKeyRef:B,rightActiveFixedChildrenColKeysRef:Z,leftFixedColumnsRef:ge,rightFixedColumnsRef:ze,fixedColumnLeftMapRef:Ye,fixedColumnRightMapRef:We}=Ma(e,{bodyWidthRef:s,mainTableInstRef:p,mergedCurrentPageRef:P}),{localeRef:$e}=Po("DataTable"),Me=S(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||R.value?"fixed":e.tableLayout);nt(rt,{props:e,treeMateRef:M,renderExpandIconRef:re(e,"renderExpandIcon"),loadingKeySetRef:H(new Set),slots:t,indentRef:re(e,"indent"),childTriggerColIndexRef:q,bodyWidthRef:s,componentId:Mr(),hoverKeyRef:E,mergedClsPrefixRef:n,mergedThemeRef:d,scrollXRef:S(()=>e.scrollX),rowsRef:u,colsRef:g,paginatedDataRef:N,leftActiveFixedColKeyRef:Re,leftActiveFixedChildrenColKeysRef:ke,rightActiveFixedColKeyRef:B,rightActiveFixedChildrenColKeysRef:Z,leftFixedColumnsRef:ge,rightFixedColumnsRef:ze,fixedColumnLeftMapRef:Ye,fixedColumnRightMapRef:We,mergedCurrentPageRef:P,someRowsCheckedRef:k,allRowsCheckedRef:J,mergedSortStateRef:T,mergedFilterStateRef:O,loadingRef:re(e,"loading"),rowClassNameRef:re(e,"rowClassName"),mergedCheckedRowKeySetRef:me,mergedExpandedRowKeysRef:Ne,mergedInderminateRowKeySetRef:Ce,localeRef:$e,expandableRef:Ie,stickyExpandedRowsRef:Te,rowKeyRef:re(e,"rowKey"),renderExpandRef:De,summaryRef:re(e,"summary"),virtualScrollRef:re(e,"virtualScroll"),virtualScrollXRef:re(e,"virtualScrollX"),heightForRowRef:re(e,"heightForRow"),minRowHeightRef:re(e,"minRowHeight"),virtualScrollHeaderRef:re(e,"virtualScrollHeader"),headerHeightRef:re(e,"headerHeight"),rowPropsRef:re(e,"rowProps"),stripedRef:re(e,"striped"),checkOptionsRef:S(()=>{const{value:f}=K;return f==null?void 0:f.options}),rawPaginatedDataRef:I,filterMenuCssVarsRef:S(()=>{const{self:{actionDividerColor:f,actionPadding:C,actionButtonMargin:W}}=d.value;return{"--n-action-padding":C,"--n-action-button-margin":W,"--n-action-divider-color":f}}),onLoadRef:re(e,"onLoad"),mergedTableLayoutRef:Me,maxHeightRef:re(e,"maxHeight"),minHeightRef:re(e,"minHeight"),flexHeightRef:re(e,"flexHeight"),headerCheckboxDisabledRef:pe,paginationBehaviorOnFilterRef:re(e,"paginationBehaviorOnFilter"),summaryPlacementRef:re(e,"summaryPlacement"),filterIconPopoverPropsRef:re(e,"filterIconPopoverProps"),scrollbarPropsRef:re(e,"scrollbarProps"),syncScrollState:ve,doUpdatePage:y,doUpdateFilters:A,getResizableWidth:b,onUnstableColumnResize:L,clearResizableWidth:m,doUpdateResizableWidth:h,deriveNextSorter:$,doCheck:be,doUncheck:ne,doCheckAll:_,doUncheckAll:X,doUpdateExpandedRowKeys:Be,handleTableHeaderScroll:te,handleTableBodyScroll:He,setHeaderScrollLeft:Pe,renderCell:re(e,"renderCell")});const Ke={filter:V,filters:D,clearFilters:ce,clearSorter:Q,page:F,sort:v,clearFilter:U,downloadCsv:w,scrollTo:(f,C)=>{var W;(W=p.value)===null||W===void 0||W.scrollTo(f,C)}},Fe=S(()=>{const{size:f}=e,{common:{cubicBezierEaseInOut:C},self:{borderColor:W,tdColorHover:Y,tdColorSorting:ee,tdColorSortingModal:le,tdColorSortingPopover:se,thColorSorting:xe,thColorSortingModal:_e,thColorSortingPopover:Le,thColor:we,thColorHover:Ve,tdColor:dt,tdTextColor:ct,thTextColor:it,thFontWeight:at,thButtonColorHover:bt,thIconColor:Ot,thIconColorActive:ut,filterSize:Ct,borderRadius:mt,lineHeight:et,tdColorModal:wt,thColorModal:Tt,borderColorModal:Ee,thColorHoverModal:je,tdColorHoverModal:to,borderColorPopover:oo,thColorPopover:no,tdColorPopover:ro,tdColorHoverPopover:io,thColorHoverPopover:ao,paginationMargin:lo,emptyPadding:so,boxShadowAfter:co,boxShadowBefore:St,sorterSize:Rt,resizableContainerSize:Kn,resizableSize:jn,loadingColor:Un,loadingSize:Wn,opacityLoading:Vn,tdColorStriped:qn,tdColorStripedModal:Gn,tdColorStripedPopover:Xn,[fe("fontSize",f)]:Zn,[fe("thPadding",f)]:Jn,[fe("tdPadding",f)]:Qn}}=d.value;return{"--n-font-size":Zn,"--n-th-padding":Jn,"--n-td-padding":Qn,"--n-bezier":C,"--n-border-radius":mt,"--n-line-height":et,"--n-border-color":W,"--n-border-color-modal":Ee,"--n-border-color-popover":oo,"--n-th-color":we,"--n-th-color-hover":Ve,"--n-th-color-modal":Tt,"--n-th-color-hover-modal":je,"--n-th-color-popover":no,"--n-th-color-hover-popover":ao,"--n-td-color":dt,"--n-td-color-hover":Y,"--n-td-color-modal":wt,"--n-td-color-hover-modal":to,"--n-td-color-popover":ro,"--n-td-color-hover-popover":io,"--n-th-text-color":it,"--n-td-text-color":ct,"--n-th-font-weight":at,"--n-th-button-color-hover":bt,"--n-th-icon-color":Ot,"--n-th-icon-color-active":ut,"--n-filter-size":Ct,"--n-pagination-margin":lo,"--n-empty-padding":so,"--n-box-shadow-before":St,"--n-box-shadow-after":co,"--n-sorter-size":Rt,"--n-resizable-container-size":Kn,"--n-resizable-size":jn,"--n-loading-size":Wn,"--n-loading-color":Un,"--n-opacity-loading":Vn,"--n-td-color-striped":qn,"--n-td-color-striped-modal":Gn,"--n-td-color-striped-popover":Xn,"--n-td-color-sorting":ee,"--n-td-color-sorting-modal":le,"--n-td-color-sorting-popover":se,"--n-th-color-sorting":xe,"--n-th-color-sorting-modal":_e,"--n-th-color-sorting-popover":Le}}),G=r?gt("data-table",S(()=>e.size[0]),Fe,e):void 0,ie=S(()=>{if(!e.pagination)return!1;if(e.paginateSinglePage)return!0;const f=oe.value,{pageCount:C}=f;return C!==void 0?C>1:f.itemCount&&f.pageSize&&f.itemCount>f.pageSize});return Object.assign({mainTableInstRef:p,mergedClsPrefix:n,rtlEnabled:c,mergedTheme:d,paginatedData:N,mergedBordered:o,mergedBottomBordered:l,mergedPagination:oe,mergedShowPagination:ie,cssVars:r?void 0:Fe,themeClass:G==null?void 0:G.themeClass,onRender:G==null?void 0:G.onRender},Ke)},render(){const{mergedClsPrefix:e,themeClass:t,onRender:o,$slots:n,spinProps:r}=this;return o==null||o(),i("div",{class:[`${e}-data-table`,this.rtlEnabled&&`${e}-data-table--rtl`,t,{[`${e}-data-table--bordered`]:this.mergedBordered,[`${e}-data-table--bottom-bordered`]:this.mergedBottomBordered,[`${e}-data-table--single-line`]:this.singleLine,[`${e}-data-table--single-column`]:this.singleColumn,[`${e}-data-table--loading`]:this.loading,[`${e}-data-table--flex-height`]:this.flexHeight}],style:this.cssVars},i("div",{class:`${e}-data-table-wrapper`},i(Ca,{ref:"mainTableInstRef"})),this.mergedShowPagination?i("div",{class:`${e}-data-table__pagination`},i(Ii,Object.assign({theme:this.mergedTheme.peers.Pagination,themeOverrides:this.mergedTheme.peerOverrides.Pagination,disabled:this.loading},this.mergedPagination))):null,i(Gt,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?i("div",{class:`${e}-data-table-loading-wrapper`},Zt(n.loading,()=>[i(Co,Object.assign({clsPrefix:e,strokeWidth:20},r))])):null}))}}),$a={async mounted(e,t){await ht(),t.value(e.getClientRects()[0])},async updated(e,t){await ht(),t.value(e.getClientRects()[0])}},$t=e=>{const t=Et({...e,render(o,n){var r;return un(Ht("span",{class:"whitespace-nowrap"},[(r=e.render)==null?void 0:r.call(e,o,n)]),[[$a,a=>{t.width=Math.max(Math.ceil(a.width+16),t.width||0,Number(t.minWidth||0))}]])}});return t},ln=e=>`${Ao(e).manufacturer} Android${Ao(e).release||"13"}`,Ha=()=>{const e=Et({key:"id",title:"创建时间",fixed:"left",width:"130px",sortOrder:!1,sorter(s,p){return s.id-p.id},render(s){return No(s.id).format("MM-DD HH:mm:ss")}}),t=Et({key:"mtime",title:"导入时间",width:"130px",sortOrder:!1,sorter(s,p){return(ho[s.id]||s.id)-(ho[p.id]||p.id)},render(s){return No(ho[s.id]||s.id).format("MM-DD HH:mm:ss")}}),o=$t({key:"versionRelease",title:"设备",filterMultiple:!0,minWidth:100,filter(s,p){return ln(p).includes(s.toString())},render(s){return ln(s)}}),n=$t({key:"appName",minWidth:100,title:"应用名称",filterMultiple:!0,filter(s,p){return s.toString()==Bt(p).name},cellProps(s){return{onClick(){fo(Bt(s).name)}}},render(s){return Bt(s).name}}),r=$t({key:"appId",title:"应用ID",minWidth:100,cellProps(s){return{onClick(){fo(s.appId)}}},render(s){return s.appId}}),a=$t({key:"appVersionCode",title:"版本代码",minWidth:150,render(s){return Bt(s).versionCode}}),c=$t({key:"appVersionName",title:"版本号",minWidth:150,render(s){return Ht(At,null,{default:()=>[Bt(s).versionName]})}}),l=Et({key:"activityId",title:"界面ID",filterMultiple:!0,filter(s,p){return s.toString()==p.activityId},cellProps(s){return{onClick(){fo(s.activityId)}}},render(s){return Ht("div",{class:"whitespace-nowrap text-left direction-rtl"},[Ht(At,null,{default:()=>[s.activityId]})])}});return{ctimeCol:e,mtimeCol:t,deviceCol:o,appNameCol:n,appIdCol:r,appVersionCodeCol:a,appVersionNameCol:c,activityIdCol:l,resetColWidth:()=>{o.width=void 0,n.width=void 0,r.width=void 0,a.width=void 0,c.width=void 0}}};export{Ea as _,Pi as a,ln as r,Ha as u};
|
|
983
|
-
//# sourceMappingURL=table-
|
|
983
|
+
//# sourceMappingURL=table-B3igD-SS.js.map
|