Userjs digger

Show all userjs available in current site

  1. // ==UserScript==
  2. // @name Userjs digger
  3. // @namespace userjs-digger
  4. // @version 0.6.4
  5. // @author enpitsulin <enpitsulin@gmail.com>
  6. // @description Show all userjs available in current site
  7. // @license MIT
  8. // @icon https://user-images.githubusercontent.com/29378026/227717136-4c9dfba4-0f90-41a2-905a-4cf19e751b5c.png
  9. // @homepage https://github.com/enpitsulin/userjs-digger#readme
  10. // @homepageURL https://github.com/enpitsulin/userjs-digger#readme
  11. // @website https://github.com/enpitsuLin/userjs-digger
  12. // @source https://github.com/enpitsulin/userjs-digger.git
  13. // @include *
  14. // @require https://unpkg.com/vue@3.3.4/dist/vue.global.prod.js
  15. // @require https://unpkg.com/psl@1.9.0/dist/psl.min.js
  16. // @require https://unpkg.com/vue-i18n@9.2.2/dist/vue-i18n.runtime.global.js
  17. // @connect greasyfork.org
  18. // @grant GM_deleteValue
  19. // @grant GM_getValue
  20. // @grant GM_setValue
  21. // @grant GM_xmlhttpRequest
  22. // @grant unsafeWindow
  23. // @noframes
  24. // ==/UserScript==
  25.  
  26. (e=>{const d=document.createElement("style");d.dataset.source="vite-plugin-monkey",d.textContent=e,document.head.append(d)})(" userjs-digger{--ud-text: #262626;--ud-text-secondary: #31313188;--ud-bg: #f5f5f5;--ud-bg-secondary: #d0d0d0;--ud-bg-hover: #d4d4d4;--ud-border: #e5e7eb;--ud-border-secondary: #d1d5db}.dark userjs-digger,[data-color-mode=dark] userjs-digger,[data-theme=dark] userjs-digger{--ud-text: #f5f5f5;--ud-text-secondary: #d5d5d588;--ud-bg: #262626;--ud-bg-secondary: #525252;--ud-bg-hover: #737373;--ud-border: #374151;--ud-border-secondary: #4b5563} ");
  27.  
  28. (function (require$$0, require$$1, require$$2) {
  29. 'use strict';
  30.  
  31. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  32.  
  33. (function (module, exports) {
  34. (function(global2, factory) {
  35. factory(require$$0, require$$1, require$$2) ;
  36. })(commonjsGlobal, function(vue, vueI18n, psl) {
  37. var __defProp = Object.defineProperty;
  38. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  39. var __publicField = (obj, key, value) => {
  40. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  41. return value;
  42. };
  43. const reset = '/*\nPlease read: https://github.com/unocss/unocss/blob/main/packages/reset/tailwind-compat.md\n*/\n\n/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type=\'button\'],\n[type=\'reset\'],\n[type=\'submit\'] {\n -webkit-appearance: button; /* 1 */\n /*will affect the button style of most component libraries, so disable it*/\n /*https://github.com/unocss/unocss/issues/2127*/\n /*background-color: transparent; !* 2 *!*/\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n';
  44. const resource$1 = {
  45. "tip": (ctx) => {
  46. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  47. return _normalize(["发现", _interpolate(_named("count")), "个脚本适用于网站 ", _interpolate(_named("host"))]);
  48. },
  49. "table": {
  50. "toggle-expand": (ctx) => {
  51. const { normalize: _normalize } = ctx;
  52. return _normalize(["展开更多"]);
  53. },
  54. "title": (ctx) => {
  55. const { normalize: _normalize } = ctx;
  56. return _normalize(["脚本标题"]);
  57. },
  58. "daily": (ctx) => {
  59. const { normalize: _normalize } = ctx;
  60. return _normalize(["日安装量"]);
  61. },
  62. "update": (ctx) => {
  63. const { normalize: _normalize } = ctx;
  64. return _normalize(["更新时间"]);
  65. },
  66. "install": (ctx) => {
  67. const { normalize: _normalize } = ctx;
  68. return _normalize(["安装"]);
  69. },
  70. "version": (ctx) => {
  71. const { normalize: _normalize } = ctx;
  72. return _normalize(["版本"]);
  73. },
  74. "score": (ctx) => {
  75. const { normalize: _normalize } = ctx;
  76. return _normalize(["评分"]);
  77. },
  78. "total-installs": (ctx) => {
  79. const { normalize: _normalize } = ctx;
  80. return _normalize(["总安装量"]);
  81. },
  82. "authors": (ctx) => {
  83. const { normalize: _normalize } = ctx;
  84. return _normalize(["作者"]);
  85. },
  86. "description": (ctx) => {
  87. const { normalize: _normalize } = ctx;
  88. return _normalize(["脚本描述"]);
  89. },
  90. "empty": (ctx) => {
  91. const { normalize: _normalize } = ctx;
  92. return _normalize(["这个网站没有适用的脚本"]);
  93. }
  94. },
  95. "settings": (ctx) => {
  96. const { normalize: _normalize } = ctx;
  97. return _normalize(["设置"]);
  98. },
  99. "language": (ctx) => {
  100. const { normalize: _normalize } = ctx;
  101. return _normalize(["语言"]);
  102. },
  103. "language-desc": (ctx) => {
  104. const { normalize: _normalize } = ctx;
  105. return _normalize(["切换用户语言设置"]);
  106. },
  107. "enable": (ctx) => {
  108. const { normalize: _normalize } = ctx;
  109. return _normalize(["本页启用"]);
  110. },
  111. "enable-desc": (ctx) => {
  112. const { normalize: _normalize } = ctx;
  113. return _normalize(["控制本页面是否启用功能(会话)"]);
  114. },
  115. "nsfw": (ctx) => {
  116. const { normalize: _normalize } = ctx;
  117. return _normalize(["成人内容"]);
  118. },
  119. "nsfw-desc": (ctx) => {
  120. const { normalize: _normalize } = ctx;
  121. return _normalize(["列表中展示Sleazyfork的搜索结果"]);
  122. },
  123. "filter": (ctx) => {
  124. const { normalize: _normalize } = ctx;
  125. return _normalize(["过滤"]);
  126. },
  127. "filter-desc": (ctx) => {
  128. const { normalize: _normalize } = ctx;
  129. return _normalize(["过滤标题含有指定内容或指定开发者的用户脚本"]);
  130. },
  131. "filter-tips": (ctx) => {
  132. const { normalize: _normalize } = ctx;
  133. return _normalize(["使用title:过滤标题或是author:指定开发者,没有相关描述则默认过滤标题,支持正则表达式"]);
  134. },
  135. "search-placeholder": (ctx) => {
  136. const { normalize: _normalize } = ctx;
  137. return _normalize(["为指定网站搜索用户脚本"]);
  138. },
  139. "time-ago": {
  140. "just-now": (ctx) => {
  141. const { normalize: _normalize } = ctx;
  142. return _normalize(["就在刚刚"]);
  143. },
  144. "past": (ctx) => {
  145. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  146. return _normalize([_interpolate(_named("n")), "前"]);
  147. },
  148. "future": (ctx) => {
  149. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  150. return _normalize([_interpolate(_named("n")), "后"]);
  151. },
  152. "month": {
  153. "past": (ctx) => {
  154. const { normalize: _normalize } = ctx;
  155. return _normalize(["上个月"]);
  156. },
  157. "future": (ctx) => {
  158. const { normalize: _normalize } = ctx;
  159. return _normalize(["下个月"]);
  160. },
  161. "n": (ctx) => {
  162. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  163. return _normalize([_interpolate(_named("n")), "个月"]);
  164. }
  165. },
  166. "year": {
  167. "past": (ctx) => {
  168. const { normalize: _normalize } = ctx;
  169. return _normalize(["去年"]);
  170. },
  171. "future": (ctx) => {
  172. const { normalize: _normalize } = ctx;
  173. return _normalize(["明年"]);
  174. },
  175. "n": (ctx) => {
  176. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  177. return _normalize([_interpolate(_named("n")), "年"]);
  178. }
  179. },
  180. "day": {
  181. "past": (ctx) => {
  182. const { normalize: _normalize } = ctx;
  183. return _normalize(["昨天"]);
  184. },
  185. "future": (ctx) => {
  186. const { normalize: _normalize } = ctx;
  187. return _normalize(["明天"]);
  188. },
  189. "n": (ctx) => {
  190. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  191. return _normalize([_interpolate(_named("n")), "天"]);
  192. }
  193. },
  194. "week": {
  195. "past": (ctx) => {
  196. const { normalize: _normalize } = ctx;
  197. return _normalize(["上周"]);
  198. },
  199. "future": (ctx) => {
  200. const { normalize: _normalize } = ctx;
  201. return _normalize(["下周"]);
  202. },
  203. "n": (ctx) => {
  204. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  205. return _normalize([_interpolate(_named("n")), "周"]);
  206. }
  207. },
  208. "hour": (ctx) => {
  209. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  210. return _normalize([_interpolate(_named("n")), "小时"]);
  211. },
  212. "minute": (ctx) => {
  213. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  214. return _normalize([_interpolate(_named("n")), "分钟"]);
  215. },
  216. "second": (ctx) => {
  217. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  218. return _normalize([_interpolate(_named("n")), "秒"]);
  219. },
  220. "invalid": (ctx) => {
  221. const { normalize: _normalize } = ctx;
  222. return _normalize(["无效"]);
  223. }
  224. }
  225. };
  226. const resource = {
  227. "tip": (ctx) => {
  228. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  229. return _normalize(["Found ", _interpolate(_named("count")), " user scripts for the ", _interpolate(_named("host"))]);
  230. },
  231. "table": {
  232. "toggle-expand": (ctx) => {
  233. const { normalize: _normalize } = ctx;
  234. return _normalize(["Toggle expand"]);
  235. },
  236. "title": (ctx) => {
  237. const { normalize: _normalize } = ctx;
  238. return _normalize(["Title"]);
  239. },
  240. "daily": (ctx) => {
  241. const { normalize: _normalize } = ctx;
  242. return _normalize(["Daily"]);
  243. },
  244. "update": (ctx) => {
  245. const { normalize: _normalize } = ctx;
  246. return _normalize(["Update"]);
  247. },
  248. "install": (ctx) => {
  249. const { normalize: _normalize } = ctx;
  250. return _normalize(["Install"]);
  251. },
  252. "version": (ctx) => {
  253. const { normalize: _normalize } = ctx;
  254. return _normalize(["Version"]);
  255. },
  256. "score": (ctx) => {
  257. const { normalize: _normalize } = ctx;
  258. return _normalize(["Score"]);
  259. },
  260. "total-installs": (ctx) => {
  261. const { normalize: _normalize } = ctx;
  262. return _normalize(["Total installs"]);
  263. },
  264. "authors": (ctx) => {
  265. const { normalize: _normalize } = ctx;
  266. return _normalize(["Author(s)"]);
  267. },
  268. "description": (ctx) => {
  269. const { normalize: _normalize } = ctx;
  270. return _normalize(["Description"]);
  271. },
  272. "empty": (ctx) => {
  273. const { normalize: _normalize } = ctx;
  274. return _normalize(["There has no Userjs for this site"]);
  275. }
  276. },
  277. "settings": (ctx) => {
  278. const { normalize: _normalize } = ctx;
  279. return _normalize(["Settings"]);
  280. },
  281. "language": (ctx) => {
  282. const { normalize: _normalize } = ctx;
  283. return _normalize(["Language"]);
  284. },
  285. "language-desc": (ctx) => {
  286. const { normalize: _normalize } = ctx;
  287. return _normalize(["Switch language"]);
  288. },
  289. "enable": (ctx) => {
  290. const { normalize: _normalize } = ctx;
  291. return _normalize(["Enable on this page"]);
  292. },
  293. "enable-desc": (ctx) => {
  294. const { normalize: _normalize } = ctx;
  295. return _normalize(["To enable this plugin on this page or not (Session)"]);
  296. },
  297. "nsfw": (ctx) => {
  298. const { normalize: _normalize } = ctx;
  299. return _normalize(["NSFW"]);
  300. },
  301. "nsfw-desc": (ctx) => {
  302. const { normalize: _normalize } = ctx;
  303. return _normalize(["Show Sleazyfork's result in list"]);
  304. },
  305. "filter": (ctx) => {
  306. const { normalize: _normalize } = ctx;
  307. return _normalize(["Filter"]);
  308. },
  309. "filter-desc": (ctx) => {
  310. const { normalize: _normalize } = ctx;
  311. return _normalize(["Filter user script with specific content in title or specific developer"]);
  312. },
  313. "filter-tips": (ctx) => {
  314. const { normalize: _normalize } = ctx;
  315. return _normalize(["use title: to filter title or author: for developer, title for default"]);
  316. },
  317. "search-placeholder": (ctx) => {
  318. const { normalize: _normalize } = ctx;
  319. return _normalize(["Search user script for website"]);
  320. },
  321. "time-ago": {
  322. "just-now": (ctx) => {
  323. const { normalize: _normalize } = ctx;
  324. return _normalize(["just now"]);
  325. },
  326. "past": (ctx) => {
  327. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  328. return _normalize([_interpolate(_named("n")), " ago"]);
  329. },
  330. "future": (ctx) => {
  331. const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;
  332. return _normalize(["in ", _interpolate(_named("n"))]);
  333. },
  334. "month": {
  335. "past": (ctx) => {
  336. const { normalize: _normalize } = ctx;
  337. return _normalize(["last month"]);
  338. },
  339. "future": (ctx) => {
  340. const { normalize: _normalize } = ctx;
  341. return _normalize(["next month"]);
  342. },
  343. "n": (ctx) => {
  344. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  345. return _plural([_normalize([_interpolate(_named("n")), " month"]), _normalize([_interpolate(_named("n")), " months"])]);
  346. }
  347. },
  348. "year": {
  349. "past": (ctx) => {
  350. const { normalize: _normalize } = ctx;
  351. return _normalize(["last year"]);
  352. },
  353. "future": (ctx) => {
  354. const { normalize: _normalize } = ctx;
  355. return _normalize(["next year"]);
  356. },
  357. "n": (ctx) => {
  358. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  359. return _plural([_normalize([_interpolate(_named("n")), " year"]), _normalize([_interpolate(_named("n")), " years"])]);
  360. }
  361. },
  362. "day": {
  363. "past": (ctx) => {
  364. const { normalize: _normalize } = ctx;
  365. return _normalize(["yesterday"]);
  366. },
  367. "future": (ctx) => {
  368. const { normalize: _normalize } = ctx;
  369. return _normalize(["tomorrow"]);
  370. },
  371. "n": (ctx) => {
  372. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  373. return _plural([_normalize([_interpolate(_named("n")), " day"]), _normalize([_interpolate(_named("n")), " days"])]);
  374. }
  375. },
  376. "week": {
  377. "past": (ctx) => {
  378. const { normalize: _normalize } = ctx;
  379. return _normalize(["last week"]);
  380. },
  381. "future": (ctx) => {
  382. const { normalize: _normalize } = ctx;
  383. return _normalize(["next week"]);
  384. },
  385. "n": (ctx) => {
  386. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  387. return _plural([_normalize([_interpolate(_named("n")), " week"]), _normalize([_interpolate(_named("n")), " weeks"])]);
  388. }
  389. },
  390. "hour": (ctx) => {
  391. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  392. return _plural([_normalize([_interpolate(_named("n")), " hour"]), _normalize([_interpolate(_named("n")), " hours"])]);
  393. },
  394. "minute": (ctx) => {
  395. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  396. return _plural([_normalize([_interpolate(_named("n")), " minute"]), _normalize([_interpolate(_named("n")), " minutes"])]);
  397. },
  398. "second": (ctx) => {
  399. const { normalize: _normalize, interpolate: _interpolate, named: _named, plural: _plural } = ctx;
  400. return _plural([_normalize([_interpolate(_named("n")), " second"]), _normalize([_interpolate(_named("n")), " seconds"])]);
  401. },
  402. "invalid": (ctx) => {
  403. const { normalize: _normalize } = ctx;
  404. return _normalize([]);
  405. }
  406. }
  407. };
  408. function tryOnScopeDispose(fn) {
  409. if (vue.getCurrentScope()) {
  410. vue.onScopeDispose(fn);
  411. return true;
  412. }
  413. return false;
  414. }
  415. function createEventHook() {
  416. const fns = /* @__PURE__ */ new Set();
  417. const off = (fn) => {
  418. fns.delete(fn);
  419. };
  420. const on = (fn) => {
  421. fns.add(fn);
  422. const offFn = () => off(fn);
  423. tryOnScopeDispose(offFn);
  424. return {
  425. off: offFn
  426. };
  427. };
  428. const trigger = (param) => {
  429. return Promise.all(Array.from(fns).map((fn) => fn(param)));
  430. };
  431. return {
  432. on,
  433. off,
  434. trigger
  435. };
  436. }
  437. function createGlobalState(stateFactory) {
  438. let initialized = false;
  439. let state;
  440. const scope = vue.effectScope(true);
  441. return (...args) => {
  442. if (!initialized) {
  443. state = scope.run(() => stateFactory(...args));
  444. initialized = true;
  445. }
  446. return state;
  447. };
  448. }
  449. function toValue(r) {
  450. return typeof r === "function" ? r() : vue.unref(r);
  451. }
  452. const resolveUnref = toValue;
  453. const isClient = typeof window !== "undefined";
  454. const noop = () => {
  455. };
  456. const isIOS = /* @__PURE__ */ getIsIOS();
  457. function getIsIOS() {
  458. var _a;
  459. return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
  460. }
  461. function createFilterWrapper(filter, fn) {
  462. function wrapper(...args) {
  463. return new Promise((resolve, reject) => {
  464. Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
  465. });
  466. }
  467. return wrapper;
  468. }
  469. const bypassFilter = (invoke) => {
  470. return invoke();
  471. };
  472. function debounceFilter(ms, options = {}) {
  473. let timer;
  474. let maxTimer;
  475. let lastRejector = noop;
  476. const _clearTimeout = (timer2) => {
  477. clearTimeout(timer2);
  478. lastRejector();
  479. lastRejector = noop;
  480. };
  481. const filter = (invoke) => {
  482. const duration = toValue(ms);
  483. const maxDuration = toValue(options.maxWait);
  484. if (timer)
  485. _clearTimeout(timer);
  486. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  487. if (maxTimer) {
  488. _clearTimeout(maxTimer);
  489. maxTimer = null;
  490. }
  491. return Promise.resolve(invoke());
  492. }
  493. return new Promise((resolve, reject) => {
  494. lastRejector = options.rejectOnCancel ? reject : resolve;
  495. if (maxDuration && !maxTimer) {
  496. maxTimer = setTimeout(() => {
  497. if (timer)
  498. _clearTimeout(timer);
  499. maxTimer = null;
  500. resolve(invoke());
  501. }, maxDuration);
  502. }
  503. timer = setTimeout(() => {
  504. if (maxTimer)
  505. _clearTimeout(maxTimer);
  506. maxTimer = null;
  507. resolve(invoke());
  508. }, duration);
  509. });
  510. };
  511. return filter;
  512. }
  513. function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {
  514. let lastExec = 0;
  515. let timer;
  516. let isLeading = true;
  517. let lastRejector = noop;
  518. let lastValue;
  519. const clear = () => {
  520. if (timer) {
  521. clearTimeout(timer);
  522. timer = void 0;
  523. lastRejector();
  524. lastRejector = noop;
  525. }
  526. };
  527. const filter = (_invoke) => {
  528. const duration = toValue(ms);
  529. const elapsed = Date.now() - lastExec;
  530. const invoke = () => {
  531. return lastValue = _invoke();
  532. };
  533. clear();
  534. if (duration <= 0) {
  535. lastExec = Date.now();
  536. return invoke();
  537. }
  538. if (elapsed > duration && (leading || !isLeading)) {
  539. lastExec = Date.now();
  540. invoke();
  541. } else if (trailing) {
  542. lastValue = new Promise((resolve, reject) => {
  543. lastRejector = rejectOnCancel ? reject : resolve;
  544. timer = setTimeout(() => {
  545. lastExec = Date.now();
  546. isLeading = true;
  547. resolve(invoke());
  548. clear();
  549. }, Math.max(0, duration - elapsed));
  550. });
  551. }
  552. if (!leading && !timer)
  553. timer = setTimeout(() => isLeading = true, duration);
  554. isLeading = false;
  555. return lastValue;
  556. };
  557. return filter;
  558. }
  559. function pausableFilter(extendFilter = bypassFilter) {
  560. const isActive = vue.ref(true);
  561. function pause() {
  562. isActive.value = false;
  563. }
  564. function resume() {
  565. isActive.value = true;
  566. }
  567. const eventFilter = (...args) => {
  568. if (isActive.value)
  569. extendFilter(...args);
  570. };
  571. return { isActive: vue.readonly(isActive), pause, resume, eventFilter };
  572. }
  573. function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
  574. return new Promise((resolve, reject) => {
  575. if (throwOnTimeout)
  576. setTimeout(() => reject(reason), ms);
  577. else
  578. setTimeout(resolve, ms);
  579. });
  580. }
  581. function containsProp(obj, ...props) {
  582. return props.some((k) => k in obj);
  583. }
  584. function toRef(...args) {
  585. if (args.length !== 1)
  586. return vue.toRef(...args);
  587. const r = args[0];
  588. return typeof r === "function" ? vue.readonly(vue.customRef(() => ({ get: r, set: noop }))) : vue.ref(r);
  589. }
  590. function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
  591. return createFilterWrapper(
  592. throttleFilter(ms, trailing, leading, rejectOnCancel),
  593. fn
  594. );
  595. }
  596. var __defProp$9 = Object.defineProperty;
  597. var __defProps$7 = Object.defineProperties;
  598. var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
  599. var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
  600. var __hasOwnProp$b = Object.prototype.hasOwnProperty;
  601. var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
  602. var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  603. var __spreadValues$9 = (a, b) => {
  604. for (var prop in b || (b = {}))
  605. if (__hasOwnProp$b.call(b, prop))
  606. __defNormalProp$9(a, prop, b[prop]);
  607. if (__getOwnPropSymbols$b)
  608. for (var prop of __getOwnPropSymbols$b(b)) {
  609. if (__propIsEnum$b.call(b, prop))
  610. __defNormalProp$9(a, prop, b[prop]);
  611. }
  612. return a;
  613. };
  614. var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
  615. function toRefs(objectRef, options = {}) {
  616. if (!vue.isRef(objectRef))
  617. return vue.toRefs(objectRef);
  618. const result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};
  619. for (const key in objectRef.value) {
  620. result[key] = vue.customRef(() => ({
  621. get() {
  622. return objectRef.value[key];
  623. },
  624. set(v) {
  625. var _a;
  626. const replaceRef = (_a = toValue(options.replaceRef)) != null ? _a : true;
  627. if (replaceRef) {
  628. if (Array.isArray(objectRef.value)) {
  629. const copy = [...objectRef.value];
  630. copy[key] = v;
  631. objectRef.value = copy;
  632. } else {
  633. const newObject = __spreadProps$7(__spreadValues$9({}, objectRef.value), { [key]: v });
  634. Object.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));
  635. objectRef.value = newObject;
  636. }
  637. } else {
  638. objectRef.value[key] = v;
  639. }
  640. }
  641. }));
  642. }
  643. return result;
  644. }
  645. function tryOnMounted(fn, sync = true) {
  646. if (vue.getCurrentInstance())
  647. vue.onMounted(fn);
  648. else if (sync)
  649. fn();
  650. else
  651. vue.nextTick(fn);
  652. }
  653. function tryOnUnmounted(fn) {
  654. if (vue.getCurrentInstance())
  655. vue.onUnmounted(fn);
  656. }
  657. function createUntil(r, isNot = false) {
  658. function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
  659. let stop = null;
  660. const watcher = new Promise((resolve) => {
  661. stop = vue.watch(
  662. r,
  663. (v) => {
  664. if (condition(v) !== isNot) {
  665. stop == null ? void 0 : stop();
  666. resolve(v);
  667. }
  668. },
  669. {
  670. flush,
  671. deep,
  672. immediate: true
  673. }
  674. );
  675. });
  676. const promises = [watcher];
  677. if (timeout != null) {
  678. promises.push(
  679. promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())
  680. );
  681. }
  682. return Promise.race(promises);
  683. }
  684. function toBe(value, options) {
  685. if (!vue.isRef(value))
  686. return toMatch((v) => v === value, options);
  687. const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
  688. let stop = null;
  689. const watcher = new Promise((resolve) => {
  690. stop = vue.watch(
  691. [r, value],
  692. ([v1, v2]) => {
  693. if (isNot !== (v1 === v2)) {
  694. stop == null ? void 0 : stop();
  695. resolve(v1);
  696. }
  697. },
  698. {
  699. flush,
  700. deep,
  701. immediate: true
  702. }
  703. );
  704. });
  705. const promises = [watcher];
  706. if (timeout != null) {
  707. promises.push(
  708. promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {
  709. stop == null ? void 0 : stop();
  710. return toValue(r);
  711. })
  712. );
  713. }
  714. return Promise.race(promises);
  715. }
  716. function toBeTruthy(options) {
  717. return toMatch((v) => Boolean(v), options);
  718. }
  719. function toBeNull(options) {
  720. return toBe(null, options);
  721. }
  722. function toBeUndefined(options) {
  723. return toBe(void 0, options);
  724. }
  725. function toBeNaN(options) {
  726. return toMatch(Number.isNaN, options);
  727. }
  728. function toContains(value, options) {
  729. return toMatch((v) => {
  730. const array = Array.from(v);
  731. return array.includes(value) || array.includes(toValue(value));
  732. }, options);
  733. }
  734. function changed(options) {
  735. return changedTimes(1, options);
  736. }
  737. function changedTimes(n = 1, options) {
  738. let count = -1;
  739. return toMatch(() => {
  740. count += 1;
  741. return count >= n;
  742. }, options);
  743. }
  744. if (Array.isArray(toValue(r))) {
  745. const instance = {
  746. toMatch,
  747. toContains,
  748. changed,
  749. changedTimes,
  750. get not() {
  751. return createUntil(r, !isNot);
  752. }
  753. };
  754. return instance;
  755. } else {
  756. const instance = {
  757. toMatch,
  758. toBe,
  759. toBeTruthy,
  760. toBeNull,
  761. toBeNaN,
  762. toBeUndefined,
  763. changed,
  764. changedTimes,
  765. get not() {
  766. return createUntil(r, !isNot);
  767. }
  768. };
  769. return instance;
  770. }
  771. }
  772. function until(r) {
  773. return createUntil(r);
  774. }
  775. function useTimeoutFn(cb, interval, options = {}) {
  776. const {
  777. immediate = true
  778. } = options;
  779. const isPending = vue.ref(false);
  780. let timer = null;
  781. function clear() {
  782. if (timer) {
  783. clearTimeout(timer);
  784. timer = null;
  785. }
  786. }
  787. function stop() {
  788. isPending.value = false;
  789. clear();
  790. }
  791. function start(...args) {
  792. clear();
  793. isPending.value = true;
  794. timer = setTimeout(() => {
  795. isPending.value = false;
  796. timer = null;
  797. cb(...args);
  798. }, toValue(interval));
  799. }
  800. if (immediate) {
  801. isPending.value = true;
  802. if (isClient)
  803. start();
  804. }
  805. tryOnScopeDispose(stop);
  806. return {
  807. isPending: vue.readonly(isPending),
  808. start,
  809. stop
  810. };
  811. }
  812. function useToggle(initialValue = false, options = {}) {
  813. const {
  814. truthyValue = true,
  815. falsyValue = false
  816. } = options;
  817. const valueIsRef = vue.isRef(initialValue);
  818. const _value = vue.ref(initialValue);
  819. function toggle(value) {
  820. if (arguments.length) {
  821. _value.value = value;
  822. return _value.value;
  823. } else {
  824. const truthy = toValue(truthyValue);
  825. _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
  826. return _value.value;
  827. }
  828. }
  829. if (valueIsRef)
  830. return toggle;
  831. else
  832. return [_value, toggle];
  833. }
  834. function watchArray(source, cb, options) {
  835. let oldList = (options == null ? void 0 : options.immediate) ? [] : [
  836. ...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)
  837. ];
  838. return vue.watch(source, (newList, _, onCleanup) => {
  839. const oldListRemains = Array.from({ length: oldList.length });
  840. const added = [];
  841. for (const obj of newList) {
  842. let found = false;
  843. for (let i = 0; i < oldList.length; i++) {
  844. if (!oldListRemains[i] && obj === oldList[i]) {
  845. oldListRemains[i] = true;
  846. found = true;
  847. break;
  848. }
  849. }
  850. if (!found)
  851. added.push(obj);
  852. }
  853. const removed = oldList.filter((_2, i) => !oldListRemains[i]);
  854. cb(newList, oldList, added, removed, onCleanup);
  855. oldList = [...newList];
  856. }, options);
  857. }
  858. var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
  859. var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
  860. var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
  861. var __objRest$5 = (source, exclude) => {
  862. var target = {};
  863. for (var prop in source)
  864. if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
  865. target[prop] = source[prop];
  866. if (source != null && __getOwnPropSymbols$8)
  867. for (var prop of __getOwnPropSymbols$8(source)) {
  868. if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
  869. target[prop] = source[prop];
  870. }
  871. return target;
  872. };
  873. function watchWithFilter(source, cb, options = {}) {
  874. const _a = options, {
  875. eventFilter = bypassFilter
  876. } = _a, watchOptions = __objRest$5(_a, [
  877. "eventFilter"
  878. ]);
  879. return vue.watch(
  880. source,
  881. createFilterWrapper(
  882. eventFilter,
  883. cb
  884. ),
  885. watchOptions
  886. );
  887. }
  888. var __defProp$6 = Object.defineProperty;
  889. var __defProps$6$1 = Object.defineProperties;
  890. var __getOwnPropDescs$6$1 = Object.getOwnPropertyDescriptors;
  891. var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
  892. var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
  893. var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
  894. var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  895. var __spreadValues$6 = (a, b) => {
  896. for (var prop in b || (b = {}))
  897. if (__hasOwnProp$6.call(b, prop))
  898. __defNormalProp$6(a, prop, b[prop]);
  899. if (__getOwnPropSymbols$6)
  900. for (var prop of __getOwnPropSymbols$6(b)) {
  901. if (__propIsEnum$6.call(b, prop))
  902. __defNormalProp$6(a, prop, b[prop]);
  903. }
  904. return a;
  905. };
  906. var __spreadProps$6$1 = (a, b) => __defProps$6$1(a, __getOwnPropDescs$6$1(b));
  907. var __objRest$3 = (source, exclude) => {
  908. var target = {};
  909. for (var prop in source)
  910. if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
  911. target[prop] = source[prop];
  912. if (source != null && __getOwnPropSymbols$6)
  913. for (var prop of __getOwnPropSymbols$6(source)) {
  914. if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
  915. target[prop] = source[prop];
  916. }
  917. return target;
  918. };
  919. function watchDebounced(source, cb, options = {}) {
  920. const _a = options, {
  921. debounce = 0,
  922. maxWait = void 0
  923. } = _a, watchOptions = __objRest$3(_a, [
  924. "debounce",
  925. "maxWait"
  926. ]);
  927. return watchWithFilter(
  928. source,
  929. cb,
  930. __spreadProps$6$1(__spreadValues$6({}, watchOptions), {
  931. eventFilter: debounceFilter(debounce, { maxWait })
  932. })
  933. );
  934. }
  935. var __defProp$2 = Object.defineProperty;
  936. var __defProps$2 = Object.defineProperties;
  937. var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
  938. var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
  939. var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
  940. var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
  941. var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  942. var __spreadValues$2 = (a, b) => {
  943. for (var prop in b || (b = {}))
  944. if (__hasOwnProp$2.call(b, prop))
  945. __defNormalProp$2(a, prop, b[prop]);
  946. if (__getOwnPropSymbols$2)
  947. for (var prop of __getOwnPropSymbols$2(b)) {
  948. if (__propIsEnum$2.call(b, prop))
  949. __defNormalProp$2(a, prop, b[prop]);
  950. }
  951. return a;
  952. };
  953. var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
  954. var __objRest$1 = (source, exclude) => {
  955. var target = {};
  956. for (var prop in source)
  957. if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
  958. target[prop] = source[prop];
  959. if (source != null && __getOwnPropSymbols$2)
  960. for (var prop of __getOwnPropSymbols$2(source)) {
  961. if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
  962. target[prop] = source[prop];
  963. }
  964. return target;
  965. };
  966. function watchPausable(source, cb, options = {}) {
  967. const _a = options, {
  968. eventFilter: filter
  969. } = _a, watchOptions = __objRest$1(_a, [
  970. "eventFilter"
  971. ]);
  972. const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
  973. const stop = watchWithFilter(
  974. source,
  975. cb,
  976. __spreadProps$2(__spreadValues$2({}, watchOptions), {
  977. eventFilter
  978. })
  979. );
  980. return { stop, pause, resume, isActive };
  981. }
  982. function unrefElement(elRef) {
  983. var _a;
  984. const plain = toValue(elRef);
  985. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  986. }
  987. const defaultWindow = isClient ? window : void 0;
  988. const defaultDocument = isClient ? window.document : void 0;
  989. function useEventListener(...args) {
  990. let target;
  991. let events;
  992. let listeners;
  993. let options;
  994. if (typeof args[0] === "string" || Array.isArray(args[0])) {
  995. [events, listeners, options] = args;
  996. target = defaultWindow;
  997. } else {
  998. [target, events, listeners, options] = args;
  999. }
  1000. if (!target)
  1001. return noop;
  1002. if (!Array.isArray(events))
  1003. events = [events];
  1004. if (!Array.isArray(listeners))
  1005. listeners = [listeners];
  1006. const cleanups = [];
  1007. const cleanup = () => {
  1008. cleanups.forEach((fn) => fn());
  1009. cleanups.length = 0;
  1010. };
  1011. const register = (el, event, listener, options2) => {
  1012. el.addEventListener(event, listener, options2);
  1013. return () => el.removeEventListener(event, listener, options2);
  1014. };
  1015. const stopWatch = vue.watch(
  1016. () => [unrefElement(target), toValue(options)],
  1017. ([el, options2]) => {
  1018. cleanup();
  1019. if (!el)
  1020. return;
  1021. cleanups.push(
  1022. ...events.flatMap((event) => {
  1023. return listeners.map((listener) => register(el, event, listener, options2));
  1024. })
  1025. );
  1026. },
  1027. { immediate: true, flush: "post" }
  1028. );
  1029. const stop = () => {
  1030. stopWatch();
  1031. cleanup();
  1032. };
  1033. tryOnScopeDispose(stop);
  1034. return stop;
  1035. }
  1036. let _iOSWorkaround = false;
  1037. function onClickOutside(target, handler, options = {}) {
  1038. const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
  1039. if (!window2)
  1040. return;
  1041. if (isIOS && !_iOSWorkaround) {
  1042. _iOSWorkaround = true;
  1043. Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop));
  1044. window2.document.documentElement.addEventListener("click", noop);
  1045. }
  1046. let shouldListen = true;
  1047. const shouldIgnore = (event) => {
  1048. return ignore.some((target2) => {
  1049. if (typeof target2 === "string") {
  1050. return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
  1051. } else {
  1052. const el = unrefElement(target2);
  1053. return el && (event.target === el || event.composedPath().includes(el));
  1054. }
  1055. });
  1056. };
  1057. const listener = (event) => {
  1058. const el = unrefElement(target);
  1059. if (!el || el === event.target || event.composedPath().includes(el))
  1060. return;
  1061. if (event.detail === 0)
  1062. shouldListen = !shouldIgnore(event);
  1063. if (!shouldListen) {
  1064. shouldListen = true;
  1065. return;
  1066. }
  1067. handler(event);
  1068. };
  1069. const cleanup = [
  1070. useEventListener(window2, "click", listener, { passive: true, capture }),
  1071. useEventListener(window2, "pointerdown", (e) => {
  1072. const el = unrefElement(target);
  1073. if (el)
  1074. shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
  1075. }, { passive: true }),
  1076. detectIframe && useEventListener(window2, "blur", (event) => {
  1077. setTimeout(() => {
  1078. var _a;
  1079. const el = unrefElement(target);
  1080. if (((_a = window2.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
  1081. handler(event);
  1082. }, 0);
  1083. })
  1084. ].filter(Boolean);
  1085. const stop = () => cleanup.forEach((fn) => fn());
  1086. return stop;
  1087. }
  1088. function useMounted() {
  1089. const isMounted = vue.ref(false);
  1090. if (vue.getCurrentInstance()) {
  1091. vue.onMounted(() => {
  1092. isMounted.value = true;
  1093. });
  1094. }
  1095. return isMounted;
  1096. }
  1097. function useSupported(callback) {
  1098. const isMounted = useMounted();
  1099. return vue.computed(() => {
  1100. isMounted.value;
  1101. return Boolean(callback());
  1102. });
  1103. }
  1104. function useMediaQuery(query, options = {}) {
  1105. const { window: window2 = defaultWindow } = options;
  1106. const isSupported = useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
  1107. let mediaQuery;
  1108. const matches = vue.ref(false);
  1109. const handler = (event) => {
  1110. matches.value = event.matches;
  1111. };
  1112. const cleanup = () => {
  1113. if (!mediaQuery)
  1114. return;
  1115. if ("removeEventListener" in mediaQuery)
  1116. mediaQuery.removeEventListener("change", handler);
  1117. else
  1118. mediaQuery.removeListener(handler);
  1119. };
  1120. const stopWatch = vue.watchEffect(() => {
  1121. if (!isSupported.value)
  1122. return;
  1123. cleanup();
  1124. mediaQuery = window2.matchMedia(toValue(query));
  1125. if ("addEventListener" in mediaQuery)
  1126. mediaQuery.addEventListener("change", handler);
  1127. else
  1128. mediaQuery.addListener(handler);
  1129. matches.value = mediaQuery.matches;
  1130. });
  1131. tryOnScopeDispose(() => {
  1132. stopWatch();
  1133. cleanup();
  1134. mediaQuery = void 0;
  1135. });
  1136. return matches;
  1137. }
  1138. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : {};
  1139. const globalKey = "__vueuse_ssr_handlers__";
  1140. const handlers = /* @__PURE__ */ getHandlers();
  1141. function getHandlers() {
  1142. if (!(globalKey in _global))
  1143. _global[globalKey] = _global[globalKey] || {};
  1144. return _global[globalKey];
  1145. }
  1146. function getSSRHandler(key, fallback) {
  1147. return handlers[key] || fallback;
  1148. }
  1149. function guessSerializerType(rawInit) {
  1150. return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
  1151. }
  1152. var __defProp$l = Object.defineProperty;
  1153. var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
  1154. var __hasOwnProp$o = Object.prototype.hasOwnProperty;
  1155. var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
  1156. var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1157. var __spreadValues$l = (a, b) => {
  1158. for (var prop in b || (b = {}))
  1159. if (__hasOwnProp$o.call(b, prop))
  1160. __defNormalProp$l(a, prop, b[prop]);
  1161. if (__getOwnPropSymbols$o)
  1162. for (var prop of __getOwnPropSymbols$o(b)) {
  1163. if (__propIsEnum$o.call(b, prop))
  1164. __defNormalProp$l(a, prop, b[prop]);
  1165. }
  1166. return a;
  1167. };
  1168. const StorageSerializers = {
  1169. boolean: {
  1170. read: (v) => v === "true",
  1171. write: (v) => String(v)
  1172. },
  1173. object: {
  1174. read: (v) => JSON.parse(v),
  1175. write: (v) => JSON.stringify(v)
  1176. },
  1177. number: {
  1178. read: (v) => Number.parseFloat(v),
  1179. write: (v) => String(v)
  1180. },
  1181. any: {
  1182. read: (v) => v,
  1183. write: (v) => String(v)
  1184. },
  1185. string: {
  1186. read: (v) => v,
  1187. write: (v) => String(v)
  1188. },
  1189. map: {
  1190. read: (v) => new Map(JSON.parse(v)),
  1191. write: (v) => JSON.stringify(Array.from(v.entries()))
  1192. },
  1193. set: {
  1194. read: (v) => new Set(JSON.parse(v)),
  1195. write: (v) => JSON.stringify(Array.from(v))
  1196. },
  1197. date: {
  1198. read: (v) => new Date(v),
  1199. write: (v) => v.toISOString()
  1200. }
  1201. };
  1202. const customStorageEventName = "vueuse-storage";
  1203. function useStorage(key, defaults, storage, options = {}) {
  1204. var _a;
  1205. const {
  1206. flush = "pre",
  1207. deep = true,
  1208. listenToStorageChanges = true,
  1209. writeDefaults = true,
  1210. mergeDefaults = false,
  1211. shallow,
  1212. window: window2 = defaultWindow,
  1213. eventFilter,
  1214. onError = (e) => {
  1215. console.error(e);
  1216. }
  1217. } = options;
  1218. const data = (shallow ? vue.shallowRef : vue.ref)(defaults);
  1219. if (!storage) {
  1220. try {
  1221. storage = getSSRHandler("getDefaultStorage", () => {
  1222. var _a2;
  1223. return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;
  1224. })();
  1225. } catch (e) {
  1226. onError(e);
  1227. }
  1228. }
  1229. if (!storage)
  1230. return data;
  1231. const rawInit = toValue(defaults);
  1232. const type = guessSerializerType(rawInit);
  1233. const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
  1234. const { pause: pauseWatch, resume: resumeWatch } = watchPausable(
  1235. data,
  1236. () => write(data.value),
  1237. { flush, deep, eventFilter }
  1238. );
  1239. if (window2 && listenToStorageChanges) {
  1240. useEventListener(window2, "storage", update);
  1241. useEventListener(window2, customStorageEventName, updateFromCustomEvent);
  1242. }
  1243. update();
  1244. return data;
  1245. function write(v) {
  1246. try {
  1247. if (v == null) {
  1248. storage.removeItem(key);
  1249. } else {
  1250. const serialized = serializer.write(v);
  1251. const oldValue = storage.getItem(key);
  1252. if (oldValue !== serialized) {
  1253. storage.setItem(key, serialized);
  1254. if (window2) {
  1255. window2.dispatchEvent(new CustomEvent(customStorageEventName, {
  1256. detail: {
  1257. key,
  1258. oldValue,
  1259. newValue: serialized,
  1260. storageArea: storage
  1261. }
  1262. }));
  1263. }
  1264. }
  1265. }
  1266. } catch (e) {
  1267. onError(e);
  1268. }
  1269. }
  1270. function read(event) {
  1271. const rawValue = event ? event.newValue : storage.getItem(key);
  1272. if (rawValue == null) {
  1273. if (writeDefaults && rawInit !== null)
  1274. storage.setItem(key, serializer.write(rawInit));
  1275. return rawInit;
  1276. } else if (!event && mergeDefaults) {
  1277. const value = serializer.read(rawValue);
  1278. if (typeof mergeDefaults === "function")
  1279. return mergeDefaults(value, rawInit);
  1280. else if (type === "object" && !Array.isArray(value))
  1281. return __spreadValues$l(__spreadValues$l({}, rawInit), value);
  1282. return value;
  1283. } else if (typeof rawValue !== "string") {
  1284. return rawValue;
  1285. } else {
  1286. return serializer.read(rawValue);
  1287. }
  1288. }
  1289. function updateFromCustomEvent(event) {
  1290. update(event.detail);
  1291. }
  1292. function update(event) {
  1293. if (event && event.storageArea !== storage)
  1294. return;
  1295. if (event && event.key == null) {
  1296. data.value = rawInit;
  1297. return;
  1298. }
  1299. if (event && event.key !== key)
  1300. return;
  1301. pauseWatch();
  1302. try {
  1303. data.value = read(event);
  1304. } catch (e) {
  1305. onError(e);
  1306. } finally {
  1307. if (event)
  1308. vue.nextTick(resumeWatch);
  1309. else
  1310. resumeWatch();
  1311. }
  1312. }
  1313. }
  1314. var __defProp$g = Object.defineProperty;
  1315. var __defProps$6 = Object.defineProperties;
  1316. var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
  1317. var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
  1318. var __hasOwnProp$i = Object.prototype.hasOwnProperty;
  1319. var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
  1320. var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1321. var __spreadValues$g = (a, b) => {
  1322. for (var prop in b || (b = {}))
  1323. if (__hasOwnProp$i.call(b, prop))
  1324. __defNormalProp$g(a, prop, b[prop]);
  1325. if (__getOwnPropSymbols$i)
  1326. for (var prop of __getOwnPropSymbols$i(b)) {
  1327. if (__propIsEnum$i.call(b, prop))
  1328. __defNormalProp$g(a, prop, b[prop]);
  1329. }
  1330. return a;
  1331. };
  1332. var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
  1333. function useDraggable(target, options = {}) {
  1334. var _a, _b;
  1335. const {
  1336. pointerTypes,
  1337. preventDefault,
  1338. stopPropagation,
  1339. exact,
  1340. onMove,
  1341. onEnd,
  1342. onStart,
  1343. initialValue,
  1344. axis = "both",
  1345. draggingElement = defaultWindow,
  1346. handle: draggingHandle = target
  1347. } = options;
  1348. const position = vue.ref(
  1349. (_a = toValue(initialValue)) != null ? _a : { x: 0, y: 0 }
  1350. );
  1351. const pressedDelta = vue.ref();
  1352. const filterEvent = (e) => {
  1353. if (pointerTypes)
  1354. return pointerTypes.includes(e.pointerType);
  1355. return true;
  1356. };
  1357. const handleEvent = (e) => {
  1358. if (toValue(preventDefault))
  1359. e.preventDefault();
  1360. if (toValue(stopPropagation))
  1361. e.stopPropagation();
  1362. };
  1363. const start = (e) => {
  1364. if (!filterEvent(e))
  1365. return;
  1366. if (toValue(exact) && e.target !== toValue(target))
  1367. return;
  1368. const rect = toValue(target).getBoundingClientRect();
  1369. const pos = {
  1370. x: e.clientX - rect.left,
  1371. y: e.clientY - rect.top
  1372. };
  1373. if ((onStart == null ? void 0 : onStart(pos, e)) === false)
  1374. return;
  1375. pressedDelta.value = pos;
  1376. handleEvent(e);
  1377. };
  1378. const move = (e) => {
  1379. if (!filterEvent(e))
  1380. return;
  1381. if (!pressedDelta.value)
  1382. return;
  1383. let { x, y } = position.value;
  1384. if (axis === "x" || axis === "both")
  1385. x = e.clientX - pressedDelta.value.x;
  1386. if (axis === "y" || axis === "both")
  1387. y = e.clientY - pressedDelta.value.y;
  1388. position.value = {
  1389. x,
  1390. y
  1391. };
  1392. onMove == null ? void 0 : onMove(position.value, e);
  1393. handleEvent(e);
  1394. };
  1395. const end = (e) => {
  1396. if (!filterEvent(e))
  1397. return;
  1398. if (!pressedDelta.value)
  1399. return;
  1400. pressedDelta.value = void 0;
  1401. onEnd == null ? void 0 : onEnd(position.value, e);
  1402. handleEvent(e);
  1403. };
  1404. if (isClient) {
  1405. const config = { capture: (_b = options.capture) != null ? _b : true };
  1406. useEventListener(draggingHandle, "pointerdown", start, config);
  1407. useEventListener(draggingElement, "pointermove", move, config);
  1408. useEventListener(draggingElement, "pointerup", end, config);
  1409. }
  1410. return __spreadProps$6(__spreadValues$g({}, toRefs(position)), {
  1411. position,
  1412. isDragging: vue.computed(() => !!pressedDelta.value),
  1413. style: vue.computed(
  1414. () => `left:${position.value.x}px;top:${position.value.y}px;`
  1415. )
  1416. });
  1417. }
  1418. var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
  1419. var __hasOwnProp$h = Object.prototype.hasOwnProperty;
  1420. var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
  1421. var __objRest$2 = (source, exclude) => {
  1422. var target = {};
  1423. for (var prop in source)
  1424. if (__hasOwnProp$h.call(source, prop) && exclude.indexOf(prop) < 0)
  1425. target[prop] = source[prop];
  1426. if (source != null && __getOwnPropSymbols$h)
  1427. for (var prop of __getOwnPropSymbols$h(source)) {
  1428. if (exclude.indexOf(prop) < 0 && __propIsEnum$h.call(source, prop))
  1429. target[prop] = source[prop];
  1430. }
  1431. return target;
  1432. };
  1433. function useResizeObserver(target, callback, options = {}) {
  1434. const _a = options, { window: window2 = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
  1435. let observer;
  1436. const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
  1437. const cleanup = () => {
  1438. if (observer) {
  1439. observer.disconnect();
  1440. observer = void 0;
  1441. }
  1442. };
  1443. const targets = vue.computed(
  1444. () => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]
  1445. );
  1446. const stopWatch = vue.watch(
  1447. targets,
  1448. (els) => {
  1449. cleanup();
  1450. if (isSupported.value && window2) {
  1451. observer = new ResizeObserver(callback);
  1452. for (const _el of els)
  1453. _el && observer.observe(_el, observerOptions);
  1454. }
  1455. },
  1456. { immediate: true, flush: "post", deep: true }
  1457. );
  1458. const stop = () => {
  1459. cleanup();
  1460. stopWatch();
  1461. };
  1462. tryOnScopeDispose(stop);
  1463. return {
  1464. isSupported,
  1465. stop
  1466. };
  1467. }
  1468. function useElementBounding(target, options = {}) {
  1469. const {
  1470. reset: reset2 = true,
  1471. windowResize = true,
  1472. windowScroll = true,
  1473. immediate = true
  1474. } = options;
  1475. const height = vue.ref(0);
  1476. const bottom = vue.ref(0);
  1477. const left = vue.ref(0);
  1478. const right = vue.ref(0);
  1479. const top = vue.ref(0);
  1480. const width = vue.ref(0);
  1481. const x = vue.ref(0);
  1482. const y = vue.ref(0);
  1483. function update() {
  1484. const el = unrefElement(target);
  1485. if (!el) {
  1486. if (reset2) {
  1487. height.value = 0;
  1488. bottom.value = 0;
  1489. left.value = 0;
  1490. right.value = 0;
  1491. top.value = 0;
  1492. width.value = 0;
  1493. x.value = 0;
  1494. y.value = 0;
  1495. }
  1496. return;
  1497. }
  1498. const rect = el.getBoundingClientRect();
  1499. height.value = rect.height;
  1500. bottom.value = rect.bottom;
  1501. left.value = rect.left;
  1502. right.value = rect.right;
  1503. top.value = rect.top;
  1504. width.value = rect.width;
  1505. x.value = rect.x;
  1506. y.value = rect.y;
  1507. }
  1508. useResizeObserver(target, update);
  1509. vue.watch(() => unrefElement(target), (ele) => !ele && update());
  1510. if (windowScroll)
  1511. useEventListener("scroll", update, { capture: true, passive: true });
  1512. if (windowResize)
  1513. useEventListener("resize", update, { passive: true });
  1514. tryOnMounted(() => {
  1515. if (immediate)
  1516. update();
  1517. });
  1518. return {
  1519. height,
  1520. bottom,
  1521. left,
  1522. right,
  1523. top,
  1524. width,
  1525. x,
  1526. y,
  1527. update
  1528. };
  1529. }
  1530. function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
  1531. const { window: window2 = defaultWindow, box = "content-box" } = options;
  1532. const isSVG = vue.computed(() => {
  1533. var _a, _b;
  1534. return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
  1535. });
  1536. const width = vue.ref(initialSize.width);
  1537. const height = vue.ref(initialSize.height);
  1538. useResizeObserver(
  1539. target,
  1540. ([entry]) => {
  1541. const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
  1542. if (window2 && isSVG.value) {
  1543. const $elem = unrefElement(target);
  1544. if ($elem) {
  1545. const styles = window2.getComputedStyle($elem);
  1546. width.value = Number.parseFloat(styles.width);
  1547. height.value = Number.parseFloat(styles.height);
  1548. }
  1549. } else {
  1550. if (boxSize) {
  1551. const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
  1552. width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
  1553. height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
  1554. } else {
  1555. width.value = entry.contentRect.width;
  1556. height.value = entry.contentRect.height;
  1557. }
  1558. }
  1559. },
  1560. options
  1561. );
  1562. vue.watch(
  1563. () => unrefElement(target),
  1564. (ele) => {
  1565. width.value = ele ? initialSize.width : 0;
  1566. height.value = ele ? initialSize.height : 0;
  1567. }
  1568. );
  1569. return {
  1570. width,
  1571. height
  1572. };
  1573. }
  1574. var __defProp$e = Object.defineProperty;
  1575. var __defProps$5 = Object.defineProperties;
  1576. var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
  1577. var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
  1578. var __hasOwnProp$f = Object.prototype.hasOwnProperty;
  1579. var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
  1580. var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1581. var __spreadValues$e = (a, b) => {
  1582. for (var prop in b || (b = {}))
  1583. if (__hasOwnProp$f.call(b, prop))
  1584. __defNormalProp$e(a, prop, b[prop]);
  1585. if (__getOwnPropSymbols$f)
  1586. for (var prop of __getOwnPropSymbols$f(b)) {
  1587. if (__propIsEnum$f.call(b, prop))
  1588. __defNormalProp$e(a, prop, b[prop]);
  1589. }
  1590. return a;
  1591. };
  1592. var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
  1593. const payloadMapping = {
  1594. json: "application/json",
  1595. text: "text/plain"
  1596. };
  1597. function isFetchOptions(obj) {
  1598. return obj && containsProp(obj, "immediate", "refetch", "initialData", "timeout", "beforeFetch", "afterFetch", "onFetchError", "fetch");
  1599. }
  1600. function headersToObject(headers) {
  1601. if (typeof Headers !== "undefined" && headers instanceof Headers)
  1602. return Object.fromEntries([...headers.entries()]);
  1603. return headers;
  1604. }
  1605. function useFetch(url, ...args) {
  1606. var _a;
  1607. const supportsAbort = typeof AbortController === "function";
  1608. let fetchOptions = {};
  1609. let options = { immediate: true, refetch: false, timeout: 0 };
  1610. const config = {
  1611. method: "GET",
  1612. type: "text",
  1613. payload: void 0
  1614. };
  1615. if (args.length > 0) {
  1616. if (isFetchOptions(args[0]))
  1617. options = __spreadValues$e(__spreadValues$e({}, options), args[0]);
  1618. else
  1619. fetchOptions = args[0];
  1620. }
  1621. if (args.length > 1) {
  1622. if (isFetchOptions(args[1]))
  1623. options = __spreadValues$e(__spreadValues$e({}, options), args[1]);
  1624. }
  1625. const {
  1626. fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,
  1627. initialData,
  1628. timeout
  1629. } = options;
  1630. const responseEvent = createEventHook();
  1631. const errorEvent = createEventHook();
  1632. const finallyEvent = createEventHook();
  1633. const isFinished = vue.ref(false);
  1634. const isFetching = vue.ref(false);
  1635. const aborted = vue.ref(false);
  1636. const statusCode = vue.ref(null);
  1637. const response = vue.shallowRef(null);
  1638. const error = vue.shallowRef(null);
  1639. const data = vue.shallowRef(initialData || null);
  1640. const canAbort = vue.computed(() => supportsAbort && isFetching.value);
  1641. let controller;
  1642. let timer;
  1643. const abort = () => {
  1644. if (supportsAbort) {
  1645. controller == null ? void 0 : controller.abort();
  1646. controller = new AbortController();
  1647. controller.signal.onabort = () => aborted.value = true;
  1648. fetchOptions = __spreadProps$5(__spreadValues$e({}, fetchOptions), {
  1649. signal: controller.signal
  1650. });
  1651. }
  1652. };
  1653. const loading = (isLoading) => {
  1654. isFetching.value = isLoading;
  1655. isFinished.value = !isLoading;
  1656. };
  1657. if (timeout)
  1658. timer = useTimeoutFn(abort, timeout, { immediate: false });
  1659. const execute = async (throwOnFailed = false) => {
  1660. var _a2;
  1661. abort();
  1662. loading(true);
  1663. error.value = null;
  1664. statusCode.value = null;
  1665. aborted.value = false;
  1666. const defaultFetchOptions = {
  1667. method: config.method,
  1668. headers: {}
  1669. };
  1670. if (config.payload) {
  1671. const headers = headersToObject(defaultFetchOptions.headers);
  1672. const payload = toValue(config.payload);
  1673. if (!config.payloadType && payload && Object.getPrototypeOf(payload) === Object.prototype && !(payload instanceof FormData))
  1674. config.payloadType = "json";
  1675. if (config.payloadType)
  1676. headers["Content-Type"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;
  1677. defaultFetchOptions.body = config.payloadType === "json" ? JSON.stringify(payload) : payload;
  1678. }
  1679. let isCanceled = false;
  1680. const context = {
  1681. url: toValue(url),
  1682. options: __spreadValues$e(__spreadValues$e({}, defaultFetchOptions), fetchOptions),
  1683. cancel: () => {
  1684. isCanceled = true;
  1685. }
  1686. };
  1687. if (options.beforeFetch)
  1688. Object.assign(context, await options.beforeFetch(context));
  1689. if (isCanceled || !fetch) {
  1690. loading(false);
  1691. return Promise.resolve(null);
  1692. }
  1693. let responseData = null;
  1694. if (timer)
  1695. timer.start();
  1696. return new Promise((resolve, reject) => {
  1697. var _a3;
  1698. fetch(
  1699. context.url,
  1700. __spreadProps$5(__spreadValues$e(__spreadValues$e({}, defaultFetchOptions), context.options), {
  1701. headers: __spreadValues$e(__spreadValues$e({}, headersToObject(defaultFetchOptions.headers)), headersToObject((_a3 = context.options) == null ? void 0 : _a3.headers))
  1702. })
  1703. ).then(async (fetchResponse) => {
  1704. response.value = fetchResponse;
  1705. statusCode.value = fetchResponse.status;
  1706. responseData = await fetchResponse[config.type]();
  1707. if (!fetchResponse.ok) {
  1708. data.value = initialData || null;
  1709. throw new Error(fetchResponse.statusText);
  1710. }
  1711. if (options.afterFetch)
  1712. ({ data: responseData } = await options.afterFetch({ data: responseData, response: fetchResponse }));
  1713. data.value = responseData;
  1714. responseEvent.trigger(fetchResponse);
  1715. return resolve(fetchResponse);
  1716. }).catch(async (fetchError) => {
  1717. let errorData = fetchError.message || fetchError.name;
  1718. if (options.onFetchError)
  1719. ({ error: errorData } = await options.onFetchError({ data: responseData, error: fetchError, response: response.value }));
  1720. error.value = errorData;
  1721. errorEvent.trigger(fetchError);
  1722. if (throwOnFailed)
  1723. return reject(fetchError);
  1724. return resolve(null);
  1725. }).finally(() => {
  1726. loading(false);
  1727. if (timer)
  1728. timer.stop();
  1729. finallyEvent.trigger(null);
  1730. });
  1731. });
  1732. };
  1733. const refetch = toRef(options.refetch);
  1734. vue.watch(
  1735. [
  1736. refetch,
  1737. toRef(url)
  1738. ],
  1739. ([refetch2]) => refetch2 && execute(),
  1740. { deep: true }
  1741. );
  1742. const shell = {
  1743. isFinished,
  1744. statusCode,
  1745. response,
  1746. error,
  1747. data,
  1748. isFetching,
  1749. canAbort,
  1750. aborted,
  1751. abort,
  1752. execute,
  1753. onFetchResponse: responseEvent.on,
  1754. onFetchError: errorEvent.on,
  1755. onFetchFinally: finallyEvent.on,
  1756. // method
  1757. get: setMethod("GET"),
  1758. put: setMethod("PUT"),
  1759. post: setMethod("POST"),
  1760. delete: setMethod("DELETE"),
  1761. patch: setMethod("PATCH"),
  1762. head: setMethod("HEAD"),
  1763. options: setMethod("OPTIONS"),
  1764. // type
  1765. json: setType("json"),
  1766. text: setType("text"),
  1767. blob: setType("blob"),
  1768. arrayBuffer: setType("arrayBuffer"),
  1769. formData: setType("formData")
  1770. };
  1771. function setMethod(method) {
  1772. return (payload, payloadType) => {
  1773. if (!isFetching.value) {
  1774. config.method = method;
  1775. config.payload = payload;
  1776. config.payloadType = payloadType;
  1777. if (vue.isRef(config.payload)) {
  1778. vue.watch(
  1779. [
  1780. refetch,
  1781. toRef(config.payload)
  1782. ],
  1783. ([refetch2]) => refetch2 && execute(),
  1784. { deep: true }
  1785. );
  1786. }
  1787. return __spreadProps$5(__spreadValues$e({}, shell), {
  1788. then(onFulfilled, onRejected) {
  1789. return waitUntilFinished().then(onFulfilled, onRejected);
  1790. }
  1791. });
  1792. }
  1793. return void 0;
  1794. };
  1795. }
  1796. function waitUntilFinished() {
  1797. return new Promise((resolve, reject) => {
  1798. until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));
  1799. });
  1800. }
  1801. function setType(type) {
  1802. return () => {
  1803. if (!isFetching.value) {
  1804. config.type = type;
  1805. return __spreadProps$5(__spreadValues$e({}, shell), {
  1806. then(onFulfilled, onRejected) {
  1807. return waitUntilFinished().then(onFulfilled, onRejected);
  1808. }
  1809. });
  1810. }
  1811. return void 0;
  1812. };
  1813. }
  1814. if (options.immediate)
  1815. Promise.resolve().then(() => execute());
  1816. return __spreadProps$5(__spreadValues$e({}, shell), {
  1817. then(onFulfilled, onRejected) {
  1818. return waitUntilFinished().then(onFulfilled, onRejected);
  1819. }
  1820. });
  1821. }
  1822. function useScriptTag(src, onLoaded = noop, options = {}) {
  1823. const {
  1824. immediate = true,
  1825. manual = false,
  1826. type = "text/javascript",
  1827. async = true,
  1828. crossOrigin,
  1829. referrerPolicy,
  1830. noModule,
  1831. defer,
  1832. document: document2 = defaultDocument,
  1833. attrs = {}
  1834. } = options;
  1835. const scriptTag = vue.ref(null);
  1836. let _promise = null;
  1837. const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {
  1838. const resolveWithElement = (el2) => {
  1839. scriptTag.value = el2;
  1840. resolve(el2);
  1841. return el2;
  1842. };
  1843. if (!document2) {
  1844. resolve(false);
  1845. return;
  1846. }
  1847. let shouldAppend = false;
  1848. let el = document2.querySelector(`script[src="${toValue(src)}"]`);
  1849. if (!el) {
  1850. el = document2.createElement("script");
  1851. el.type = type;
  1852. el.async = async;
  1853. el.src = toValue(src);
  1854. if (defer)
  1855. el.defer = defer;
  1856. if (crossOrigin)
  1857. el.crossOrigin = crossOrigin;
  1858. if (noModule)
  1859. el.noModule = noModule;
  1860. if (referrerPolicy)
  1861. el.referrerPolicy = referrerPolicy;
  1862. Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));
  1863. shouldAppend = true;
  1864. } else if (el.hasAttribute("data-loaded")) {
  1865. resolveWithElement(el);
  1866. }
  1867. el.addEventListener("error", (event) => reject(event));
  1868. el.addEventListener("abort", (event) => reject(event));
  1869. el.addEventListener("load", () => {
  1870. el.setAttribute("data-loaded", "true");
  1871. onLoaded(el);
  1872. resolveWithElement(el);
  1873. });
  1874. if (shouldAppend)
  1875. el = document2.head.appendChild(el);
  1876. if (!waitForScriptLoad)
  1877. resolveWithElement(el);
  1878. });
  1879. const load = (waitForScriptLoad = true) => {
  1880. if (!_promise)
  1881. _promise = loadScript(waitForScriptLoad);
  1882. return _promise;
  1883. };
  1884. const unload = () => {
  1885. if (!document2)
  1886. return;
  1887. _promise = null;
  1888. if (scriptTag.value)
  1889. scriptTag.value = null;
  1890. const el = document2.querySelector(`script[src="${toValue(src)}"]`);
  1891. if (el)
  1892. document2.head.removeChild(el);
  1893. };
  1894. if (immediate && !manual)
  1895. tryOnMounted(load);
  1896. if (!manual)
  1897. tryOnUnmounted(unload);
  1898. return { scriptTag, load, unload };
  1899. }
  1900. function useSessionStorage(key, initialValue, options = {}) {
  1901. const { window: window2 = defaultWindow } = options;
  1902. return useStorage(key, initialValue, window2 == null ? void 0 : window2.sessionStorage, options);
  1903. }
  1904. const defaultSortFn = (source, compareFn) => source.sort(compareFn);
  1905. const defaultCompare = (a, b) => a - b;
  1906. function useSorted(...args) {
  1907. var _a, _b, _c, _d;
  1908. const [source] = args;
  1909. let compareFn = defaultCompare;
  1910. let options = {};
  1911. if (args.length === 2) {
  1912. if (typeof args[1] === "object") {
  1913. options = args[1];
  1914. compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;
  1915. } else {
  1916. compareFn = (_b = args[1]) != null ? _b : defaultCompare;
  1917. }
  1918. } else if (args.length > 2) {
  1919. compareFn = (_c = args[1]) != null ? _c : defaultCompare;
  1920. options = (_d = args[2]) != null ? _d : {};
  1921. }
  1922. const {
  1923. dirty = false,
  1924. sortFn = defaultSortFn
  1925. } = options;
  1926. if (!dirty)
  1927. return vue.computed(() => sortFn([...toValue(source)], compareFn));
  1928. vue.watchEffect(() => {
  1929. const result = sortFn(toValue(source), compareFn);
  1930. if (vue.isRef(source))
  1931. source.value = result;
  1932. else
  1933. source.splice(0, source.length, ...result);
  1934. });
  1935. return source;
  1936. }
  1937. const DEFAULT_UNITS = [
  1938. { max: 6e4, value: 1e3, name: "second" },
  1939. { max: 276e4, value: 6e4, name: "minute" },
  1940. { max: 72e6, value: 36e5, name: "hour" },
  1941. { max: 5184e5, value: 864e5, name: "day" },
  1942. { max: 24192e5, value: 6048e5, name: "week" },
  1943. { max: 28512e6, value: 2592e6, name: "month" },
  1944. { max: Number.POSITIVE_INFINITY, value: 31536e6, name: "year" }
  1945. ];
  1946. const DEFAULT_MESSAGES = {
  1947. justNow: "just now",
  1948. past: (n) => n.match(/\d/) ? `${n} ago` : n,
  1949. future: (n) => n.match(/\d/) ? `in ${n}` : n,
  1950. month: (n, past) => n === 1 ? past ? "last month" : "next month" : `${n} month${n > 1 ? "s" : ""}`,
  1951. year: (n, past) => n === 1 ? past ? "last year" : "next year" : `${n} year${n > 1 ? "s" : ""}`,
  1952. day: (n, past) => n === 1 ? past ? "yesterday" : "tomorrow" : `${n} day${n > 1 ? "s" : ""}`,
  1953. week: (n, past) => n === 1 ? past ? "last week" : "next week" : `${n} week${n > 1 ? "s" : ""}`,
  1954. hour: (n) => `${n} hour${n > 1 ? "s" : ""}`,
  1955. minute: (n) => `${n} minute${n > 1 ? "s" : ""}`,
  1956. second: (n) => `${n} second${n > 1 ? "s" : ""}`,
  1957. invalid: ""
  1958. };
  1959. function DEFAULT_FORMATTER(date) {
  1960. return date.toISOString().slice(0, 10);
  1961. }
  1962. function formatTimeAgo(from, options = {}, now = Date.now()) {
  1963. var _a;
  1964. const {
  1965. max,
  1966. messages = DEFAULT_MESSAGES,
  1967. fullDateFormatter = DEFAULT_FORMATTER,
  1968. units = DEFAULT_UNITS,
  1969. showSecond = false,
  1970. rounding = "round"
  1971. } = options;
  1972. const roundFn = typeof rounding === "number" ? (n) => +n.toFixed(rounding) : Math[rounding];
  1973. const diff = +now - +from;
  1974. const absDiff = Math.abs(diff);
  1975. function getValue(diff2, unit) {
  1976. return roundFn(Math.abs(diff2) / unit.value);
  1977. }
  1978. function format(diff2, unit) {
  1979. const val = getValue(diff2, unit);
  1980. const past = diff2 > 0;
  1981. const str = applyFormat(unit.name, val, past);
  1982. return applyFormat(past ? "past" : "future", str, past);
  1983. }
  1984. function applyFormat(name, val, isPast) {
  1985. const formatter = messages[name];
  1986. if (typeof formatter === "function")
  1987. return formatter(val, isPast);
  1988. return formatter.replace("{0}", val.toString());
  1989. }
  1990. if (absDiff < 6e4 && !showSecond)
  1991. return messages.justNow;
  1992. if (typeof max === "number" && absDiff > max)
  1993. return fullDateFormatter(new Date(from));
  1994. if (typeof max === "string") {
  1995. const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;
  1996. if (unitMax && absDiff > unitMax)
  1997. return fullDateFormatter(new Date(from));
  1998. }
  1999. for (const [idx, unit] of units.entries()) {
  2000. const val = getValue(diff, unit);
  2001. if (val <= 0 && units[idx - 1])
  2002. return format(diff, units[idx - 1]);
  2003. if (absDiff < unit.max)
  2004. return format(diff, unit);
  2005. }
  2006. return messages.invalid;
  2007. }
  2008. function useVirtualList(list, options) {
  2009. const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = "itemHeight" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);
  2010. return {
  2011. list: currentList,
  2012. scrollTo,
  2013. containerProps: {
  2014. ref: containerRef,
  2015. onScroll: () => {
  2016. calculateRange();
  2017. },
  2018. style: containerStyle
  2019. },
  2020. wrapperProps
  2021. };
  2022. }
  2023. function useVirtualListResources(list) {
  2024. const containerRef = vue.ref(null);
  2025. const size = useElementSize(containerRef);
  2026. const currentList = vue.ref([]);
  2027. const source = vue.shallowRef(list);
  2028. const state = vue.ref({ start: 0, end: 10 });
  2029. return { state, source, currentList, size, containerRef };
  2030. }
  2031. function createGetViewCapacity(state, source, itemSize) {
  2032. return (containerSize) => {
  2033. if (typeof itemSize === "number")
  2034. return Math.ceil(containerSize / itemSize);
  2035. const { start = 0 } = state.value;
  2036. let sum = 0;
  2037. let capacity = 0;
  2038. for (let i = start; i < source.value.length; i++) {
  2039. const size = itemSize(i);
  2040. sum += size;
  2041. capacity = i;
  2042. if (sum > containerSize)
  2043. break;
  2044. }
  2045. return capacity - start;
  2046. };
  2047. }
  2048. function createGetOffset(source, itemSize) {
  2049. return (scrollDirection) => {
  2050. if (typeof itemSize === "number")
  2051. return Math.floor(scrollDirection / itemSize) + 1;
  2052. let sum = 0;
  2053. let offset = 0;
  2054. for (let i = 0; i < source.value.length; i++) {
  2055. const size = itemSize(i);
  2056. sum += size;
  2057. if (sum >= scrollDirection) {
  2058. offset = i;
  2059. break;
  2060. }
  2061. }
  2062. return offset + 1;
  2063. };
  2064. }
  2065. function createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {
  2066. return () => {
  2067. const element = containerRef.value;
  2068. if (element) {
  2069. const offset = getOffset(type === "vertical" ? element.scrollTop : element.scrollLeft);
  2070. const viewCapacity = getViewCapacity(type === "vertical" ? element.clientHeight : element.clientWidth);
  2071. const from = offset - overscan;
  2072. const to = offset + viewCapacity + overscan;
  2073. state.value = {
  2074. start: from < 0 ? 0 : from,
  2075. end: to > source.value.length ? source.value.length : to
  2076. };
  2077. currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({
  2078. data: ele,
  2079. index: index + state.value.start
  2080. }));
  2081. }
  2082. };
  2083. }
  2084. function createGetDistance(itemSize, source) {
  2085. return (index) => {
  2086. if (typeof itemSize === "number") {
  2087. const size2 = index * itemSize;
  2088. return size2;
  2089. }
  2090. const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);
  2091. return size;
  2092. };
  2093. }
  2094. function useWatchForSizes(size, list, calculateRange) {
  2095. vue.watch([size.width, size.height, list], () => {
  2096. calculateRange();
  2097. });
  2098. }
  2099. function createComputedTotalSize(itemSize, source) {
  2100. return vue.computed(() => {
  2101. if (typeof itemSize === "number")
  2102. return source.value.length * itemSize;
  2103. return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);
  2104. });
  2105. }
  2106. const scrollToDictionaryForElementScrollKey = {
  2107. horizontal: "scrollLeft",
  2108. vertical: "scrollTop"
  2109. };
  2110. function createScrollTo(type, calculateRange, getDistance, containerRef) {
  2111. return (index) => {
  2112. if (containerRef.value) {
  2113. containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);
  2114. calculateRange();
  2115. }
  2116. };
  2117. }
  2118. function useHorizontalVirtualList(options, list) {
  2119. const resources = useVirtualListResources(list);
  2120. const { state, source, currentList, size, containerRef } = resources;
  2121. const containerStyle = { overflowX: "auto" };
  2122. const { itemWidth, overscan = 5 } = options;
  2123. const getViewCapacity = createGetViewCapacity(state, source, itemWidth);
  2124. const getOffset = createGetOffset(source, itemWidth);
  2125. const calculateRange = createCalculateRange("horizontal", overscan, getOffset, getViewCapacity, resources);
  2126. const getDistanceLeft = createGetDistance(itemWidth, source);
  2127. const offsetLeft = vue.computed(() => getDistanceLeft(state.value.start));
  2128. const totalWidth = createComputedTotalSize(itemWidth, source);
  2129. useWatchForSizes(size, list, calculateRange);
  2130. const scrollTo = createScrollTo("horizontal", calculateRange, getDistanceLeft, containerRef);
  2131. const wrapperProps = vue.computed(() => {
  2132. return {
  2133. style: {
  2134. height: "100%",
  2135. width: `${totalWidth.value - offsetLeft.value}px`,
  2136. marginLeft: `${offsetLeft.value}px`,
  2137. display: "flex"
  2138. }
  2139. };
  2140. });
  2141. return {
  2142. scrollTo,
  2143. calculateRange,
  2144. wrapperProps,
  2145. containerStyle,
  2146. currentList,
  2147. containerRef
  2148. };
  2149. }
  2150. function useVerticalVirtualList(options, list) {
  2151. const resources = useVirtualListResources(list);
  2152. const { state, source, currentList, size, containerRef } = resources;
  2153. const containerStyle = { overflowY: "auto" };
  2154. const { itemHeight, overscan = 5 } = options;
  2155. const getViewCapacity = createGetViewCapacity(state, source, itemHeight);
  2156. const getOffset = createGetOffset(source, itemHeight);
  2157. const calculateRange = createCalculateRange("vertical", overscan, getOffset, getViewCapacity, resources);
  2158. const getDistanceTop = createGetDistance(itemHeight, source);
  2159. const offsetTop = vue.computed(() => getDistanceTop(state.value.start));
  2160. const totalHeight = createComputedTotalSize(itemHeight, source);
  2161. useWatchForSizes(size, list, calculateRange);
  2162. const scrollTo = createScrollTo("vertical", calculateRange, getDistanceTop, containerRef);
  2163. const wrapperProps = vue.computed(() => {
  2164. return {
  2165. style: {
  2166. width: "100%",
  2167. height: `${totalHeight.value - offsetTop.value}px`,
  2168. marginTop: `${offsetTop.value}px`
  2169. }
  2170. };
  2171. });
  2172. return {
  2173. calculateRange,
  2174. scrollTo,
  2175. containerStyle,
  2176. wrapperProps,
  2177. currentList,
  2178. containerRef
  2179. };
  2180. }
  2181. function useWindowSize(options = {}) {
  2182. const {
  2183. window: window2 = defaultWindow,
  2184. initialWidth = Number.POSITIVE_INFINITY,
  2185. initialHeight = Number.POSITIVE_INFINITY,
  2186. listenOrientation = true,
  2187. includeScrollbar = true
  2188. } = options;
  2189. const width = vue.ref(initialWidth);
  2190. const height = vue.ref(initialHeight);
  2191. const update = () => {
  2192. if (window2) {
  2193. if (includeScrollbar) {
  2194. width.value = window2.innerWidth;
  2195. height.value = window2.innerHeight;
  2196. } else {
  2197. width.value = window2.document.documentElement.clientWidth;
  2198. height.value = window2.document.documentElement.clientHeight;
  2199. }
  2200. }
  2201. };
  2202. update();
  2203. tryOnMounted(update);
  2204. useEventListener("resize", update, { passive: true });
  2205. if (listenOrientation) {
  2206. const matches = useMediaQuery("(orientation: portrait)");
  2207. vue.watch(matches, () => update());
  2208. }
  2209. return { width, height };
  2210. }
  2211. function formatTimeAgoWithI18n(from) {
  2212. const { t } = vueI18n.useI18n();
  2213. return formatTimeAgo(from, {
  2214. messages: {
  2215. justNow: t("time-ago.just-now"),
  2216. past: (n) => n.match(/\d/) ? t("time-ago.past", { n }) : n,
  2217. future: (n) => n.match(/\d/) ? t("time-ago.future", { n }) : n,
  2218. month: (n, past) => n === 1 ? past ? t("time-ago.month.past") : t("time-ago.month.future") : t("time-ago.month.n", { n }),
  2219. year: (n, past) => n === 1 ? past ? t("time-ago.year.past") : t("time-ago.year.future") : t("time-ago.year.n", { n }),
  2220. day: (n, past) => n === 1 ? past ? t("time-ago.day.past") : t("time-ago.day.future") : t("time-ago.day.n", { n }),
  2221. week: (n, past) => n === 1 ? past ? t("time-ago.week.past") : t("time-ago.week.future") : t("time-ago.week.n", { n }),
  2222. hour: (n) => t("time-ago.hour", { n }),
  2223. minute: (n) => t("time-ago.minute", { n }),
  2224. second: (n) => t("time-ago.second", { n }),
  2225. invalid: "invalid"
  2226. }
  2227. });
  2228. }
  2229. const _hoisted_1$6 = { class: "inline-block min-w-full align-middle" };
  2230. const _hoisted_2$5 = { class: "relative overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5" };
  2231. const _hoisted_3$4 = { class: "min-w-full divide-y divide-$ud-border-secondary" };
  2232. const _hoisted_4$4 = { class: "bg-$ud-bg-secondary select-none" };
  2233. const _hoisted_5$4 = {
  2234. style: { "table-layout": "fixed" },
  2235. class: "table"
  2236. };
  2237. const _hoisted_6$4 = {
  2238. scope: "col",
  2239. class: "w-8 relative p-2"
  2240. };
  2241. const _hoisted_7$3 = { class: "sr-only" };
  2242. const _hoisted_8$3 = {
  2243. scope: "col",
  2244. class: "w-60 py-2 pl-4 pr-3 text-left text-xs font-semibold"
  2245. };
  2246. const _hoisted_9$3 = { class: "inline-flex items-center" };
  2247. const _hoisted_10$3 = { class: "relative ml-0.5" };
  2248. const _hoisted_11$3 = { class: "inline-flex items-center" };
  2249. const _hoisted_12$1 = { class: "relative ml-0.5" };
  2250. const _hoisted_13$1 = {
  2251. scope: "col",
  2252. class: "relative py-2 pl-3 pr-4"
  2253. };
  2254. const _hoisted_14$1 = { class: "sr-only" };
  2255. const _hoisted_15$1 = {
  2256. key: 0,
  2257. class: "flex items-center justify-center py-10"
  2258. };
  2259. const _hoisted_16$1 = /* @__PURE__ */ vue.createElementVNode("svg", {
  2260. class: "animate-spin w-10 h-10 text-indigo-500",
  2261. xmlns: "http://www.w3.org/2000/svg",
  2262. fill: "none",
  2263. viewBox: "0 0 24 24"
  2264. }, [
  2265. /* @__PURE__ */ vue.createElementVNode("circle", {
  2266. class: "opacity-25",
  2267. cx: "12",
  2268. cy: "12",
  2269. r: "10",
  2270. stroke: "currentColor",
  2271. "stroke-width": "4"
  2272. }),
  2273. /* @__PURE__ */ vue.createElementVNode("path", {
  2274. class: "opacity-75",
  2275. fill: "currentColor",
  2276. d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
  2277. })
  2278. ], -1);
  2279. const _hoisted_17$1 = [
  2280. _hoisted_16$1
  2281. ];
  2282. const _hoisted_18$1 = {
  2283. key: 1,
  2284. class: "p-3 text-center text-sm"
  2285. };
  2286. const _hoisted_19$1 = { class: "table w-full" };
  2287. const _hoisted_20$1 = ["onClick"];
  2288. const _hoisted_21$1 = ["title"];
  2289. const _hoisted_22 = ["href"];
  2290. const _hoisted_23 = { class: "w-20 break-all truncate px-3 py-2 text-xs text-$ud-text-secondary" };
  2291. const _hoisted_24 = { class: "w-22 break-all truncate px-3 py-2 text-xs text-$ud-text-secondary" };
  2292. const _hoisted_25 = { class: "relative truncate py-2 pl-3 pr-4 text-right text-xs font-medium" };
  2293. const _hoisted_26 = ["href"];
  2294. const _hoisted_27 = { class: "sr-only" };
  2295. const _hoisted_28 = {
  2296. key: 0,
  2297. class: "table w-full"
  2298. };
  2299. const _hoisted_29 = {
  2300. colspan: "5",
  2301. class: "py-2"
  2302. };
  2303. const _hoisted_30 = { class: "mx-2" };
  2304. const _hoisted_31 = { class: "text-xs grid grid-cols-6 gap-y-2" };
  2305. const _hoisted_32 = { class: "font-semibold" };
  2306. const _hoisted_33 = { class: "text-$ud-text" };
  2307. const _hoisted_34 = { class: "font-semibold" };
  2308. const _hoisted_35 = { class: "text-$ud-text" };
  2309. const _hoisted_36 = { class: "font-semibold" };
  2310. const _hoisted_37 = { class: "text-$ud-text" };
  2311. const _hoisted_38 = { class: "font-semibold" };
  2312. const _hoisted_39 = { class: "col-span-5 text-$ud-text" };
  2313. const _hoisted_40 = ["href"];
  2314. const _hoisted_41 = { class: "font-semibold" };
  2315. const _hoisted_42 = { class: "col-span-5 text-$ud-text" };
  2316. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  2317. __name: "DataTable",
  2318. props: {
  2319. data: {},
  2320. loading: { type: Boolean }
  2321. },
  2322. setup(__props) {
  2323. const props = __props;
  2324. const expanded = vue.ref([]);
  2325. watchArray(
  2326. () => props.data,
  2327. () => {
  2328. expanded.value = Array.from({ length: props.data.length }, () => false);
  2329. }
  2330. );
  2331. function toggleExpand(i) {
  2332. expanded.value[i] = !expanded.value[i];
  2333. }
  2334. const sort = vue.reactive({
  2335. updated: "",
  2336. daily: ""
  2337. });
  2338. const sortedData = useSorted(
  2339. vue.computed(() => props.data),
  2340. (a, b) => {
  2341. if (sort.updated !== "") {
  2342. if (sort.updated === "asc")
  2343. return +new Date(a.code_updated_at) - +new Date(b.code_updated_at);
  2344. return +new Date(b.code_updated_at) - +new Date(a.code_updated_at);
  2345. }
  2346. if (sort.daily === "asc")
  2347. return a.daily_installs - b.daily_installs;
  2348. return b.daily_installs - a.daily_installs;
  2349. }
  2350. );
  2351. const { list, containerProps, wrapperProps } = useVirtualList(sortedData, {
  2352. itemHeight: (index) => {
  2353. if (expanded.value[index])
  2354. return 112;
  2355. else
  2356. return 32;
  2357. }
  2358. });
  2359. function sortIcon(sort2) {
  2360. if (sort2 === "")
  2361. return "i-carbon-caret-sort";
  2362. return { desc: "i-carbon-caret-sort-down", asc: "i-carbon-caret-sort-up" }[sort2];
  2363. }
  2364. function onSortClick(key) {
  2365. sort[key] = sort[key] === "" ? "desc" : sort[key] === "desc" ? "asc" : "";
  2366. sort[key === "daily" ? "updated" : "daily"] = "";
  2367. }
  2368. const { t } = vueI18n.useI18n();
  2369. return (_ctx, _cache) => {
  2370. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
  2371. vue.createElementVNode("div", _hoisted_2$5, [
  2372. vue.createElementVNode("table", _hoisted_3$4, [
  2373. vue.createElementVNode("thead", _hoisted_4$4, [
  2374. vue.createElementVNode("tr", _hoisted_5$4, [
  2375. vue.createElementVNode("th", _hoisted_6$4, [
  2376. vue.createElementVNode("span", _hoisted_7$3, vue.toDisplayString(vue.unref(t)("table.toggle-expand")), 1)
  2377. ]),
  2378. vue.createElementVNode("th", _hoisted_8$3, vue.toDisplayString(vue.unref(t)("table.title")), 1),
  2379. vue.createElementVNode("th", {
  2380. scope: "col",
  2381. class: "w-20 px-2 py-2 text-left text-xs font-semibold cursor-pointer",
  2382. onClick: _cache[0] || (_cache[0] = ($event) => onSortClick("daily"))
  2383. }, [
  2384. vue.createElementVNode("div", _hoisted_9$3, [
  2385. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(t)("table.daily")), 1),
  2386. vue.createElementVNode("div", _hoisted_10$3, [
  2387. vue.createElementVNode("div", {
  2388. class: vue.normalizeClass(sortIcon(vue.unref(sort).daily))
  2389. }, null, 2)
  2390. ])
  2391. ])
  2392. ]),
  2393. vue.createElementVNode("th", {
  2394. scope: "col",
  2395. class: "w-22 px-2 py-2 text-left text-xs font-semibold cursor-pointer",
  2396. onClick: _cache[1] || (_cache[1] = ($event) => onSortClick("updated"))
  2397. }, [
  2398. vue.createElementVNode("div", _hoisted_11$3, [
  2399. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(t)("table.update")), 1),
  2400. vue.createElementVNode("div", _hoisted_12$1, [
  2401. vue.createElementVNode("div", {
  2402. class: vue.normalizeClass(sortIcon(vue.unref(sort).updated))
  2403. }, null, 2)
  2404. ])
  2405. ])
  2406. ]),
  2407. vue.createElementVNode("th", _hoisted_13$1, [
  2408. vue.createElementVNode("span", _hoisted_14$1, vue.toDisplayString(vue.unref(t)("table.install")), 1)
  2409. ])
  2410. ])
  2411. ]),
  2412. vue.createElementVNode("tbody", vue.mergeProps(vue.unref(containerProps), { class: "h-60 overflow-y-overlay block divide-y divide-$ud-border w-full bg-$ud-bg" }), [
  2413. vue.createElementVNode("div", vue.normalizeProps(vue.guardReactiveProps(vue.unref(wrapperProps))), [
  2414. _ctx.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15$1, _hoisted_17$1)) : _ctx.data.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, vue.toDisplayString(vue.unref(t)("table.empty")), 1)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(vue.unref(list), (item) => {
  2415. return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
  2416. key: item.index
  2417. }, [
  2418. vue.createElementVNode("tr", _hoisted_19$1, [
  2419. vue.createElementVNode("td", {
  2420. class: "w-8 relative truncate p-2 text-right text-xs font-medium cursor-pointer",
  2421. onClick: ($event) => toggleExpand(item.index)
  2422. }, [
  2423. vue.createElementVNode("div", {
  2424. class: vue.normalizeClass(["i-carbon-chevron-right", vue.unref(expanded)[item.index] && "rotate-90"])
  2425. }, null, 2)
  2426. ], 8, _hoisted_20$1),
  2427. vue.createElementVNode("td", {
  2428. title: item.data.name,
  2429. class: "w-60 break-all truncate py-2 pl-4 pr-3 text-xs font-medium max-w-60"
  2430. }, [
  2431. vue.createElementVNode("a", {
  2432. href: item.data.url,
  2433. target: "_blank"
  2434. }, vue.toDisplayString(item.data.name), 9, _hoisted_22)
  2435. ], 8, _hoisted_21$1),
  2436. vue.createElementVNode("td", _hoisted_23, vue.toDisplayString(item.data.daily_installs), 1),
  2437. vue.createElementVNode("td", _hoisted_24, vue.toDisplayString(vue.unref(formatTimeAgoWithI18n)(new Date(item.data.code_updated_at))), 1),
  2438. vue.createElementVNode("td", _hoisted_25, [
  2439. vue.createElementVNode("a", {
  2440. href: item.data.code_url,
  2441. target: "_blank",
  2442. class: "text-indigo-600 hover:text-indigo-900"
  2443. }, [
  2444. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("table.install")) + " ", 1),
  2445. vue.createElementVNode("span", _hoisted_27, ", " + vue.toDisplayString(item.data.name), 1)
  2446. ], 8, _hoisted_26)
  2447. ])
  2448. ]),
  2449. vue.unref(expanded)[item.index] ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_28, [
  2450. vue.createElementVNode("td", _hoisted_29, [
  2451. vue.createElementVNode("div", _hoisted_30, [
  2452. vue.createElementVNode("dl", _hoisted_31, [
  2453. vue.createElementVNode("dt", _hoisted_32, vue.toDisplayString(vue.unref(t)("table.version")), 1),
  2454. vue.createElementVNode("dd", _hoisted_33, vue.toDisplayString(item.data.version), 1),
  2455. vue.createElementVNode("dt", _hoisted_34, vue.toDisplayString(vue.unref(t)("table.score")), 1),
  2456. vue.createElementVNode("dd", _hoisted_35, vue.toDisplayString(item.data.fan_score), 1),
  2457. vue.createElementVNode("dt", _hoisted_36, vue.toDisplayString(vue.unref(t)("table.total-installs")), 1),
  2458. vue.createElementVNode("dd", _hoisted_37, vue.toDisplayString(item.data.total_installs.toLocaleString()), 1),
  2459. vue.createElementVNode("dt", _hoisted_38, vue.toDisplayString(vue.unref(t)("table.authors")), 1),
  2460. vue.createElementVNode("dd", _hoisted_39, [
  2461. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.data.users, (user) => {
  2462. return vue.openBlock(), vue.createElementBlock("a", {
  2463. key: user.id,
  2464. href: user.url,
  2465. target: "_blank",
  2466. class: "underline underline-$ud-border"
  2467. }, vue.toDisplayString(user.name), 9, _hoisted_40);
  2468. }), 128))
  2469. ]),
  2470. vue.createElementVNode("dt", _hoisted_41, vue.toDisplayString(vue.unref(t)("table.description")), 1),
  2471. vue.createElementVNode("dd", _hoisted_42, vue.toDisplayString(item.data.description), 1)
  2472. ])
  2473. ])
  2474. ])
  2475. ])) : vue.createCommentVNode("", true)
  2476. ], 64);
  2477. }), 128))
  2478. ], 16)
  2479. ], 16)
  2480. ])
  2481. ])
  2482. ]);
  2483. };
  2484. }
  2485. });
  2486. var _GM_deleteValue = /* @__PURE__ */ (() => typeof GM_deleteValue != "undefined" ? GM_deleteValue : void 0)();
  2487. var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  2488. var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  2489. var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)();
  2490. const GMStorage = {
  2491. getItem(key) {
  2492. return _GM_getValue(key);
  2493. },
  2494. setItem(key, value) {
  2495. _GM_setValue(key, value);
  2496. },
  2497. removeItem(key) {
  2498. _GM_deleteValue(key);
  2499. }
  2500. };
  2501. function useGMStorage(key, defaults) {
  2502. return useStorage(key, defaults, GMStorage);
  2503. }
  2504. const useInjectContainer = () => vue.inject("container");
  2505. const defaultSettings = {
  2506. locale: navigator.language ?? "en",
  2507. nsfw: false,
  2508. filter: [],
  2509. debugger: false
  2510. };
  2511. const toString = Object.prototype.toString;
  2512. const useUserjsDiggerSettings = createGlobalState(() => {
  2513. const settings2 = useGMStorage("ud_settings", defaultSettings);
  2514. Object.entries(settings2.value).forEach(([key, value]) => {
  2515. if (toString.call(value) !== toString.call(defaultSettings[key])) {
  2516. settings2.value[key] = defaultSettings[key];
  2517. }
  2518. });
  2519. return settings2;
  2520. });
  2521. const AUTHOR_REGEX = /^author:(\S+)$/;
  2522. const TITLE_REGEX = /^title:(\S+)$/;
  2523. function isAuthorFilter(filter) {
  2524. return !!filter.match(AUTHOR_REGEX);
  2525. }
  2526. function getTypedFilter(filter) {
  2527. if (filter.includes(":")) {
  2528. if (isAuthorFilter(filter)) {
  2529. const regexp = new RegExp(filter.match(AUTHOR_REGEX)[1]);
  2530. return { type: "author", regexp };
  2531. } else {
  2532. return getTypedFilter(filter.match(TITLE_REGEX)[1]);
  2533. }
  2534. }
  2535. return {
  2536. type: "title",
  2537. regexp: new RegExp(filter)
  2538. };
  2539. }
  2540. function useGreasyfork(host, { site, immediate } = {
  2541. site: "https://greasyfork.org",
  2542. immediate: true
  2543. }) {
  2544. const apiEndpoint = vue.computed(
  2545. () => `${site}/scripts/by-site/${resolveUnref(host)}.json`
  2546. );
  2547. const fetch = _unsafeWindow.fetch;
  2548. const afterFetch = async ({
  2549. data: prevData,
  2550. response
  2551. }) => {
  2552. if ((prevData == null ? void 0 : prevData.length) === 50) {
  2553. const prevPage = Number(new URL(response.url).searchParams.get("page")) || 1;
  2554. const nextPage = `${apiEndpoint.value}?page=${prevPage + 1}`;
  2555. const { data, execute } = useFetch(nextPage, {
  2556. fetch,
  2557. immediate: false,
  2558. afterFetch
  2559. }).json();
  2560. await execute();
  2561. return {
  2562. response: new Response(),
  2563. data: prevData == null ? void 0 : prevData.concat(data.value ?? [])
  2564. };
  2565. }
  2566. return { data: prevData };
  2567. };
  2568. return useFetch(apiEndpoint, {
  2569. fetch,
  2570. immediate,
  2571. afterFetch
  2572. }).json();
  2573. }
  2574. function useDataList(host) {
  2575. const settings2 = useUserjsDiggerSettings();
  2576. const {
  2577. data: greasyfork,
  2578. isFetching,
  2579. execute: executeGreasyfork
  2580. } = useGreasyfork(host);
  2581. const {
  2582. data: sleazyfork,
  2583. execute: executeSleazyfork,
  2584. isFetching: isSleazyforkFetching
  2585. } = useGreasyfork(host, { site: "https://sleazyfork.org", immediate: false });
  2586. vue.watch(
  2587. () => settings2.value.nsfw,
  2588. (val) => {
  2589. if (val) {
  2590. if (!sleazyfork.value)
  2591. executeSleazyfork();
  2592. }
  2593. },
  2594. { immediate: true }
  2595. );
  2596. const data = vue.computed(() => {
  2597. var _a;
  2598. return (((_a = greasyfork.value) == null ? void 0 : _a.concat(
  2599. settings2.value.nsfw ? sleazyfork.value ?? [] : []
  2600. )) ?? []).filter(
  2601. (item) => settings2.value.filter.every((keywords) => {
  2602. const filter = getTypedFilter(keywords);
  2603. if (filter.type === "title")
  2604. return !filter.regexp.test(item.name);
  2605. else
  2606. return item.users.every((user) => !filter.regexp.test(user.name));
  2607. })
  2608. );
  2609. });
  2610. const isLoading = vue.computed(() => {
  2611. if (settings2.value.nsfw)
  2612. return isFetching.value || isSleazyforkFetching.value;
  2613. return isFetching.value;
  2614. });
  2615. const execute = () => {
  2616. greasyfork.value = [];
  2617. sleazyfork.value = [];
  2618. executeGreasyfork();
  2619. if (settings2.value.nsfw)
  2620. executeSleazyfork();
  2621. };
  2622. return { data, isLoading, execute };
  2623. }
  2624. const _hoisted_1$5 = { class: "p-2 text-sm truncate" };
  2625. const _hoisted_2$4 = ["title"];
  2626. const _hoisted_3$3 = { class: "p-2 leading-5 flex-1" };
  2627. const _hoisted_4$3 = ["placeholder"];
  2628. const _hoisted_5$3 = /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon:search" }, null, -1);
  2629. const _hoisted_6$3 = [
  2630. _hoisted_5$3
  2631. ];
  2632. const _hoisted_7$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon:settings-adjust" }, null, -1);
  2633. const _hoisted_8$2 = [
  2634. _hoisted_7$2
  2635. ];
  2636. const _hoisted_9$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon-close" }, null, -1);
  2637. const _hoisted_10$2 = [
  2638. _hoisted_9$2
  2639. ];
  2640. const _hoisted_11$2 = { key: 0 };
  2641. const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
  2642. __name: "MainPanel",
  2643. props: {
  2644. show: { type: Boolean }
  2645. },
  2646. emits: ["update:show", "setting"],
  2647. setup(__props, { emit }) {
  2648. const target = vue.ref(null);
  2649. const container = useInjectContainer();
  2650. const [showTable, toggleShowTable] = useToggle(false);
  2651. const searchSite = vue.ref("");
  2652. const pagePsl = vue.computed(() => {
  2653. if (searchSite.value === "")
  2654. return psl.get(window.location.hostname) ?? "";
  2655. return searchSite.value;
  2656. });
  2657. const [search, toggleSearch] = useToggle(false);
  2658. const searchInput = vue.ref();
  2659. const { data, isLoading, execute } = useDataList(pagePsl);
  2660. onClickOutside(
  2661. target,
  2662. (val) => {
  2663. if (val) {
  2664. emit("update:show", false);
  2665. toggleShowTable(false);
  2666. }
  2667. },
  2668. { ignore: [container] }
  2669. );
  2670. function onSearchEnter() {
  2671. toggleSearch(false);
  2672. execute();
  2673. }
  2674. return (_ctx, _cache) => {
  2675. const _component_i18n_t = vue.resolveComponent("i18n-t");
  2676. const _component_DataTable = _sfc_main$7;
  2677. return vue.openBlock(), vue.createElementBlock("div", {
  2678. ref_key: "target",
  2679. ref: target,
  2680. class: vue.normalizeClass([[_ctx.show ? "translate-x-0" : "translate-x-[calc(100%_+_1rem)]"], "fixed rounded-lg bg-$ud-bg text-$ud-text right-4 bottom-4 w-130 transition-all shadow-md divide-y divide-$ud-border-secondary"])
  2681. }, [
  2682. vue.createElementVNode("header", {
  2683. class: "relative w-full flex px-3 items-center select-none cursor-pointer",
  2684. onClick: _cache[6] || (_cache[6] = ($event) => vue.unref(toggleShowTable)())
  2685. }, [
  2686. vue.createElementVNode("div", null, [
  2687. vue.createElementVNode("div", {
  2688. class: vue.normalizeClass(["i-carbon-chevron-left", vue.unref(showTable) ? "-rotate-90" : "rotate-90"])
  2689. }, null, 2)
  2690. ]),
  2691. vue.withDirectives(vue.createElementVNode("div", _hoisted_1$5, [
  2692. vue.createVNode(_component_i18n_t, { keypath: "tip" }, {
  2693. count: vue.withCtx(() => {
  2694. var _a;
  2695. return [
  2696. vue.createElementVNode("span", {
  2697. class: vue.normalizeClass([vue.unref(isLoading) && "animate-pulse text-transparent", "rounded-full mx-1 px-2 py-0.25 text-xs bg-indigo-500 text-white"])
  2698. }, vue.toDisplayString((_a = vue.unref(data)) == null ? void 0 : _a.length), 3)
  2699. ];
  2700. }),
  2701. host: vue.withCtx(() => [
  2702. vue.createElementVNode("span", {
  2703. title: vue.unref(pagePsl) ?? ""
  2704. }, vue.toDisplayString(vue.unref(pagePsl)), 9, _hoisted_2$4)
  2705. ]),
  2706. _: 1
  2707. })
  2708. ], 512), [
  2709. [vue.vShow, !vue.unref(search)]
  2710. ]),
  2711. vue.withDirectives(vue.createElementVNode("div", _hoisted_3$3, [
  2712. vue.withDirectives(vue.createElementVNode("input", {
  2713. ref_key: "searchInput",
  2714. ref: searchInput,
  2715. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchSite) ? searchSite.value = $event : null),
  2716. type: "text",
  2717. class: "bg-$ud-bg text-sm p-0 border-none rounded-sm px-1 w-full",
  2718. placeholder: _ctx.$t("search-placeholder"),
  2719. onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
  2720. }, ["stop"])),
  2721. onKeypress: _cache[2] || (_cache[2] = vue.withKeys(($event) => onSearchEnter(), ["enter"]))
  2722. }, null, 40, _hoisted_4$3), [
  2723. [vue.vModelText, vue.unref(searchSite)]
  2724. ])
  2725. ], 512), [
  2726. [vue.vShow, vue.unref(search)]
  2727. ]),
  2728. vue.createElementVNode("div", {
  2729. class: "ml-auto hover:bg-$ud-bg-hover rounded p-1",
  2730. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => vue.unref(toggleSearch)(), ["stop"]))
  2731. }, _hoisted_6$3),
  2732. vue.createElementVNode("div", {
  2733. class: "hover:bg-$ud-bg-hover rounded p-1",
  2734. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => _ctx.$emit("setting"), ["stop"]))
  2735. }, _hoisted_8$2),
  2736. vue.createElementVNode("div", {
  2737. class: "hover:bg-$ud-bg-hover rounded p-1",
  2738. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => _ctx.$emit("update:show", false), ["stop"]))
  2739. }, _hoisted_10$2)
  2740. ]),
  2741. vue.unref(showTable) ? (vue.openBlock(), vue.createElementBlock("section", _hoisted_11$2, [
  2742. vue.createVNode(_component_DataTable, {
  2743. data: vue.unref(data) ?? [],
  2744. loading: vue.unref(isLoading)
  2745. }, null, 8, ["data", "loading"])
  2746. ])) : vue.createCommentVNode("", true)
  2747. ], 2);
  2748. };
  2749. }
  2750. });
  2751. const _hoisted_1$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "select-none" }, [
  2752. /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon-settings w-4 h-4" })
  2753. ], -1);
  2754. const _hoisted_2$3 = [
  2755. _hoisted_1$4
  2756. ];
  2757. const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
  2758. __name: "FloatActionButton",
  2759. props: {
  2760. modelValue: { type: Boolean }
  2761. },
  2762. emits: ["update:modelValue"],
  2763. setup(__props, { emit }) {
  2764. const props = __props;
  2765. const fab = vue.ref(null);
  2766. const { width: fabWidth, height: fabHeight } = useElementBounding(fab);
  2767. const { width, height } = useWindowSize();
  2768. const position = useGMStorage("ud_position", {
  2769. x: width.value - 64,
  2770. y: height.value - 64
  2771. });
  2772. const time = vue.ref(+/* @__PURE__ */ new Date());
  2773. const { isDragging, x, y, style: style2 } = useDraggable(fab, {
  2774. initialValue: position,
  2775. preventDefault: true,
  2776. onStart: () => {
  2777. time.value = +/* @__PURE__ */ new Date();
  2778. },
  2779. onEnd: (_pos) => {
  2780. if (+/* @__PURE__ */ new Date() - time.value < 100)
  2781. emit("update:modelValue", !props.modelValue);
  2782. }
  2783. });
  2784. const isLeft = vue.computed(() => x.value < width.value / 2);
  2785. watchDebounced(
  2786. () => ({ x: x.value, y: y.value }),
  2787. (val) => {
  2788. position.value = val;
  2789. },
  2790. { debounce: 500, deep: true }
  2791. );
  2792. vue.watch(isDragging, (val) => {
  2793. if (!val) {
  2794. if (x.value >= width.value / 2)
  2795. x.value = width.value - fabWidth.value - 32;
  2796. else
  2797. x.value = 16;
  2798. if (y.value >= height.value - fabHeight.value)
  2799. y.value = height.value - fabHeight.value;
  2800. else if (y.value < -16)
  2801. y.value = 0;
  2802. }
  2803. });
  2804. vue.watch(width, (w, oldW) => {
  2805. if (x.value >= (oldW ?? height.value) / 2)
  2806. x.value = w - fabWidth.value - 16;
  2807. else
  2808. x.value = 16;
  2809. });
  2810. vue.watch(height, (h, oldH) => {
  2811. if (y.value >= (oldH ?? height.value) / 2) {
  2812. const bottom = (oldH ?? height.value) - y.value;
  2813. y.value = h - bottom;
  2814. }
  2815. });
  2816. return (_ctx, _cache) => {
  2817. return vue.openBlock(), vue.createElementBlock("div", {
  2818. ref_key: "fab",
  2819. ref: fab,
  2820. class: vue.normalizeClass(["fixed ease-out rounded-md shadow-md bg-$ud-bg text-$ud-text p-2", [
  2821. vue.unref(isDragging) ? "transition-transform" : "transition-all",
  2822. _ctx.modelValue ? vue.unref(isLeft) ? "-translate-x-[calc(100%_+_1rem)]" : "translate-x-[calc(100%_+_1rem)]" : "translate-x-0"
  2823. ]]),
  2824. style: vue.normalizeStyle([{ "touch-action": "none" }, vue.unref(style2)])
  2825. }, _hoisted_2$3, 6);
  2826. };
  2827. }
  2828. });
  2829. const _hoisted_1$3 = { class: "p-2 gap-y-1 inline-flex flex-wrap relative shadow-sm border-1px border-$ud-border rounded-md focus-within:ring-2 focus-within:ring-indigo-500 focus-within:border-indigo-500" };
  2830. const _hoisted_2$2 = ["onClick"];
  2831. const _hoisted_3$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "sr-only" }, " Remove ", -1);
  2832. const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "h-3 w-3 i-carbon-close" }, null, -1);
  2833. const _hoisted_5$2 = [
  2834. _hoisted_3$2,
  2835. _hoisted_4$2
  2836. ];
  2837. const _hoisted_6$2 = ["onKeypress"];
  2838. const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
  2839. __name: "TagsInput",
  2840. props: {
  2841. tags: {}
  2842. },
  2843. emits: ["update:tags"],
  2844. setup(__props, { emit }) {
  2845. const props = __props;
  2846. const inputVal = vue.ref("");
  2847. function onFilterAdd() {
  2848. if (inputVal.value !== "") {
  2849. emit("update:tags", [...props.tags, inputVal.value]);
  2850. inputVal.value = "";
  2851. }
  2852. }
  2853. const onFilterBack = useThrottleFn(() => {
  2854. if (props.tags.length > 0 && inputVal.value === "")
  2855. removeByIndex(props.tags.length - 1);
  2856. }, 500);
  2857. function removeByIndex(index) {
  2858. emit(
  2859. "update:tags",
  2860. props.tags.filter((_, i) => i !== index)
  2861. );
  2862. }
  2863. return (_ctx, _cache) => {
  2864. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  2865. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tags, (item, i) => {
  2866. return vue.openBlock(), vue.createElementBlock("div", {
  2867. key: item,
  2868. class: "inline-flex mr-1 rounded-full items-center py-0.5 pl-2.5 pr-1 text-xs font-medium bg-indigo-100 text-indigo-700"
  2869. }, [
  2870. vue.createElementVNode("span", null, vue.toDisplayString(item), 1),
  2871. vue.createElementVNode("button", {
  2872. type: "button",
  2873. class: "flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white",
  2874. onClick: ($event) => removeByIndex(i)
  2875. }, _hoisted_5$2, 8, _hoisted_2$2)
  2876. ]);
  2877. }), 128)),
  2878. vue.withDirectives(vue.createElementVNode("input", {
  2879. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(inputVal) ? inputVal.value = $event : null),
  2880. type: "text",
  2881. class: "bg-transparent border-none ring-none! flex-1 p-0 text-xs",
  2882. onKeypress: vue.withKeys(onFilterAdd, ["enter"]),
  2883. onKeydown: _cache[1] || (_cache[1] = vue.withKeys(
  2884. //@ts-ignore
  2885. (...args) => vue.unref(onFilterBack) && vue.unref(onFilterBack)(...args),
  2886. ["backspace"]
  2887. ))
  2888. }, null, 40, _hoisted_6$2), [
  2889. [vue.vModelText, vue.unref(inputVal)]
  2890. ])
  2891. ]);
  2892. };
  2893. }
  2894. });
  2895. const _hoisted_1$2 = ["aria-checked"];
  2896. const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  2897. __name: "Toggle",
  2898. props: {
  2899. modelValue: { type: Boolean }
  2900. },
  2901. emits: ["update:modelValue"],
  2902. setup(__props) {
  2903. return (_ctx, _cache) => {
  2904. return vue.openBlock(), vue.createElementBlock("button", {
  2905. type: "button",
  2906. class: vue.normalizeClass(["relative inline-flex flex-shrink-0 h-4 w-9 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500", _ctx.modelValue ? "bg-indigo-600" : "bg-gray-200"]),
  2907. role: "switch",
  2908. "aria-checked": _ctx.modelValue,
  2909. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  2910. }, [
  2911. vue.createElementVNode("span", {
  2912. "aria-hidden": "true",
  2913. class: vue.normalizeClass(["pointer-events-none inline-block h-3 w-3 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200", _ctx.modelValue ? "translate-x-5" : "translate-x-0"])
  2914. }, null, 2)
  2915. ], 10, _hoisted_1$2);
  2916. };
  2917. }
  2918. });
  2919. const _hoisted_1$1 = { class: "mt-1 relative" };
  2920. const _hoisted_2$1 = ["aria-expanded"];
  2921. const _hoisted_3$1 = { class: "flex items-center" };
  2922. const _hoisted_4$1 = { class: "block truncate uppercase" };
  2923. const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("span", { class: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none" }, [
  2924. /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon-chevron-sort" })
  2925. ], -1);
  2926. const _hoisted_6$1 = ["aria-activedescendant"];
  2927. const _hoisted_7$1 = ["id", "onClick", "onKeydown"];
  2928. const _hoisted_8$1 = { class: "flex items-center" };
  2929. const _hoisted_9$1 = {
  2930. key: 0,
  2931. class: "text-indigo-600 group-focus:text-$ud-text hover:text-$ud-text absolute inset-y-0 right-0 flex items-center pr-4"
  2932. };
  2933. const _hoisted_10$1 = /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon-checkmark" }, null, -1);
  2934. const _hoisted_11$1 = [
  2935. _hoisted_10$1
  2936. ];
  2937. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  2938. __name: "LocaleSelect",
  2939. setup(__props) {
  2940. const { locale, messages } = vueI18n.useI18n({ useScope: "global" });
  2941. const [show, toggleShow] = useToggle(false);
  2942. const locales = vue.computed(() => Object.keys(messages.value));
  2943. function onChangeLocale(to) {
  2944. locale.value = to;
  2945. toggleShow(false);
  2946. }
  2947. const button = vue.ref(null);
  2948. const listbox = vue.ref(null);
  2949. const activedescendant = vue.ref(0);
  2950. function onKeyboardShow() {
  2951. toggleShow(true);
  2952. vue.nextTick(() => {
  2953. var _a;
  2954. ((_a = listbox.value) == null ? void 0 : _a.children.item(0)).focus();
  2955. });
  2956. }
  2957. function onKeyArrowUp(e) {
  2958. activedescendant.value = activedescendant.value - 1 < 0 ? locales.value.length - 1 : activedescendant.value - 1;
  2959. const parentEl = e.target.parentElement;
  2960. if (!parentEl)
  2961. return;
  2962. parentEl.children.item(activedescendant.value).focus();
  2963. }
  2964. function onKeyArrowDown(e) {
  2965. activedescendant.value = activedescendant.value + 1 > locales.value.length - 1 ? 0 : activedescendant.value + 1;
  2966. const parentEl = e.target.parentElement;
  2967. if (!parentEl)
  2968. return;
  2969. parentEl.children.item(activedescendant.value).focus();
  2970. }
  2971. function onLocaleEnter(to) {
  2972. var _a;
  2973. onChangeLocale(to);
  2974. (_a = button.value) == null ? void 0 : _a.focus();
  2975. }
  2976. function onEsc() {
  2977. var _a;
  2978. toggleShow(false);
  2979. (_a = button.value) == null ? void 0 : _a.focus();
  2980. }
  2981. const settings2 = useUserjsDiggerSettings();
  2982. vue.watch(locale, (val) => {
  2983. settings2.value.locale = val;
  2984. });
  2985. return (_ctx, _cache) => {
  2986. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  2987. vue.createElementVNode("button", {
  2988. ref_key: "button",
  2989. ref: button,
  2990. type: "button",
  2991. class: "relative w-full bg-$ud-bg border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",
  2992. "aria-haspopup": "listbox",
  2993. "aria-expanded": vue.unref(show),
  2994. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(toggleShow)()),
  2995. onKeydown: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(($event) => onKeyboardShow(), ["prevent"]), ["arrow-down"]))
  2996. }, [
  2997. vue.createElementVNode("div", _hoisted_3$1, [
  2998. vue.createElementVNode("span", _hoisted_4$1, vue.toDisplayString(vue.unref(locale)), 1)
  2999. ]),
  3000. _hoisted_5$1
  3001. ], 40, _hoisted_2$1),
  3002. vue.createVNode(vue.Transition, {
  3003. "leave-active-class": "transition ease-in duration-100",
  3004. "leave-from-class": "opacity-100",
  3005. "leave-to-class": "opacity-0"
  3006. }, {
  3007. default: vue.withCtx(() => [
  3008. vue.unref(show) ? (vue.openBlock(), vue.createElementBlock("ul", {
  3009. key: 0,
  3010. ref_key: "listbox",
  3011. ref: listbox,
  3012. class: "absolute z-10 mt-1 w-full bg-$ud-bg shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
  3013. tabindex: "-1",
  3014. "aria-activedescendant": `listbox-option-${vue.unref(activedescendant)}`
  3015. }, [
  3016. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(locales), (lang, index) => {
  3017. return vue.openBlock(), vue.createElementBlock("li", {
  3018. id: `listbox-option-${index + 1}`,
  3019. key: lang,
  3020. class: "group text-$ud-text cursor-default select-none relative py-2 pl-3 pr-9 focus:text-white focus:bg-indigo-600 hover:text-white hover:bg-indigo-600",
  3021. role: "option",
  3022. tabindex: "0",
  3023. onClick: ($event) => onChangeLocale(lang),
  3024. onKeydown: [
  3025. vue.withKeys(vue.withModifiers(($event) => onLocaleEnter(lang), ["prevent"]), ["enter"]),
  3026. vue.withKeys(vue.withModifiers(onKeyArrowUp, ["prevent"]), ["arrow-up"]),
  3027. vue.withKeys(vue.withModifiers(onKeyArrowDown, ["prevent"]), ["arrow-down"]),
  3028. vue.withKeys(vue.withModifiers(onEsc, ["prevent"]), ["esc"])
  3029. ]
  3030. }, [
  3031. vue.createElementVNode("div", _hoisted_8$1, [
  3032. vue.createElementVNode("span", {
  3033. class: vue.normalizeClass(["font-normal block truncate uppercase", vue.unref(locale) === lang ? "font-semibold" : "font-normal"])
  3034. }, vue.toDisplayString(lang), 3)
  3035. ]),
  3036. lang === vue.unref(locale) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$1, _hoisted_11$1)) : vue.createCommentVNode("", true)
  3037. ], 40, _hoisted_7$1);
  3038. }), 128))
  3039. ], 8, _hoisted_6$1)) : vue.createCommentVNode("", true)
  3040. ]),
  3041. _: 1
  3042. })
  3043. ]);
  3044. };
  3045. }
  3046. });
  3047. const _hoisted_1 = { class: "border-b border-b-$ud-border p-4 flex items-center" };
  3048. const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "i-carbon-close" }, null, -1);
  3049. const _hoisted_3 = [
  3050. _hoisted_2
  3051. ];
  3052. const _hoisted_4 = { class: "divide-y divide-$ud-border px-4 py-2 h-60 overflow-y-scroll" };
  3053. const _hoisted_5 = { class: "py-2 flex items-center justify-between space-x-4" };
  3054. const _hoisted_6 = { class: "flex flex-col w-4/5 overflow-hidden" };
  3055. const _hoisted_7 = { class: "text-sm font-medium" };
  3056. const _hoisted_8 = { class: "text-sm text-$ud-text-secondary text-xs" };
  3057. const _hoisted_9 = { class: "py-2 flex items-center justify-between space-x-4" };
  3058. const _hoisted_10 = { class: "flex flex-col w-4/5 overflow-hidden" };
  3059. const _hoisted_11 = { class: "text-sm font-medium" };
  3060. const _hoisted_12 = { class: "text-sm text-$ud-text-secondary text-xs" };
  3061. const _hoisted_13 = { class: "py-2 flex items-center justify-between space-x-4" };
  3062. const _hoisted_14 = { class: "flex flex-col w-4/5 overflow-hidden" };
  3063. const _hoisted_15 = { class: "text-sm font-medium" };
  3064. const _hoisted_16 = { class: "text-sm text-$ud-text-secondary text-xs" };
  3065. const _hoisted_17 = { class: "py-2 flex flex-col space-y-2" };
  3066. const _hoisted_18 = { class: "flex flex-col w-4/5 overflow-hidden" };
  3067. const _hoisted_19 = { class: "text-sm font-medium" };
  3068. const _hoisted_20 = { class: "text-sm text-$ud-text-secondary text-xs" };
  3069. const _hoisted_21 = ["title"];
  3070. const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
  3071. __name: "SettingsPanel",
  3072. props: {
  3073. show: { type: Boolean }
  3074. },
  3075. emits: ["update:show"],
  3076. setup(__props, { emit }) {
  3077. const dialog = vue.ref(null);
  3078. onClickOutside(dialog, () => {
  3079. emit("update:show", false);
  3080. });
  3081. const settings2 = useUserjsDiggerSettings();
  3082. const enable = useSessionStorage("ud_show", true);
  3083. const { t } = vueI18n.useI18n();
  3084. return (_ctx, _cache) => {
  3085. const _component_LocaleSelect = _sfc_main$2;
  3086. const _component_Toggle = _sfc_main$3;
  3087. const _component_TagsInput = _sfc_main$4;
  3088. return _ctx.show ? (vue.openBlock(), vue.createElementBlock("div", {
  3089. key: 0,
  3090. ref_key: "dialog",
  3091. ref: dialog,
  3092. class: "fixed left-1/2 -translate-x-1/2 top-25vh w-100 shadow-md rounded bg-$ud-bg text-$ud-text"
  3093. }, [
  3094. vue.createElementVNode("div", _hoisted_1, [
  3095. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(t)("settings")), 1),
  3096. vue.createElementVNode("div", {
  3097. class: "ml-auto p-1 hover:bg-$ud-bg-hover rounded",
  3098. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:show", false))
  3099. }, _hoisted_3)
  3100. ]),
  3101. vue.createElementVNode("ul", _hoisted_4, [
  3102. vue.createElementVNode("li", _hoisted_5, [
  3103. vue.createElementVNode("div", _hoisted_6, [
  3104. vue.createElementVNode("p", _hoisted_7, vue.toDisplayString(vue.unref(t)("language")), 1),
  3105. vue.createElementVNode("p", _hoisted_8, vue.toDisplayString(vue.unref(t)("language-desc")), 1)
  3106. ]),
  3107. vue.createVNode(_component_LocaleSelect)
  3108. ]),
  3109. vue.createElementVNode("li", _hoisted_9, [
  3110. vue.createElementVNode("div", _hoisted_10, [
  3111. vue.createElementVNode("p", _hoisted_11, vue.toDisplayString(vue.unref(t)("enable")), 1),
  3112. vue.createElementVNode("p", _hoisted_12, vue.toDisplayString(vue.unref(t)("enable-desc")), 1)
  3113. ]),
  3114. vue.createVNode(_component_Toggle, {
  3115. modelValue: vue.unref(enable),
  3116. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(enable) ? enable.value = $event : null)
  3117. }, null, 8, ["modelValue"])
  3118. ]),
  3119. vue.createElementVNode("li", _hoisted_13, [
  3120. vue.createElementVNode("div", _hoisted_14, [
  3121. vue.createElementVNode("p", _hoisted_15, vue.toDisplayString(vue.unref(t)("nsfw")), 1),
  3122. vue.createElementVNode("p", _hoisted_16, vue.toDisplayString(vue.unref(t)("nsfw-desc")), 1)
  3123. ]),
  3124. vue.createVNode(_component_Toggle, {
  3125. modelValue: vue.unref(settings2).nsfw,
  3126. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.unref(settings2).nsfw = $event)
  3127. }, null, 8, ["modelValue"])
  3128. ]),
  3129. vue.createElementVNode("li", _hoisted_17, [
  3130. vue.createElementVNode("div", _hoisted_18, [
  3131. vue.createElementVNode("p", _hoisted_19, vue.toDisplayString(vue.unref(t)("filter")), 1),
  3132. vue.createElementVNode("p", _hoisted_20, [
  3133. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("filter-desc")) + " ", 1),
  3134. vue.createElementVNode("span", {
  3135. class: "underline cursor-help",
  3136. title: vue.unref(t)("filter-tips")
  3137. }, "(?)", 8, _hoisted_21)
  3138. ])
  3139. ]),
  3140. vue.createVNode(_component_TagsInput, {
  3141. tags: vue.unref(settings2).filter,
  3142. "onUpdate:tags": _cache[3] || (_cache[3] = ($event) => vue.unref(settings2).filter = $event)
  3143. }, null, 8, ["tags"])
  3144. ])
  3145. ])
  3146. ], 512)) : vue.createCommentVNode("", true);
  3147. };
  3148. }
  3149. });
  3150. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  3151. __name: "App",
  3152. setup(__props) {
  3153. const collapse = vue.ref(false);
  3154. const enable = useSessionStorage("ud_show", true);
  3155. const [settingShow, toggleSettingShow] = useToggle(false);
  3156. return (_ctx, _cache) => {
  3157. const _component_SettingsPanel = _sfc_main$1;
  3158. const _component_FloatActionButton = _sfc_main$5;
  3159. const _component_MainPanel = _sfc_main$6;
  3160. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  3161. vue.createVNode(_component_SettingsPanel, {
  3162. show: vue.unref(settingShow),
  3163. "onUpdate:show": _cache[0] || (_cache[0] = ($event) => vue.isRef(settingShow) ? settingShow.value = $event : null)
  3164. }, null, 8, ["show"]),
  3165. vue.unref(enable) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  3166. vue.createVNode(_component_FloatActionButton, {
  3167. modelValue: vue.unref(collapse),
  3168. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(collapse) ? collapse.value = $event : null)
  3169. }, null, 8, ["modelValue"]),
  3170. vue.createVNode(_component_MainPanel, {
  3171. show: vue.unref(collapse),
  3172. "onUpdate:show": _cache[2] || (_cache[2] = ($event) => vue.isRef(collapse) ? collapse.value = $event : null),
  3173. onSetting: _cache[3] || (_cache[3] = ($event) => vue.unref(toggleSettingShow)(true))
  3174. }, null, 8, ["show"])
  3175. ], 64)) : vue.createCommentVNode("", true)
  3176. ], 64);
  3177. };
  3178. }
  3179. });
  3180. function attachUnocss(root) {
  3181. {
  3182. Promise.resolve().then(() => __unocss_raw$1).then(({ default: css }) => {
  3183. const style2 = document.createElement("style");
  3184. style2.innerText = css;
  3185. root.appendChild(style2);
  3186. });
  3187. }
  3188. }
  3189. const settings = useUserjsDiggerSettings();
  3190. const i18n = vueI18n.createI18n({
  3191. legacy: false,
  3192. locale: settings.value.locale,
  3193. fallbackLocale: "en",
  3194. messages: { zh: resource$1, en: resource }
  3195. });
  3196. if (!HTMLElement.prototype.attachShadow) {
  3197. console.error("shadow-dom doesn't support in current website, load polyfill");
  3198. useScriptTag("https://unpkg.com/attachshadow@0.3.0/min.js", () => {
  3199. initUserjsDigger(Element.prototype.attachShadow);
  3200. });
  3201. } else {
  3202. initUserjsDigger();
  3203. }
  3204. function initUserjsDigger(attachShadow = HTMLElement.prototype.attachShadow) {
  3205. customElements.define(
  3206. "userjs-digger",
  3207. class extends HTMLElement {
  3208. constructor() {
  3209. super();
  3210. __publicField(this, "app");
  3211. const app = document.createElement("div");
  3212. const shadow = attachShadow.call(this, { mode: "open" });
  3213. const resetStyle = document.createElement("style");
  3214. resetStyle.innerHTML = reset;
  3215. attachUnocss(shadow);
  3216. shadow.appendChild(resetStyle);
  3217. shadow.appendChild(app);
  3218. this.app = vue.createApp(_sfc_main);
  3219. this.app.use(i18n);
  3220. this.app.provide("container", app);
  3221. this.app.mount(app);
  3222. }
  3223. }
  3224. );
  3225. const userDigger = document.createElement("userjs-digger");
  3226. document.body.append(userDigger);
  3227. }
  3228. const __unocss_raw = `/* layer: preflights */*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: ;}[type='text'], [type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select { appearance: none;background-color: #fff;border-color: #6b7280;border-width: 1px;border-radius: 0;padding-top: 0.5rem;padding-right: 0.75rem;padding-bottom: 0.5rem;padding-left: 0.75rem;font-size: 1rem;line-height: 1.5rem;--un-shadow: 0 0 #0000; }[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus { outline: 2px solid transparent;outline-offset: 2px;--un-ring-inset: var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width: 0px;--un-ring-offset-color: #fff;--un-ring-color: #2563eb;--un-ring-offset-shadow: var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow: var(--un-ring-inset) 0 0 0 calc(1px + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow: var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);border-color: #2563eb; }input::placeholder, textarea::placeholder { color: #6b7280;opacity: 1; }::-webkit-datetime-edit-fields-wrapper { padding: 0; }::-webkit-date-and-time-value { min-height: 1.5em; }::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { padding-top: 0;padding-bottom: 0; }select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position: right 0.5rem center;background-repeat: no-repeat;background-size: 1.5em 1.5em;padding-right: 2.5rem;print-color-adjust: exact; }[multiple] { background-image: initial;background-position: initial;background-repeat: unset;background-size: initial;padding-right: 0.75rem;print-color-adjust: unset; }[type='checkbox'], [type='radio'] { appearance: none;padding: 0;print-color-adjust: exact;display: inline-block;vertical-align: middle;background-origin: border-box;user-select: none;flex-shrink: 0;height: 1rem;width: 1rem;color: #2563eb;background-color: #fff;border-color: #6b7280;border-width: 1px;--un-shadow: 0 0 #0000; }[type='checkbox'] { border-radius: 0; }[type='radio'] { border-radius: 100%; }[type='checkbox']:focus, [type='radio']:focus { outline: 2px solid transparent;outline-offset: 2px;--un-ring-inset: var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width: 2px;--un-ring-offset-color: #fff;--un-ring-color: #2563eb;--un-ring-offset-shadow: var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow: var(--un-ring-inset) 0 0 0 calc(2px + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow: var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow); }[type='checkbox']:checked, [type='radio']:checked { border-color: transparent;background-color: currentColor;background-size: 100% 100%;background-position: center;background-repeat: no-repeat; }[type='checkbox']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); }[type='radio']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); }[type='checkbox']:checked:hover, [type='checkbox']:checked:focus, [type='radio']:checked:hover, [type='radio']:checked:focus { border-color: transparent;background-color: currentColor; }[type='checkbox']:indeterminate { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color: transparent;background-color: currentColor;background-size: 100% 100%;background-position: center;background-repeat: no-repeat; }[type='checkbox']:indeterminate:hover, [type='checkbox']:indeterminate:focus { border-color: transparent;background-color: currentColor; }[type='file'] { background: unset;border-color: inherit;border-width: 0;border-radius: 0;padding: 0;font-size: unset;line-height: inherit; }[type='file']:focus { outline: 1px solid ButtonText , 1px auto -webkit-focus-ring-color; }[data-v-app]{font-size:16px}:host{z-index:999999;position:relative}/* layer: icons */.i-carbon-caret-sort{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m24 24l-8 8l-8-8zM8 8l8-8l8 8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-caret-sort-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m24 24l-8 8l-8-8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-caret-sort-up{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m8 8l8-8l8 8z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-checkmark{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-chevron-left{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M10 16L20 6l1.4 1.4l-8.6 8.6l8.6 8.6L20 26z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-chevron-right{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M22 16L12 26l-1.4-1.4l8.6-8.6l-8.6-8.6L12 6z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-chevron-sort{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m16 28l-7-7l1.41-1.41L16 25.17l5.59-5.58L23 21l-7 7zm0-24l7 7l-1.41 1.41L16 6.83l-5.59 5.58L9 11l7-7z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M24 9.4L22.6 8L16 14.6L9.4 8L8 9.4l6.6 6.6L8 22.6L9.4 24l6.6-6.6l6.6 6.6l1.4-1.4l-6.6-6.6L24 9.4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon-settings{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M27 16.76v-1.53l1.92-1.68A2 2 0 0 0 29.3 11l-2.36-4a2 2 0 0 0-1.73-1a2 2 0 0 0-.64.1l-2.43.82a11.35 11.35 0 0 0-1.31-.75l-.51-2.52a2 2 0 0 0-2-1.61h-4.68a2 2 0 0 0-2 1.61l-.51 2.52a11.48 11.48 0 0 0-1.32.75l-2.38-.86A2 2 0 0 0 6.79 6a2 2 0 0 0-1.73 1L2.7 11a2 2 0 0 0 .41 2.51L5 15.24v1.53l-1.89 1.68A2 2 0 0 0 2.7 21l2.36 4a2 2 0 0 0 1.73 1a2 2 0 0 0 .64-.1l2.43-.82a11.35 11.35 0 0 0 1.31.75l.51 2.52a2 2 0 0 0 2 1.61h4.72a2 2 0 0 0 2-1.61l.51-2.52a11.48 11.48 0 0 0 1.32-.75l2.42.82a2 2 0 0 0 .64.1a2 2 0 0 0 1.73-1l2.28-4a2 2 0 0 0-.41-2.51ZM25.21 24l-3.43-1.16a8.86 8.86 0 0 1-2.71 1.57L18.36 28h-4.72l-.71-3.55a9.36 9.36 0 0 1-2.7-1.57L6.79 24l-2.36-4l2.72-2.4a8.9 8.9 0 0 1 0-3.13L4.43 12l2.36-4l3.43 1.16a8.86 8.86 0 0 1 2.71-1.57L13.64 4h4.72l.71 3.55a9.36 9.36 0 0 1 2.7 1.57L25.21 8l2.36 4l-2.72 2.4a8.9 8.9 0 0 1 0 3.13L27.57 20Z'/%3E%3Cpath fill='currentColor' d='M16 22a6 6 0 1 1 6-6a5.94 5.94 0 0 1-6 6Zm0-10a3.91 3.91 0 0 0-4 4a3.91 3.91 0 0 0 4 4a3.91 3.91 0 0 0 4-4a3.91 3.91 0 0 0-4-4Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon\\:search{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29ZM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9Z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}.i-carbon\\:settings-adjust{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30V8zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3s3 1.3 3 3s-1.3 3-3 3zM2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3s-3-1.3-3-3s1.3-3 3-3z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}/* layer: shortcuts */.container{width:100%;}@media (min-width: 640px){.container{max-width:640px;}}@media (min-width: 768px){.container{max-width:768px;}}@media (min-width: 1024px){.container{max-width:1024px;}}@media (min-width: 1280px){.container{max-width:1280px;}}@media (min-width: 1536px){.container{max-width:1536px;}}/* layer: default */.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}.pointer-events-none{pointer-events:none;}.absolute{position:absolute;}.fixed{position:fixed;}.relative{position:relative;}.inset-y-0{top:0;bottom:0;}.bottom-4{bottom:16px;}.left-1\\/2{left:50%;}.right-0{right:0;}.right-4{right:16px;}.top-25vh{top:25vh;}.z-10{z-index:10;}.grid{display:grid;}.col-span-5{grid-column:span 5/span 5;}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr));}.mx-1{margin-left:4px;margin-right:4px;}.mx-2{margin-left:8px;margin-right:8px;}.ml-0\\.5{margin-left:2px;}.ml-auto{margin-left:auto;}.mr-1{margin-right:4px;}.mt-1{margin-top:4px;}.block{display:block;}.inline-block{display:inline-block;}.h-10{height:40px;}.h-3{height:12px;}.h-4{height:16px;}.h-60{height:240px;}.max-h-60{max-height:240px;}.max-w-60{max-width:240px;}.min-w-full{min-width:100%;}.w-10{width:40px;}.w-100{width:400px;}.w-130{width:520px;}.w-20{width:80px;}.w-22{width:88px;}.w-3{width:12px;}.w-4{width:16px;}.w-4\\/5{width:80%;}.w-60{width:240px;}.w-8{width:32px;}.w-9{width:36px;}.w-full{width:100%;}.flex{display:flex;}.inline-flex{display:inline-flex;}.flex-1{flex:1 1 0%;}.flex-shrink-0{flex-shrink:0;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}.table{display:table;}.-translate-x-\\[calc\\(100\\%_\\+_1rem\\)\\]{--un-translate-x:calc(calc(100% + 16px) * -1);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.-translate-x-1\\/2{--un-translate-x:-50%;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.translate-x-\\[calc\\(100\\%_\\+_1rem\\)\\]{--un-translate-x:calc(100% + 16px);transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.translate-x-0{--un-translate-x:0;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.translate-x-5{--un-translate-x:20px;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.-rotate-90{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:-90deg;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.rotate-90{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:90deg;transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}.transform{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}@keyframes pulse{0%, 100% {opacity:1} 50% {opacity:.5}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.animate-pulse{animation:pulse 2s cubic-bezier(0.4,0,.6,1) infinite;}.animate-spin{animation:spin 1s linear infinite;}.cursor-default{cursor:default;}.cursor-help{cursor:help;}.cursor-pointer{cursor:pointer;}.select-none{-webkit-user-select:none;user-select:none;}.items-center{align-items:center;}.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-y-1{row-gap:4px;}.gap-y-2{row-gap:8px;}.space-x-4>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(16px * calc(1 - var(--un-space-x-reverse)));margin-right:calc(16px * var(--un-space-x-reverse));}.space-y-2>:not([hidden])~:not([hidden]){--un-space-y-reverse:0;margin-top:calc(8px * calc(1 - var(--un-space-y-reverse)));margin-bottom:calc(8px * var(--un-space-y-reverse));}.divide-y>:not([hidden])~:not([hidden]){--un-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--un-divide-y-reverse)));border-bottom-width:calc(1px * var(--un-divide-y-reverse));}.divide-\\$ud-border-secondary>:not([hidden])~:not([hidden]){border-color:var(--ud-border-secondary);}.border-\\$ud-border,.divide-\\$ud-border>:not([hidden])~:not([hidden]){border-color:var(--ud-border);}.overflow-auto{overflow:auto;}.overflow-hidden{overflow:hidden;}.overflow-y-overlay{overflow-y:overlay;}.overflow-y-scroll{overflow-y:scroll;}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.break-all{word-break:break-all;}.border,.border-1px{border-width:1px;}.border-2{border-width:2px;}.border-b{border-bottom-width:1px;}.border-gray-300{--un-border-opacity:1;border-color:rgba(209,213,219,var(--un-border-opacity));}.border-transparent{border-color:transparent;}.focus-within\\:border-indigo-500:focus-within{--un-border-opacity:1;border-color:rgba(99,102,241,var(--un-border-opacity));}.focus\\:border-indigo-500:focus{--un-border-opacity:1;border-color:rgba(99,102,241,var(--un-border-opacity));}.border-b-\\$ud-border{border-bottom-color:var(--ud-border);}.rounded{border-radius:4px;}.rounded-full{border-radius:9999px;}.rounded-lg{border-radius:8px;}.rounded-md{border-radius:6px;}.rounded-sm{border-radius:2px;}.border-none{border-style:none;}.bg-\\$ud-bg{background-color:var(--ud-bg);}.bg-\\$ud-bg-secondary{background-color:var(--ud-bg-secondary);}.bg-gray-200{--un-bg-opacity:1;background-color:rgba(229,231,235,var(--un-bg-opacity));}.bg-indigo-100{--un-bg-opacity:1;background-color:rgba(224,231,255,var(--un-bg-opacity));}.bg-indigo-500{--un-bg-opacity:1;background-color:rgba(99,102,241,var(--un-bg-opacity));}.bg-indigo-600{--un-bg-opacity:1;background-color:rgba(79,70,229,var(--un-bg-opacity));}.bg-transparent{background-color:transparent;}.bg-white{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.hover\\:bg-\\$ud-bg-hover:hover{background-color:var(--ud-bg-hover);}.hover\\:bg-indigo-200:hover{--un-bg-opacity:1;background-color:rgba(199,210,254,var(--un-bg-opacity));}.hover\\:bg-indigo-600:hover{--un-bg-opacity:1;background-color:rgba(79,70,229,var(--un-bg-opacity));}.focus\\:bg-indigo-500:focus{--un-bg-opacity:1;background-color:rgba(99,102,241,var(--un-bg-opacity));}.focus\\:bg-indigo-600:focus{--un-bg-opacity:1;background-color:rgba(79,70,229,var(--un-bg-opacity));}.p-0{padding:0;}.p-1{padding:4px;}.p-2{padding:8px;}.p-3{padding:12px;}.p-4{padding:16px;}.px-1{padding-left:4px;padding-right:4px;}.px-2{padding-left:8px;padding-right:8px;}.px-3{padding-left:12px;padding-right:12px;}.px-4{padding-left:16px;padding-right:16px;}.py-0\\.25{padding-top:1px;padding-bottom:1px;}.py-0\\.5{padding-top:2px;padding-bottom:2px;}.py-1{padding-top:4px;padding-bottom:4px;}.py-10{padding-top:40px;padding-bottom:40px;}.py-2{padding-top:8px;padding-bottom:8px;}.pl-2\\.5{padding-left:10px;}.pl-3{padding-left:12px;}.pl-4{padding-left:16px;}.pr-1{padding-right:4px;}.pr-10{padding-right:40px;}.pr-2{padding-right:8px;}.pr-3{padding-right:12px;}.pr-4{padding-right:16px;}.pr-9{padding-right:36px;}.text-center{text-align:center;}.text-left{text-align:left;}.text-right{text-align:right;}.align-middle{vertical-align:middle;}.text-base{font-size:16px;line-height:24px;}.text-sm{font-size:14px;line-height:20px;}.text-xs{font-size:12px;line-height:16px;}.font-medium{font-weight:500;}.font-normal{font-weight:400;}.font-semibold{font-weight:600;}.leading-5{line-height:20px;}.uppercase{text-transform:uppercase;}.text-\\$ud-text,.group:focus .group-focus\\:text-\\$ud-text{color:var(--ud-text);}.text-\\$ud-text-secondary{color:var(--ud-text-secondary);}.text-indigo-400{--un-text-opacity:1;color:rgba(129,140,248,var(--un-text-opacity));}.text-indigo-500{--un-text-opacity:1;color:rgba(99,102,241,var(--un-text-opacity));}.text-indigo-600{--un-text-opacity:1;color:rgba(79,70,229,var(--un-text-opacity));}.text-indigo-700{--un-text-opacity:1;color:rgba(67,56,202,var(--un-text-opacity));}.text-transparent{color:transparent;}.text-white{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.hover\\:text-\\$ud-text:hover{color:var(--ud-text);}.hover\\:text-indigo-500:hover{--un-text-opacity:1;color:rgba(99,102,241,var(--un-text-opacity));}.hover\\:text-indigo-900:hover{--un-text-opacity:1;color:rgba(49,46,129,var(--un-text-opacity));}.hover\\:text-white:hover{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.focus\\:text-white:focus{--un-text-opacity:1;color:rgba(255,255,255,var(--un-text-opacity));}.underline{text-decoration-line:underline;}.underline-\\$ud-border{-webkit-text-decoration-color:var(--ud-border);text-decoration-color:var(--ud-border);}.opacity-0{opacity:0;}.opacity-100{opacity:1;}.opacity-25{opacity:0.25;}.opacity-75{opacity:0.75;}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.shadow-md{--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.shadow-sm{--un-shadow:var(--un-shadow-inset) 0 1px 2px 0 var(--un-shadow-color, rgba(0,0,0,0.05));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px;}.ring-0{--un-ring-width:0;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.ring-1{--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.ring-none\\!{--un-ring-width:0 !important;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color) !important;--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color) !important;box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow) !important;}.focus-within\\:ring-2:focus-within{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.focus\\:ring-1:focus{--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.focus\\:ring-2:focus{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.focus\\:ring-offset-2:focus{--un-ring-offset-width:2px;}.ring-black{--un-ring-opacity:1;--un-ring-color:rgba(0,0,0,var(--un-ring-opacity));}.focus-within\\:ring-indigo-500:focus-within{--un-ring-opacity:1;--un-ring-color:rgba(99,102,241,var(--un-ring-opacity));}.focus\\:ring-indigo-500:focus{--un-ring-opacity:1;--un-ring-color:rgba(99,102,241,var(--un-ring-opacity));}.ring-opacity-5{--un-ring-opacity:0.05;}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.duration-100{transition-duration:100ms;}.duration-200{transition-duration:200ms;}.ease-in{transition-timing-function:cubic-bezier(0.4, 0, 1, 1);}.ease-in-out{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}.ease-out{transition-timing-function:cubic-bezier(0, 0, 0.2, 1);}@media (min-width: 640px){.sm\\:text-sm{font-size:14px;line-height:20px;}}`;
  3229. const __unocss_raw$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  3230. __proto__: null,
  3231. default: __unocss_raw
  3232. }, Symbol.toStringTag, { value: "Module" }));
  3233. });
  3234. } ());
  3235.  
  3236. })(Vue, VueI18n, psl);