ranuts 0.4.1-alpha.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/CLAUDE.md +23 -16
  2. package/README.de.md +62 -0
  3. package/README.es.md +62 -0
  4. package/README.fa.md +62 -0
  5. package/README.ja.md +62 -0
  6. package/README.ko.md +62 -0
  7. package/README.md +35 -92
  8. package/README.pt.md +62 -0
  9. package/README.zh-CN.md +35 -91
  10. package/dist/iife/index.iife.js +4 -0
  11. package/dist/iife/utils.iife.js +4 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +306 -1
  14. package/dist/src/_virtual/_rolldown/runtime/index.js +12 -0
  15. package/dist/src/conversation/engine.d.ts +1 -1
  16. package/dist/src/conversation/engine.js +101 -0
  17. package/dist/src/conversation/index.d.ts +3 -3
  18. package/dist/src/conversation/index.js +4 -1
  19. package/dist/src/stream/accumulator.d.ts +1 -1
  20. package/dist/src/stream/accumulator.js +79 -0
  21. package/dist/src/stream/budget.d.ts +1 -1
  22. package/dist/src/stream/budget.js +45 -0
  23. package/dist/src/stream/index.d.ts +7 -7
  24. package/dist/src/stream/index.js +11 -1
  25. package/dist/src/stream/sse.d.ts +1 -1
  26. package/dist/src/stream/sse.js +61 -0
  27. package/dist/src/sw/index.js +52 -1
  28. package/dist/src/utils/async.js +49 -0
  29. package/dist/src/utils/audioRecorder.js +1121 -0
  30. package/dist/src/utils/behavior.js +9 -0
  31. package/dist/src/utils/binary.js +89 -0
  32. package/dist/src/utils/bom.d.ts +31 -9
  33. package/dist/src/utils/bom.js +165 -0
  34. package/dist/src/utils/bridge.js +310 -0
  35. package/dist/src/utils/canvas.js +103 -0
  36. package/dist/src/utils/chain.js +76 -0
  37. package/dist/src/utils/color.d.ts +0 -1
  38. package/dist/src/utils/color.js +312 -0
  39. package/dist/src/utils/compose.js +22 -0
  40. package/dist/src/utils/console.js +22 -0
  41. package/dist/src/utils/debounce.js +18 -0
  42. package/dist/src/utils/device.d.ts +0 -9
  43. package/dist/src/utils/device.js +31 -0
  44. package/dist/src/utils/diff.js +110 -0
  45. package/dist/src/utils/dom.d.ts +1 -1
  46. package/dist/src/utils/dom.js +89 -0
  47. package/dist/src/utils/error.js +11 -0
  48. package/dist/src/utils/event.d.ts +3 -3
  49. package/dist/src/utils/event.js +39 -0
  50. package/dist/src/utils/file.js +14 -0
  51. package/dist/src/utils/func.js +4 -0
  52. package/dist/src/utils/i18n/index.js +79 -1
  53. package/dist/src/utils/idb.js +177 -0
  54. package/dist/src/utils/img.d.ts +1 -1
  55. package/dist/src/utils/img.js +68 -0
  56. package/dist/src/utils/index.d.ts +80 -80
  57. package/dist/src/utils/index.js +306 -1
  58. package/dist/src/utils/lang.d.ts +23 -6
  59. package/dist/src/utils/lang.js +42 -0
  60. package/dist/src/utils/localePath.js +48 -0
  61. package/dist/src/utils/memoize.d.ts +1 -7
  62. package/dist/src/utils/memoize.js +16 -0
  63. package/dist/src/utils/mimeType.js +841 -0
  64. package/dist/src/utils/monitor.js +84 -0
  65. package/dist/src/utils/network.js +117 -0
  66. package/dist/src/utils/noop.js +5 -0
  67. package/dist/src/utils/number.js +185 -0
  68. package/dist/src/utils/obj.d.ts +2 -2
  69. package/dist/src/utils/obj.js +140 -0
  70. package/dist/src/utils/paginate.js +93 -0
  71. package/dist/src/utils/performance.js +26 -0
  72. package/dist/src/utils/placement.js +37 -0
  73. package/dist/src/utils/prefetch.js +69 -0
  74. package/dist/src/utils/queue.js +46 -0
  75. package/dist/src/utils/report.js +44 -0
  76. package/dist/src/utils/request.js +35 -0
  77. package/dist/src/utils/script.d.ts +1 -1
  78. package/dist/src/utils/script.js +46 -0
  79. package/dist/src/utils/scroll.js +62 -0
  80. package/dist/src/utils/secure.js +36 -0
  81. package/dist/src/utils/segment.js +43 -0
  82. package/dist/src/utils/signal.d.ts +1 -1
  83. package/dist/src/utils/signal.js +13 -0
  84. package/dist/src/utils/speech.js +59 -0
  85. package/dist/src/utils/storage.js +53 -0
  86. package/dist/src/utils/str.d.ts +0 -6
  87. package/dist/src/utils/str.js +395 -0
  88. package/dist/src/utils/style.js +29 -0
  89. package/dist/src/utils/subscribe.js +58 -0
  90. package/dist/src/utils/throttle.js +17 -0
  91. package/dist/src/utils/time.d.ts +0 -21
  92. package/dist/src/utils/time.js +97 -0
  93. package/dist/src/utils/totp/sha/common.d.ts +1 -1
  94. package/dist/src/utils/totp/sha/common.js +201 -0
  95. package/dist/src/utils/totp/sha/converters.d.ts +1 -1
  96. package/dist/src/utils/totp/sha/converters.js +188 -0
  97. package/dist/src/utils/totp/sha/primitives_32.js +55 -0
  98. package/dist/src/utils/totp/sha/primitives_64.js +85 -0
  99. package/dist/src/utils/totp/sha/sha.d.ts +1 -1
  100. package/dist/src/utils/totp/sha/sha.js +30 -0
  101. package/dist/src/utils/totp/sha/sha1.d.ts +2 -2
  102. package/dist/src/utils/totp/sha/sha1.js +51 -0
  103. package/dist/src/utils/totp/sha/sha256.d.ts +2 -2
  104. package/dist/src/utils/totp/sha/sha256.js +56 -0
  105. package/dist/src/utils/totp/sha/sha3.d.ts +3 -3
  106. package/dist/src/utils/totp/sha/sha3.js +253 -0
  107. package/dist/src/utils/totp/sha/sha512.d.ts +3 -3
  108. package/dist/src/utils/totp/sha/sha512.js +177 -0
  109. package/dist/src/utils/totp/totp.js +49 -0
  110. package/dist/src/utils/tween.js +59 -0
  111. package/dist/src/utils/visual/application.d.ts +4 -4
  112. package/dist/src/utils/visual/application.js +42 -0
  113. package/dist/src/utils/visual/enums.js +19 -0
  114. package/dist/src/utils/visual/event/boundary.d.ts +2 -2
  115. package/dist/src/utils/visual/event/boundary.js +93 -0
  116. package/dist/src/utils/visual/event/event.d.ts +1 -1
  117. package/dist/src/utils/visual/event/event.js +34 -0
  118. package/dist/src/utils/visual/event/index.d.ts +4 -4
  119. package/dist/src/utils/visual/event/types.d.ts +2 -2
  120. package/dist/src/utils/visual/event/types.js +23 -0
  121. package/dist/src/utils/visual/graphics/graphics.d.ts +8 -8
  122. package/dist/src/utils/visual/graphics/graphics.js +168 -0
  123. package/dist/src/utils/visual/graphics/graphicsData.d.ts +3 -3
  124. package/dist/src/utils/visual/graphics/graphicsData.js +12 -0
  125. package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +7 -7
  126. package/dist/src/utils/visual/graphics/graphicsGeometry.js +39 -0
  127. package/dist/src/utils/visual/graphics/index.d.ts +3 -3
  128. package/dist/src/utils/visual/index.d.ts +8 -8
  129. package/dist/src/utils/visual/index.js +20 -1
  130. package/dist/src/utils/visual/math/bezier.js +15 -0
  131. package/dist/src/utils/visual/math/enums.js +6 -0
  132. package/dist/src/utils/visual/math/index.d.ts +4 -4
  133. package/dist/src/utils/visual/math/matrix.d.ts +1 -1
  134. package/dist/src/utils/visual/math/matrix.js +59 -0
  135. package/dist/src/utils/visual/math/transform.d.ts +2 -2
  136. package/dist/src/utils/visual/math/transform.js +50 -0
  137. package/dist/src/utils/visual/render/batchRenderer.d.ts +4 -4
  138. package/dist/src/utils/visual/render/batchRenderer.js +59 -0
  139. package/dist/src/utils/visual/render/canvasRenderer.d.ts +3 -3
  140. package/dist/src/utils/visual/render/canvasRenderer.js +17 -0
  141. package/dist/src/utils/visual/render/filter.d.ts +1 -1
  142. package/dist/src/utils/visual/render/filter.js +92 -0
  143. package/dist/src/utils/visual/render/index.d.ts +2 -2
  144. package/dist/src/utils/visual/render/index.js +20 -0
  145. package/dist/src/utils/visual/render/render.d.ts +4 -4
  146. package/dist/src/utils/visual/render/render.js +19 -0
  147. package/dist/src/utils/visual/render/renderTarget.js +28 -0
  148. package/dist/src/utils/visual/render/utils/batch/index.d.ts +4 -4
  149. package/dist/src/utils/visual/render/utils/batch/index.js +88 -0
  150. package/dist/src/utils/visual/render/utils/earcut.js +328 -0
  151. package/dist/src/utils/visual/render/utils/float.js +65 -0
  152. package/dist/src/utils/visual/render/utils/index.js +50 -0
  153. package/dist/src/utils/visual/render/utils/verticy.d.ts +2 -2
  154. package/dist/src/utils/visual/render/utils/verticy.js +162 -0
  155. package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +1 -1
  156. package/dist/src/utils/visual/render/utils/webgl/initShader.js +31 -0
  157. package/dist/src/utils/visual/render/utils/webgl/shaders.js +22 -0
  158. package/dist/src/utils/visual/render/utils/webgpu/shaders.js +32 -0
  159. package/dist/src/utils/visual/render/webGPURenderer.d.ts +2 -2
  160. package/dist/src/utils/visual/render/webGPURenderer.js +185 -0
  161. package/dist/src/utils/visual/render/webGlRenderer.d.ts +2 -2
  162. package/dist/src/utils/visual/render/webGlRenderer.js +88 -0
  163. package/dist/src/utils/visual/shape/circle.d.ts +3 -3
  164. package/dist/src/utils/visual/shape/circle.js +17 -0
  165. package/dist/src/utils/visual/shape/ellipse.d.ts +3 -3
  166. package/dist/src/utils/visual/shape/ellipse.js +18 -0
  167. package/dist/src/utils/visual/shape/index.d.ts +6 -6
  168. package/dist/src/utils/visual/shape/polygon.d.ts +3 -3
  169. package/dist/src/utils/visual/shape/polygon.js +29 -0
  170. package/dist/src/utils/visual/shape/rectangle.d.ts +3 -3
  171. package/dist/src/utils/visual/shape/rectangle.js +18 -0
  172. package/dist/src/utils/visual/shape/roundedRectangle.d.ts +3 -3
  173. package/dist/src/utils/visual/shape/roundedRectangle.js +32 -0
  174. package/dist/src/utils/visual/shape/shape.d.ts +2 -2
  175. package/dist/src/utils/visual/shape/shape.js +5 -0
  176. package/dist/src/utils/visual/style/fill.js +18 -0
  177. package/dist/src/utils/visual/style/index.d.ts +2 -2
  178. package/dist/src/utils/visual/style/line.d.ts +2 -2
  179. package/dist/src/utils/visual/style/line.js +18 -0
  180. package/dist/src/utils/visual/types.d.ts +1 -1
  181. package/dist/src/utils/visual/vertex/container.d.ts +5 -5
  182. package/dist/src/utils/visual/vertex/container.js +54 -0
  183. package/dist/src/utils/visual/vertex/point.js +37 -0
  184. package/dist/src/utils/visual/vertex/vertex.d.ts +7 -7
  185. package/dist/src/utils/visual/vertex/vertex.js +76 -0
  186. package/dist/src/utils/worker.js +89 -0
  187. package/dist/src/utils/zip.js +161 -0
  188. package/dist/src/vnode/h.d.ts +1 -1
  189. package/dist/src/vnode/h.js +22 -0
  190. package/dist/src/vnode/hooks.d.ts +1 -1
  191. package/dist/src/vnode/htmlDomApi.js +94 -0
  192. package/dist/src/vnode/index.d.ts +16 -16
  193. package/dist/src/vnode/index.js +28 -1
  194. package/dist/src/vnode/init.d.ts +1 -1
  195. package/dist/src/vnode/init.js +104 -0
  196. package/dist/src/vnode/is.d.ts +1 -1
  197. package/dist/src/vnode/is.js +20 -0
  198. package/dist/src/vnode/modules/attributes.d.ts +1 -1
  199. package/dist/src/vnode/modules/attributes.js +21 -0
  200. package/dist/src/vnode/modules/class.d.ts +1 -1
  201. package/dist/src/vnode/modules/class.js +18 -0
  202. package/dist/src/vnode/modules/index.js +15 -0
  203. package/dist/src/vnode/modules/listeners.d.ts +1 -1
  204. package/dist/src/vnode/modules/listeners.js +36 -0
  205. package/dist/src/vnode/modules/props.d.ts +1 -1
  206. package/dist/src/vnode/modules/props.js +17 -0
  207. package/dist/src/vnode/modules/style.d.ts +1 -1
  208. package/dist/src/vnode/modules/style.js +52 -0
  209. package/dist/src/vnode/vnode.d.ts +6 -6
  210. package/dist/src/vnode/vnode.js +13 -0
  211. package/dist/third-party/jschardet/LICENSE.txt +504 -0
  212. package/dist/third-party/jschardet/NOTICE.txt +33 -0
  213. package/docs/API.md +8 -64
  214. package/package.json +12 -16
  215. package/dist/bin/generate-api-docs.d.ts +0 -1
  216. package/dist/build/build.es.d.ts +0 -2
  217. package/dist/build/build.umd.d.ts +0 -2
  218. package/dist/build/build.umd.node.d.ts +0 -2
  219. package/dist/build/build.umd.utils.d.ts +0 -2
  220. package/dist/chain-CTywmh_H.js +0 -1
  221. package/dist/color-BTvZUuf-.js +0 -1
  222. package/dist/enums-BAgbyGdH.js +0 -1
  223. package/dist/examples/clone-deep-example.d.ts +0 -1
  224. package/dist/examples/is-equal-example.d.ts +0 -1
  225. package/dist/i18n-DW21b_DJ.js +0 -1
  226. package/dist/plugins/vite-plugins-banner.d.ts +0 -2
  227. package/dist/rolldown-runtime-I3TIJKkN.js +0 -1
  228. package/dist/src/node/appendFile.d.ts +0 -7
  229. package/dist/src/node/body.d.ts +0 -9
  230. package/dist/src/node/color.d.ts +0 -7
  231. package/dist/src/node/command.d.ts +0 -8
  232. package/dist/src/node/ctx2req.d.ts +0 -5
  233. package/dist/src/node/fileInfo.d.ts +0 -7
  234. package/dist/src/node/fs.d.ts +0 -7
  235. package/dist/src/node/get.d.ts +0 -10
  236. package/dist/src/node/getIPAdress.d.ts +0 -1
  237. package/dist/src/node/index.d.ts +0 -25
  238. package/dist/src/node/index.js +0 -1
  239. package/dist/src/node/isColorSupported.d.ts +0 -2
  240. package/dist/src/node/paresUrl.d.ts +0 -19
  241. package/dist/src/node/readDir.d.ts +0 -6
  242. package/dist/src/node/readFile.d.ts +0 -9
  243. package/dist/src/node/router.d.ts +0 -42
  244. package/dist/src/node/send.d.ts +0 -7
  245. package/dist/src/node/server.d.ts +0 -18
  246. package/dist/src/node/startTask.d.ts +0 -2
  247. package/dist/src/node/stream.d.ts +0 -15
  248. package/dist/src/node/taskEnd.d.ts +0 -2
  249. package/dist/src/node/traverse.d.ts +0 -17
  250. package/dist/src/node/watchFile.d.ts +0 -8
  251. package/dist/src/node/writeFile.d.ts +0 -8
  252. package/dist/src/node/ws.d.ts +0 -8
  253. package/dist/src/utils/visual/render/utils/batch/index.test.d.ts +0 -1
  254. package/dist/src/utils/visual/render/utils/index.test.d.ts +0 -1
  255. package/dist/test/binary.test.d.ts +0 -1
  256. package/dist/test/bridge.test.d.ts +0 -1
  257. package/dist/test/budget.test.d.ts +0 -1
  258. package/dist/test/canvas.test.d.ts +0 -1
  259. package/dist/test/clearBr.test.d.ts +0 -1
  260. package/dist/test/cloneDeep.test.d.ts +0 -1
  261. package/dist/test/color.test.d.ts +0 -1
  262. package/dist/test/command.test.d.ts +0 -1
  263. package/dist/test/conversation.test.d.ts +0 -1
  264. package/dist/test/diff.test.d.ts +0 -1
  265. package/dist/test/encodeUrl.test.d.ts +0 -1
  266. package/dist/test/escapeHtml.test.d.ts +0 -1
  267. package/dist/test/formatBytes.test.d.ts +0 -1
  268. package/dist/test/is-equal.test.d.ts +0 -1
  269. package/dist/test/mimeType.test.d.ts +0 -1
  270. package/dist/test/package-exports.test.d.ts +0 -1
  271. package/dist/test/scroll.test.d.ts +0 -1
  272. package/dist/test/server.test.d.ts +0 -1
  273. package/dist/test/status.test.d.ts +0 -1
  274. package/dist/test/stream.test.d.ts +0 -1
  275. package/dist/test/sw.test.d.ts +0 -1
  276. package/dist/test/totp.test.d.ts +0 -1
  277. package/dist/test/tween.test.d.ts +0 -1
  278. package/dist/test/utils/async.test.d.ts +0 -1
  279. package/dist/test/utils/autosize.test.d.ts +0 -1
  280. package/dist/test/utils/color-grade.test.d.ts +0 -1
  281. package/dist/test/utils/compose.test.d.ts +0 -1
  282. package/dist/test/utils/event.test.d.ts +0 -1
  283. package/dist/test/utils/file-read.test.d.ts +0 -1
  284. package/dist/test/utils/format.test.d.ts +0 -1
  285. package/dist/test/utils/i18n.test.d.ts +0 -1
  286. package/dist/test/utils/idb-collection.test.d.ts +0 -1
  287. package/dist/test/utils/idb.test.d.ts +0 -1
  288. package/dist/test/utils/instrumentation.test.d.ts +0 -1
  289. package/dist/test/utils/interp.test.d.ts +0 -1
  290. package/dist/test/utils/lang.test.d.ts +0 -1
  291. package/dist/test/utils/locale-path.test.d.ts +0 -1
  292. package/dist/test/utils/media-query.test.d.ts +0 -1
  293. package/dist/test/utils/mergeObj.test.d.ts +0 -1
  294. package/dist/test/utils/number-parse.test.d.ts +0 -1
  295. package/dist/test/utils/paginate.test.d.ts +0 -1
  296. package/dist/test/utils/placement.test.d.ts +0 -1
  297. package/dist/test/utils/prefetch.test.d.ts +0 -1
  298. package/dist/test/utils/query-storage.test.d.ts +0 -1
  299. package/dist/test/utils/queue.test.d.ts +0 -1
  300. package/dist/test/utils/report-config.test.d.ts +0 -1
  301. package/dist/test/utils/report-image.test.d.ts +0 -1
  302. package/dist/test/utils/secure.test.d.ts +0 -1
  303. package/dist/test/utils/segment.test.d.ts +0 -1
  304. package/dist/test/utils/signal-once.test.d.ts +0 -1
  305. package/dist/test/utils/single-flight.test.d.ts +0 -1
  306. package/dist/test/utils/speech.test.d.ts +0 -1
  307. package/dist/test/utils/text-boundary.test.d.ts +0 -1
  308. package/dist/test/utils/time.test.d.ts +0 -1
  309. package/dist/test/utils/timing.test.d.ts +0 -1
  310. package/dist/test/utils/truncate.test.d.ts +0 -1
  311. package/dist/test/utils/visual/filter.test.d.ts +0 -1
  312. package/dist/test/utils/worker-client.test.d.ts +0 -1
  313. package/dist/test/utils/worker-serve.test.d.ts +0 -1
  314. package/dist/test/utils/zip.test.d.ts +0 -1
  315. package/dist/test/visual/math.test.d.ts +0 -1
  316. package/dist/test/visual-application.test.d.ts +0 -1
  317. package/dist/test/visual-batch.test.d.ts +0 -1
  318. package/dist/test/visual-math.test.d.ts +0 -1
  319. package/dist/test/vnode/index.d.ts +0 -1
  320. package/dist/test/vnode/server.d.ts +0 -2
  321. package/dist/test/vnode/vnode.d.ts +0 -1
  322. package/dist/test/vnode.test.d.ts +0 -1
  323. package/dist/test/websocket.test.d.ts +0 -1
  324. package/dist/test/writeFile.test.d.ts +0 -1
  325. package/dist/umd/index.umd.cjs +0 -1
  326. package/dist/umd/node/node.umd.cjs +0 -1
  327. package/dist/umd/utils/utils.umd.cjs +0 -1
  328. package/dist/utils-B4FnyUzW.js +0 -1
  329. package/dist/vite.config.d.ts +0 -8
  330. package/dist/vitest.config.d.ts +0 -2
@@ -1,81 +1,81 @@
1
- import { createBottomFollower } from './scroll';
2
- import { diffLines } from './diff';
3
- import { SyncHook } from './subscribe';
4
- import { Mathjs, addNumSym, formatBytes, clamp, fit, inverseLerp, lerp, linearstep, mathjs, parseChineseNumber, parseEnglishNumber, parseRomanNumber, perToNum, range, remap, smoothstep, transformNumber } from './number';
5
- import { MessageCodec, arrayBufferToString, checkEncoding, clearBr, clearStr, getMatchingSentences, getRandomString, isString, md5, randomString, strParse, toFullWidth, toHalfWidth, toString, transformText, truncate, truncateWithMarker, fenceCode, slugify, csvEscape } from './str';
6
- import type { BottomFollower, BottomFollowerOptions } from './scroll';
7
- import type { DiffHunk, DiffLine, DiffLineKind, DiffOptions } from './diff';
8
- import type { TransformText, TruncateOptions, TruncatePosition } from './str';
9
- import { createSpeechRecognizer, isSpeechRecognitionSupported } from './speech';
10
- import type { SpeechError, SpeechErrorKind, SpeechRecognizer, SpeechRecognizerOptions } from './speech';
11
- import { appendUrl, connection, createObjectURL, durationHandler, encodeUrl, getAllQueryString, getCookie, getCookieByName, getFrame, getPixelRatio, getWindow, imageRequest, isInIframe, isSafari, networkSpeed, queryFlag, requestUrlToBuffer } from './bom';
12
- import { BRIDGE_MARKER, BridgeManager, Client, DEFAULT_CHANNEL, Platform, PostMessageBridge, acceptPortBridge, bridgeManager, createPortBridge, openPortBridge } from './bridge';
13
- import type { AcceptPortBridgeOptions, BridgeManagerOptions, BroadcastPayload, CallToPayload, MessageData, MessageHandler, OpenPortBridgeOptions, PendingRequest, PortBridge } from './bridge';
14
- import { cloneDeep, filterObj, formatJson, isEqual, merge, mergeExports, querystring, replaceOld } from './obj';
15
- import { MimeType, getExtensions, getMime, setMime } from './mimeType';
16
- import { AudioRecorder } from './audioRecorder';
17
- import { createSignal, subscribers } from './signal';
18
- import { TOTP } from './totp/totp';
19
- import { createStore, localStorageGetItem, localStorageRemoveItem, localStorageSetItem } from './storage';
20
- import type { JsonStore } from './storage';
21
- import { compose } from './compose';
22
- import { handleConsole } from './console';
23
- import { debounce } from './debounce';
24
- import type { Debounced } from './debounce';
25
- import { Chain, addClassToElement, autosizeTextarea, create, createDocumentFragment, escapeHtml, removeClassToElement, setFontSize2html } from './dom';
26
- import { handleError } from './error';
27
- import { EventManager, createDoubleTapDetector } from './event';
28
- import type { DoubleTapDetector, DoubleTapDetectorOptions } from './event';
29
- import { circ, cubic, expo, quad, quart, quint, sine } from './tween';
30
- import type { EasingFn, SpeedType } from './tween';
31
- import { convertImageToBase64, cutRound, getImage, getMatrix, isImageSize, opacity } from './img';
32
- import type { ImgSource } from './img';
33
- import { fanShapedByArc, getAngle, getArcPointerByDeg, getLinearGradient, getTangentByPointer, roundRectByArc } from './canvas';
34
- import { ADOPTED_SHEET_MARKER, ADOPTED_STYLE_MARKER, adoptSheetText, adoptStyles } from './style';
35
- import { memoize, once, singleFlight } from './memoize';
36
- import type { SingleFlight } from './memoize';
37
- import { WebDB, createHandoff } from './idb';
38
- import type { Handoff, HandoffOptions, IDBCollection, IDBResult, IDBStoreSchema, WebDBOptions } from './idb';
39
- import { buildOffsets, indexForOffset, segmentByRanges } from './segment';
40
- import { paginateText } from './paginate';
41
- import type { PaginateOptions, PaginateResult, TextBox, TextGridMetrics, TextPage } from './paginate';
42
- import type { OffsetRange, Segment } from './segment';
43
- import { detectLanguage, navigatorLanguage, resolveLocale } from './lang';
44
- import { I18nCore, createI18n, useI18n } from './i18n';
45
- import type { I18nConfig, LocaleChangeHandler, LocaleMessages, MessageDict, StringValues, TranslateParams } from './i18n';
46
- import { createLocalePath } from './localePath';
47
- import type { LocalePath, LocalePathConfig, LocaleRoute } from './localePath';
48
- import { alignCrossAxis, computePlacement } from './placement';
49
- import type { ComputePlacementOptions, ComputedPlacement, Placement, PlacementAlign, PlacementRect, PlacementSide } from './placement';
50
- import type { ResolveLocaleOptions, TextLanguage } from './lang';
51
- import { readFileAsArrayBuffer, readFileAsDataURL, readFileAsText, readFileAsUint8Array } from './file';
52
- import { base64ToBytes, bytesToBase64, decodeTextBytes, fetchMaybeGzip, gunzipMaybe, isGzip, isHtmlDocument, isZipContainer, saveFileToDisk, bytesToBase64Url, base64UrlToBytes, concatBytes } from './binary';
53
- import { UNAMBIGUOUS_ALPHABET, safeEqual, secureRandomString, secureToken } from './secure';
54
- import { WorkerClient, serveWorker } from './worker';
55
- import type { ServeWorkerOptions, WorkerClientOptions, WorkerHandlerContext, WorkerRequestBase, WorkerResponseBase } from './worker';
56
- import { isUrlCached, networkAllowsDownload, prefetchUrl, prefetchUrls, prefetchWhenIdle, whenIdle } from './prefetch';
57
- import type { NetworkAllowanceOptions, PrefetchOptions, WhenIdleOptions } from './prefetch';
58
- import { TimeoutError, createRaceGuard, deferred, delay, withTimeout, withTimeoutFallback } from './async';
59
- import type { Deferred, RaceGuard } from './async';
60
- import { ZIP_DEFLATE, ZIP_STORED, createZip, crc32, inflateRaw, readZipEntries, readZipEntry, rewriteZip, zipHasEntry } from './zip';
61
- import type { RewriteZipOptions, ZipEntry } from './zip';
62
- import { Monitor } from './monitor';
63
- import { getStatus, status } from './network';
64
- import { noop } from './noop';
65
- import { getPerformance } from './performance';
66
- import { QuestQueue } from './queue';
67
- import { createData, getReportUrl, report, setReportUrl } from './report';
68
- import type { BeaconPayload, ReportConfig } from './report';
69
- import { handleFetchHook, handleXhrHook } from './request';
70
- import { loadScript, scriptOnLoad } from './script';
71
- import type { LoadScriptOptions } from './script';
72
- import { throttle } from './throttle';
73
- import type { Throttled } from './throttle';
74
- import { formatDate, formatDuration, formatRelative, parseVttCueTiming, parseVttTimestamp, performanceTime, timeFormat, timestampToTime } from './time';
75
- import type { DateInput, FormatRelativeOptions, RelativeStyle } from './time';
76
- import type { CurrentDevice } from './device';
77
- import { MOBILE_MEDIA_QUERY, currentDevice, isClient, isMobile, isWeiXin, matchMediaQuery, watchMediaQuery } from './device';
78
- import { Color, ColorScheme, FMT, HEX_COLOR_REGEX, Hsl, Hsla, RGBA_REGEX, RGB_REGEX, Rgb, Rgba, blendMultiply, blendOverlay, blendScreen, brightnessContrast, componentToHex, cosinePalette, hexToAlpha, hexToHsb, hexToHsv, hexToRgb, hsbToHsl, hsbToRgb, hslToHsb, hslToHsv, hslToRgb, hsvToHsl, hsvToRgb, hue2rgb, linearToSrgb, luma, randomColor, rgbToHex, rgbToHsb, rgbToHsl, rgbToHsv, rgbaString, rgbaToHex, rgbaToRgb, saturation, srgbToLinear, vibrance } from '@/utils/color';
79
- import type { RGB } from '@/utils/color';
80
- export { createBottomFollower, diffLines, formatBytes, performanceTime, timeFormat, timestampToTime, throttle, SyncHook, clearBr, clearStr, isString, randomString, strParse, scriptOnLoad, handleFetchHook, createData, report, QuestQueue, noop, getPerformance, querystring, formatJson, filterObj, merge, replaceOld, mergeExports, perToNum, range, clamp, lerp, inverseLerp, remap, fit, linearstep, smoothstep, Mathjs, mathjs, getStatus, status, Monitor, MimeType, getExtensions, setMime, getMime, memoize, once, isImageSize, convertImageToBase64, handleError, addClassToElement, removeClassToElement, createDocumentFragment, escapeHtml, isClient, isWeiXin, isMobile, debounce, currentDevice, handleConsole, compose, Color, FMT, Hsl, Hsla, Rgb, Rgba, randomColor, hexToRgb, componentToHex, rgbToHex, rgbToHsl, hue2rgb, hslToRgb, rgbToHsb, hsbToRgb, hsvToRgb, hsvToHsl, ColorScheme, AudioRecorder, getCookie, requestUrlToBuffer, getPixelRatio, createObjectURL, getFrame, getAllQueryString, queryFlag, isInIframe, appendUrl, getCookieByName, getWindow, connection, encodeUrl, imageRequest, durationHandler, networkSpeed, TOTP, localStorageGetItem, localStorageSetItem, localStorageRemoveItem, createStore, setFontSize2html, autosizeTextarea, createSpeechRecognizer, isSpeechRecognitionSupported, Chain, create, isEqual, cloneDeep, createSignal, subscribers, getMatchingSentences, transformNumber, toString, addNumSym, checkEncoding, transformText, isSafari, md5, getRandomString, bridgeManager, Client, BridgeManager, PostMessageBridge, MessageCodec, Platform, openPortBridge, acceptPortBridge, createPortBridge, BRIDGE_MARKER, DEFAULT_CHANNEL, singleFlight, WebDB, createHandoff, buildOffsets, paginateText, indexForOffset, segmentByRanges, detectLanguage, navigatorLanguage, resolveLocale, readFileAsArrayBuffer, readFileAsUint8Array, base64ToBytes, bytesToBase64, decodeTextBytes, fetchMaybeGzip, gunzipMaybe, isGzip, isHtmlDocument, isZipContainer, saveFileToDisk, readFileAsText, readFileAsDataURL, WorkerClient, serveWorker, whenIdle, networkAllowsDownload, isUrlCached, prefetchUrl, prefetchUrls, prefetchWhenIdle, deferred, withTimeout, withTimeoutFallback, delay, TimeoutError, createRaceGuard, crc32, inflateRaw, readZipEntries, readZipEntry, zipHasEntry, rewriteZip, createZip, ZIP_STORED, ZIP_DEFLATE, arrayBufferToString, toHalfWidth, toFullWidth, truncate, parseChineseNumber, parseRomanNumber, parseEnglishNumber, MOBILE_MEDIA_QUERY, matchMediaQuery, watchMediaQuery, createLocalePath, setReportUrl, getReportUrl, formatDate, formatDuration, formatRelative, parseVttCueTiming, parseVttTimestamp, handleXhrHook, EventManager, createDoubleTapDetector, quad, cubic, quart, quint, sine, expo, circ, getImage, cutRound, opacity, getMatrix, getAngle, getArcPointerByDeg, getTangentByPointer, fanShapedByArc, roundRectByArc, getLinearGradient, adoptStyles, adoptSheetText, ADOPTED_STYLE_MARKER, ADOPTED_SHEET_MARKER, rgbToHsv, hexToHsb, hexToHsv, hsbToHsl, hslToHsb, hslToHsv, hexToAlpha, rgbaString, rgbaToRgb, rgbaToHex, srgbToLinear, linearToSrgb, luma, blendScreen, blendMultiply, blendOverlay, brightnessContrast, saturation, vibrance, cosinePalette, HEX_COLOR_REGEX, RGB_REGEX, RGBA_REGEX, loadScript, I18nCore, createI18n, useI18n, alignCrossAxis, computePlacement, safeEqual, secureRandomString, secureToken, UNAMBIGUOUS_ALPHABET, bytesToBase64Url, base64UrlToBytes, concatBytes, truncateWithMarker, fenceCode, slugify, csvEscape, };
1
+ import { createBottomFollower } from "./scroll.js";
2
+ import { diffLines } from "./diff.js";
3
+ import { SyncHook } from "./subscribe.js";
4
+ import { Mathjs, addNumSym, formatBytes, clamp, fit, inverseLerp, lerp, linearstep, mathjs, parseChineseNumber, parseEnglishNumber, parseRomanNumber, perToNum, range, remap, smoothstep, transformNumber } from "./number.js";
5
+ import { MessageCodec, arrayBufferToString, checkEncoding, clearBr, clearStr, getMatchingSentences, getRandomString, isString, randomString, strParse, toFullWidth, toHalfWidth, toString, transformText, truncate, truncateWithMarker, fenceCode, slugify, csvEscape } from "./str.js";
6
+ import type { BottomFollower, BottomFollowerOptions } from "./scroll.js";
7
+ import type { DiffHunk, DiffLine, DiffLineKind, DiffOptions } from "./diff.js";
8
+ import type { TransformText, TruncateOptions, TruncatePosition } from "./str.js";
9
+ import { createSpeechRecognizer, isSpeechRecognitionSupported } from "./speech.js";
10
+ import type { SpeechError, SpeechErrorKind, SpeechRecognizer, SpeechRecognizerOptions } from "./speech.js";
11
+ import { appendUrl, connection, createObjectURL, durationHandler, encodeUrl, getAllQueryString, getCookie, getCookieByName, getFrame, getPixelRatio, getWindow, imageRequest, isInIframe, isSafari, networkSpeed, queryFlag, requestUrlToBuffer } from "./bom.js";
12
+ import { BRIDGE_MARKER, BridgeManager, Client, DEFAULT_CHANNEL, Platform, PostMessageBridge, acceptPortBridge, bridgeManager, createPortBridge, openPortBridge } from "./bridge.js";
13
+ import type { AcceptPortBridgeOptions, BridgeManagerOptions, BroadcastPayload, CallToPayload, MessageData, MessageHandler, OpenPortBridgeOptions, PendingRequest, PortBridge } from "./bridge.js";
14
+ import { cloneDeep, filterObj, formatJson, isEqual, merge, mergeExports, querystring, replaceOld } from "./obj.js";
15
+ import { MimeType, getExtensions, getMime, setMime } from "./mimeType.js";
16
+ import { AudioRecorder } from "./audioRecorder.js";
17
+ import { createSignal, subscribers } from "./signal.js";
18
+ import { TOTP } from "./totp/totp.js";
19
+ import { createStore, localStorageGetItem, localStorageRemoveItem, localStorageSetItem } from "./storage.js";
20
+ import type { JsonStore } from "./storage.js";
21
+ import { compose } from "./compose.js";
22
+ import { handleConsole } from "./console.js";
23
+ import { debounce } from "./debounce.js";
24
+ import type { Debounced } from "./debounce.js";
25
+ import { Chain, addClassToElement, autosizeTextarea, create, createDocumentFragment, escapeHtml, removeClassToElement, setFontSize2html } from "./dom.js";
26
+ import { handleError } from "./error.js";
27
+ import { EventManager, createDoubleTapDetector } from "./event.js";
28
+ import type { DoubleTapDetector, DoubleTapDetectorOptions } from "./event.js";
29
+ import { circ, cubic, expo, quad, quart, quint, sine } from "./tween.js";
30
+ import type { EasingFn, SpeedType } from "./tween.js";
31
+ import { convertImageToBase64, cutRound, getImage, getMatrix, isImageSize, opacity } from "./img.js";
32
+ import type { ImgSource } from "./img.js";
33
+ import { fanShapedByArc, getAngle, getArcPointerByDeg, getLinearGradient, getTangentByPointer, roundRectByArc } from "./canvas.js";
34
+ import { ADOPTED_SHEET_MARKER, ADOPTED_STYLE_MARKER, adoptSheetText, adoptStyles } from "./style.js";
35
+ import { once, singleFlight } from "./memoize.js";
36
+ import type { SingleFlight } from "./memoize.js";
37
+ import { WebDB, createHandoff } from "./idb.js";
38
+ import type { Handoff, HandoffOptions, IDBCollection, IDBResult, IDBStoreSchema, WebDBOptions } from "./idb.js";
39
+ import { buildOffsets, indexForOffset, segmentByRanges } from "./segment.js";
40
+ import { paginateText } from "./paginate.js";
41
+ import type { PaginateOptions, PaginateResult, TextBox, TextGridMetrics, TextPage } from "./paginate.js";
42
+ import type { OffsetRange, Segment } from "./segment.js";
43
+ import { detectLanguage, navigatorLanguage, resolveLocale } from "./lang.js";
44
+ import { I18nCore, createI18n, useI18n } from "./i18n.js";
45
+ import type { I18nConfig, LocaleChangeHandler, LocaleMessages, MessageDict, StringValues, TranslateParams } from "./i18n.js";
46
+ import { createLocalePath } from "./localePath.js";
47
+ import type { LocalePath, LocalePathConfig, LocaleRoute } from "./localePath.js";
48
+ import { alignCrossAxis, computePlacement } from "./placement.js";
49
+ import type { ComputePlacementOptions, ComputedPlacement, Placement, PlacementAlign, PlacementRect, PlacementSide } from "./placement.js";
50
+ import type { ResolveLocaleOptions, TextLanguage } from "./lang.js";
51
+ import { readFileAsArrayBuffer, readFileAsDataURL, readFileAsText, readFileAsUint8Array } from "./file.js";
52
+ import { base64ToBytes, bytesToBase64, decodeTextBytes, fetchMaybeGzip, gunzipMaybe, isGzip, isHtmlDocument, isZipContainer, saveFileToDisk, bytesToBase64Url, base64UrlToBytes, concatBytes } from "./binary.js";
53
+ import { UNAMBIGUOUS_ALPHABET, safeEqual, secureRandomString, secureToken } from "./secure.js";
54
+ import { WorkerClient, serveWorker } from "./worker.js";
55
+ import type { ServeWorkerOptions, WorkerClientOptions, WorkerHandlerContext, WorkerRequestBase, WorkerResponseBase } from "./worker.js";
56
+ import { isUrlCached, networkAllowsDownload, prefetchUrl, prefetchUrls, prefetchWhenIdle, whenIdle } from "./prefetch.js";
57
+ import type { NetworkAllowanceOptions, PrefetchOptions, WhenIdleOptions } from "./prefetch.js";
58
+ import { TimeoutError, createRaceGuard, deferred, delay, withTimeout, withTimeoutFallback } from "./async.js";
59
+ import type { Deferred, RaceGuard } from "./async.js";
60
+ import { ZIP_DEFLATE, ZIP_STORED, createZip, crc32, inflateRaw, readZipEntries, readZipEntry, rewriteZip, zipHasEntry } from "./zip.js";
61
+ import type { RewriteZipOptions, ZipEntry } from "./zip.js";
62
+ import { Monitor } from "./monitor.js";
63
+ import { getStatus, status } from "./network.js";
64
+ import { noop } from "./noop.js";
65
+ import { getPerformance } from "./performance.js";
66
+ import { QuestQueue } from "./queue.js";
67
+ import { createData, getReportUrl, report, setReportUrl } from "./report.js";
68
+ import type { BeaconPayload, ReportConfig } from "./report.js";
69
+ import { handleFetchHook, handleXhrHook } from "./request.js";
70
+ import { loadScript, scriptOnLoad } from "./script.js";
71
+ import type { LoadScriptOptions } from "./script.js";
72
+ import { throttle } from "./throttle.js";
73
+ import type { Throttled } from "./throttle.js";
74
+ import { formatDate, formatDuration, formatRelative, parseVttCueTiming, parseVttTimestamp, performanceTime } from "./time.js";
75
+ import type { DateInput, FormatRelativeOptions, RelativeStyle } from "./time.js";
76
+ import type { CurrentDevice } from "./device.js";
77
+ import { MOBILE_MEDIA_QUERY, currentDevice, isMobile, isWeiXin, matchMediaQuery, watchMediaQuery } from "./device.js";
78
+ import { Color, ColorScheme, HEX_COLOR_REGEX, Hsl, Hsla, RGBA_REGEX, RGB_REGEX, Rgb, Rgba, blendMultiply, blendOverlay, blendScreen, brightnessContrast, componentToHex, cosinePalette, hexToAlpha, hexToHsb, hexToHsv, hexToRgb, hsbToHsl, hsbToRgb, hslToHsb, hslToHsv, hslToRgb, hsvToHsl, hsvToRgb, hue2rgb, linearToSrgb, luma, randomColor, rgbToHex, rgbToHsb, rgbToHsl, rgbToHsv, rgbaString, rgbaToHex, rgbaToRgb, saturation, srgbToLinear, vibrance } from "./color.js";
79
+ import type { RGB } from "./color.js";
80
+ export { createBottomFollower, diffLines, formatBytes, performanceTime, throttle, SyncHook, clearBr, clearStr, isString, randomString, strParse, scriptOnLoad, handleFetchHook, createData, report, QuestQueue, noop, getPerformance, querystring, formatJson, filterObj, merge, replaceOld, mergeExports, perToNum, range, clamp, lerp, inverseLerp, remap, fit, linearstep, smoothstep, Mathjs, mathjs, getStatus, status, Monitor, MimeType, getExtensions, setMime, getMime, once, isImageSize, convertImageToBase64, handleError, addClassToElement, removeClassToElement, createDocumentFragment, escapeHtml, isWeiXin, isMobile, debounce, currentDevice, handleConsole, compose, Color, Hsl, Hsla, Rgb, Rgba, randomColor, hexToRgb, componentToHex, rgbToHex, rgbToHsl, hue2rgb, hslToRgb, rgbToHsb, hsbToRgb, hsvToRgb, hsvToHsl, ColorScheme, AudioRecorder, getCookie, requestUrlToBuffer, getPixelRatio, createObjectURL, getFrame, getAllQueryString, queryFlag, isInIframe, appendUrl, getCookieByName, getWindow, connection, encodeUrl, imageRequest, durationHandler, networkSpeed, TOTP, localStorageGetItem, localStorageSetItem, localStorageRemoveItem, createStore, setFontSize2html, autosizeTextarea, createSpeechRecognizer, isSpeechRecognitionSupported, Chain, create, isEqual, cloneDeep, createSignal, subscribers, getMatchingSentences, transformNumber, toString, addNumSym, checkEncoding, transformText, isSafari, getRandomString, bridgeManager, Client, BridgeManager, PostMessageBridge, MessageCodec, Platform, openPortBridge, acceptPortBridge, createPortBridge, BRIDGE_MARKER, DEFAULT_CHANNEL, singleFlight, WebDB, createHandoff, buildOffsets, paginateText, indexForOffset, segmentByRanges, detectLanguage, navigatorLanguage, resolveLocale, readFileAsArrayBuffer, readFileAsUint8Array, base64ToBytes, bytesToBase64, decodeTextBytes, fetchMaybeGzip, gunzipMaybe, isGzip, isHtmlDocument, isZipContainer, saveFileToDisk, readFileAsText, readFileAsDataURL, WorkerClient, serveWorker, whenIdle, networkAllowsDownload, isUrlCached, prefetchUrl, prefetchUrls, prefetchWhenIdle, deferred, withTimeout, withTimeoutFallback, delay, TimeoutError, createRaceGuard, crc32, inflateRaw, readZipEntries, readZipEntry, zipHasEntry, rewriteZip, createZip, ZIP_STORED, ZIP_DEFLATE, arrayBufferToString, toHalfWidth, toFullWidth, truncate, parseChineseNumber, parseRomanNumber, parseEnglishNumber, MOBILE_MEDIA_QUERY, matchMediaQuery, watchMediaQuery, createLocalePath, setReportUrl, getReportUrl, formatDate, formatDuration, formatRelative, parseVttCueTiming, parseVttTimestamp, handleXhrHook, EventManager, createDoubleTapDetector, quad, cubic, quart, quint, sine, expo, circ, getImage, cutRound, opacity, getMatrix, getAngle, getArcPointerByDeg, getTangentByPointer, fanShapedByArc, roundRectByArc, getLinearGradient, adoptStyles, adoptSheetText, ADOPTED_STYLE_MARKER, ADOPTED_SHEET_MARKER, rgbToHsv, hexToHsb, hexToHsv, hsbToHsl, hslToHsb, hslToHsv, hexToAlpha, rgbaString, rgbaToRgb, rgbaToHex, srgbToLinear, linearToSrgb, luma, blendScreen, blendMultiply, blendOverlay, brightnessContrast, saturation, vibrance, cosinePalette, HEX_COLOR_REGEX, RGB_REGEX, RGBA_REGEX, loadScript, I18nCore, createI18n, useI18n, alignCrossAxis, computePlacement, safeEqual, secureRandomString, secureToken, UNAMBIGUOUS_ALPHABET, bytesToBase64Url, base64UrlToBytes, concatBytes, truncateWithMarker, fenceCode, slugify, csvEscape, };
81
81
  export type { RGB, DateInput, FormatRelativeOptions, RelativeStyle, TruncateOptions, TruncatePosition, SpeechError, SpeechErrorKind, SpeechRecognizer, SpeechRecognizerOptions, EasingFn, SpeedType, ImgSource, LoadScriptOptions, I18nConfig, MessageDict, StringValues, LocaleMessages, TranslateParams, LocaleChangeHandler, Debounced, Throttled, BeaconPayload, ReportConfig, LocalePath, LocalePathConfig, LocaleRoute, SingleFlight, IDBCollection, IDBResult, IDBStoreSchema, WebDBOptions, Handoff, HandoffOptions, JsonStore, Deferred, RaceGuard, DoubleTapDetector, DoubleTapDetectorOptions, ZipEntry, RewriteZipOptions, ResolveLocaleOptions, OffsetRange, PaginateOptions, PaginateResult, TextBox, TextGridMetrics, TextPage, Segment, TextLanguage, ServeWorkerOptions, WorkerClientOptions, WorkerHandlerContext, WorkerRequestBase, WorkerResponseBase, WhenIdleOptions, NetworkAllowanceOptions, PrefetchOptions, CurrentDevice, TransformText, MessageHandler, MessageData, PendingRequest, BridgeManagerOptions, BroadcastPayload, CallToPayload, PortBridge, OpenPortBridgeOptions, AcceptPortBridgeOptions, ComputePlacementOptions, ComputedPlacement, Placement, PlacementAlign, PlacementRect, PlacementSide, BottomFollower, BottomFollowerOptions, DiffHunk, DiffLine, DiffLineKind, DiffOptions, };
@@ -1 +1,306 @@
1
- import{$ as s,$t as a,A as t,An as n,At as o,B as r,Bn as m,Bt as i,C as p,Cn as f,Ct as j,D as c,Dn as l,Dt as u,E as d,En as h,Et as x,F as b,Fn as e,Ft as g,G as k,Gn as v,Gt as w,H as y,Hn as A,Ht as C,I as D,In as E,It as F,J as M,Jt as N,K as O,Kn as P,Kt as S,L as T,Ln as _,Lt as q,M as z,Mn as B,Mt as G,N as H,Nn as I,Nt as K,O as L,On as R,Ot as U,P as V,Pn as W,Pt as J,Q,Qt as X,R as Y,Rn as Z,Rt as $,S as ss,Sn as as,St as ts,T as ns,Tn as os,Tt as rs,U as ms,Un as is,Ut as ps,V as fs,Vn as js,Vt as cs,W as ls,Wn as us,Wt as ds,X as hs,Xt as xs,Y as bs,Yt as es,Z as gs,Zt as ks,_ as vs,_n as ws,_t as ys,a as As,an as Cs,at as Ds,b as Es,bn as Fs,bt as Ms,c as Ns,cn as Os,ct as Ps,d as Ss,dn as Ts,dt as _s,en as qs,et as zs,f as Bs,fn as Gs,ft as Hs,g as Is,gn as Ks,gt as Ls,h as Rs,hn as Us,ht as Vs,i as Ws,in as Js,it as Qs,j as Xs,jn as Ys,jt as Zs,k as $s,kn as sa,kt as aa,l as ta,ln as na,lt as oa,m as ra,mn as ma,mt as ia,n as pa,nn as fa,nt as ja,o as ca,on as la,ot as ua,p as da,pn as ha,pt as xa,q as ba,qn as ea,qt as ga,r as ka,rn as va,rt as wa,s as ya,sn as Aa,st as Ca,t as Da,tn as Ea,tt as Fa,u as Ma,un as Na,ut as Oa,v as Pa,vn as Sa,vt as Ta,w as _a,wn as qa,wt as za,x as Ba,xn as Ga,xt as Ha,y as Ia,yn as Ka,yt as La,z as Ra,zn as Ua,zt as Va}from"../../utils-B4FnyUzW.js";import{i as Wa}from"../../enums-BAgbyGdH.js";import{$ as Ja,A as Qa,B as Xa,C as Ya,D as Za,E as $a,F as st,G as at,H as tt,I as nt,J as ot,K as rt,L as mt,M as it,N as pt,O as ft,P as jt,Q as ct,R as lt,S as ut,T as dt,U as ht,V as xt,W as bt,X as et,Y as gt,Z as kt,_ as vt,a as wt,at as yt,b as At,c as Ct,ct as Dt,d as Et,dt as Ft,et as Mt,f as Nt,g as Ot,h as Pt,i as St,it as Tt,j as _t,k as qt,l as zt,lt as Bt,m as Gt,n as Ht,nt as It,o as Kt,ot as Lt,p as Rt,q as Ut,r as Vt,rt as Wt,s as Jt,st as Qt,t as Xt,tt as Yt,u as Zt,ut as $t,v as sn,w as an,x as tn,y as nn,z as on}from"../../color-BTvZUuf-.js";import{A as rn,C as mn,D as pn,E as fn,F as jn,M as cn,N as ln,O as un,P as dn,S as hn,T as xn,_ as bn,a as en,b as gn,c as kn,d as vn,f as wn,g as yn,h as An,i as Cn,j as Dn,k as En,l as Fn,m as Mn,n as Nn,o as On,p as Pn,r as Sn,s as Tn,t as _n,u as qn,v as zn,w as Bn,x as Gn,y as Hn}from"../../i18n-DW21b_DJ.js";import{n as In,t as Kn}from"../../chain-CTywmh_H.js";export{xa as ADOPTED_SHEET_MARKER,ia as ADOPTED_STYLE_MARKER,Js as AudioRecorder,ws as BRIDGE_MARKER,Sa as BridgeManager,Kn as Chain,Ka as Client,Xt as Color,Ht as ColorScheme,Fs as DEFAULT_CHANNEL,F as EventManager,Vt as FMT,St as HEX_COLOR_REGEX,wt as Hsl,Kt as Hsla,_n as I18nCore,w as MOBILE_MEDIA_QUERY,sa as Mathjs,rt as MessageCodec,tt as MimeType,ca as Monitor,Ga as Platform,as as PostMessageBridge,ka as QuestQueue,Jt as RGBA_REGEX,Ct as RGB_REGEX,zt as Rgb,Zt as Rgba,Wa as SyncHook,Ea as TOTP,_a as TimeoutError,Y as UNAMBIGUOUS_ALPHABET,_s as WebDB,D as WorkerClient,Rs as ZIP_DEFLATE,Is as ZIP_STORED,f as acceptPortBridge,Va as addClassToElement,n as addNumSym,Vs as adoptSheetText,Ls as adoptStyles,Qs as alignCrossAxis,vn as appendUrl,Ut as arrayBufferToString,i as autosizeTextarea,y as base64ToBytes,ms as base64UrlToBytes,Et as blendMultiply,Nt as blendOverlay,Rt as blendScreen,qa as bridgeManager,Gt as brightnessContrast,Ps as buildOffsets,ls as bytesToBase64,k as bytesToBase64Url,ot as checkEncoding,aa as circ,Ys as clamp,gt as clearBr,et as clearStr,Cs as cloneDeep,Pt as componentToHex,qs as compose,Ds as computePlacement,O as concatBytes,wn as connection,ys as convertImageToBase64,Ot as cosinePalette,vs as crc32,In as create,ea as createBottomFollower,Ma as createData,cs as createDocumentFragment,q as createDoubleTapDetector,Hs as createHandoff,Nn as createI18n,ua as createLocalePath,Pn as createObjectURL,os as createPortBridge,ns as createRaceGuard,fa as createSignal,l as createSpeechRecognizer,Tn as createStore,Pa as createZip,kt as csvEscape,o as cubic,S as currentDevice,Ta as cutRound,X as debounce,ba as decodeTextBytes,d as deferred,c as delay,Cn as detectLanguage,P as diffLines,Mn as durationHandler,An as encodeUrl,C as escapeHtml,Zs as expo,j as fanShapedByArc,ct as fenceCode,M as fetchMaybeGzip,la as filterObj,B as fit,I as formatBytes,un as formatDate,En as formatDuration,Aa as formatJson,rn as formatRelative,yn as getAllQueryString,za as getAngle,rs as getArcPointerByDeg,bn as getCookie,zn as getCookieByName,ht as getExtensions,Hn as getFrame,La as getImage,x as getLinearGradient,Ja as getMatchingSentences,Ms as getMatrix,bt as getMime,ra as getPerformance,gn as getPixelRatio,Mt as getRandomString,Ss as getReportUrl,Ws as getStatus,u as getTangentByPointer,Gn as getWindow,bs as gunzipMaybe,a as handleConsole,$ as handleError,Ns as handleFetchHook,ta as handleXhrHook,vt as hexToAlpha,sn as hexToHsb,nn as hexToHsv,At as hexToRgb,tn as hsbToHsl,ut as hsbToRgb,Ya as hslToHsb,an as hslToHsv,dt as hslToRgb,$a as hsvToHsl,Za as hsvToRgb,ft as hue2rgb,hn as imageRequest,oa as indexForOffset,Ia as inflateRaw,W as inverseLerp,ga as isClient,Os as isEqual,hs as isGzip,gs as isHtmlDocument,Ha as isImageSize,mn as isInIframe,N as isMobile,Bn as isSafari,R as isSpeechRecognitionSupported,Yt as isString,t as isUrlCached,es as isWeiXin,Q as isZipContainer,e as lerp,qt as linearToSrgb,E as linearstep,Da as loadScript,kn as localStorageGetItem,Fn as localStorageRemoveItem,qn as localStorageSetItem,Qa as luma,xs as matchMediaQuery,_ as mathjs,It as md5,ma as memoize,na as merge,Na as mergeExports,en as navigatorLanguage,Xs as networkAllowsDownload,xn as networkSpeed,ha as noop,Us as once,ts as opacity,h as openPortBridge,Ca as paginateText,Z as parseChineseNumber,Ua as parseEnglishNumber,m as parseRomanNumber,Dn as parseVttCueTiming,cn as parseVttTimestamp,js as perToNum,ln as performanceTime,z as prefetchUrl,H as prefetchUrls,V as prefetchWhenIdle,G as quad,K as quart,fn as queryFlag,Ts as querystring,J as quint,_t as randomColor,Wt as randomString,A as range,zs as readFileAsArrayBuffer,Fa as readFileAsDataURL,ja as readFileAsText,wa as readFileAsUint8Array,Es as readZipEntries,Ba as readZipEntry,is as remap,ps as removeClassToElement,Gs as replaceOld,Bs as report,pn as requestUrlToBuffer,On as resolveLocale,ss as rewriteZip,it as rgbToHex,pt as rgbToHsb,jt as rgbToHsl,st as rgbToHsv,nt as rgbaString,mt as rgbaToHex,lt as rgbaToRgb,U as roundRectByArc,Ra as safeEqual,on as saturation,s as saveFileToDisk,pa as scriptOnLoad,r as secureRandomString,fs as secureToken,Oa as segmentByRanges,T as serveWorker,ds as setFontSize2html,at as setMime,da as setReportUrl,g as sine,Ks as singleFlight,Tt as slugify,us as smoothstep,Xa as srgbToLinear,As as status,yt as strParse,va as subscribers,ya as throttle,dn as timeFormat,jn as timestampToTime,Lt as toFullWidth,Qt as toHalfWidth,Dt as toString,v as transformNumber,Bt as transformText,$t as truncate,Ft as truncateWithMarker,Sn as useI18n,xt as vibrance,ks as watchMediaQuery,b as whenIdle,L as withTimeout,$s as withTimeoutFallback,p as zipHasEntry};
1
+ import { createBottomFollower as r } from "./scroll.js";
2
+ import { diffLines as t } from "./diff.js";
3
+ import { SyncHook as i } from "./subscribe.js";
4
+ import { MessageCodec as n, arrayBufferToString as s, checkEncoding as p, clearBr as l, clearStr as c, csvEscape as g, fenceCode as f, getMatchingSentences as d, getRandomString as u, isString as T, randomString as h, slugify as b, strParse as R, toFullWidth as E, toHalfWidth as S, toString as y, transformText as B, truncate as A, truncateWithMarker as H } from "./str.js";
5
+ import { Mathjs as D, addNumSym as C, clamp as x, fit as v, formatBytes as I, inverseLerp as P, lerp as L, linearstep as U, mathjs as F, parseChineseNumber as O, parseEnglishNumber as _, parseRomanNumber as k, perToNum as w, range as G, remap as N, smoothstep as q, transformNumber as W } from "./number.js";
6
+ import { createSpeechRecognizer as Z, isSpeechRecognitionSupported as Q } from "./speech.js";
7
+ import { formatDate as j, formatDuration as K, formatRelative as V, parseVttCueTiming as Y, parseVttTimestamp as J, performanceTime as $ } from "./time.js";
8
+ import { appendUrl as re, connection as oe, createObjectURL as te, durationHandler as ae, encodeUrl as ie, getAllQueryString as me, getCookie as ne, getCookieByName as se, getFrame as pe, getPixelRatio as le, getWindow as ce, imageRequest as ge, isInIframe as fe, isSafari as de, networkSpeed as ue, queryFlag as Te, requestUrlToBuffer as he } from "./bom.js";
9
+ import { BRIDGE_MARKER as Re, BridgeManager as Ee, Client as Se, DEFAULT_CHANNEL as ye, Platform as Be, PostMessageBridge as Ae, acceptPortBridge as He, bridgeManager as Me, createPortBridge as De, openPortBridge as Ce } from "./bridge.js";
10
+ import { once as ve, singleFlight as Ie } from "./memoize.js";
11
+ import { noop as Le } from "./noop.js";
12
+ import { cloneDeep as Fe, filterObj as Oe, formatJson as _e, isEqual as ke, merge as we, mergeExports as Ge, querystring as Ne, replaceOld as qe } from "./obj.js";
13
+ import { MimeType as ze, getExtensions as Ze, getMime as Qe, setMime as Xe } from "./mimeType.js";
14
+ import { AudioRecorder as Ke } from "./audioRecorder.js";
15
+ import { createSignal as Ye, subscribers as Je } from "./signal.js";
16
+ import { TOTP as er } from "./totp/totp.js";
17
+ import { createStore as or, localStorageGetItem as tr, localStorageRemoveItem as ar, localStorageSetItem as ir } from "./storage.js";
18
+ import { compose as nr } from "./compose.js";
19
+ import { handleConsole as pr } from "./console.js";
20
+ import { debounce as cr } from "./debounce.js";
21
+ import { MOBILE_MEDIA_QUERY as fr, currentDevice as dr, isMobile as ur, isWeiXin as Tr, matchMediaQuery as hr, watchMediaQuery as br } from "./device.js";
22
+ import { Chain as Er, create as Sr } from "./chain.js";
23
+ import { addClassToElement as Br, autosizeTextarea as Ar, createDocumentFragment as Hr, escapeHtml as Mr, removeClassToElement as Dr, setFontSize2html as Cr } from "./dom.js";
24
+ import { handleError as vr } from "./error.js";
25
+ import { EventManager as Pr, createDoubleTapDetector as Lr } from "./event.js";
26
+ import { circ as Fr, cubic as Or, expo as _r, quad as kr, quart as wr, quint as Gr, sine as Nr } from "./tween.js";
27
+ import { fanShapedByArc as Wr, getAngle as zr, getArcPointerByDeg as Zr, getLinearGradient as Qr, getTangentByPointer as Xr, roundRectByArc as jr } from "./canvas.js";
28
+ import { convertImageToBase64 as Vr, cutRound as Yr, getImage as Jr, getMatrix as $r, isImageSize as eo, opacity as ro } from "./img.js";
29
+ import { ADOPTED_SHEET_MARKER as to, ADOPTED_STYLE_MARKER as ao, adoptSheetText as io, adoptStyles as mo } from "./style.js";
30
+ import { WebDB as so, createHandoff as po } from "./idb.js";
31
+ import { buildOffsets as co, indexForOffset as go, segmentByRanges as fo } from "./segment.js";
32
+ import { paginateText as To } from "./paginate.js";
33
+ import { detectLanguage as bo, navigatorLanguage as Ro, resolveLocale as Eo } from "./lang.js";
34
+ import { I18nCore as yo, createI18n as Bo, useI18n as Ao } from "./i18n/index.js";
35
+ import { createLocalePath as Mo } from "./localePath.js";
36
+ import { alignCrossAxis as Co, computePlacement as xo } from "./placement.js";
37
+ import { readFileAsArrayBuffer as Io, readFileAsDataURL as Po, readFileAsText as Lo, readFileAsUint8Array as Uo } from "./file.js";
38
+ import { base64ToBytes as Oo, base64UrlToBytes as _o, bytesToBase64 as ko, bytesToBase64Url as wo, concatBytes as Go, decodeTextBytes as No, fetchMaybeGzip as qo, gunzipMaybe as Wo, isGzip as zo, isHtmlDocument as Zo, isZipContainer as Qo, saveFileToDisk as Xo } from "./binary.js";
39
+ import { UNAMBIGUOUS_ALPHABET as Ko, safeEqual as Vo, secureRandomString as Yo, secureToken as Jo } from "./secure.js";
40
+ import { WorkerClient as et, serveWorker as rt } from "./worker.js";
41
+ import { isUrlCached as tt, networkAllowsDownload as at, prefetchUrl as it, prefetchUrls as mt, prefetchWhenIdle as nt, whenIdle as st } from "./prefetch.js";
42
+ import { TimeoutError as lt, createRaceGuard as ct, deferred as gt, delay as ft, withTimeout as dt, withTimeoutFallback as ut } from "./async.js";
43
+ import { ZIP_DEFLATE as ht, ZIP_STORED as bt, crc32 as Rt, createZip as Et, inflateRaw as St, readZipEntries as yt, readZipEntry as Bt, rewriteZip as At, zipHasEntry as Ht } from "./zip.js";
44
+ import { getPerformance as Dt } from "./performance.js";
45
+ import { createData as xt, getReportUrl as vt, report as It, setReportUrl as Pt } from "./report.js";
46
+ import { handleFetchHook as Ut, handleXhrHook as Ft } from "./request.js";
47
+ import { throttle as _t } from "./throttle.js";
48
+ import { Monitor as wt } from "./monitor.js";
49
+ import { getStatus as Nt, status as qt } from "./network.js";
50
+ import { QuestQueue as zt } from "./queue.js";
51
+ import { loadScript as Qt, scriptOnLoad as Xt } from "./script.js";
52
+ import { Color as Kt, ColorScheme as Vt, HEX_COLOR_REGEX as Yt, Hsl as Jt, Hsla as $t, RGBA_REGEX as ea, RGB_REGEX as ra, Rgb as oa, Rgba as ta, blendMultiply as aa, blendOverlay as ia, blendScreen as ma, brightnessContrast as na, componentToHex as sa, cosinePalette as pa, hexToAlpha as la, hexToHsb as ca, hexToHsv as ga, hexToRgb as fa, hsbToHsl as da, hsbToRgb as ua, hslToHsb as Ta, hslToHsv as ha, hslToRgb as ba, hsvToHsl as Ra, hsvToRgb as Ea, hue2rgb as Sa, linearToSrgb as ya, luma as Ba, randomColor as Aa, rgbToHex as Ha, rgbToHsb as Ma, rgbToHsl as Da, rgbToHsv as Ca, rgbaString as xa, rgbaToHex as va, rgbaToRgb as Ia, saturation as Pa, srgbToLinear as La, vibrance as Ua } from "./color.js";
53
+ export {
54
+ to as ADOPTED_SHEET_MARKER,
55
+ ao as ADOPTED_STYLE_MARKER,
56
+ Ke as AudioRecorder,
57
+ Re as BRIDGE_MARKER,
58
+ Ee as BridgeManager,
59
+ Er as Chain,
60
+ Se as Client,
61
+ Kt as Color,
62
+ Vt as ColorScheme,
63
+ ye as DEFAULT_CHANNEL,
64
+ Pr as EventManager,
65
+ Yt as HEX_COLOR_REGEX,
66
+ Jt as Hsl,
67
+ $t as Hsla,
68
+ yo as I18nCore,
69
+ fr as MOBILE_MEDIA_QUERY,
70
+ D as Mathjs,
71
+ n as MessageCodec,
72
+ ze as MimeType,
73
+ wt as Monitor,
74
+ Be as Platform,
75
+ Ae as PostMessageBridge,
76
+ zt as QuestQueue,
77
+ ea as RGBA_REGEX,
78
+ ra as RGB_REGEX,
79
+ oa as Rgb,
80
+ ta as Rgba,
81
+ i as SyncHook,
82
+ er as TOTP,
83
+ lt as TimeoutError,
84
+ Ko as UNAMBIGUOUS_ALPHABET,
85
+ so as WebDB,
86
+ et as WorkerClient,
87
+ ht as ZIP_DEFLATE,
88
+ bt as ZIP_STORED,
89
+ He as acceptPortBridge,
90
+ Br as addClassToElement,
91
+ C as addNumSym,
92
+ io as adoptSheetText,
93
+ mo as adoptStyles,
94
+ Co as alignCrossAxis,
95
+ re as appendUrl,
96
+ s as arrayBufferToString,
97
+ Ar as autosizeTextarea,
98
+ Oo as base64ToBytes,
99
+ _o as base64UrlToBytes,
100
+ aa as blendMultiply,
101
+ ia as blendOverlay,
102
+ ma as blendScreen,
103
+ Me as bridgeManager,
104
+ na as brightnessContrast,
105
+ co as buildOffsets,
106
+ ko as bytesToBase64,
107
+ wo as bytesToBase64Url,
108
+ p as checkEncoding,
109
+ Fr as circ,
110
+ x as clamp,
111
+ l as clearBr,
112
+ c as clearStr,
113
+ Fe as cloneDeep,
114
+ sa as componentToHex,
115
+ nr as compose,
116
+ xo as computePlacement,
117
+ Go as concatBytes,
118
+ oe as connection,
119
+ Vr as convertImageToBase64,
120
+ pa as cosinePalette,
121
+ Rt as crc32,
122
+ Sr as create,
123
+ r as createBottomFollower,
124
+ xt as createData,
125
+ Hr as createDocumentFragment,
126
+ Lr as createDoubleTapDetector,
127
+ po as createHandoff,
128
+ Bo as createI18n,
129
+ Mo as createLocalePath,
130
+ te as createObjectURL,
131
+ De as createPortBridge,
132
+ ct as createRaceGuard,
133
+ Ye as createSignal,
134
+ Z as createSpeechRecognizer,
135
+ or as createStore,
136
+ Et as createZip,
137
+ g as csvEscape,
138
+ Or as cubic,
139
+ dr as currentDevice,
140
+ Yr as cutRound,
141
+ cr as debounce,
142
+ No as decodeTextBytes,
143
+ gt as deferred,
144
+ ft as delay,
145
+ bo as detectLanguage,
146
+ t as diffLines,
147
+ ae as durationHandler,
148
+ ie as encodeUrl,
149
+ Mr as escapeHtml,
150
+ _r as expo,
151
+ Wr as fanShapedByArc,
152
+ f as fenceCode,
153
+ qo as fetchMaybeGzip,
154
+ Oe as filterObj,
155
+ v as fit,
156
+ I as formatBytes,
157
+ j as formatDate,
158
+ K as formatDuration,
159
+ _e as formatJson,
160
+ V as formatRelative,
161
+ me as getAllQueryString,
162
+ zr as getAngle,
163
+ Zr as getArcPointerByDeg,
164
+ ne as getCookie,
165
+ se as getCookieByName,
166
+ Ze as getExtensions,
167
+ pe as getFrame,
168
+ Jr as getImage,
169
+ Qr as getLinearGradient,
170
+ d as getMatchingSentences,
171
+ $r as getMatrix,
172
+ Qe as getMime,
173
+ Dt as getPerformance,
174
+ le as getPixelRatio,
175
+ u as getRandomString,
176
+ vt as getReportUrl,
177
+ Nt as getStatus,
178
+ Xr as getTangentByPointer,
179
+ ce as getWindow,
180
+ Wo as gunzipMaybe,
181
+ pr as handleConsole,
182
+ vr as handleError,
183
+ Ut as handleFetchHook,
184
+ Ft as handleXhrHook,
185
+ la as hexToAlpha,
186
+ ca as hexToHsb,
187
+ ga as hexToHsv,
188
+ fa as hexToRgb,
189
+ da as hsbToHsl,
190
+ ua as hsbToRgb,
191
+ Ta as hslToHsb,
192
+ ha as hslToHsv,
193
+ ba as hslToRgb,
194
+ Ra as hsvToHsl,
195
+ Ea as hsvToRgb,
196
+ Sa as hue2rgb,
197
+ ge as imageRequest,
198
+ go as indexForOffset,
199
+ St as inflateRaw,
200
+ P as inverseLerp,
201
+ ke as isEqual,
202
+ zo as isGzip,
203
+ Zo as isHtmlDocument,
204
+ eo as isImageSize,
205
+ fe as isInIframe,
206
+ ur as isMobile,
207
+ de as isSafari,
208
+ Q as isSpeechRecognitionSupported,
209
+ T as isString,
210
+ tt as isUrlCached,
211
+ Tr as isWeiXin,
212
+ Qo as isZipContainer,
213
+ L as lerp,
214
+ ya as linearToSrgb,
215
+ U as linearstep,
216
+ Qt as loadScript,
217
+ tr as localStorageGetItem,
218
+ ar as localStorageRemoveItem,
219
+ ir as localStorageSetItem,
220
+ Ba as luma,
221
+ hr as matchMediaQuery,
222
+ F as mathjs,
223
+ we as merge,
224
+ Ge as mergeExports,
225
+ Ro as navigatorLanguage,
226
+ at as networkAllowsDownload,
227
+ ue as networkSpeed,
228
+ Le as noop,
229
+ ve as once,
230
+ ro as opacity,
231
+ Ce as openPortBridge,
232
+ To as paginateText,
233
+ O as parseChineseNumber,
234
+ _ as parseEnglishNumber,
235
+ k as parseRomanNumber,
236
+ Y as parseVttCueTiming,
237
+ J as parseVttTimestamp,
238
+ w as perToNum,
239
+ $ as performanceTime,
240
+ it as prefetchUrl,
241
+ mt as prefetchUrls,
242
+ nt as prefetchWhenIdle,
243
+ kr as quad,
244
+ wr as quart,
245
+ Te as queryFlag,
246
+ Ne as querystring,
247
+ Gr as quint,
248
+ Aa as randomColor,
249
+ h as randomString,
250
+ G as range,
251
+ Io as readFileAsArrayBuffer,
252
+ Po as readFileAsDataURL,
253
+ Lo as readFileAsText,
254
+ Uo as readFileAsUint8Array,
255
+ yt as readZipEntries,
256
+ Bt as readZipEntry,
257
+ N as remap,
258
+ Dr as removeClassToElement,
259
+ qe as replaceOld,
260
+ It as report,
261
+ he as requestUrlToBuffer,
262
+ Eo as resolveLocale,
263
+ At as rewriteZip,
264
+ Ha as rgbToHex,
265
+ Ma as rgbToHsb,
266
+ Da as rgbToHsl,
267
+ Ca as rgbToHsv,
268
+ xa as rgbaString,
269
+ va as rgbaToHex,
270
+ Ia as rgbaToRgb,
271
+ jr as roundRectByArc,
272
+ Vo as safeEqual,
273
+ Pa as saturation,
274
+ Xo as saveFileToDisk,
275
+ Xt as scriptOnLoad,
276
+ Yo as secureRandomString,
277
+ Jo as secureToken,
278
+ fo as segmentByRanges,
279
+ rt as serveWorker,
280
+ Cr as setFontSize2html,
281
+ Xe as setMime,
282
+ Pt as setReportUrl,
283
+ Nr as sine,
284
+ Ie as singleFlight,
285
+ b as slugify,
286
+ q as smoothstep,
287
+ La as srgbToLinear,
288
+ qt as status,
289
+ R as strParse,
290
+ Je as subscribers,
291
+ _t as throttle,
292
+ E as toFullWidth,
293
+ S as toHalfWidth,
294
+ y as toString,
295
+ W as transformNumber,
296
+ B as transformText,
297
+ A as truncate,
298
+ H as truncateWithMarker,
299
+ Ao as useI18n,
300
+ Ua as vibrance,
301
+ br as watchMediaQuery,
302
+ st as whenIdle,
303
+ dt as withTimeout,
304
+ ut as withTimeoutFallback,
305
+ Ht as zipHasEntry
306
+ };
@@ -1,15 +1,32 @@
1
- /** Coarse language bucket: Chinese / English / other only */
2
- export type TextLanguage = 'zh' | 'en' | 'other';
3
1
  /**
4
- * @description: Decide a text's primary language from the ratio of CJK to Latin characters.
5
- * Pure statistics, no model or dictionary loaded — good enough to branch on "which
6
- * tokenizer / which language-specific model / which typographic metrics".
2
+ * Coarse script bucket: the four writing systems that need different handling, plus
3
+ * `'other'` for everything else.
4
+ *
5
+ * These are scripts wearing language names, not a language identifier. Spanish, Portuguese
6
+ * and German all report `'en'` because they are Latin script and want the same word
7
+ * segmentation and the same line-breaking; nothing downstream of this function can tell
8
+ * them apart, and nothing that reads this needs to. What genuinely differs is CJK vs Latin,
9
+ * and — inside CJK — Chinese, Japanese and Korean, which take different segmenters and
10
+ * different typographic metrics.
11
+ */
12
+ export type TextLanguage = 'zh' | 'ja' | 'ko' | 'en' | 'other';
13
+ /**
14
+ * @description: Decide a text's primary script from character ratios. Pure statistics, no
15
+ * model or dictionary loaded — good enough to branch on "which tokenizer / which
16
+ * language-specific model / which typographic metrics".
7
17
  *
8
18
  * Only the first N characters are sampled: the body language is consistent throughout, so
9
19
  * scanning a whole book (millions of characters) is pure waste. Text with a little CJK still
10
- * counts as Chinese (Latin has to clearly dominate for English), because English mixed into
20
+ * counts as CJK (Latin has to clearly dominate for English), because English mixed into
11
21
  * Chinese text is common while the reverse is rare.
12
22
  *
23
+ * Han alone cannot separate Chinese from Japanese — Japanese writes kanji too. What
24
+ * separates them is kana, which Japanese uses for every particle and inflection and Chinese
25
+ * does not use at all; Hangul plays the same role for Korean. So the ideographs are counted
26
+ * as CJK and the verdict inside CJK is decided by whichever *marker* script is present.
27
+ * Han with no marker is Chinese, which is the right default: it is the only one of the three
28
+ * that is written in Han alone.
29
+ *
13
30
  * @param {string} text text to inspect
14
31
  * @param {number} sampleSize sample length, defaults to 20000
15
32
  * @return {TextLanguage}
@@ -0,0 +1,42 @@
1
+ import { getAllQueryString as m, getCookieByName as k } from "./bom.js";
2
+ import { localStorageGetItem as y } from "./storage.js";
3
+ var L = (t) => t >= 12352 && t <= 12447 || t >= 12448 && t <= 12543 || t >= 12784 && t <= 12799 || t >= 65382 && t <= 65437, x = (t) => t >= 44032 && t <= 55203 || t >= 4352 && t <= 4607 || t >= 12592 && t <= 12687, C = (t) => t >= 19968 && t <= 40959 || t >= 13312 && t <= 19903, j = 0.05, S = (t, n = 2e4) => {
4
+ const l = t.slice(0, n);
5
+ let o = 0, i = 0, g = 0, u = 0;
6
+ for (const h of l) {
7
+ const e = h.codePointAt(0) ?? 0;
8
+ C(e) ? g++ : L(e) ? o++ : x(e) ? i++ : (e >= 65 && e <= 90 || e >= 97 && e <= 122) && u++;
9
+ }
10
+ const s = g + o + i;
11
+ return s === 0 && u === 0 ? "other" : u > s * 3 ? "en" : Math.max(o, i) >= s * j ? i > o ? "ko" : "ja" : "zh";
12
+ }, W = () => {
13
+ if (typeof navigator > "u") return "other";
14
+ const t = (navigator.language || "").toLowerCase();
15
+ return t.startsWith("zh") ? "zh" : t.startsWith("ja") ? "ja" : t.startsWith("ko") ? "ko" : t.startsWith("en") ? "en" : "other";
16
+ }, b = (t) => {
17
+ const { supported: n, query: l, cookie: o, storageKey: i, useNavigator: g = !0, url: u } = t, s = t.fallback ?? n[0] ?? "en";
18
+ if (n.length === 0) return s;
19
+ const h = n.map((r) => r.toLowerCase()), e = (r) => {
20
+ if (!r) return;
21
+ const a = r.trim().toLowerCase();
22
+ if (!a) return;
23
+ const c = h.indexOf(a);
24
+ if (c !== -1) return n[c];
25
+ const v = a.split("-")[0], p = h.findIndex((d) => d === v || d.split("-")[0] === v);
26
+ return p === -1 ? void 0 : n[p];
27
+ }, f = [];
28
+ if (l && f.push(m(u)[l]), o && f.push(k(o)), i && f.push(y(i)), g && typeof navigator < "u") {
29
+ const { languages: r, language: a } = navigator;
30
+ f.push(...r ?? [], a);
31
+ }
32
+ for (const r of f) {
33
+ const a = e(r);
34
+ if (a) return a;
35
+ }
36
+ return s;
37
+ };
38
+ export {
39
+ S as detectLanguage,
40
+ W as navigatorLanguage,
41
+ b as resolveLocale
42
+ };
@@ -0,0 +1,48 @@
1
+ var W = (s) => {
2
+ let r = s.length;
3
+ for (; r > 0 && s[r - 1] === "/"; ) r--;
4
+ return s.slice(0, r);
5
+ }, g = (s) => {
6
+ const r = W(s.trim());
7
+ return r ? r.startsWith("/") ? r : `/${r}` : "";
8
+ }, h = (s) => {
9
+ const r = s.search(/[?#]/);
10
+ return r === -1 ? [s, ""] : [s.slice(0, r), s.slice(r)];
11
+ }, P = (s) => {
12
+ const r = s.locales.length > 0 ? s.locales : [{ code: "en" }], i = g(s.base ?? ""), c = s.defaultLocale ?? (r.find((t) => !t.prefix) ?? r[0]).code, u = r.filter((t) => t.prefix).sort((t, e) => e.prefix.length - t.prefix.length), x = (t) => r.find((e) => e.code === t) ?? { code: c }, a = (t) => {
13
+ const e = t || "/";
14
+ return i ? e === i ? "/" : e.startsWith(`${i}/`) ? e.slice(i.length) : e.startsWith("/") ? e : `/${e}` : e.startsWith("/") ? e : `/${e}`;
15
+ }, f = (t) => {
16
+ const e = t.split("/").filter(Boolean)[0], n = e ? u.find((l) => l.prefix === e) : void 0;
17
+ if (!n) return {
18
+ code: c,
19
+ rest: t
20
+ };
21
+ const o = t.slice(n.prefix.length + 1) || "/";
22
+ return {
23
+ code: n.code,
24
+ rest: o.startsWith("/") ? o : `/${o}`
25
+ };
26
+ }, $ = (t) => f(a(h(t)[0])).code, m = (t) => {
27
+ const [e, n] = h(t);
28
+ return `${i}${f(a(e)).rest}${n}`;
29
+ }, d = (t, e = c) => {
30
+ const [n, o] = h(t), { rest: l } = f(a(n)), { prefix: p } = x(e), L = p ? `/${p}${l}` : l;
31
+ return `${i}${L}${o}` || "/";
32
+ };
33
+ return {
34
+ base: i,
35
+ defaultLocale: c,
36
+ localeFromPath: $,
37
+ stripLocale: m,
38
+ href: d,
39
+ hrefForLocale: (t, e) => d(t, e),
40
+ alternates: (t) => r.map((e) => ({
41
+ code: e.code,
42
+ href: d(t, e.code)
43
+ }))
44
+ };
45
+ };
46
+ export {
47
+ P as createLocalePath
48
+ };