ranuts 0.4.1-alpha.2 → 0.5.1

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 (333) 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 +307 -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/charset.d.ts +15 -0
  38. package/dist/src/utils/charset.js +21 -0
  39. package/dist/src/utils/color.d.ts +0 -1
  40. package/dist/src/utils/color.js +312 -0
  41. package/dist/src/utils/compose.js +22 -0
  42. package/dist/src/utils/console.js +22 -0
  43. package/dist/src/utils/debounce.js +18 -0
  44. package/dist/src/utils/device.d.ts +0 -9
  45. package/dist/src/utils/device.js +31 -0
  46. package/dist/src/utils/diff.js +110 -0
  47. package/dist/src/utils/dom.d.ts +1 -1
  48. package/dist/src/utils/dom.js +89 -0
  49. package/dist/src/utils/error.js +11 -0
  50. package/dist/src/utils/event.d.ts +3 -3
  51. package/dist/src/utils/event.js +39 -0
  52. package/dist/src/utils/file.js +14 -0
  53. package/dist/src/utils/func.js +4 -0
  54. package/dist/src/utils/i18n/index.js +79 -1
  55. package/dist/src/utils/idb.js +177 -0
  56. package/dist/src/utils/img.d.ts +1 -1
  57. package/dist/src/utils/img.js +68 -0
  58. package/dist/src/utils/index.d.ts +82 -80
  59. package/dist/src/utils/index.js +307 -1
  60. package/dist/src/utils/lang.d.ts +23 -6
  61. package/dist/src/utils/lang.js +42 -0
  62. package/dist/src/utils/localePath.js +48 -0
  63. package/dist/src/utils/memoize.d.ts +1 -7
  64. package/dist/src/utils/memoize.js +16 -0
  65. package/dist/src/utils/mimeType.js +841 -0
  66. package/dist/src/utils/monitor.js +84 -0
  67. package/dist/src/utils/network.js +117 -0
  68. package/dist/src/utils/noop.js +5 -0
  69. package/dist/src/utils/number.js +185 -0
  70. package/dist/src/utils/obj.d.ts +2 -2
  71. package/dist/src/utils/obj.js +140 -0
  72. package/dist/src/utils/paginate.js +93 -0
  73. package/dist/src/utils/performance.js +26 -0
  74. package/dist/src/utils/placement.js +37 -0
  75. package/dist/src/utils/prefetch.js +69 -0
  76. package/dist/src/utils/queue.js +46 -0
  77. package/dist/src/utils/report.js +44 -0
  78. package/dist/src/utils/request.js +35 -0
  79. package/dist/src/utils/script.d.ts +4 -2
  80. package/dist/src/utils/script.js +45 -0
  81. package/dist/src/utils/scroll.d.ts +2 -0
  82. package/dist/src/utils/scroll.js +62 -0
  83. package/dist/src/utils/secure.js +36 -0
  84. package/dist/src/utils/segment.js +43 -0
  85. package/dist/src/utils/signal.d.ts +1 -1
  86. package/dist/src/utils/signal.js +13 -0
  87. package/dist/src/utils/speech.js +59 -0
  88. package/dist/src/utils/storage.js +53 -0
  89. package/dist/src/utils/str.d.ts +0 -21
  90. package/dist/src/utils/str.js +377 -0
  91. package/dist/src/utils/style.js +29 -0
  92. package/dist/src/utils/subscribe.js +58 -0
  93. package/dist/src/utils/throttle.js +17 -0
  94. package/dist/src/utils/time.d.ts +0 -21
  95. package/dist/src/utils/time.js +97 -0
  96. package/dist/src/utils/totp/sha/common.d.ts +1 -1
  97. package/dist/src/utils/totp/sha/common.js +201 -0
  98. package/dist/src/utils/totp/sha/converters.d.ts +1 -1
  99. package/dist/src/utils/totp/sha/converters.js +188 -0
  100. package/dist/src/utils/totp/sha/primitives_32.js +55 -0
  101. package/dist/src/utils/totp/sha/primitives_64.js +85 -0
  102. package/dist/src/utils/totp/sha/sha.d.ts +1 -1
  103. package/dist/src/utils/totp/sha/sha.js +30 -0
  104. package/dist/src/utils/totp/sha/sha1.d.ts +2 -2
  105. package/dist/src/utils/totp/sha/sha1.js +51 -0
  106. package/dist/src/utils/totp/sha/sha256.d.ts +2 -2
  107. package/dist/src/utils/totp/sha/sha256.js +56 -0
  108. package/dist/src/utils/totp/sha/sha3.d.ts +3 -3
  109. package/dist/src/utils/totp/sha/sha3.js +253 -0
  110. package/dist/src/utils/totp/sha/sha512.d.ts +3 -3
  111. package/dist/src/utils/totp/sha/sha512.js +177 -0
  112. package/dist/src/utils/totp/totp.js +49 -0
  113. package/dist/src/utils/tween.js +59 -0
  114. package/dist/src/utils/visual/application.d.ts +4 -4
  115. package/dist/src/utils/visual/application.js +42 -0
  116. package/dist/src/utils/visual/enums.js +19 -0
  117. package/dist/src/utils/visual/event/boundary.d.ts +2 -2
  118. package/dist/src/utils/visual/event/boundary.js +93 -0
  119. package/dist/src/utils/visual/event/event.d.ts +1 -1
  120. package/dist/src/utils/visual/event/event.js +34 -0
  121. package/dist/src/utils/visual/event/index.d.ts +4 -4
  122. package/dist/src/utils/visual/event/types.d.ts +2 -2
  123. package/dist/src/utils/visual/event/types.js +23 -0
  124. package/dist/src/utils/visual/graphics/graphics.d.ts +8 -8
  125. package/dist/src/utils/visual/graphics/graphics.js +168 -0
  126. package/dist/src/utils/visual/graphics/graphicsData.d.ts +3 -3
  127. package/dist/src/utils/visual/graphics/graphicsData.js +12 -0
  128. package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +7 -7
  129. package/dist/src/utils/visual/graphics/graphicsGeometry.js +39 -0
  130. package/dist/src/utils/visual/graphics/index.d.ts +3 -3
  131. package/dist/src/utils/visual/index.d.ts +8 -8
  132. package/dist/src/utils/visual/index.js +20 -1
  133. package/dist/src/utils/visual/math/bezier.js +15 -0
  134. package/dist/src/utils/visual/math/enums.js +6 -0
  135. package/dist/src/utils/visual/math/index.d.ts +4 -4
  136. package/dist/src/utils/visual/math/matrix.d.ts +1 -1
  137. package/dist/src/utils/visual/math/matrix.js +59 -0
  138. package/dist/src/utils/visual/math/transform.d.ts +2 -2
  139. package/dist/src/utils/visual/math/transform.js +50 -0
  140. package/dist/src/utils/visual/render/batchRenderer.d.ts +4 -4
  141. package/dist/src/utils/visual/render/batchRenderer.js +59 -0
  142. package/dist/src/utils/visual/render/canvasRenderer.d.ts +3 -3
  143. package/dist/src/utils/visual/render/canvasRenderer.js +17 -0
  144. package/dist/src/utils/visual/render/filter.d.ts +1 -1
  145. package/dist/src/utils/visual/render/filter.js +92 -0
  146. package/dist/src/utils/visual/render/index.d.ts +2 -2
  147. package/dist/src/utils/visual/render/index.js +20 -0
  148. package/dist/src/utils/visual/render/render.d.ts +4 -4
  149. package/dist/src/utils/visual/render/render.js +19 -0
  150. package/dist/src/utils/visual/render/renderTarget.js +28 -0
  151. package/dist/src/utils/visual/render/utils/batch/index.d.ts +4 -4
  152. package/dist/src/utils/visual/render/utils/batch/index.js +88 -0
  153. package/dist/src/utils/visual/render/utils/earcut.js +328 -0
  154. package/dist/src/utils/visual/render/utils/float.js +65 -0
  155. package/dist/src/utils/visual/render/utils/index.js +50 -0
  156. package/dist/src/utils/visual/render/utils/verticy.d.ts +2 -2
  157. package/dist/src/utils/visual/render/utils/verticy.js +162 -0
  158. package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +1 -1
  159. package/dist/src/utils/visual/render/utils/webgl/initShader.js +31 -0
  160. package/dist/src/utils/visual/render/utils/webgl/shaders.js +22 -0
  161. package/dist/src/utils/visual/render/utils/webgpu/shaders.js +32 -0
  162. package/dist/src/utils/visual/render/webGPURenderer.d.ts +2 -2
  163. package/dist/src/utils/visual/render/webGPURenderer.js +185 -0
  164. package/dist/src/utils/visual/render/webGlRenderer.d.ts +2 -2
  165. package/dist/src/utils/visual/render/webGlRenderer.js +88 -0
  166. package/dist/src/utils/visual/shape/circle.d.ts +3 -3
  167. package/dist/src/utils/visual/shape/circle.js +17 -0
  168. package/dist/src/utils/visual/shape/ellipse.d.ts +3 -3
  169. package/dist/src/utils/visual/shape/ellipse.js +18 -0
  170. package/dist/src/utils/visual/shape/index.d.ts +6 -6
  171. package/dist/src/utils/visual/shape/polygon.d.ts +3 -3
  172. package/dist/src/utils/visual/shape/polygon.js +29 -0
  173. package/dist/src/utils/visual/shape/rectangle.d.ts +3 -3
  174. package/dist/src/utils/visual/shape/rectangle.js +18 -0
  175. package/dist/src/utils/visual/shape/roundedRectangle.d.ts +3 -3
  176. package/dist/src/utils/visual/shape/roundedRectangle.js +32 -0
  177. package/dist/src/utils/visual/shape/shape.d.ts +2 -2
  178. package/dist/src/utils/visual/shape/shape.js +5 -0
  179. package/dist/src/utils/visual/style/fill.js +18 -0
  180. package/dist/src/utils/visual/style/index.d.ts +2 -2
  181. package/dist/src/utils/visual/style/line.d.ts +2 -2
  182. package/dist/src/utils/visual/style/line.js +18 -0
  183. package/dist/src/utils/visual/types.d.ts +1 -1
  184. package/dist/src/utils/visual/vertex/container.d.ts +5 -5
  185. package/dist/src/utils/visual/vertex/container.js +54 -0
  186. package/dist/src/utils/visual/vertex/point.js +37 -0
  187. package/dist/src/utils/visual/vertex/vertex.d.ts +7 -7
  188. package/dist/src/utils/visual/vertex/vertex.js +76 -0
  189. package/dist/src/utils/worker.js +89 -0
  190. package/dist/src/utils/zip.js +161 -0
  191. package/dist/src/vnode/h.d.ts +1 -1
  192. package/dist/src/vnode/h.js +22 -0
  193. package/dist/src/vnode/hooks.d.ts +1 -1
  194. package/dist/src/vnode/htmlDomApi.js +94 -0
  195. package/dist/src/vnode/index.d.ts +16 -16
  196. package/dist/src/vnode/index.js +28 -1
  197. package/dist/src/vnode/init.d.ts +1 -1
  198. package/dist/src/vnode/init.js +104 -0
  199. package/dist/src/vnode/is.d.ts +1 -1
  200. package/dist/src/vnode/is.js +20 -0
  201. package/dist/src/vnode/modules/attributes.d.ts +1 -1
  202. package/dist/src/vnode/modules/attributes.js +21 -0
  203. package/dist/src/vnode/modules/class.d.ts +1 -1
  204. package/dist/src/vnode/modules/class.js +18 -0
  205. package/dist/src/vnode/modules/index.js +15 -0
  206. package/dist/src/vnode/modules/listeners.d.ts +1 -1
  207. package/dist/src/vnode/modules/listeners.js +36 -0
  208. package/dist/src/vnode/modules/props.d.ts +1 -1
  209. package/dist/src/vnode/modules/props.js +17 -0
  210. package/dist/src/vnode/modules/style.d.ts +1 -1
  211. package/dist/src/vnode/modules/style.js +52 -0
  212. package/dist/src/vnode/vnode.d.ts +6 -6
  213. package/dist/src/vnode/vnode.js +13 -0
  214. package/dist/third-party/jschardet/LICENSE.txt +504 -0
  215. package/dist/third-party/jschardet/NOTICE.txt +33 -0
  216. package/docs/API.md +8 -64
  217. package/package.json +14 -18
  218. package/dist/bin/generate-api-docs.d.ts +0 -1
  219. package/dist/build/build.es.d.ts +0 -2
  220. package/dist/build/build.umd.d.ts +0 -2
  221. package/dist/build/build.umd.node.d.ts +0 -2
  222. package/dist/build/build.umd.utils.d.ts +0 -2
  223. package/dist/chain-CTywmh_H.js +0 -1
  224. package/dist/color-BTvZUuf-.js +0 -1
  225. package/dist/enums-BAgbyGdH.js +0 -1
  226. package/dist/examples/clone-deep-example.d.ts +0 -1
  227. package/dist/examples/is-equal-example.d.ts +0 -1
  228. package/dist/i18n-DW21b_DJ.js +0 -1
  229. package/dist/plugins/vite-plugins-banner.d.ts +0 -2
  230. package/dist/rolldown-runtime-I3TIJKkN.js +0 -1
  231. package/dist/src/node/appendFile.d.ts +0 -7
  232. package/dist/src/node/body.d.ts +0 -9
  233. package/dist/src/node/color.d.ts +0 -7
  234. package/dist/src/node/command.d.ts +0 -8
  235. package/dist/src/node/ctx2req.d.ts +0 -5
  236. package/dist/src/node/fileInfo.d.ts +0 -7
  237. package/dist/src/node/fs.d.ts +0 -7
  238. package/dist/src/node/get.d.ts +0 -10
  239. package/dist/src/node/getIPAdress.d.ts +0 -1
  240. package/dist/src/node/index.d.ts +0 -25
  241. package/dist/src/node/index.js +0 -1
  242. package/dist/src/node/isColorSupported.d.ts +0 -2
  243. package/dist/src/node/paresUrl.d.ts +0 -19
  244. package/dist/src/node/readDir.d.ts +0 -6
  245. package/dist/src/node/readFile.d.ts +0 -9
  246. package/dist/src/node/router.d.ts +0 -42
  247. package/dist/src/node/send.d.ts +0 -7
  248. package/dist/src/node/server.d.ts +0 -18
  249. package/dist/src/node/startTask.d.ts +0 -2
  250. package/dist/src/node/stream.d.ts +0 -15
  251. package/dist/src/node/taskEnd.d.ts +0 -2
  252. package/dist/src/node/traverse.d.ts +0 -17
  253. package/dist/src/node/watchFile.d.ts +0 -8
  254. package/dist/src/node/writeFile.d.ts +0 -8
  255. package/dist/src/node/ws.d.ts +0 -8
  256. package/dist/src/utils/visual/render/utils/batch/index.test.d.ts +0 -1
  257. package/dist/src/utils/visual/render/utils/index.test.d.ts +0 -1
  258. package/dist/test/binary.test.d.ts +0 -1
  259. package/dist/test/bridge.test.d.ts +0 -1
  260. package/dist/test/budget.test.d.ts +0 -1
  261. package/dist/test/canvas.test.d.ts +0 -1
  262. package/dist/test/clearBr.test.d.ts +0 -1
  263. package/dist/test/cloneDeep.test.d.ts +0 -1
  264. package/dist/test/color.test.d.ts +0 -1
  265. package/dist/test/command.test.d.ts +0 -1
  266. package/dist/test/conversation.test.d.ts +0 -1
  267. package/dist/test/diff.test.d.ts +0 -1
  268. package/dist/test/encodeUrl.test.d.ts +0 -1
  269. package/dist/test/escapeHtml.test.d.ts +0 -1
  270. package/dist/test/formatBytes.test.d.ts +0 -1
  271. package/dist/test/is-equal.test.d.ts +0 -1
  272. package/dist/test/mimeType.test.d.ts +0 -1
  273. package/dist/test/package-exports.test.d.ts +0 -1
  274. package/dist/test/scroll.test.d.ts +0 -1
  275. package/dist/test/server.test.d.ts +0 -1
  276. package/dist/test/status.test.d.ts +0 -1
  277. package/dist/test/stream.test.d.ts +0 -1
  278. package/dist/test/sw.test.d.ts +0 -1
  279. package/dist/test/totp.test.d.ts +0 -1
  280. package/dist/test/tween.test.d.ts +0 -1
  281. package/dist/test/utils/async.test.d.ts +0 -1
  282. package/dist/test/utils/autosize.test.d.ts +0 -1
  283. package/dist/test/utils/color-grade.test.d.ts +0 -1
  284. package/dist/test/utils/compose.test.d.ts +0 -1
  285. package/dist/test/utils/event.test.d.ts +0 -1
  286. package/dist/test/utils/file-read.test.d.ts +0 -1
  287. package/dist/test/utils/format.test.d.ts +0 -1
  288. package/dist/test/utils/i18n.test.d.ts +0 -1
  289. package/dist/test/utils/idb-collection.test.d.ts +0 -1
  290. package/dist/test/utils/idb.test.d.ts +0 -1
  291. package/dist/test/utils/instrumentation.test.d.ts +0 -1
  292. package/dist/test/utils/interp.test.d.ts +0 -1
  293. package/dist/test/utils/lang.test.d.ts +0 -1
  294. package/dist/test/utils/locale-path.test.d.ts +0 -1
  295. package/dist/test/utils/media-query.test.d.ts +0 -1
  296. package/dist/test/utils/mergeObj.test.d.ts +0 -1
  297. package/dist/test/utils/number-parse.test.d.ts +0 -1
  298. package/dist/test/utils/paginate.test.d.ts +0 -1
  299. package/dist/test/utils/placement.test.d.ts +0 -1
  300. package/dist/test/utils/prefetch.test.d.ts +0 -1
  301. package/dist/test/utils/query-storage.test.d.ts +0 -1
  302. package/dist/test/utils/queue.test.d.ts +0 -1
  303. package/dist/test/utils/report-config.test.d.ts +0 -1
  304. package/dist/test/utils/report-image.test.d.ts +0 -1
  305. package/dist/test/utils/secure.test.d.ts +0 -1
  306. package/dist/test/utils/segment.test.d.ts +0 -1
  307. package/dist/test/utils/signal-once.test.d.ts +0 -1
  308. package/dist/test/utils/single-flight.test.d.ts +0 -1
  309. package/dist/test/utils/speech.test.d.ts +0 -1
  310. package/dist/test/utils/text-boundary.test.d.ts +0 -1
  311. package/dist/test/utils/time.test.d.ts +0 -1
  312. package/dist/test/utils/timing.test.d.ts +0 -1
  313. package/dist/test/utils/truncate.test.d.ts +0 -1
  314. package/dist/test/utils/visual/filter.test.d.ts +0 -1
  315. package/dist/test/utils/worker-client.test.d.ts +0 -1
  316. package/dist/test/utils/worker-serve.test.d.ts +0 -1
  317. package/dist/test/utils/zip.test.d.ts +0 -1
  318. package/dist/test/visual/math.test.d.ts +0 -1
  319. package/dist/test/visual-application.test.d.ts +0 -1
  320. package/dist/test/visual-batch.test.d.ts +0 -1
  321. package/dist/test/visual-math.test.d.ts +0 -1
  322. package/dist/test/vnode/index.d.ts +0 -1
  323. package/dist/test/vnode/server.d.ts +0 -2
  324. package/dist/test/vnode/vnode.d.ts +0 -1
  325. package/dist/test/vnode.test.d.ts +0 -1
  326. package/dist/test/websocket.test.d.ts +0 -1
  327. package/dist/test/writeFile.test.d.ts +0 -1
  328. package/dist/umd/index.umd.cjs +0 -1
  329. package/dist/umd/node/node.umd.cjs +0 -1
  330. package/dist/umd/utils/utils.umd.cjs +0 -1
  331. package/dist/utils-B4FnyUzW.js +0 -1
  332. package/dist/vite.config.d.ts +0 -8
  333. package/dist/vitest.config.d.ts +0 -2
@@ -1,81 +1,83 @@
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, clearBr, clearStr, getMatchingSentences, getRandomString, isString, randomString, strParse, toFullWidth, toHalfWidth, toString, 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 { TruncateOptions, TruncatePosition } from "./str.js";
9
+ import { arrayBufferToString, checkEncoding, transformText } from "./charset.js";
10
+ import type { TransformText } from "./charset.js";
11
+ import { createSpeechRecognizer, isSpeechRecognitionSupported } from "./speech.js";
12
+ import type { SpeechError, SpeechErrorKind, SpeechRecognizer, SpeechRecognizerOptions } from "./speech.js";
13
+ import { appendUrl, connection, createObjectURL, durationHandler, encodeUrl, getAllQueryString, getCookie, getCookieByName, getFrame, getPixelRatio, getWindow, imageRequest, isInIframe, isSafari, networkSpeed, queryFlag, requestUrlToBuffer } from "./bom.js";
14
+ import { BRIDGE_MARKER, BridgeManager, Client, DEFAULT_CHANNEL, Platform, PostMessageBridge, acceptPortBridge, bridgeManager, createPortBridge, openPortBridge } from "./bridge.js";
15
+ import type { AcceptPortBridgeOptions, BridgeManagerOptions, BroadcastPayload, CallToPayload, MessageData, MessageHandler, OpenPortBridgeOptions, PendingRequest, PortBridge } from "./bridge.js";
16
+ import { cloneDeep, filterObj, formatJson, isEqual, merge, mergeExports, querystring, replaceOld } from "./obj.js";
17
+ import { MimeType, getExtensions, getMime, setMime } from "./mimeType.js";
18
+ import { AudioRecorder } from "./audioRecorder.js";
19
+ import { createSignal, subscribers } from "./signal.js";
20
+ import { TOTP } from "./totp/totp.js";
21
+ import { createStore, localStorageGetItem, localStorageRemoveItem, localStorageSetItem } from "./storage.js";
22
+ import type { JsonStore } from "./storage.js";
23
+ import { compose } from "./compose.js";
24
+ import { handleConsole } from "./console.js";
25
+ import { debounce } from "./debounce.js";
26
+ import type { Debounced } from "./debounce.js";
27
+ import { Chain, addClassToElement, autosizeTextarea, create, createDocumentFragment, escapeHtml, removeClassToElement, setFontSize2html } from "./dom.js";
28
+ import { handleError } from "./error.js";
29
+ import { EventManager, createDoubleTapDetector } from "./event.js";
30
+ import type { DoubleTapDetector, DoubleTapDetectorOptions } from "./event.js";
31
+ import { circ, cubic, expo, quad, quart, quint, sine } from "./tween.js";
32
+ import type { EasingFn, SpeedType } from "./tween.js";
33
+ import { convertImageToBase64, cutRound, getImage, getMatrix, isImageSize, opacity } from "./img.js";
34
+ import type { ImgSource } from "./img.js";
35
+ import { fanShapedByArc, getAngle, getArcPointerByDeg, getLinearGradient, getTangentByPointer, roundRectByArc } from "./canvas.js";
36
+ import { ADOPTED_SHEET_MARKER, ADOPTED_STYLE_MARKER, adoptSheetText, adoptStyles } from "./style.js";
37
+ import { once, singleFlight } from "./memoize.js";
38
+ import type { SingleFlight } from "./memoize.js";
39
+ import { WebDB, createHandoff } from "./idb.js";
40
+ import type { Handoff, HandoffOptions, IDBCollection, IDBResult, IDBStoreSchema, WebDBOptions } from "./idb.js";
41
+ import { buildOffsets, indexForOffset, segmentByRanges } from "./segment.js";
42
+ import { paginateText } from "./paginate.js";
43
+ import type { PaginateOptions, PaginateResult, TextBox, TextGridMetrics, TextPage } from "./paginate.js";
44
+ import type { OffsetRange, Segment } from "./segment.js";
45
+ import { detectLanguage, navigatorLanguage, resolveLocale } from "./lang.js";
46
+ import { I18nCore, createI18n, useI18n } from "./i18n.js";
47
+ import type { I18nConfig, LocaleChangeHandler, LocaleMessages, MessageDict, StringValues, TranslateParams } from "./i18n.js";
48
+ import { createLocalePath } from "./localePath.js";
49
+ import type { LocalePath, LocalePathConfig, LocaleRoute } from "./localePath.js";
50
+ import { alignCrossAxis, computePlacement } from "./placement.js";
51
+ import type { ComputePlacementOptions, ComputedPlacement, Placement, PlacementAlign, PlacementRect, PlacementSide } from "./placement.js";
52
+ import type { ResolveLocaleOptions, TextLanguage } from "./lang.js";
53
+ import { readFileAsArrayBuffer, readFileAsDataURL, readFileAsText, readFileAsUint8Array } from "./file.js";
54
+ import { base64ToBytes, bytesToBase64, decodeTextBytes, fetchMaybeGzip, gunzipMaybe, isGzip, isHtmlDocument, isZipContainer, saveFileToDisk, bytesToBase64Url, base64UrlToBytes, concatBytes } from "./binary.js";
55
+ import { UNAMBIGUOUS_ALPHABET, safeEqual, secureRandomString, secureToken } from "./secure.js";
56
+ import { WorkerClient, serveWorker } from "./worker.js";
57
+ import type { ServeWorkerOptions, WorkerClientOptions, WorkerHandlerContext, WorkerRequestBase, WorkerResponseBase } from "./worker.js";
58
+ import { isUrlCached, networkAllowsDownload, prefetchUrl, prefetchUrls, prefetchWhenIdle, whenIdle } from "./prefetch.js";
59
+ import type { NetworkAllowanceOptions, PrefetchOptions, WhenIdleOptions } from "./prefetch.js";
60
+ import { TimeoutError, createRaceGuard, deferred, delay, withTimeout, withTimeoutFallback } from "./async.js";
61
+ import type { Deferred, RaceGuard } from "./async.js";
62
+ import { ZIP_DEFLATE, ZIP_STORED, createZip, crc32, inflateRaw, readZipEntries, readZipEntry, rewriteZip, zipHasEntry } from "./zip.js";
63
+ import type { RewriteZipOptions, ZipEntry } from "./zip.js";
64
+ import { Monitor } from "./monitor.js";
65
+ import { getStatus, status } from "./network.js";
66
+ import { noop } from "./noop.js";
67
+ import { getPerformance } from "./performance.js";
68
+ import { QuestQueue } from "./queue.js";
69
+ import { createData, getReportUrl, report, setReportUrl } from "./report.js";
70
+ import type { BeaconPayload, ReportConfig } from "./report.js";
71
+ import { handleFetchHook, handleXhrHook } from "./request.js";
72
+ import { loadScript, scriptOnLoad } from "./script.js";
73
+ import type { LoadScriptOptions } from "./script.js";
74
+ import { throttle } from "./throttle.js";
75
+ import type { Throttled } from "./throttle.js";
76
+ import { formatDate, formatDuration, formatRelative, parseVttCueTiming, parseVttTimestamp, performanceTime } from "./time.js";
77
+ import type { DateInput, FormatRelativeOptions, RelativeStyle } from "./time.js";
78
+ import type { CurrentDevice } from "./device.js";
79
+ import { MOBILE_MEDIA_QUERY, currentDevice, isMobile, isWeiXin, matchMediaQuery, watchMediaQuery } from "./device.js";
80
+ 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";
81
+ import type { RGB } from "./color.js";
82
+ 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
83
  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,307 @@
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, clearBr as s, clearStr as p, csvEscape as l, fenceCode as c, getMatchingSentences as f, getRandomString as g, isString as d, randomString as u, slugify as T, strParse as h, toFullWidth as b, toHalfWidth as R, toString as E, truncate as S, truncateWithMarker as y } from "./str.js";
5
+ import { Mathjs as A, addNumSym as H, clamp as M, fit as D, formatBytes as C, inverseLerp as x, lerp as v, linearstep as I, mathjs as P, parseChineseNumber as L, parseEnglishNumber as U, parseRomanNumber as F, perToNum as O, range as _, remap as k, smoothstep as w, transformNumber as G } from "./number.js";
6
+ import { arrayBufferToString as q, checkEncoding as W, transformText as z } from "./charset.js";
7
+ import { createSpeechRecognizer as Q, isSpeechRecognitionSupported as X } from "./speech.js";
8
+ import { formatDate as K, formatDuration as V, formatRelative as Y, parseVttCueTiming as J, parseVttTimestamp as $, performanceTime as ee } from "./time.js";
9
+ import { appendUrl as oe, connection as te, createObjectURL as ae, durationHandler as ie, encodeUrl as me, getAllQueryString as ne, getCookie as se, getCookieByName as pe, getFrame as le, getPixelRatio as ce, getWindow as fe, imageRequest as ge, isInIframe as de, isSafari as ue, networkSpeed as Te, queryFlag as he, requestUrlToBuffer as be } from "./bom.js";
10
+ import { BRIDGE_MARKER as Ee, BridgeManager as Se, Client as ye, DEFAULT_CHANNEL as Be, Platform as Ae, PostMessageBridge as He, acceptPortBridge as Me, bridgeManager as De, createPortBridge as Ce, openPortBridge as xe } from "./bridge.js";
11
+ import { once as Ie, singleFlight as Pe } from "./memoize.js";
12
+ import { noop as Ue } from "./noop.js";
13
+ import { cloneDeep as Oe, filterObj as _e, formatJson as ke, isEqual as we, merge as Ge, mergeExports as Ne, querystring as qe, replaceOld as We } from "./obj.js";
14
+ import { MimeType as Ze, getExtensions as Qe, getMime as Xe, setMime as je } from "./mimeType.js";
15
+ import { AudioRecorder as Ve } from "./audioRecorder.js";
16
+ import { createSignal as Je, subscribers as $e } from "./signal.js";
17
+ import { TOTP as rr } from "./totp/totp.js";
18
+ import { createStore as tr, localStorageGetItem as ar, localStorageRemoveItem as ir, localStorageSetItem as mr } from "./storage.js";
19
+ import { compose as sr } from "./compose.js";
20
+ import { handleConsole as lr } from "./console.js";
21
+ import { debounce as fr } from "./debounce.js";
22
+ import { MOBILE_MEDIA_QUERY as dr, currentDevice as ur, isMobile as Tr, isWeiXin as hr, matchMediaQuery as br, watchMediaQuery as Rr } from "./device.js";
23
+ import { Chain as Sr, create as yr } from "./chain.js";
24
+ import { addClassToElement as Ar, autosizeTextarea as Hr, createDocumentFragment as Mr, escapeHtml as Dr, removeClassToElement as Cr, setFontSize2html as xr } from "./dom.js";
25
+ import { handleError as Ir } from "./error.js";
26
+ import { EventManager as Lr, createDoubleTapDetector as Ur } from "./event.js";
27
+ import { circ as Or, cubic as _r, expo as kr, quad as wr, quart as Gr, quint as Nr, sine as qr } from "./tween.js";
28
+ import { fanShapedByArc as zr, getAngle as Zr, getArcPointerByDeg as Qr, getLinearGradient as Xr, getTangentByPointer as jr, roundRectByArc as Kr } from "./canvas.js";
29
+ import { convertImageToBase64 as Yr, cutRound as Jr, getImage as $r, getMatrix as eo, isImageSize as ro, opacity as oo } from "./img.js";
30
+ import { ADOPTED_SHEET_MARKER as ao, ADOPTED_STYLE_MARKER as io, adoptSheetText as mo, adoptStyles as no } from "./style.js";
31
+ import { WebDB as po, createHandoff as lo } from "./idb.js";
32
+ import { buildOffsets as fo, indexForOffset as go, segmentByRanges as uo } from "./segment.js";
33
+ import { paginateText as ho } from "./paginate.js";
34
+ import { detectLanguage as Ro, navigatorLanguage as Eo, resolveLocale as So } from "./lang.js";
35
+ import { I18nCore as Bo, createI18n as Ao, useI18n as Ho } from "./i18n/index.js";
36
+ import { createLocalePath as Do } from "./localePath.js";
37
+ import { alignCrossAxis as xo, computePlacement as vo } from "./placement.js";
38
+ import { readFileAsArrayBuffer as Po, readFileAsDataURL as Lo, readFileAsText as Uo, readFileAsUint8Array as Fo } from "./file.js";
39
+ import { base64ToBytes as _o, base64UrlToBytes as ko, bytesToBase64 as wo, bytesToBase64Url as Go, concatBytes as No, decodeTextBytes as qo, fetchMaybeGzip as Wo, gunzipMaybe as zo, isGzip as Zo, isHtmlDocument as Qo, isZipContainer as Xo, saveFileToDisk as jo } from "./binary.js";
40
+ import { UNAMBIGUOUS_ALPHABET as Vo, safeEqual as Yo, secureRandomString as Jo, secureToken as $o } from "./secure.js";
41
+ import { WorkerClient as rt, serveWorker as ot } from "./worker.js";
42
+ import { isUrlCached as at, networkAllowsDownload as it, prefetchUrl as mt, prefetchUrls as nt, prefetchWhenIdle as st, whenIdle as pt } from "./prefetch.js";
43
+ import { TimeoutError as ct, createRaceGuard as ft, deferred as gt, delay as dt, withTimeout as ut, withTimeoutFallback as Tt } from "./async.js";
44
+ import { ZIP_DEFLATE as bt, ZIP_STORED as Rt, crc32 as Et, createZip as St, inflateRaw as yt, readZipEntries as Bt, readZipEntry as At, rewriteZip as Ht, zipHasEntry as Mt } from "./zip.js";
45
+ import { getPerformance as Ct } from "./performance.js";
46
+ import { createData as vt, getReportUrl as It, report as Pt, setReportUrl as Lt } from "./report.js";
47
+ import { handleFetchHook as Ft, handleXhrHook as Ot } from "./request.js";
48
+ import { throttle as kt } from "./throttle.js";
49
+ import { Monitor as Gt } from "./monitor.js";
50
+ import { getStatus as qt, status as Wt } from "./network.js";
51
+ import { QuestQueue as Zt } from "./queue.js";
52
+ import { loadScript as Xt, scriptOnLoad as jt } from "./script.js";
53
+ import { Color as Vt, ColorScheme as Yt, HEX_COLOR_REGEX as Jt, Hsl as $t, Hsla as ea, RGBA_REGEX as ra, RGB_REGEX as oa, Rgb as ta, Rgba as aa, blendMultiply as ia, blendOverlay as ma, blendScreen as na, brightnessContrast as sa, componentToHex as pa, cosinePalette as la, hexToAlpha as ca, hexToHsb as fa, hexToHsv as ga, hexToRgb as da, hsbToHsl as ua, hsbToRgb as Ta, hslToHsb as ha, hslToHsv as ba, hslToRgb as Ra, hsvToHsl as Ea, hsvToRgb as Sa, hue2rgb as ya, linearToSrgb as Ba, luma as Aa, randomColor as Ha, rgbToHex as Ma, rgbToHsb as Da, rgbToHsl as Ca, rgbToHsv as xa, rgbaString as va, rgbaToHex as Ia, rgbaToRgb as Pa, saturation as La, srgbToLinear as Ua, vibrance as Fa } from "./color.js";
54
+ export {
55
+ ao as ADOPTED_SHEET_MARKER,
56
+ io as ADOPTED_STYLE_MARKER,
57
+ Ve as AudioRecorder,
58
+ Ee as BRIDGE_MARKER,
59
+ Se as BridgeManager,
60
+ Sr as Chain,
61
+ ye as Client,
62
+ Vt as Color,
63
+ Yt as ColorScheme,
64
+ Be as DEFAULT_CHANNEL,
65
+ Lr as EventManager,
66
+ Jt as HEX_COLOR_REGEX,
67
+ $t as Hsl,
68
+ ea as Hsla,
69
+ Bo as I18nCore,
70
+ dr as MOBILE_MEDIA_QUERY,
71
+ A as Mathjs,
72
+ n as MessageCodec,
73
+ Ze as MimeType,
74
+ Gt as Monitor,
75
+ Ae as Platform,
76
+ He as PostMessageBridge,
77
+ Zt as QuestQueue,
78
+ ra as RGBA_REGEX,
79
+ oa as RGB_REGEX,
80
+ ta as Rgb,
81
+ aa as Rgba,
82
+ i as SyncHook,
83
+ rr as TOTP,
84
+ ct as TimeoutError,
85
+ Vo as UNAMBIGUOUS_ALPHABET,
86
+ po as WebDB,
87
+ rt as WorkerClient,
88
+ bt as ZIP_DEFLATE,
89
+ Rt as ZIP_STORED,
90
+ Me as acceptPortBridge,
91
+ Ar as addClassToElement,
92
+ H as addNumSym,
93
+ mo as adoptSheetText,
94
+ no as adoptStyles,
95
+ xo as alignCrossAxis,
96
+ oe as appendUrl,
97
+ q as arrayBufferToString,
98
+ Hr as autosizeTextarea,
99
+ _o as base64ToBytes,
100
+ ko as base64UrlToBytes,
101
+ ia as blendMultiply,
102
+ ma as blendOverlay,
103
+ na as blendScreen,
104
+ De as bridgeManager,
105
+ sa as brightnessContrast,
106
+ fo as buildOffsets,
107
+ wo as bytesToBase64,
108
+ Go as bytesToBase64Url,
109
+ W as checkEncoding,
110
+ Or as circ,
111
+ M as clamp,
112
+ s as clearBr,
113
+ p as clearStr,
114
+ Oe as cloneDeep,
115
+ pa as componentToHex,
116
+ sr as compose,
117
+ vo as computePlacement,
118
+ No as concatBytes,
119
+ te as connection,
120
+ Yr as convertImageToBase64,
121
+ la as cosinePalette,
122
+ Et as crc32,
123
+ yr as create,
124
+ r as createBottomFollower,
125
+ vt as createData,
126
+ Mr as createDocumentFragment,
127
+ Ur as createDoubleTapDetector,
128
+ lo as createHandoff,
129
+ Ao as createI18n,
130
+ Do as createLocalePath,
131
+ ae as createObjectURL,
132
+ Ce as createPortBridge,
133
+ ft as createRaceGuard,
134
+ Je as createSignal,
135
+ Q as createSpeechRecognizer,
136
+ tr as createStore,
137
+ St as createZip,
138
+ l as csvEscape,
139
+ _r as cubic,
140
+ ur as currentDevice,
141
+ Jr as cutRound,
142
+ fr as debounce,
143
+ qo as decodeTextBytes,
144
+ gt as deferred,
145
+ dt as delay,
146
+ Ro as detectLanguage,
147
+ t as diffLines,
148
+ ie as durationHandler,
149
+ me as encodeUrl,
150
+ Dr as escapeHtml,
151
+ kr as expo,
152
+ zr as fanShapedByArc,
153
+ c as fenceCode,
154
+ Wo as fetchMaybeGzip,
155
+ _e as filterObj,
156
+ D as fit,
157
+ C as formatBytes,
158
+ K as formatDate,
159
+ V as formatDuration,
160
+ ke as formatJson,
161
+ Y as formatRelative,
162
+ ne as getAllQueryString,
163
+ Zr as getAngle,
164
+ Qr as getArcPointerByDeg,
165
+ se as getCookie,
166
+ pe as getCookieByName,
167
+ Qe as getExtensions,
168
+ le as getFrame,
169
+ $r as getImage,
170
+ Xr as getLinearGradient,
171
+ f as getMatchingSentences,
172
+ eo as getMatrix,
173
+ Xe as getMime,
174
+ Ct as getPerformance,
175
+ ce as getPixelRatio,
176
+ g as getRandomString,
177
+ It as getReportUrl,
178
+ qt as getStatus,
179
+ jr as getTangentByPointer,
180
+ fe as getWindow,
181
+ zo as gunzipMaybe,
182
+ lr as handleConsole,
183
+ Ir as handleError,
184
+ Ft as handleFetchHook,
185
+ Ot as handleXhrHook,
186
+ ca as hexToAlpha,
187
+ fa as hexToHsb,
188
+ ga as hexToHsv,
189
+ da as hexToRgb,
190
+ ua as hsbToHsl,
191
+ Ta as hsbToRgb,
192
+ ha as hslToHsb,
193
+ ba as hslToHsv,
194
+ Ra as hslToRgb,
195
+ Ea as hsvToHsl,
196
+ Sa as hsvToRgb,
197
+ ya as hue2rgb,
198
+ ge as imageRequest,
199
+ go as indexForOffset,
200
+ yt as inflateRaw,
201
+ x as inverseLerp,
202
+ we as isEqual,
203
+ Zo as isGzip,
204
+ Qo as isHtmlDocument,
205
+ ro as isImageSize,
206
+ de as isInIframe,
207
+ Tr as isMobile,
208
+ ue as isSafari,
209
+ X as isSpeechRecognitionSupported,
210
+ d as isString,
211
+ at as isUrlCached,
212
+ hr as isWeiXin,
213
+ Xo as isZipContainer,
214
+ v as lerp,
215
+ Ba as linearToSrgb,
216
+ I as linearstep,
217
+ Xt as loadScript,
218
+ ar as localStorageGetItem,
219
+ ir as localStorageRemoveItem,
220
+ mr as localStorageSetItem,
221
+ Aa as luma,
222
+ br as matchMediaQuery,
223
+ P as mathjs,
224
+ Ge as merge,
225
+ Ne as mergeExports,
226
+ Eo as navigatorLanguage,
227
+ it as networkAllowsDownload,
228
+ Te as networkSpeed,
229
+ Ue as noop,
230
+ Ie as once,
231
+ oo as opacity,
232
+ xe as openPortBridge,
233
+ ho as paginateText,
234
+ L as parseChineseNumber,
235
+ U as parseEnglishNumber,
236
+ F as parseRomanNumber,
237
+ J as parseVttCueTiming,
238
+ $ as parseVttTimestamp,
239
+ O as perToNum,
240
+ ee as performanceTime,
241
+ mt as prefetchUrl,
242
+ nt as prefetchUrls,
243
+ st as prefetchWhenIdle,
244
+ wr as quad,
245
+ Gr as quart,
246
+ he as queryFlag,
247
+ qe as querystring,
248
+ Nr as quint,
249
+ Ha as randomColor,
250
+ u as randomString,
251
+ _ as range,
252
+ Po as readFileAsArrayBuffer,
253
+ Lo as readFileAsDataURL,
254
+ Uo as readFileAsText,
255
+ Fo as readFileAsUint8Array,
256
+ Bt as readZipEntries,
257
+ At as readZipEntry,
258
+ k as remap,
259
+ Cr as removeClassToElement,
260
+ We as replaceOld,
261
+ Pt as report,
262
+ be as requestUrlToBuffer,
263
+ So as resolveLocale,
264
+ Ht as rewriteZip,
265
+ Ma as rgbToHex,
266
+ Da as rgbToHsb,
267
+ Ca as rgbToHsl,
268
+ xa as rgbToHsv,
269
+ va as rgbaString,
270
+ Ia as rgbaToHex,
271
+ Pa as rgbaToRgb,
272
+ Kr as roundRectByArc,
273
+ Yo as safeEqual,
274
+ La as saturation,
275
+ jo as saveFileToDisk,
276
+ jt as scriptOnLoad,
277
+ Jo as secureRandomString,
278
+ $o as secureToken,
279
+ uo as segmentByRanges,
280
+ ot as serveWorker,
281
+ xr as setFontSize2html,
282
+ je as setMime,
283
+ Lt as setReportUrl,
284
+ qr as sine,
285
+ Pe as singleFlight,
286
+ T as slugify,
287
+ w as smoothstep,
288
+ Ua as srgbToLinear,
289
+ Wt as status,
290
+ h as strParse,
291
+ $e as subscribers,
292
+ kt as throttle,
293
+ b as toFullWidth,
294
+ R as toHalfWidth,
295
+ E as toString,
296
+ G as transformNumber,
297
+ z as transformText,
298
+ S as truncate,
299
+ y as truncateWithMarker,
300
+ Ho as useI18n,
301
+ Fa as vibrance,
302
+ Rr as watchMediaQuery,
303
+ pt as whenIdle,
304
+ ut as withTimeout,
305
+ Tt as withTimeoutFallback,
306
+ Mt as zipHasEntry
307
+ };
@@ -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
+ };