stellavault 0.2.0 → 0.2.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 (390) hide show
  1. package/package.json +1 -1
  2. package/packages/core/dist/api/dashboard.d.ts +3 -0
  3. package/packages/core/{src/api/dashboard.ts → dist/api/dashboard.js} +8 -11
  4. package/packages/core/dist/api/graph-data.d.ts +11 -0
  5. package/packages/core/dist/api/graph-data.js +255 -0
  6. package/packages/core/dist/api/pwa.d.ts +3 -0
  7. package/packages/core/{src/api/pwa.ts → dist/api/pwa.js} +27 -32
  8. package/packages/core/dist/api/server.d.ts +16 -0
  9. package/packages/core/dist/api/server.js +647 -0
  10. package/packages/core/dist/capture/voice.d.ts +24 -0
  11. package/packages/core/dist/capture/voice.js +135 -0
  12. package/packages/core/{src/cloud/index.ts → dist/cloud/index.d.ts} +1 -0
  13. package/packages/core/dist/cloud/index.js +2 -0
  14. package/packages/core/dist/cloud/sync.d.ts +29 -0
  15. package/packages/core/dist/cloud/sync.js +137 -0
  16. package/packages/core/dist/config.d.ts +27 -0
  17. package/packages/core/dist/config.js +55 -0
  18. package/packages/core/dist/federation/credits.d.ts +26 -0
  19. package/packages/core/dist/federation/credits.js +56 -0
  20. package/packages/core/dist/federation/identity.d.ts +14 -0
  21. package/packages/core/dist/federation/identity.js +74 -0
  22. package/packages/core/{src/federation/index.ts → dist/federation/index.d.ts} +1 -2
  23. package/packages/core/dist/federation/index.js +5 -0
  24. package/packages/core/dist/federation/node.d.ts +31 -0
  25. package/packages/core/dist/federation/node.js +216 -0
  26. package/packages/core/dist/federation/privacy.d.ts +8 -0
  27. package/packages/core/dist/federation/privacy.js +40 -0
  28. package/packages/core/dist/federation/reputation.d.ts +37 -0
  29. package/packages/core/dist/federation/reputation.js +139 -0
  30. package/packages/core/dist/federation/search.d.ts +19 -0
  31. package/packages/core/dist/federation/search.js +101 -0
  32. package/packages/core/dist/federation/sharing.d.ts +72 -0
  33. package/packages/core/dist/federation/sharing.js +246 -0
  34. package/packages/core/dist/federation/trust.d.ts +15 -0
  35. package/packages/core/dist/federation/trust.js +60 -0
  36. package/packages/core/dist/federation/types.d.ts +40 -0
  37. package/packages/core/dist/federation/types.js +3 -0
  38. package/packages/core/dist/i18n/index.d.ts +6 -0
  39. package/packages/core/dist/i18n/index.js +81 -0
  40. package/packages/core/{src/index.ts → dist/index.d.ts} +46 -65
  41. package/packages/core/dist/index.js +69 -0
  42. package/packages/core/dist/indexer/chunker.d.ts +14 -0
  43. package/packages/core/dist/indexer/chunker.js +148 -0
  44. package/packages/core/dist/indexer/embedder.d.ts +8 -0
  45. package/packages/core/dist/indexer/embedder.js +3 -0
  46. package/packages/core/dist/indexer/index.d.ts +28 -0
  47. package/packages/core/dist/indexer/index.js +74 -0
  48. package/packages/core/dist/indexer/local-embedder.d.ts +3 -0
  49. package/packages/core/dist/indexer/local-embedder.js +29 -0
  50. package/packages/core/dist/indexer/scanner.d.ts +11 -0
  51. package/packages/core/dist/indexer/scanner.js +137 -0
  52. package/packages/core/dist/indexer/watcher.d.ts +19 -0
  53. package/packages/core/dist/indexer/watcher.js +49 -0
  54. package/packages/core/dist/intelligence/contradiction-detector.d.ts +20 -0
  55. package/packages/core/dist/intelligence/contradiction-detector.js +115 -0
  56. package/packages/core/dist/intelligence/decay-engine.d.ts +27 -0
  57. package/packages/core/dist/intelligence/decay-engine.js +190 -0
  58. package/packages/core/dist/intelligence/duplicate-detector.d.ts +20 -0
  59. package/packages/core/dist/intelligence/duplicate-detector.js +55 -0
  60. package/packages/core/dist/intelligence/fsrs.d.ts +43 -0
  61. package/packages/core/dist/intelligence/fsrs.js +70 -0
  62. package/packages/core/dist/intelligence/gap-detector.d.ts +25 -0
  63. package/packages/core/dist/intelligence/gap-detector.js +78 -0
  64. package/packages/core/dist/intelligence/learning-path.d.ts +31 -0
  65. package/packages/core/dist/intelligence/learning-path.js +53 -0
  66. package/packages/core/dist/intelligence/notifications.d.ts +31 -0
  67. package/packages/core/dist/intelligence/notifications.js +65 -0
  68. package/packages/core/dist/intelligence/predictive-gaps.d.ts +14 -0
  69. package/packages/core/dist/intelligence/predictive-gaps.js +74 -0
  70. package/packages/core/dist/intelligence/semantic-versioning.d.ts +37 -0
  71. package/packages/core/dist/intelligence/semantic-versioning.js +68 -0
  72. package/packages/core/dist/intelligence/types.d.ts +28 -0
  73. package/packages/core/dist/intelligence/types.js +3 -0
  74. package/packages/core/dist/mcp/custom-tools.d.ts +29 -0
  75. package/packages/core/dist/mcp/custom-tools.js +70 -0
  76. package/packages/core/{src/mcp/index.ts → dist/mcp/index.d.ts} +1 -0
  77. package/packages/core/dist/mcp/index.js +2 -0
  78. package/packages/core/dist/mcp/server.d.ts +49 -0
  79. package/packages/core/dist/mcp/server.js +133 -0
  80. package/packages/core/dist/mcp/tools/agentic-graph.d.ts +87 -0
  81. package/packages/core/dist/mcp/tools/agentic-graph.js +88 -0
  82. package/packages/core/dist/mcp/tools/brief.d.ts +31 -0
  83. package/packages/core/dist/mcp/tools/brief.js +39 -0
  84. package/packages/core/dist/mcp/tools/decay.d.ts +33 -0
  85. package/packages/core/dist/mcp/tools/decay.js +32 -0
  86. package/packages/core/dist/mcp/tools/decision-journal.d.ts +78 -0
  87. package/packages/core/dist/mcp/tools/decision-journal.js +79 -0
  88. package/packages/core/dist/mcp/tools/export.d.ts +29 -0
  89. package/packages/core/dist/mcp/tools/export.js +60 -0
  90. package/packages/core/dist/mcp/tools/federated-search.d.ts +29 -0
  91. package/packages/core/dist/mcp/tools/federated-search.js +36 -0
  92. package/packages/core/dist/mcp/tools/generate-claude-md.d.ts +35 -0
  93. package/packages/core/dist/mcp/tools/generate-claude-md.js +107 -0
  94. package/packages/core/dist/mcp/tools/get-document.d.ts +35 -0
  95. package/packages/core/dist/mcp/tools/get-document.js +25 -0
  96. package/packages/core/dist/mcp/tools/get-related.d.ts +32 -0
  97. package/packages/core/dist/mcp/tools/get-related.js +33 -0
  98. package/packages/core/dist/mcp/tools/learning-path.d.ts +23 -0
  99. package/packages/core/dist/mcp/tools/learning-path.js +45 -0
  100. package/packages/core/dist/mcp/tools/list-topics.d.ts +15 -0
  101. package/packages/core/dist/mcp/tools/list-topics.js +18 -0
  102. package/packages/core/dist/mcp/tools/search.d.ts +39 -0
  103. package/packages/core/dist/mcp/tools/search.js +29 -0
  104. package/packages/core/dist/mcp/tools/snapshot.d.ts +47 -0
  105. package/packages/core/dist/mcp/tools/snapshot.js +84 -0
  106. package/packages/core/dist/multi-vault/index.d.ts +26 -0
  107. package/packages/core/dist/multi-vault/index.js +80 -0
  108. package/packages/core/dist/pack/creator.d.ts +21 -0
  109. package/packages/core/dist/pack/creator.js +105 -0
  110. package/packages/core/dist/pack/exporter.d.ts +4 -0
  111. package/packages/core/dist/pack/exporter.js +18 -0
  112. package/packages/core/dist/pack/importer.d.ts +10 -0
  113. package/packages/core/dist/pack/importer.js +55 -0
  114. package/packages/core/{src/pack/index.ts → dist/pack/index.d.ts} +1 -0
  115. package/packages/core/dist/pack/index.js +5 -0
  116. package/packages/core/dist/pack/marketplace.d.ts +14 -0
  117. package/packages/core/dist/pack/marketplace.js +90 -0
  118. package/packages/core/dist/pack/pii-masker.d.ts +7 -0
  119. package/packages/core/dist/pack/pii-masker.js +29 -0
  120. package/packages/core/dist/pack/types.d.ts +36 -0
  121. package/packages/core/dist/pack/types.js +3 -0
  122. package/packages/core/dist/plugins/index.d.ts +35 -0
  123. package/packages/core/dist/plugins/index.js +57 -0
  124. package/packages/core/dist/plugins/webhooks.d.ts +30 -0
  125. package/packages/core/dist/plugins/webhooks.js +79 -0
  126. package/packages/core/dist/search/bm25.d.ts +4 -0
  127. package/packages/core/dist/search/bm25.js +10 -0
  128. package/packages/core/dist/search/index.d.ts +13 -0
  129. package/packages/core/dist/search/index.js +63 -0
  130. package/packages/core/dist/search/rrf.d.ts +7 -0
  131. package/packages/core/dist/search/rrf.js +21 -0
  132. package/packages/core/dist/search/semantic.d.ts +5 -0
  133. package/packages/core/dist/search/semantic.js +6 -0
  134. package/packages/core/{src/store/index.ts → dist/store/index.d.ts} +1 -0
  135. package/packages/core/dist/store/index.js +2 -0
  136. package/packages/core/dist/store/sqlite-vec.d.ts +6 -0
  137. package/packages/core/dist/store/sqlite-vec.js +251 -0
  138. package/packages/core/dist/store/types.d.ts +20 -0
  139. package/packages/core/dist/store/types.js +3 -0
  140. package/packages/core/dist/team/index.d.ts +25 -0
  141. package/packages/core/dist/team/index.js +97 -0
  142. package/packages/core/dist/types/chunk.d.ts +23 -0
  143. package/packages/core/dist/types/chunk.js +3 -0
  144. package/packages/core/dist/types/document.d.ts +23 -0
  145. package/packages/core/dist/types/document.js +3 -0
  146. package/packages/core/dist/types/graph.d.ts +39 -0
  147. package/packages/core/dist/types/graph.js +3 -0
  148. package/packages/core/dist/types/index.d.ts +5 -0
  149. package/packages/core/dist/types/index.js +2 -0
  150. package/packages/core/dist/types/search.d.ts +39 -0
  151. package/packages/core/dist/types/search.js +3 -0
  152. package/packages/core/dist/utils/retry.d.ts +25 -0
  153. package/packages/core/dist/utils/retry.js +59 -0
  154. package/.github/workflows/pages.yml +0 -37
  155. package/memory/MEMORY.md +0 -25
  156. package/packages/cli/dist/commands/brief-cmd.d.ts.map +0 -1
  157. package/packages/cli/dist/commands/brief-cmd.js.map +0 -1
  158. package/packages/cli/dist/commands/capture-cmd.d.ts.map +0 -1
  159. package/packages/cli/dist/commands/capture-cmd.js.map +0 -1
  160. package/packages/cli/dist/commands/card-cmd.d.ts.map +0 -1
  161. package/packages/cli/dist/commands/card-cmd.js.map +0 -1
  162. package/packages/cli/dist/commands/clip-cmd.d.ts.map +0 -1
  163. package/packages/cli/dist/commands/clip-cmd.js.map +0 -1
  164. package/packages/cli/dist/commands/cloud-cmd.d.ts.map +0 -1
  165. package/packages/cli/dist/commands/cloud-cmd.js.map +0 -1
  166. package/packages/cli/dist/commands/contradictions-cmd.d.ts.map +0 -1
  167. package/packages/cli/dist/commands/contradictions-cmd.js.map +0 -1
  168. package/packages/cli/dist/commands/decay-cmd.d.ts.map +0 -1
  169. package/packages/cli/dist/commands/decay-cmd.js.map +0 -1
  170. package/packages/cli/dist/commands/digest-cmd.d.ts.map +0 -1
  171. package/packages/cli/dist/commands/digest-cmd.js.map +0 -1
  172. package/packages/cli/dist/commands/duplicates-cmd.d.ts.map +0 -1
  173. package/packages/cli/dist/commands/duplicates-cmd.js.map +0 -1
  174. package/packages/cli/dist/commands/federate-cmd.d.ts.map +0 -1
  175. package/packages/cli/dist/commands/federate-cmd.js.map +0 -1
  176. package/packages/cli/dist/commands/gaps-cmd.d.ts.map +0 -1
  177. package/packages/cli/dist/commands/gaps-cmd.js.map +0 -1
  178. package/packages/cli/dist/commands/graph-cmd.d.ts.map +0 -1
  179. package/packages/cli/dist/commands/graph-cmd.js.map +0 -1
  180. package/packages/cli/dist/commands/index-cmd.d.ts.map +0 -1
  181. package/packages/cli/dist/commands/index-cmd.js.map +0 -1
  182. package/packages/cli/dist/commands/init-cmd.d.ts.map +0 -1
  183. package/packages/cli/dist/commands/init-cmd.js.map +0 -1
  184. package/packages/cli/dist/commands/learn-cmd.d.ts.map +0 -1
  185. package/packages/cli/dist/commands/learn-cmd.js.map +0 -1
  186. package/packages/cli/dist/commands/pack-cmd.d.ts.map +0 -1
  187. package/packages/cli/dist/commands/pack-cmd.js.map +0 -1
  188. package/packages/cli/dist/commands/review-cmd.d.ts.map +0 -1
  189. package/packages/cli/dist/commands/review-cmd.js.map +0 -1
  190. package/packages/cli/dist/commands/search-cmd.d.ts.map +0 -1
  191. package/packages/cli/dist/commands/search-cmd.js.map +0 -1
  192. package/packages/cli/dist/commands/serve-cmd.d.ts.map +0 -1
  193. package/packages/cli/dist/commands/serve-cmd.js.map +0 -1
  194. package/packages/cli/dist/commands/status-cmd.d.ts.map +0 -1
  195. package/packages/cli/dist/commands/status-cmd.js.map +0 -1
  196. package/packages/cli/dist/commands/sync-cmd.d.ts.map +0 -1
  197. package/packages/cli/dist/commands/sync-cmd.js.map +0 -1
  198. package/packages/cli/dist/commands/vault-cmd.d.ts.map +0 -1
  199. package/packages/cli/dist/commands/vault-cmd.js.map +0 -1
  200. package/packages/cli/dist/index.d.ts.map +0 -1
  201. package/packages/cli/dist/index.js.map +0 -1
  202. package/packages/cli/src/commands/brief-cmd.ts +0 -87
  203. package/packages/cli/src/commands/capture-cmd.ts +0 -34
  204. package/packages/cli/src/commands/card-cmd.ts +0 -29
  205. package/packages/cli/src/commands/clip-cmd.ts +0 -172
  206. package/packages/cli/src/commands/cloud-cmd.ts +0 -75
  207. package/packages/cli/src/commands/contradictions-cmd.ts +0 -41
  208. package/packages/cli/src/commands/decay-cmd.ts +0 -57
  209. package/packages/cli/src/commands/digest-cmd.ts +0 -89
  210. package/packages/cli/src/commands/duplicates-cmd.ts +0 -38
  211. package/packages/cli/src/commands/federate-cmd.ts +0 -256
  212. package/packages/cli/src/commands/gaps-cmd.ts +0 -40
  213. package/packages/cli/src/commands/graph-cmd.ts +0 -88
  214. package/packages/cli/src/commands/index-cmd.ts +0 -65
  215. package/packages/cli/src/commands/init-cmd.ts +0 -145
  216. package/packages/cli/src/commands/learn-cmd.ts +0 -56
  217. package/packages/cli/src/commands/pack-cmd.ts +0 -121
  218. package/packages/cli/src/commands/review-cmd.ts +0 -125
  219. package/packages/cli/src/commands/search-cmd.ts +0 -45
  220. package/packages/cli/src/commands/serve-cmd.ts +0 -17
  221. package/packages/cli/src/commands/status-cmd.ts +0 -37
  222. package/packages/cli/src/commands/sync-cmd.ts +0 -68
  223. package/packages/cli/src/commands/vault-cmd.ts +0 -64
  224. package/packages/cli/src/index.ts +0 -187
  225. package/packages/core/src/api/graph-data.ts +0 -286
  226. package/packages/core/src/api/server.ts +0 -660
  227. package/packages/core/src/capture/voice.ts +0 -168
  228. package/packages/core/src/cloud/sync.ts +0 -167
  229. package/packages/core/src/config.ts +0 -82
  230. package/packages/core/src/federation/credits.ts +0 -80
  231. package/packages/core/src/federation/hyperswarm.d.ts +0 -19
  232. package/packages/core/src/federation/identity.ts +0 -90
  233. package/packages/core/src/federation/node.ts +0 -235
  234. package/packages/core/src/federation/privacy.ts +0 -52
  235. package/packages/core/src/federation/reputation.ts +0 -202
  236. package/packages/core/src/federation/search.ts +0 -129
  237. package/packages/core/src/federation/sharing.ts +0 -315
  238. package/packages/core/src/federation/trust.ts +0 -76
  239. package/packages/core/src/federation/types.ts +0 -25
  240. package/packages/core/src/i18n/index.ts +0 -85
  241. package/packages/core/src/indexer/chunker.ts +0 -180
  242. package/packages/core/src/indexer/embedder.ts +0 -9
  243. package/packages/core/src/indexer/index.ts +0 -113
  244. package/packages/core/src/indexer/local-embedder.ts +0 -35
  245. package/packages/core/src/indexer/scanner.ts +0 -142
  246. package/packages/core/src/indexer/watcher.ts +0 -62
  247. package/packages/core/src/intelligence/contradiction-detector.ts +0 -134
  248. package/packages/core/src/intelligence/decay-engine.ts +0 -229
  249. package/packages/core/src/intelligence/duplicate-detector.ts +0 -71
  250. package/packages/core/src/intelligence/fsrs.ts +0 -79
  251. package/packages/core/src/intelligence/gap-detector.ts +0 -109
  252. package/packages/core/src/intelligence/learning-path.ts +0 -86
  253. package/packages/core/src/intelligence/notifications.ts +0 -106
  254. package/packages/core/src/intelligence/predictive-gaps.ts +0 -94
  255. package/packages/core/src/intelligence/semantic-versioning.ts +0 -97
  256. package/packages/core/src/intelligence/types.ts +0 -28
  257. package/packages/core/src/mcp/custom-tools.ts +0 -97
  258. package/packages/core/src/mcp/server.ts +0 -142
  259. package/packages/core/src/mcp/tools/agentic-graph.ts +0 -96
  260. package/packages/core/src/mcp/tools/brief.ts +0 -49
  261. package/packages/core/src/mcp/tools/decay.ts +0 -40
  262. package/packages/core/src/mcp/tools/decision-journal.ts +0 -95
  263. package/packages/core/src/mcp/tools/export.ts +0 -72
  264. package/packages/core/src/mcp/tools/federated-search.ts +0 -43
  265. package/packages/core/src/mcp/tools/generate-claude-md.ts +0 -130
  266. package/packages/core/src/mcp/tools/get-document.ts +0 -26
  267. package/packages/core/src/mcp/tools/get-related.ts +0 -41
  268. package/packages/core/src/mcp/tools/learning-path.ts +0 -52
  269. package/packages/core/src/mcp/tools/list-topics.ts +0 -20
  270. package/packages/core/src/mcp/tools/search.ts +0 -35
  271. package/packages/core/src/mcp/tools/snapshot.ts +0 -98
  272. package/packages/core/src/multi-vault/index.ts +0 -118
  273. package/packages/core/src/pack/creator.ts +0 -127
  274. package/packages/core/src/pack/exporter.ts +0 -21
  275. package/packages/core/src/pack/importer.ts +0 -82
  276. package/packages/core/src/pack/marketplace.ts +0 -103
  277. package/packages/core/src/pack/pii-masker.ts +0 -38
  278. package/packages/core/src/pack/types.ts +0 -39
  279. package/packages/core/src/plugins/index.ts +0 -100
  280. package/packages/core/src/plugins/webhooks.ts +0 -110
  281. package/packages/core/src/search/bm25.ts +0 -16
  282. package/packages/core/src/search/index.ts +0 -83
  283. package/packages/core/src/search/rrf.ts +0 -31
  284. package/packages/core/src/search/semantic.ts +0 -15
  285. package/packages/core/src/store/sqlite-vec.ts +0 -290
  286. package/packages/core/src/store/types.ts +0 -22
  287. package/packages/core/src/team/index.ts +0 -126
  288. package/packages/core/src/types/chunk.ts +0 -25
  289. package/packages/core/src/types/document.ts +0 -24
  290. package/packages/core/src/types/graph.ts +0 -44
  291. package/packages/core/src/types/index.ts +0 -15
  292. package/packages/core/src/types/search.ts +0 -38
  293. package/packages/core/src/utils/retry.ts +0 -85
  294. package/packages/core/tests/api-card.test.ts +0 -60
  295. package/packages/core/tests/api-routes.test.ts +0 -98
  296. package/packages/core/tests/bm25.test.ts +0 -87
  297. package/packages/core/tests/chunker.test.ts +0 -48
  298. package/packages/core/tests/cluster.test.ts +0 -75
  299. package/packages/core/tests/constellation.test.ts +0 -77
  300. package/packages/core/tests/export-utils.test.ts +0 -97
  301. package/packages/core/tests/fsrs.test.ts +0 -96
  302. package/packages/core/tests/gesture-detector.test.ts +0 -45
  303. package/packages/core/tests/graph-data.test.ts +0 -87
  304. package/packages/core/tests/layout.test.ts +0 -83
  305. package/packages/core/tests/mcp.test.ts +0 -148
  306. package/packages/core/tests/pack.test.ts +0 -127
  307. package/packages/core/tests/pii-masker.test.ts +0 -42
  308. package/packages/core/tests/profile-card.test.ts +0 -62
  309. package/packages/core/tests/rrf.test.ts +0 -29
  310. package/packages/core/tests/search-integration.test.ts +0 -139
  311. package/packages/core/tests/store.test.ts +0 -80
  312. package/packages/graph/click-result.png +0 -0
  313. package/packages/graph/dist/assets/camera_utils-BMxqtvoZ.js +0 -1
  314. package/packages/graph/dist/assets/hands-DXA01_mx.js +0 -18
  315. package/packages/graph/dist/assets/index-DMEe2diW.js +0 -4192
  316. package/packages/graph/dist/assets/layout.worker-DbKCEFTz.js +0 -1
  317. package/packages/graph/dist/index.html +0 -17
  318. package/packages/graph/index.html +0 -17
  319. package/packages/graph/package.json +0 -32
  320. package/packages/graph/src/App.tsx +0 -7
  321. package/packages/graph/src/api/client.ts +0 -39
  322. package/packages/graph/src/components/ClusterFilter.tsx +0 -73
  323. package/packages/graph/src/components/ConstellationView.tsx +0 -232
  324. package/packages/graph/src/components/ExportPanel.tsx +0 -177
  325. package/packages/graph/src/components/Graph3D.tsx +0 -230
  326. package/packages/graph/src/components/GraphEdges.tsx +0 -100
  327. package/packages/graph/src/components/GraphNodes.tsx +0 -386
  328. package/packages/graph/src/components/HealthDashboard.tsx +0 -173
  329. package/packages/graph/src/components/Layout.tsx +0 -214
  330. package/packages/graph/src/components/MotionOverlay.tsx +0 -81
  331. package/packages/graph/src/components/MotionToggle.tsx +0 -33
  332. package/packages/graph/src/components/MultiverseView.tsx +0 -286
  333. package/packages/graph/src/components/NodeDetail.tsx +0 -232
  334. package/packages/graph/src/components/PulseParticle.tsx +0 -232
  335. package/packages/graph/src/components/SearchBar.tsx +0 -107
  336. package/packages/graph/src/components/StarField.tsx +0 -197
  337. package/packages/graph/src/components/StatusBar.tsx +0 -53
  338. package/packages/graph/src/components/Timeline.tsx +0 -148
  339. package/packages/graph/src/components/ToolsPanel.tsx +0 -512
  340. package/packages/graph/src/components/Tooltip.tsx +0 -100
  341. package/packages/graph/src/components/TypeFilter.tsx +0 -131
  342. package/packages/graph/src/embed/EmbedGraph.tsx +0 -144
  343. package/packages/graph/src/hooks/useConstellationLOD.ts +0 -76
  344. package/packages/graph/src/hooks/useDecay.ts +0 -37
  345. package/packages/graph/src/hooks/useExport.ts +0 -165
  346. package/packages/graph/src/hooks/useGraph.ts +0 -69
  347. package/packages/graph/src/hooks/useKeyboardNav.ts +0 -122
  348. package/packages/graph/src/hooks/useLayout.ts +0 -45
  349. package/packages/graph/src/hooks/useMotion.ts +0 -120
  350. package/packages/graph/src/hooks/usePulse.ts +0 -58
  351. package/packages/graph/src/hooks/useSearch.ts +0 -71
  352. package/packages/graph/src/lib/constellation.ts +0 -107
  353. package/packages/graph/src/lib/export-utils.ts +0 -48
  354. package/packages/graph/src/lib/gesture-detector.ts +0 -123
  355. package/packages/graph/src/lib/layout.worker.ts +0 -153
  356. package/packages/graph/src/lib/motion-controller.ts +0 -83
  357. package/packages/graph/src/lib/profile-card.ts +0 -122
  358. package/packages/graph/src/main.tsx +0 -4
  359. package/packages/graph/src/stores/graph-store.ts +0 -155
  360. package/packages/graph/success.png +0 -0
  361. package/packages/graph/test-click.mjs +0 -49
  362. package/packages/graph/test-explore.mjs +0 -102
  363. package/packages/graph/test-final.mjs +0 -61
  364. package/packages/graph/test-graph.mjs +0 -139
  365. package/packages/graph/test-hover.mjs +0 -48
  366. package/packages/graph/test-pulse.mjs +0 -68
  367. package/packages/graph/test-screenshot.mjs +0 -56
  368. package/packages/graph/test-v2.mjs +0 -97
  369. package/packages/graph/tsconfig.tsbuildinfo +0 -1
  370. package/packages/graph/vite.config.ts +0 -15
  371. package/packages/sync/.env.example +0 -11
  372. package/packages/sync/.sync-state.json +0 -317
  373. package/packages/sync/.upload-state.json +0 -1009
  374. package/packages/sync/create-stella-network-notion.mjs +0 -151
  375. package/packages/sync/create-stellavault-project-notion.mjs +0 -322
  376. package/packages/sync/logs/sync-2026-03-28.log +0 -6
  377. package/packages/sync/logs/sync-2026-03-29.log +0 -12
  378. package/packages/sync/logs/sync-2026-03-30.log +0 -6
  379. package/packages/sync/logs/sync-2026-03-31.log +0 -6
  380. package/packages/sync/logs/sync-2026-04-01.log +0 -6
  381. package/packages/sync/logs/sync-2026-04-02.log +0 -6
  382. package/packages/sync/package-lock.json +0 -373
  383. package/packages/sync/package.json +0 -16
  384. package/packages/sync/run-sync.bat +0 -18
  385. package/packages/sync/run-sync.mjs +0 -46
  386. package/packages/sync/setup-scheduler.mjs +0 -119
  387. package/packages/sync/structured-sync.mjs +0 -187
  388. package/packages/sync/sync-to-obsidian.mjs +0 -264
  389. package/packages/sync/upload-pdca-to-notion.mjs +0 -495
  390. package/tsconfig.base.json +0 -18
@@ -1,42 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { maskPII } from '../src/pack/pii-masker.js';
3
-
4
- describe('PII Masker', () => {
5
- it('이메일 마스킹', () => {
6
- const { masked, redactedCount } = maskPII('Contact user@example.com for help');
7
- expect(masked).not.toContain('user@example.com');
8
- expect(masked).toContain('[REDACTED:email]');
9
- expect(redactedCount).toBe(1);
10
- });
11
-
12
- it('API 키 마스킹', () => {
13
- const { masked } = maskPII('Use sk_live_1234567890abcdefghij for auth');
14
- expect(masked).toContain('[REDACTED:api_key]');
15
- });
16
-
17
- it('AWS 키 마스킹', () => {
18
- const { masked } = maskPII('AWS key: AKIAIOSFODNN7EXAMPLE');
19
- expect(masked).toContain('[REDACTED:aws_key]');
20
- });
21
-
22
- it('JWT 마스킹', () => {
23
- const { masked } = maskPII('token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U');
24
- expect(masked).toContain('[REDACTED:jwt]');
25
- });
26
-
27
- it('PII 없으면 변경 없음', () => {
28
- const text = 'React 컴포넌트 패턴에 대한 가이드';
29
- const { masked, redactedCount } = maskPII(text);
30
- expect(masked).toBe(text);
31
- expect(redactedCount).toBe(0);
32
- });
33
-
34
- it('복수 PII 동시 마스킹', () => {
35
- const { masked, redactedCount, redactedTypes } = maskPII(
36
- 'admin@test.com has key sk_test_abcdefghijklmnopqrstuvwxyz1234'
37
- );
38
- expect(redactedCount).toBeGreaterThanOrEqual(2);
39
- expect(redactedTypes).toContain('email');
40
- expect(redactedTypes).toContain('api_key');
41
- });
42
- });
@@ -1,62 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
-
3
- // profile-card SVG 생성 로직 검증
4
- // 실제 함수는 graph 패키지이므로 SVG 구조 검증용 단위 테스트
5
-
6
- function generateSimpleSVG(data: {
7
- documentCount: number;
8
- clusterCount: number;
9
- edgeCount: number;
10
- clusters: Array<{ label: string; nodeCount: number; color: string }>;
11
- tags: Array<{ tag: string; count: number }>;
12
- }): string {
13
- const W = 800, H = 420;
14
- const esc = (s: string) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;');
15
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${H}">
16
- <text>${data.documentCount} docs</text>
17
- ${data.clusters.map(c => `<circle fill="${c.color}"/>`).join('')}
18
- ${data.tags.map(t => `<text>#${esc(t.tag)}</text>`).join('')}
19
- </svg>`;
20
- }
21
-
22
- describe('Profile Card SVG', () => {
23
- it('유효한 SVG 생성', () => {
24
- const svg = generateSimpleSVG({
25
- documentCount: 100, clusterCount: 5, edgeCount: 200,
26
- clusters: [{ label: 'AI', nodeCount: 50, color: '#6366f1' }],
27
- tags: [{ tag: 'react', count: 10 }],
28
- });
29
- expect(svg).toContain('<svg');
30
- expect(svg).toContain('100 docs');
31
- });
32
-
33
- it('클러스터 컬러 포함', () => {
34
- const svg = generateSimpleSVG({
35
- documentCount: 10, clusterCount: 2, edgeCount: 5,
36
- clusters: [
37
- { label: 'A', nodeCount: 5, color: '#ff0000' },
38
- { label: 'B', nodeCount: 5, color: '#00ff00' },
39
- ],
40
- tags: [],
41
- });
42
- expect(svg).toContain('#ff0000');
43
- expect(svg).toContain('#00ff00');
44
- });
45
-
46
- it('태그 이스케이프', () => {
47
- const svg = generateSimpleSVG({
48
- documentCount: 1, clusterCount: 1, edgeCount: 0,
49
- clusters: [], tags: [{ tag: '<script>', count: 1 }],
50
- });
51
- expect(svg).not.toContain('<script>');
52
- expect(svg).toContain('&lt;script');
53
- });
54
-
55
- it('빈 데이터도 에러 없이 생성', () => {
56
- const svg = generateSimpleSVG({
57
- documentCount: 0, clusterCount: 0, edgeCount: 0,
58
- clusters: [], tags: [],
59
- });
60
- expect(svg).toContain('<svg');
61
- });
62
- });
@@ -1,29 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { rrfFusion } from '../src/search/rrf.js';
3
-
4
- describe('rrfFusion', () => {
5
- it('양쪽 리스트에 있는 항목이 상위', () => {
6
- const listA = [{ chunkId: 'a', score: 0.9 }, { chunkId: 'b', score: 0.8 }];
7
- const listB = [{ chunkId: 'b', score: 0.95 }, { chunkId: 'c', score: 0.7 }];
8
- const result = rrfFusion(listA, listB, 60, 10);
9
- expect(result[0].chunkId).toBe('b'); // 양쪽 모두 등장
10
- });
11
-
12
- it('limit 적용', () => {
13
- const listA = [{ chunkId: 'a', score: 1 }, { chunkId: 'b', score: 0.9 }, { chunkId: 'c', score: 0.8 }];
14
- const result = rrfFusion(listA, [], 60, 2);
15
- expect(result.length).toBe(2);
16
- });
17
-
18
- it('빈 리스트 처리', () => {
19
- const result = rrfFusion([], [], 60, 10);
20
- expect(result).toEqual([]);
21
- });
22
-
23
- it('k 값에 따라 점수 변동', () => {
24
- const list = [{ chunkId: 'a', score: 1 }];
25
- const r1 = rrfFusion(list, [], 10, 10); // 1/(10+1) = 0.0909
26
- const r2 = rrfFusion(list, [], 60, 10); // 1/(60+1) = 0.0164
27
- expect(r1[0].score).toBeGreaterThan(r2[0].score);
28
- });
29
- });
@@ -1,139 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
- import { createSqliteVecStore } from '../src/store/sqlite-vec.js';
3
- import { createSearchEngine } from '../src/search/index.js';
4
- import type { VectorStore } from '../src/store/types.js';
5
- import type { Embedder } from '../src/indexer/embedder.js';
6
-
7
- const DIMS = 4;
8
-
9
- // 고정 벡터를 반환하는 테스트용 embedder
10
- function createMockEmbedder(): Embedder {
11
- return {
12
- modelName: 'test-mock',
13
- dimensions: DIMS,
14
- embed: async (text: string) => {
15
- // 간단한 결정적 벡터 생성: 텍스트 길이 기반
16
- const len = text.length;
17
- return [len % 3 / 3, len % 5 / 5, len % 7 / 7, len % 11 / 11];
18
- },
19
- embedBatch: async (texts: string[]) => {
20
- return Promise.all(texts.map(t => {
21
- const len = t.length;
22
- return [len % 3 / 3, len % 5 / 5, len % 7 / 7, len % 11 / 11];
23
- }));
24
- },
25
- };
26
- }
27
-
28
- let store: VectorStore;
29
- let embedder: Embedder;
30
-
31
- beforeEach(async () => {
32
- store = createSqliteVecStore(':memory:', DIMS);
33
- await store.initialize();
34
- embedder = createMockEmbedder();
35
-
36
- // 테스트 문서 3개 삽입
37
- await store.upsertDocument({
38
- id: 'doc-react', filePath: 'react-patterns.md', title: 'React 상태관리 패턴',
39
- content: 'React 상태관리 패턴에 대한 종합 가이드', frontmatter: {},
40
- tags: ['react', 'frontend'], lastModified: '2026-01-01', contentHash: 'r1',
41
- });
42
- await store.upsertChunks([{
43
- id: 'doc-react#0', documentId: 'doc-react',
44
- content: 'React useState useReducer 패턴 비교 분석',
45
- heading: 'React 상태관리', startLine: 1, endLine: 5, tokenCount: 10,
46
- embedding: [0.9, 0.1, 0.2, 0.1],
47
- }]);
48
-
49
- await store.upsertDocument({
50
- id: 'doc-auth', filePath: 'auth-design.md', title: 'OAuth 인증 설계',
51
- content: 'OAuth 2.0 인증 흐름 설계 문서', frontmatter: {},
52
- tags: ['auth', 'security'], lastModified: '2026-01-02', contentHash: 'a1',
53
- });
54
- await store.upsertChunks([{
55
- id: 'doc-auth#0', documentId: 'doc-auth',
56
- content: 'OAuth 2.0 Authorization Code Flow with PKCE',
57
- heading: 'OAuth 인증', startLine: 1, endLine: 5, tokenCount: 8,
58
- embedding: [0.1, 0.9, 0.1, 0.2],
59
- }]);
60
-
61
- await store.upsertDocument({
62
- id: 'doc-deploy', filePath: 'deploy-lessons.md', title: '배포 실패 교훈',
63
- content: '프로덕션 배포 중 발생한 장애 회고', frontmatter: {},
64
- tags: ['devops', 'lessons'], lastModified: '2026-01-03', contentHash: 'd1',
65
- });
66
- await store.upsertChunks([{
67
- id: 'doc-deploy#0', documentId: 'doc-deploy',
68
- content: '배포 실패 롤백 전략과 카나리 배포 교훈',
69
- heading: '배포 교훈', startLine: 1, endLine: 5, tokenCount: 12,
70
- embedding: [0.2, 0.1, 0.9, 0.1],
71
- }]);
72
- });
73
-
74
- afterEach(async () => {
75
- await store.close();
76
- });
77
-
78
- describe('Search Integration (BM25 + Semantic + RRF)', () => {
79
- it('자연어 쿼리로 결과 반환', async () => {
80
- const engine = createSearchEngine({ store, embedder });
81
- const results = await engine.search({ query: 'React 상태관리', limit: 5 });
82
-
83
- expect(results.length).toBeGreaterThan(0);
84
- // 각 결과에 필수 필드 존재
85
- for (const r of results) {
86
- expect(r.chunk).toBeDefined();
87
- expect(r.document).toBeDefined();
88
- expect(r.score).toBeGreaterThan(0);
89
- expect(r.highlights).toBeDefined();
90
- }
91
- });
92
-
93
- it('태그 필터링 동작', async () => {
94
- const engine = createSearchEngine({ store, embedder });
95
- const results = await engine.search({
96
- query: 'React 상태관리 OAuth 배포',
97
- limit: 10,
98
- tags: ['auth'],
99
- });
100
-
101
- // auth 태그가 있는 문서만 반환
102
- for (const r of results) {
103
- expect(r.document.tags).toContain('auth');
104
- }
105
- });
106
-
107
- it('limit 제한 동작', async () => {
108
- const engine = createSearchEngine({ store, embedder });
109
- const results = await engine.search({ query: 'React OAuth 배포', limit: 1 });
110
- expect(results.length).toBeLessThanOrEqual(1);
111
- });
112
-
113
- it('빈 쿼리도 에러 없이 처리', async () => {
114
- const engine = createSearchEngine({ store, embedder });
115
- const results = await engine.search({ query: '', limit: 5 });
116
- expect(Array.isArray(results)).toBe(true);
117
- });
118
-
119
- it('결과에 highlights 포함', async () => {
120
- const engine = createSearchEngine({ store, embedder });
121
- const results = await engine.search({ query: 'React', limit: 5 });
122
-
123
- const withHighlights = results.filter(r => r.highlights.length > 0);
124
- // BM25가 매칭하면 highlights가 있어야 함
125
- if (results.length > 0) {
126
- expect(withHighlights.length).toBeGreaterThanOrEqual(0);
127
- }
128
- });
129
-
130
- it('존재하지 않는 태그 필터 시 빈 결과', async () => {
131
- const engine = createSearchEngine({ store, embedder });
132
- const results = await engine.search({
133
- query: 'React',
134
- limit: 10,
135
- tags: ['nonexistent-tag'],
136
- });
137
- expect(results).toEqual([]);
138
- });
139
- });
@@ -1,80 +0,0 @@
1
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
- import { createSqliteVecStore } from '../src/store/sqlite-vec.js';
3
- import type { VectorStore } from '../src/store/types.js';
4
-
5
- let store: VectorStore;
6
-
7
- beforeEach(async () => {
8
- store = createSqliteVecStore(':memory:', 4); // 4차원 (테스트용)
9
- await store.initialize();
10
- });
11
-
12
- afterEach(async () => {
13
- await store.close();
14
- });
15
-
16
- describe('VectorStore', () => {
17
- it('초기 상태 비어있음', async () => {
18
- const stats = await store.getStats();
19
- expect(stats.documentCount).toBe(0);
20
- expect(stats.chunkCount).toBe(0);
21
- });
22
-
23
- it('document + chunk upsert 및 조회', async () => {
24
- await store.upsertDocument({
25
- id: 'doc1', filePath: 'test.md', title: 'Test', content: 'Hello',
26
- frontmatter: {}, tags: ['test'], lastModified: '2026-01-01', contentHash: 'abc',
27
- });
28
- await store.upsertChunks([{
29
- id: 'doc1#0', documentId: 'doc1', content: 'Hello world',
30
- heading: 'Test', startLine: 1, endLine: 2, tokenCount: 3,
31
- embedding: [0.1, 0.2, 0.3, 0.4],
32
- }]);
33
-
34
- const doc = await store.getDocument('doc1');
35
- expect(doc).not.toBeNull();
36
- expect(doc!.title).toBe('Test');
37
-
38
- const chunk = await store.getChunk('doc1#0');
39
- expect(chunk).not.toBeNull();
40
- expect(chunk!.content).toBe('Hello world');
41
-
42
- const stats = await store.getStats();
43
- expect(stats.documentCount).toBe(1);
44
- expect(stats.chunkCount).toBe(1);
45
- });
46
-
47
- it('semantic search', async () => {
48
- await store.upsertDocument({
49
- id: 'doc1', filePath: 'a.md', title: 'A', content: 'A',
50
- frontmatter: {}, tags: [], lastModified: '2026-01-01', contentHash: 'a',
51
- });
52
- await store.upsertChunks([{
53
- id: 'doc1#0', documentId: 'doc1', content: 'Content A',
54
- heading: 'A', startLine: 1, endLine: 1, tokenCount: 2,
55
- embedding: [1.0, 0.0, 0.0, 0.0],
56
- }]);
57
-
58
- const results = await store.searchSemantic([1.0, 0.0, 0.0, 0.0], 5);
59
- expect(results.length).toBe(1);
60
- expect(results[0].chunkId).toBe('doc1#0');
61
- expect(results[0].score).toBeGreaterThan(0);
62
- });
63
-
64
- it('deleteByDocumentId', async () => {
65
- await store.upsertDocument({
66
- id: 'doc1', filePath: 'a.md', title: 'A', content: 'A',
67
- frontmatter: {}, tags: [], lastModified: '2026-01-01', contentHash: 'a',
68
- });
69
- await store.upsertChunks([{
70
- id: 'doc1#0', documentId: 'doc1', content: 'Content',
71
- heading: 'A', startLine: 1, endLine: 1, tokenCount: 1,
72
- embedding: [0.1, 0.2, 0.3, 0.4],
73
- }]);
74
-
75
- await store.deleteByDocumentId('doc1');
76
- expect(await store.getDocument('doc1')).toBeNull();
77
- const stats = await store.getStats();
78
- expect(stats.chunkCount).toBe(0);
79
- });
80
- });
Binary file
@@ -1 +0,0 @@
1
- import{c as q,g as K}from"./index-DMEe2diW.js";function L(d,m){for(var w=0;w<m.length;w++){const f=m[w];if(typeof f!="string"&&!Array.isArray(f)){for(const a in f)if(a!=="default"&&!(a in d)){const j=Object.getOwnPropertyDescriptor(f,a);j&&Object.defineProperty(d,a,j.get?j:{enumerable:!0,get:()=>f[a]})}}}return Object.freeze(Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}))}var F={},T;function Q(){return T||(T=1,(function(){function d(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var m=typeof Object.defineProperties=="function"?Object.defineProperty:function(t,e,o){return t==Array.prototype||t==Object.prototype||(t[e]=o.value),t};function w(t){t=[typeof globalThis=="object"&&globalThis,t,typeof window=="object"&&window,typeof self=="object"&&self,typeof q=="object"&&q];for(var e=0;e<t.length;++e){var o=t[e];if(o&&o.Math==Math)return o}throw Error("Cannot find global object")}var f=w(this);function a(t,e){if(e)t:{var o=f;t=t.split(".");for(var i=0;i<t.length-1;i++){var s=t[i];if(!(s in o))break t;o=o[s]}t=t[t.length-1],i=o[t],e=e(i),e!=i&&e!=null&&m(o,t,{configurable:!0,writable:!0,value:e})}}a("Symbol",function(t){function e(l){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new o(i+(l||"")+"_"+s++,l)}function o(l,n){this.g=l,m(this,"description",{configurable:!0,writable:!0,value:n})}if(t)return t;o.prototype.toString=function(){return this.g};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",s=0;return e}),a("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<e.length;o++){var i=f[e[o]];typeof i=="function"&&typeof i.prototype[t]!="function"&&m(i.prototype,t,{configurable:!0,writable:!0,value:function(){return j(d(this))}})}return t});function j(t){return t={next:t},t[Symbol.iterator]=function(){return this},t}function A(t){var e=typeof Symbol<"u"&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:d(t)}}function E(){this.i=!1,this.g=null,this.o=void 0,this.j=1,this.m=0,this.h=null}function S(t){if(t.i)throw new TypeError("Generator is already running");t.i=!0}E.prototype.l=function(t){this.o=t};function _(t,e){t.h={F:e,G:!0},t.j=t.m}E.prototype.return=function(t){this.h={return:t},this.j=this.m};function U(t){this.g=new E,this.h=t}function H(t,e){S(t.g);var o=t.g.g;return o?C(t,"return"in o?o.return:function(i){return{value:i,done:!0}},e,t.g.return):(t.g.return(e),b(t))}function C(t,e,o,i){try{var s=e.call(t.g.g,o);if(!(s instanceof Object))throw new TypeError("Iterator result "+s+" is not an object");if(!s.done)return t.g.i=!1,s;var l=s.value}catch(n){return t.g.g=null,_(t.g,n),b(t)}return t.g.g=null,i.call(t.g,l),b(t)}function b(t){for(;t.g.j;)try{var e=t.h(t.g);if(e)return t.g.i=!1,{value:e.value,done:!1}}catch(o){t.g.o=void 0,_(t.g,o)}if(t.g.i=!1,t.g.h){if(e=t.g.h,t.g.h=null,e.G)throw e.F;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function I(t){this.next=function(e){return S(t.g),t.g.g?e=C(t,t.g.g.next,e,t.g.l):(t.g.l(e),e=b(t)),e},this.throw=function(e){return S(t.g),t.g.g?e=C(t,t.g.g.throw,e,t.g.l):(_(t.g,e),e=b(t)),e},this.return=function(e){return H(t,e)},this[Symbol.iterator]=function(){return this}}function G(t){function e(i){return t.next(i)}function o(i){return t.throw(i)}return new Promise(function(i,s){function l(n){n.done?i(n.value):Promise.resolve(n.value).then(e,o).then(l,s)}l(t.next())})}a("Promise",function(t){function e(n){this.h=0,this.i=void 0,this.g=[],this.o=!1;var r=this.j();try{n(r.resolve,r.reject)}catch(u){r.reject(u)}}function o(){this.g=null}function i(n){return n instanceof e?n:new e(function(r){r(n)})}if(t)return t;o.prototype.h=function(n){if(this.g==null){this.g=[];var r=this;this.i(function(){r.l()})}this.g.push(n)};var s=f.setTimeout;o.prototype.i=function(n){s(n,0)},o.prototype.l=function(){for(;this.g&&this.g.length;){var n=this.g;this.g=[];for(var r=0;r<n.length;++r){var u=n[r];n[r]=null;try{u()}catch(c){this.j(c)}}}this.g=null},o.prototype.j=function(n){this.i(function(){throw n})},e.prototype.j=function(){function n(c){return function(h){u||(u=!0,c.call(r,h))}}var r=this,u=!1;return{resolve:n(this.A),reject:n(this.l)}},e.prototype.A=function(n){if(n===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(n instanceof e)this.C(n);else{t:switch(typeof n){case"object":var r=n!=null;break t;case"function":r=!0;break t;default:r=!1}r?this.v(n):this.m(n)}},e.prototype.v=function(n){var r=void 0;try{r=n.then}catch(u){this.l(u);return}typeof r=="function"?this.D(r,n):this.m(n)},e.prototype.l=function(n){this.u(2,n)},e.prototype.m=function(n){this.u(1,n)},e.prototype.u=function(n,r){if(this.h!=0)throw Error("Cannot settle("+n+", "+r+"): Promise already settled in state"+this.h);this.h=n,this.i=r,this.h===2&&this.B(),this.H()},e.prototype.B=function(){var n=this;s(function(){if(n.I()){var r=f.console;typeof r<"u"&&r.error(n.i)}},1)},e.prototype.I=function(){if(this.o)return!1;var n=f.CustomEvent,r=f.Event,u=f.dispatchEvent;return typeof u>"u"?!0:(typeof n=="function"?n=new n("unhandledrejection",{cancelable:!0}):typeof r=="function"?n=new r("unhandledrejection",{cancelable:!0}):(n=f.document.createEvent("CustomEvent"),n.initCustomEvent("unhandledrejection",!1,!0,n)),n.promise=this,n.reason=this.i,u(n))},e.prototype.H=function(){if(this.g!=null){for(var n=0;n<this.g.length;++n)l.h(this.g[n]);this.g=null}};var l=new o;return e.prototype.C=function(n){var r=this.j();n.s(r.resolve,r.reject)},e.prototype.D=function(n,r){var u=this.j();try{n.call(r,u.resolve,u.reject)}catch(c){u.reject(c)}},e.prototype.then=function(n,r){function u(v,y){return typeof v=="function"?function(k){try{c(v(k))}catch(D){h(D)}}:y}var c,h,M=new e(function(v,y){c=v,h=y});return this.s(u(n,c),u(r,h)),M},e.prototype.catch=function(n){return this.then(void 0,n)},e.prototype.s=function(n,r){function u(){switch(c.h){case 1:n(c.i);break;case 2:r(c.i);break;default:throw Error("Unexpected state: "+c.h)}}var c=this;this.g==null?l.h(u):this.g.push(u),this.o=!0},e.resolve=i,e.reject=function(n){return new e(function(r,u){u(n)})},e.race=function(n){return new e(function(r,u){for(var c=A(n),h=c.next();!h.done;h=c.next())i(h.value).s(r,u)})},e.all=function(n){var r=A(n),u=r.next();return u.done?i([]):new e(function(c,h){function M(k){return function(D){v[k]=D,y--,y==0&&c(v)}}var v=[],y=0;do v.push(void 0),y++,i(u.value).s(M(v.length-1),h),u=r.next();while(!u.done)})},e});var N=typeof Object.assign=="function"?Object.assign:function(t,e){for(var o=1;o<arguments.length;o++){var i=arguments[o];if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t};a("Object.assign",function(t){return t||N});var z=this||self,R={facingMode:"user",width:640,height:480};function O(t,e){this.video=t,this.i=0,this.h=Object.assign(Object.assign({},R),e)}O.prototype.stop=function(){var t=this,e,o,i,s;return G(new I(new U(function(l){if(t.g){for(e=t.g.getTracks(),o=A(e),i=o.next();!i.done;i=o.next())s=i.value,s.stop();t.g=void 0}l.j=0})))},O.prototype.start=function(){var t=this,e;return G(new I(new U(function(o){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||alert("No navigator.mediaDevices.getUserMedia exists."),e=t.h,o.return(navigator.mediaDevices.getUserMedia({video:{facingMode:e.facingMode,width:e.width,height:e.height}}).then(function(i){$(t,i)}).catch(function(i){var s="Failed to acquire camera feed: "+i;throw console.error(s),alert(s),i}))})))};function P(t){window.requestAnimationFrame(function(){J(t)})}function $(t,e){t.g=e,t.video.srcObject=e,t.video.onloadedmetadata=function(){t.video.play(),P(t)}}function J(t){var e=null;t.video.paused||t.video.currentTime===t.i||(t.i=t.video.currentTime,e=t.h.onFrame()),e?e.then(function(){P(t)}):P(t)}var x=["Camera"],g=z;x[0]in g||typeof g.execScript>"u"||g.execScript("var "+x[0]);for(var p;x.length&&(p=x.shift());)x.length||O===void 0?g[p]&&g[p]!==Object.prototype[p]?g=g[p]:g=g[p]={}:g[p]=O}).call(F)),F}var B=Q();const V=K(B),X=L({__proto__:null,default:V},[B]);export{X as c};
@@ -1,18 +0,0 @@
1
- import{c as fr,g as dn}from"./index-DMEe2diW.js";function yn(j,Q){for(var H=0;H<Q.length;H++){const z=Q[H];if(typeof z!="string"&&!Array.isArray(z)){for(const T in z)if(T!=="default"&&!(T in j)){const w=Object.getOwnPropertyDescriptor(z,T);w&&Object.defineProperty(j,T,w.get?w:{enumerable:!0,get:()=>z[T]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var Jt={},ar;function mn(){return ar||(ar=1,(function(){var j;function Q(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var H=typeof Object.defineProperties=="function"?Object.defineProperty:function(t,e,r){return t==Array.prototype||t==Object.prototype||(t[e]=r.value),t};function z(t){t=[typeof globalThis=="object"&&globalThis,t,typeof window=="object"&&window,typeof self=="object"&&self,typeof fr=="object"&&fr];for(var e=0;e<t.length;++e){var r=t[e];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}var T=z(this);function w(t,e){if(e)t:{var r=T;t=t.split(".");for(var n=0;n<t.length-1;n++){var i=t[n];if(!(i in r))break t;r=r[i]}t=t[t.length-1],n=r[t],e=e(n),e!=n&&e!=null&&H(r,t,{configurable:!0,writable:!0,value:e})}}w("Symbol",function(t){function e(u){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new r(n+(u||"")+"_"+i++,u)}function r(u,o){this.h=u,H(this,"description",{configurable:!0,writable:!0,value:o})}if(t)return t;r.prototype.toString=function(){return this.h};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return e}),w("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),r=0;r<e.length;r++){var n=T[e[r]];typeof n=="function"&&typeof n.prototype[t]!="function"&&H(n.prototype,t,{configurable:!0,writable:!0,value:function(){return hr(Q(this))}})}return t});function hr(t){return t={next:t},t[Symbol.iterator]=function(){return this},t}function F(t){var e=typeof Symbol<"u"&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:Q(t)}}function qt(t){if(!(t instanceof Array)){t=F(t);for(var e,r=[];!(e=t.next()).done;)r.push(e.value);t=r}return t}var pr=typeof Object.assign=="function"?Object.assign:function(t,e){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};w("Object.assign",function(t){return t||pr});var vr=typeof Object.create=="function"?Object.create:function(t){function e(){}return e.prototype=t,new e},bt;if(typeof Object.setPrototypeOf=="function")bt=Object.setPrototypeOf;else{var Et;t:{var dr={a:!0},te={};try{te.__proto__=dr,Et=te.a;break t}catch{}Et=!1}bt=Et?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var ee=bt;function J(t,e){if(t.prototype=vr(e.prototype),t.prototype.constructor=t,ee)ee(t,e);else for(var r in e)if(r!="prototype")if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n)}else t[r]=e[r];t.ya=e.prototype}function _t(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function Ot(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}_t.prototype.u=function(t){this.i=t};function Ft(t,e){t.l={ma:e,na:!0},t.h=t.s||t.v}_t.prototype.return=function(t){this.l={return:t},this.h=this.v};function x(t,e,r){return t.h=r,{value:e}}function yr(t){this.h=new _t,this.i=t}function mr(t,e){Ot(t.h);var r=t.h.j;return r?St(t,"return"in r?r.return:function(n){return{value:n,done:!0}},e,t.h.return):(t.h.return(e),q(t))}function St(t,e,r,n){try{var i=e.call(t.h.j,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return t.h.m=!1,i;var u=i.value}catch(o){return t.h.j=null,Ft(t.h,o),q(t)}return t.h.j=null,n.call(t.h,u),q(t)}function q(t){for(;t.h.h;)try{var e=t.i(t.h);if(e)return t.h.m=!1,{value:e.value,done:!1}}catch(r){t.h.i=void 0,Ft(t.h,r)}if(t.h.m=!1,t.h.l){if(e=t.h.l,t.h.l=null,e.na)throw e.ma;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function gr(t){this.next=function(e){return Ot(t.h),t.h.j?e=St(t,t.h.j.next,e,t.h.u):(t.h.u(e),e=q(t)),e},this.throw=function(e){return Ot(t.h),t.h.j?e=St(t,t.h.j.throw,e,t.h.u):(Ft(t.h,e),e=q(t)),e},this.return=function(e){return mr(t,e)},this[Symbol.iterator]=function(){return this}}function wr(t){function e(n){return t.next(n)}function r(n){return t.throw(n)}return new Promise(function(n,i){function u(o){o.done?n(o.value):Promise.resolve(o.value).then(e,r).then(u,i)}u(t.next())})}function O(t){return wr(new gr(new yr(t)))}w("Promise",function(t){function e(o){this.i=0,this.j=void 0,this.h=[],this.u=!1;var s=this.l();try{o(s.resolve,s.reject)}catch(l){s.reject(l)}}function r(){this.h=null}function n(o){return o instanceof e?o:new e(function(s){s(o)})}if(t)return t;r.prototype.i=function(o){if(this.h==null){this.h=[];var s=this;this.j(function(){s.m()})}this.h.push(o)};var i=T.setTimeout;r.prototype.j=function(o){i(o,0)},r.prototype.m=function(){for(;this.h&&this.h.length;){var o=this.h;this.h=[];for(var s=0;s<o.length;++s){var l=o[s];o[s]=null;try{l()}catch(f){this.l(f)}}}this.h=null},r.prototype.l=function(o){this.j(function(){throw o})},e.prototype.l=function(){function o(f){return function(a){l||(l=!0,f.call(s,a))}}var s=this,l=!1;return{resolve:o(this.I),reject:o(this.m)}},e.prototype.I=function(o){if(o===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(o instanceof e)this.L(o);else{t:switch(typeof o){case"object":var s=o!=null;break t;case"function":s=!0;break t;default:s=!1}s?this.F(o):this.s(o)}},e.prototype.F=function(o){var s=void 0;try{s=o.then}catch(l){this.m(l);return}typeof s=="function"?this.M(s,o):this.s(o)},e.prototype.m=function(o){this.v(2,o)},e.prototype.s=function(o){this.v(1,o)},e.prototype.v=function(o,s){if(this.i!=0)throw Error("Cannot settle("+o+", "+s+"): Promise already settled in state"+this.i);this.i=o,this.j=s,this.i===2&&this.K(),this.H()},e.prototype.K=function(){var o=this;i(function(){if(o.D()){var s=T.console;typeof s<"u"&&s.error(o.j)}},1)},e.prototype.D=function(){if(this.u)return!1;var o=T.CustomEvent,s=T.Event,l=T.dispatchEvent;return typeof l>"u"?!0:(typeof o=="function"?o=new o("unhandledrejection",{cancelable:!0}):typeof s=="function"?o=new s("unhandledrejection",{cancelable:!0}):(o=T.document.createEvent("CustomEvent"),o.initCustomEvent("unhandledrejection",!1,!0,o)),o.promise=this,o.reason=this.j,l(o))},e.prototype.H=function(){if(this.h!=null){for(var o=0;o<this.h.length;++o)u.i(this.h[o]);this.h=null}};var u=new r;return e.prototype.L=function(o){var s=this.l();o.T(s.resolve,s.reject)},e.prototype.M=function(o,s){var l=this.l();try{o.call(s,l.resolve,l.reject)}catch(f){l.reject(f)}},e.prototype.then=function(o,s){function l(h,c){return typeof h=="function"?function(v){try{f(h(v))}catch(d){a(d)}}:c}var f,a,p=new e(function(h,c){f=h,a=c});return this.T(l(o,f),l(s,a)),p},e.prototype.catch=function(o){return this.then(void 0,o)},e.prototype.T=function(o,s){function l(){switch(f.i){case 1:o(f.j);break;case 2:s(f.j);break;default:throw Error("Unexpected state: "+f.i)}}var f=this;this.h==null?u.i(l):this.h.push(l),this.u=!0},e.resolve=n,e.reject=function(o){return new e(function(s,l){l(o)})},e.race=function(o){return new e(function(s,l){for(var f=F(o),a=f.next();!a.done;a=f.next())n(a.value).T(s,l)})},e.all=function(o){var s=F(o),l=s.next();return l.done?n([]):new e(function(f,a){function p(v){return function(d){h[v]=d,c--,c==0&&f(h)}}var h=[],c=0;do h.push(void 0),c++,n(l.value).T(p(h.length-1),a),l=s.next();while(!l.done)})},e});function Ar(t,e){t instanceof String&&(t+="");var r=0,n=!1,i={next:function(){if(!n&&r<t.length){var u=r++;return{value:e(u,t[u]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}w("Array.prototype.keys",function(t){return t||function(){return Ar(this,function(e){return e})}}),w("Array.prototype.fill",function(t){return t||function(e,r,n){var i=this.length||0;for(0>r&&(r=Math.max(0,i+r)),(n==null||n>i)&&(n=i),n=Number(n),0>n&&(n=Math.max(0,i+n)),r=Number(r||0);r<n;r++)this[r]=e;return this}});function k(t){return t||Array.prototype.fill}w("Int8Array.prototype.fill",k),w("Uint8Array.prototype.fill",k),w("Uint8ClampedArray.prototype.fill",k),w("Int16Array.prototype.fill",k),w("Uint16Array.prototype.fill",k),w("Int32Array.prototype.fill",k),w("Uint32Array.prototype.fill",k),w("Float32Array.prototype.fill",k),w("Float64Array.prototype.fill",k),w("Object.is",function(t){return t||function(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}}),w("Array.prototype.includes",function(t){return t||function(e,r){var n=this;n instanceof String&&(n=String(n));var i=n.length;for(r=r||0,0>r&&(r=Math.max(r+i,0));r<i;r++){var u=n[r];if(u===e||Object.is(u,e))return!0}return!1}}),w("String.prototype.includes",function(t){return t||function(e,r){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(e,r||0)!==-1}});var Tt=this||self;function tt(t,e){t=t.split(".");var r=Tt;t[0]in r||typeof r.execScript>"u"||r.execScript("var "+t[0]);for(var n;t.length&&(n=t.shift());)t.length||e===void 0?r[n]&&r[n]!==Object.prototype[n]?r=r[n]:r=r[n]={}:r[n]=e}function re(t){var e;t:{if((e=Tt.navigator)&&(e=e.userAgent))break t;e=""}return e.indexOf(t)!=-1}var jr=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var r=t.length,n=Array(r),i=typeof t=="string"?t.split(""):t,u=0;u<r;u++)u in i&&(n[u]=e.call(void 0,i[u],u,t));return n},ne={},et=null;function xr(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):"=.".indexOf(t[e-1])!=-1&&(r="=.".indexOf(t[e-2])!=-1?r-2:r-1);var n=new Uint8Array(r),i=0;return br(t,function(u){n[i++]=u}),i!==r?n.subarray(0,i):n}function br(t,e){function r(l){for(;n<t.length;){var f=t.charAt(n++),a=et[f];if(a!=null)return a;if(!/^[\s\xa0]*$/.test(f))throw Error("Unknown base64 encoding at char: "+f)}return l}ie();for(var n=0;;){var i=r(-1),u=r(0),o=r(64),s=r(64);if(s===64&&i===-1)break;e(i<<2|u>>4),o!=64&&(e(u<<4&240|o>>2),s!=64&&e(o<<6&192|s))}}function ie(){if(!et){et={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=t.concat(e[r].split(""));ne[r]=n;for(var i=0;i<n.length;i++){var u=n[i];et[u]===void 0&&(et[u]=i)}}}}var Rt=typeof Uint8Array<"u",oe=!(re("Trident")||re("MSIE"))&&typeof Tt.btoa=="function";function ue(t){if(!oe){var e;e===void 0&&(e=0),ie(),e=ne[e];for(var r=Array(Math.floor(t.length/3)),n=e[64]||"",i=0,u=0;i<t.length-2;i+=3){var o=t[i],s=t[i+1],l=t[i+2],f=e[o>>2];o=e[(o&3)<<4|s>>4],s=e[(s&15)<<2|l>>6],l=e[l&63],r[u++]=f+o+s+l}switch(f=0,l=n,t.length-i){case 2:f=t[i+1],l=e[(f&15)<<2]||n;case 1:t=t[i],r[u]=e[t>>2]+e[(t&3)<<4|f>>4]+l+n}return r.join("")}for(e="";10240<t.length;)e+=String.fromCharCode.apply(null,t.subarray(0,10240)),t=t.subarray(10240);return e+=String.fromCharCode.apply(null,t),btoa(e)}var se=RegExp("[-_.]","g");function Er(t){switch(t){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function le(t){if(!oe)return xr(t);se.test(t)&&(t=t.replace(se,Er)),t=atob(t);for(var e=new Uint8Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var fe;function Ut(){return fe||(fe=new Uint8Array(0))}var rt={},_r=typeof Uint8Array.prototype.slice=="function",b=0,S=0;function ae(t){var e=0>t;t=Math.abs(t);var r=t>>>0;t=Math.floor((t-r)/4294967296),e&&(r=F(ce(r,t)),e=r.next().value,t=r.next().value,r=e),b=r>>>0,S=t>>>0}var Or=typeof BigInt=="function";function ce(t,e){return e=~e,t?t=~t+1:e+=1,[t,e]}function he(t,e){this.i=t>>>0,this.h=e>>>0}function pe(t){if(!t)return ve||(ve=new he(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)ae(Number(t));else if(Or)t=BigInt(t),b=Number(t&BigInt(4294967295))>>>0,S=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+(t[0]==="-");S=b=0;for(var r=t.length,n=e,i=(r-e)%6+e;i<=r;n=i,i+=6)n=Number(t.slice(n,i)),S*=1e6,b=1e6*b+n,4294967296<=b&&(S+=b/4294967296|0,b%=4294967296);e&&(e=F(ce(b,S)),t=e.next().value,e=e.next().value,b=t,S=e)}return new he(b,S)}var ve;function de(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function Pt(){return Error("Failed to read varint, encoding is invalid.")}function ye(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function W(){throw Error("Invalid UTF8")}function me(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var at=void 0,Ct,Fr=typeof TextDecoder<"u",ge,Sr=typeof TextEncoder<"u",we;function Ae(t){if(t!==rt)throw Error("illegal external caller")}function nt(t,e){if(Ae(e),this.V=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}function Nt(){return we||(we=new nt(null,rt))}function je(t){Ae(rt);var e=t.V;return e=e==null||Rt&&e!=null&&e instanceof Uint8Array?e:typeof e=="string"?le(e):null,e==null?e:t.V=e}function Tr(t){if(typeof t=="string")return{buffer:le(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===nt)return{buffer:je(t)||Ut(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function xe(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,Mt(this,t,e)}function Mt(t,e,r){r=r===void 0?{}:r,t.S=r.S===void 0?!1:r.S,e&&(e=Tr(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}xe.prototype.reset=function(){this.h=this.l};function V(t,e){if(t.h=e,e>t.j)throw ye(t.j,e)}function it(t){var e=t.i,r=t.h,n=e[r++],i=n&127;if(n&128&&(n=e[r++],i|=(n&127)<<7,n&128&&(n=e[r++],i|=(n&127)<<14,n&128&&(n=e[r++],i|=(n&127)<<21,n&128&&(n=e[r++],i|=n<<28,n&128&&e[r++]&128&&e[r++]&128&&e[r++]&128&&e[r++]&128&&e[r++]&128)))))throw Pt();return V(t,r),i}function be(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var r=t.h,n=r+e;if(n>t.j)throw ye(e,t.j-r);return t.h=n,r}var Ee=[];function Lt(){this.h=[]}Lt.prototype.length=function(){return this.h.length},Lt.prototype.end=function(){var t=this.h;return this.h=[],t};function _e(t,e,r){for(;0<r||127<e;)t.h.push(e&127|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.h.push(e)}function X(t,e){for(;127<e;)t.h.push(e&127|128),e>>>=7;t.h.push(e)}function Bt(t,e){if(Ee.length){var r=Ee.pop();Mt(r,t,e),t=r}else t=new xe(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}Bt.prototype.setOptions=function(t){t=t===void 0?{}:t,this.ca=t.ca===void 0?!1:t.ca},Bt.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};function Oe(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var r=it(t.h)>>>0;if(e=r>>>3,r&=7,!(0<=r&&5>=r))throw de(r,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=r,!0}function ct(t){switch(t.i){case 0:if(t.i!=0)ct(t);else t:{t=t.h;for(var e=t.h,r=e+10,n=t.i;e<r;)if((n[e++]&128)===0){V(t,e);break t}throw Pt()}break;case 1:t=t.h,V(t,t.h+8);break;case 2:t.i!=2?ct(t):(e=it(t.h)>>>0,t=t.h,V(t,t.h+e));break;case 5:t=t.h,V(t,t.h+4);break;case 3:e=t.l;do{if(!Oe(t))throw Error("Unmatched start-group tag: stream EOF");if(t.i==4){if(t.l!=e)throw Error("Unmatched end-group tag");break}ct(t)}while(!0);break;default:throw de(t.i,t.j)}}var ht=[];function Rr(){this.j=[],this.i=0,this.h=new Lt}function K(t,e){e.length!==0&&(t.j.push(e),t.i+=e.length)}function Ur(t,e){if(e=e.R){K(t,t.h.end());for(var r=0;r<e.length;r++)K(t,je(e[r])||Ut())}}var I=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():void 0;function Y(t,e){return I?t[I]|=e:t.A!==void 0?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function Fe(t,e){I?t[I]&&(t[I]&=~e):t.A!==void 0&&(t.A&=~e)}function A(t){var e;return I?e=t[I]:e=t.A,e??0}function M(t,e){I?t[I]=e:t.A!==void 0?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function Dt(t){return Y(t,1),t}function Pr(t,e){M(e,(t|0)&-51)}function pt(t,e){M(e,(t|18)&-41)}var kt={};function vt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}var ot,Se=[];M(Se,23),ot=Object.freeze(Se);function It(t){if(A(t.o)&2)throw Error("Cannot mutate an immutable Message")}function Gt(t){var e=t.length;(e=e?t[e-1]:void 0)&&vt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function Te(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function C(t,e){return e===-1?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function L(t,e,r,n){It(t),ut(t,e,r,n)}function ut(t,e,r,n){t.j&&(t.j=void 0),e>=t.i||n?Te(t)[e]=r:(t.o[e+t.G]=r,(t=t.B)&&e in t&&delete t[e])}function Ht(t,e,r,n){var i=C(t,e);Array.isArray(i)||(i=ot);var u=A(i);if(u&1||Dt(i),n)u&2||Y(i,2),r&1||Object.freeze(i);else{n=!(r&2);var o=u&2;r&1||!o?n&&u&16&&!o&&Fe(i,16):(i=Dt(Array.prototype.slice.call(i)),ut(t,e,i))}return i}function zt(t,e){var r=C(t,e),n=r==null?r:typeof r=="number"||r==="NaN"||r==="Infinity"||r==="-Infinity"?Number(r):void 0;return n!=null&&n!==r&&ut(t,e,n),n}function Re(t,e,r,n,i){t.h||(t.h={});var u=t.h[r],o=Ht(t,r,3,i);if(!u){var s=o;u=[];var l=!!(A(t.o)&16);o=!!(A(s)&2);var f=s;!i&&o&&(s=Array.prototype.slice.call(s));for(var a=o,p=0;p<s.length;p++){var h=s[p],c=e,v=!1;if(v=v===void 0?!1:v,h=Array.isArray(h)?new c(h):v?new c:void 0,h!==void 0){c=h.o;var d=v=A(c);o&&(d|=2),l&&(d|=16),d!=v&&M(c,d),c=d,a=a||!!(2&c),u.push(h)}}return t.h[r]=u,l=A(s),e=l|33,e=a?e&-9:e|8,l!=e&&(a=s,Object.isFrozen(a)&&(a=Array.prototype.slice.call(a)),M(a,e),s=a),f!==s&&ut(t,r,s),(i||n&&o)&&Y(u,2),n&&Object.freeze(u),u}return i||(i=Object.isFrozen(u),n&&!i?Object.freeze(u):!n&&i&&(u=Array.prototype.slice.call(u),t.h[r]=u)),u}function dt(t,e,r){var n=!!(A(t.o)&2);if(e=Re(t,e,r,n,n),t=Ht(t,r,3,n),!(n||A(t)&8)){for(n=0;n<e.length;n++){if(r=e[n],A(r.o)&2){var i=Le(r,!1);i.j=r}else i=r;r!==i&&(e[n]=i,t[n]=i.o)}Y(t,8)}return e}function B(t,e,r){if(r!=null&&typeof r!="number")throw Error("Value of float/double field must be a number|null|undefined, found "+typeof r+": "+r);L(t,e,r)}function Ue(t,e,r,n,i){It(t);var u=Re(t,r,e,!1,!1);return r=n??new r,t=Ht(t,e,2,!1),i!=null?(u.splice(i,0,r),t.splice(i,0,r.o)):(u.push(r),t.push(r.o)),r.C()&&Fe(t,8),r}function yt(t,e){return t??e}function D(t,e,r){return r=r===void 0?0:r,yt(zt(t,e),r)}var mt;function Cr(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"object":if(t)if(Array.isArray(t)){if((A(t)&128)!==0)return t=Array.prototype.slice.call(t),Gt(t),t}else{if(Rt&&t!=null&&t instanceof Uint8Array)return ue(t);if(t instanceof nt){var e=t.V;return e==null?"":typeof e=="string"?e:t.V=ue(e)}}}return t}function Pe(t,e,r,n){if(t!=null){if(Array.isArray(t))t=Wt(t,e,r,n!==void 0);else if(vt(t)){var i={},u;for(u in t)i[u]=Pe(t[u],e,r,n);t=i}else t=e(t,n);return t}}function Wt(t,e,r,n){var i=A(t);n=n?!!(i&16):void 0,t=Array.prototype.slice.call(t);for(var u=0;u<t.length;u++)t[u]=Pe(t[u],e,r,n);return r(i,t),t}function Nr(t){return t.ja===kt?t.toJSON():Cr(t)}function Mr(t,e){t&128&&Gt(e)}function Ce(t,e,r){if(r=r===void 0?pt:r,t!=null){if(Rt&&t instanceof Uint8Array)return t.length?new nt(new Uint8Array(t),rt):Nt();if(Array.isArray(t)){var n=A(t);return n&2?t:e&&!(n&32)&&(n&16||n===0)?(M(t,n|2),t):(t=Wt(t,Ce,n&4?pt:r,!0),e=A(t),e&4&&e&2&&Object.freeze(t),t)}return t.ja===kt?Me(t):t}}function Ne(t,e,r,n,i,u,o){if(t=t.h&&t.h[r]){if(n=A(t),n&2?n=t:(u=jr(t,Me),pt(n,u),Object.freeze(u),n=u),It(e),o=n==null?ot:Dt([]),n!=null){for(u=!!n.length,t=0;t<n.length;t++){var s=n[t];u=u&&!(A(s.o)&2),o[t]=s.o}u=(u?8:0)|1,t=A(o),(t&u)!==u&&(Object.isFrozen(o)&&(o=Array.prototype.slice.call(o)),M(o,t|u)),e.h||(e.h={}),e.h[r]=n}else e.h&&(e.h[r]=void 0);ut(e,r,o,i)}else L(e,r,Ce(n,u,o),i)}function Me(t){return A(t.o)&2||(t=Le(t,!0),Y(t.o,2)),t}function Le(t,e){var r=t.o,n=[];Y(n,16);var i=t.constructor.h;if(i&&n.push(i),i=t.B,i){n.length=r.length,n.fill(void 0,n.length,r.length);var u={};n[n.length-1]=u}(A(r)&128)!==0&&Gt(n),e=e||t.C()?pt:Pr,u=t.constructor,mt=n,n=new u(n),mt=void 0,t.R&&(n.R=t.R.slice()),u=!!(A(r)&16);for(var o=i?r.length-1:r.length,s=0;s<o;s++)Ne(t,n,s-t.G,r[s],!1,u,e);if(i)for(var l in i)Ne(t,n,+l,i[l],!0,u,e);return n}function R(t,e,r){t==null&&(t=mt),mt=void 0;var n=this.constructor.i||0,i=0<n,u=this.constructor.h,o=!1;if(t==null){t=u?[u]:[];var s=48,l=!0;i&&(n=0,s|=128),M(t,s)}else{if(!Array.isArray(t)||u&&u!==t[0])throw Error();var f=s=Y(t,0);if((l=(16&f)!==0)&&((o=(32&f)!==0)||(f|=32)),i){if(128&f)n=0;else if(0<t.length){var a=t[t.length-1];if(vt(a)&&"g"in a){n=0,f|=128,delete a.g;var p=!0,h;for(h in a){p=!1;break}p&&t.pop()}}}else if(128&f)throw Error();s!==f&&M(t,f)}this.G=(u?0:-1)-n,this.h=void 0,this.o=t;t:{if(u=this.o.length,n=u-1,u&&(u=this.o[n],vt(u))){this.B=u,this.i=n-this.G;break t}e!==void 0&&-1<e?(this.i=Math.max(e,n+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE}if(!i&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(r){e=l&&!o&&!0,i=this.i;var c;for(l=0;l<r.length;l++)o=r[l],o<i?(o+=this.G,(n=t[o])?Be(n,e):t[o]=ot):(c||(c=Te(this)),(n=c[o])?Be(n,e):c[o]=ot)}}R.prototype.toJSON=function(){return Wt(this.o,Nr,Mr)},R.prototype.C=function(){return!!(A(this.o)&2)};function Be(t,e){if(Array.isArray(t)){var r=A(t),n=1;!e||r&2||(n|=16),(r&n)!==n&&M(t,r|n)}}R.prototype.ja=kt,R.prototype.toString=function(){return this.o.toString()};function De(t,e,r){if(r){var n={},i;for(i in r){var u=r[i],o=u.qa;o||(n.J=u.wa||u.oa.W,u.ia?(n.aa=ze(u.ia),o=(function(s){return function(l,f,a){return s.J(l,f,a,s.aa)}})(n)):u.ka?(n.Z=We(u.da.P,u.ka),o=(function(s){return function(l,f,a){return s.J(l,f,a,s.Z)}})(n)):o=n.J,u.qa=o),o(e,t,u.da),n={J:n.J,aa:n.aa,Z:n.Z}}}Ur(e,t)}var gt=Symbol();function ke(t,e,r){return t[gt]||(t[gt]=function(n,i){return e(n,i,r)})}function Ie(t){var e=t[gt];if(!e){var r=Xt(t);e=function(n,i){return Ve(n,i,r)},t[gt]=e}return e}function Lr(t){var e=t.ia;if(e)return Ie(e);if(e=t.va)return ke(t.da.P,e,t.ka)}function Br(t){var e=Lr(t),r=t.da,n=t.oa.U;return e?function(i,u){return n(i,u,r,e)}:function(i,u){return n(i,u,r)}}function Ge(t,e){var r=t[e];return typeof r=="function"&&r.length===0&&(r=r(),t[e]=r),Array.isArray(r)&&(lt in r||st in r||0<r.length&&typeof r[0]=="function")?r:void 0}function He(t,e,r,n,i,u){e.P=t[0];var o=1;if(t.length>o&&typeof t[o]!="number"){var s=t[o++];r(e,s)}for(;o<t.length;){r=t[o++];for(var l=o+1;l<t.length&&typeof t[l]!="number";)l++;switch(s=t[o++],l-=o,l){case 0:n(e,r,s);break;case 1:(l=Ge(t,o))?(o++,i(e,r,s,l)):n(e,r,s,t[o++]);break;case 2:l=o++,l=Ge(t,l),i(e,r,s,l,t[o++]);break;case 3:u(e,r,s,t[o++],t[o++],t[o++]);break;case 4:u(e,r,s,t[o++],t[o++],t[o++],t[o++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return e}var wt=Symbol();function ze(t){var e=t[wt];if(!e){var r=Vt(t);e=function(n,i){return Xe(n,i,r)},t[wt]=e}return e}function We(t,e){var r=t[wt];return r||(r=function(n,i){return De(n,i,e)},t[wt]=r),r}var st=Symbol();function Dr(t,e){t.push(e)}function kr(t,e,r){t.push(e,r.W)}function Ir(t,e,r,n){var i=ze(n),u=Vt(n).P,o=r.W;t.push(e,function(s,l,f){return o(s,l,f,u,i)})}function Gr(t,e,r,n,i,u){var o=We(n,u),s=r.W;t.push(e,function(l,f,a){return s(l,f,a,n,o)})}function Vt(t){var e=t[st];return e||(e=He(t,t[st]=[],Dr,kr,Ir,Gr),lt in t&&st in t&&(t.length=0),e)}var lt=Symbol();function Hr(t,e){t[0]=e}function zr(t,e,r,n){var i=r.U;t[e]=n?function(u,o,s){return i(u,o,s,n)}:i}function Wr(t,e,r,n,i){var u=r.U,o=Ie(n),s=Xt(n).P;t[e]=function(l,f,a){return u(l,f,a,s,o,i)}}function Vr(t,e,r,n,i,u,o){var s=r.U,l=ke(n,i,u);t[e]=function(f,a,p){return s(f,a,p,n,l,o)}}function Xt(t){var e=t[lt];return e||(e=He(t,t[lt]={},Hr,zr,Wr,Vr),lt in t&&st in t&&(t.length=0),e)}function Ve(t,e,r){for(;Oe(e)&&e.i!=4;){var n=e.l,i=r[n];if(!i){var u=r[0];u&&(u=u[n])&&(i=r[n]=Br(u))}if(!i||!i(e,t,n)){i=e,n=t,u=i.j,ct(i);var o=i;if(!o.ca){if(i=o.h.h-u,o.h.h=u,o=o.h,i==0)i=Nt();else{if(u=be(o,i),o.S&&o.m)i=o.i.subarray(u,u+i);else{o=o.i;var s=u;i=u+i,i=s===i?Ut():_r?o.slice(s,i):new Uint8Array(o.subarray(s,i))}i=i.length==0?Nt():new nt(i,rt)}(u=n.R)?u.push(i):n.R=[i]}}}return t}function Xe(t,e,r){for(var n=r.length,i=n%2==1,u=i?1:0;u<n;u+=2)(0,r[u+1])(e,t,r[u]);De(t,e,i?r[0]:void 0)}function ft(t,e){return{U:t,W:e}}var N=ft(function(t,e,r){if(t.i!==5)return!1;t=t.h;var n=t.i,i=t.h,u=n[i],o=n[i+1],s=n[i+2];return n=n[i+3],V(t,t.h+4),o=(u<<0|o<<8|s<<16|n<<24)>>>0,t=2*(o>>31)+1,u=o>>>23&255,o&=8388607,L(e,r,u==255?o?NaN:1/0*t:u==0?t*Math.pow(2,-149)*o:t*Math.pow(2,u-150)*(o+Math.pow(2,23))),!0},function(t,e,r){if(e=zt(e,r),e!=null){X(t.h,8*r+5),t=t.h;var n=+e;n===0?0<1/n?b=S=0:(S=0,b=2147483648):isNaN(n)?(S=0,b=2147483647):(n=(r=0>n?-2147483648:0)?-n:n,34028234663852886e22<n?(S=0,b=(r|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),S=0,b=(r|n)>>>0):(e=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-e),n=Math.round(8388608*n),16777216<=n&&++e,S=0,b=(r|e+127<<23|n&8388607)>>>0)),r=b,t.h.push(r>>>0&255),t.h.push(r>>>8&255),t.h.push(r>>>16&255),t.h.push(r>>>24&255)}}),Xr=ft(function(t,e,r){if(t.i!==0)return!1;var n=t.h,i=0,u=t=0,o=n.i,s=n.h;do{var l=o[s++];i|=(l&127)<<u,u+=7}while(32>u&&l&128);for(32<u&&(t|=(l&127)>>4),u=3;32>u&&l&128;u+=7)l=o[s++],t|=(l&127)<<u;if(V(n,s),128>l)n=i>>>0,l=t>>>0,(t=l&2147483648)&&(n=~n+1>>>0,l=~l>>>0,n==0&&(l=l+1>>>0)),n=4294967296*l+(n>>>0);else throw Pt();return L(e,r,t?-n:n),!0},function(t,e,r){e=C(e,r),e!=null&&(typeof e=="string"&&pe(e),e!=null&&(X(t.h,8*r),typeof e=="number"?(t=t.h,ae(e),_e(t,b,S)):(r=pe(e),_e(t.h,r.i,r.h))))}),Yr=ft(function(t,e,r){return t.i!==0?!1:(L(e,r,it(t.h)),!0)},function(t,e,r){if(e=C(e,r),e!=null&&e!=null)if(X(t.h,8*r),t=t.h,r=e,0<=r)X(t,r);else{for(e=0;9>e;e++)t.h.push(r&127|128),r>>=7;t.h.push(1)}}),Ye=ft(function(t,e,r){if(t.i!==2)return!1;var n=it(t.h)>>>0;t=t.h;var i=be(t,n);if(t=t.i,Fr){var u=t,o;(o=Ct)||(o=Ct=new TextDecoder("utf-8",{fatal:!0})),t=i+n,u=i===0&&t===u.length?u:u.subarray(i,t);try{var s=o.decode(u)}catch(p){if(at===void 0){try{o.decode(new Uint8Array([128]))}catch{}try{o.decode(new Uint8Array([97])),at=!0}catch{at=!1}}throw!at&&(Ct=void 0),p}}else{s=i,n=s+n,i=[];for(var l=null,f,a;s<n;)f=t[s++],128>f?i.push(f):224>f?s>=n?W():(a=t[s++],194>f||(a&192)!==128?(s--,W()):i.push((f&31)<<6|a&63)):240>f?s>=n-1?W():(a=t[s++],(a&192)!==128||f===224&&160>a||f===237&&160<=a||((u=t[s++])&192)!==128?(s--,W()):i.push((f&15)<<12|(a&63)<<6|u&63)):244>=f?s>=n-2?W():(a=t[s++],(a&192)!==128||(f<<28)+(a-144)>>30!==0||((u=t[s++])&192)!==128||((o=t[s++])&192)!==128?(s--,W()):(f=(f&7)<<18|(a&63)<<12|(u&63)<<6|o&63,f-=65536,i.push((f>>10&1023)+55296,(f&1023)+56320))):W(),8192<=i.length&&(l=me(l,i),i.length=0);s=me(l,i)}return L(e,r,s),!0},function(t,e,r){if(e=C(e,r),e!=null){var n=!1;if(n=n===void 0?!1:n,Sr){if(n&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(ge||(ge=new TextEncoder)).encode(e)}else{for(var i=0,u=new Uint8Array(3*e.length),o=0;o<e.length;o++){var s=e.charCodeAt(o);if(128>s)u[i++]=s;else{if(2048>s)u[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&o<e.length){var l=e.charCodeAt(++o);if(56320<=l&&57343>=l){s=1024*(s-55296)+l-56320+65536,u[i++]=s>>18|240,u[i++]=s>>12&63|128,u[i++]=s>>6&63|128,u[i++]=s&63|128;continue}else o--}if(n)throw Error("Found an unpaired surrogate");s=65533}u[i++]=s>>12|224,u[i++]=s>>6&63|128}u[i++]=s&63|128}}e=i===u.length?u:u.subarray(0,i)}X(t.h,8*r+2),X(t.h,e.length),K(t,t.h.end()),K(t,e)}}),Ke=ft(function(t,e,r,n,i){if(t.i!==2)return!1;e=Ue(e,r,n),r=t.h.j,n=it(t.h)>>>0;var u=t.h.h+n,o=u-r;if(0>=o&&(t.h.j=u,i(e,t,void 0,void 0,void 0),o=u-t.h.h),o)throw Error("Message parsing ended unexpectedly. Expected to read "+(n+" bytes, instead read "+(n-o)+" bytes, either the data ended unexpectedly or the message misreported its own length"));return t.h.h=u,t.h.j=r,!0},function(t,e,r,n,i){if(e=dt(e,n,r),e!=null)for(n=0;n<e.length;n++){var u=t;X(u.h,8*r+2);var o=u.h.end();K(u,o),o.push(u.i),u=o,i(e[n],t),o=t;var s=u.pop();for(s=o.i+o.h.length()-s;127<s;)u.push(s&127|128),s>>>=7,o.i++;u.push(s),o.i++}});function Yt(t){return function(e,r){t:{if(ht.length){var n=ht.pop();n.setOptions(r),Mt(n.h,e,r),e=n}else e=new Bt(e,r);try{var i=Xt(t),u=Ve(new i.P,e,i);break t}finally{i=e.h,i.i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>ht.length&&ht.push(e)}u=void 0}return u}}function Kt(t){return function(){var e=new Rr;Xe(this,e,Vt(t)),K(e,e.h.end());for(var r=new Uint8Array(e.i),n=e.j,i=n.length,u=0,o=0;o<i;o++){var s=n[o];r.set(s,u),u+=s.length}return e.j=[r],r}}function Z(t){R.call(this,t)}J(Z,R);var Ze=[Z,1,Yr,2,N,3,Ye,4,Ye];Z.prototype.l=Kt(Ze);function Zt(t){R.call(this,t,-1,Kr)}J(Zt,R),Zt.prototype.addClassification=function(t,e){return Ue(this,1,Z,t,e),this};var Kr=[1],$e=Yt([Zt,1,Ke,Ze]);function $(t){R.call(this,t)}J($,R);var Qe=[$,1,N,2,N,3,N,4,N,5,N];$.prototype.l=Kt(Qe);function Je(t){R.call(this,t,-1,Zr)}J(Je,R);var Zr=[1],qe=Yt([Je,1,Ke,Qe]);function At(t){R.call(this,t)}J(At,R);var tr=[At,1,N,2,N,3,N,4,N,5,N,6,Xr],$r=Yt(tr);At.prototype.l=Kt(tr);function er(t,e,r){if(r=t.createShader(r===0?t.VERTEX_SHADER:t.FRAGMENT_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw Error(`Could not compile WebGL shader.
2
-
3
- `+t.getShaderInfoLog(r));return r}function rr(t){return dt(t,Z,1).map(function(e){var r=C(e,1);return{index:r??0,score:D(e,2),label:C(e,3)!=null?yt(C(e,3),""):void 0,displayName:C(e,4)!=null?yt(C(e,4),""):void 0}})}function nr(t){return{x:D(t,1),y:D(t,2),z:D(t,3),visibility:zt(t,4)!=null?D(t,4):void 0}}function ir(t){return t.map(function(e){return dt(qe(e),$,1).map(nr)})}function $t(t,e){this.i=t,this.h=e,this.m=0}function or(t,e,r){return Qr(t,e),typeof t.h.canvas.transferToImageBitmap=="function"?Promise.resolve(t.h.canvas.transferToImageBitmap()):r?Promise.resolve(t.h.canvas):typeof createImageBitmap=="function"?createImageBitmap(t.h.canvas):(t.j===void 0&&(t.j=document.createElement("canvas")),new Promise(function(n){t.j.height=t.h.canvas.height,t.j.width=t.h.canvas.width,t.j.getContext("2d",{}).drawImage(t.h.canvas,0,0,t.h.canvas.width,t.h.canvas.height),n(t.j)}))}function Qr(t,e){var r=t.h;if(t.s===void 0){var n=er(r,`
4
- attribute vec2 aVertex;
5
- attribute vec2 aTex;
6
- varying vec2 vTex;
7
- void main(void) {
8
- gl_Position = vec4(aVertex, 0.0, 1.0);
9
- vTex = aTex;
10
- }`,0),i=er(r,`
11
- precision mediump float;
12
- varying vec2 vTex;
13
- uniform sampler2D sampler0;
14
- void main(){
15
- gl_FragColor = texture2D(sampler0, vTex);
16
- }`,1),u=r.createProgram();if(r.attachShader(u,n),r.attachShader(u,i),r.linkProgram(u),!r.getProgramParameter(u,r.LINK_STATUS))throw Error(`Could not compile WebGL program.
17
-
18
- `+r.getProgramInfoLog(u));n=t.s=u,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),t.l={O:r.getAttribLocation(n,"aVertex"),N:r.getAttribLocation(n,"aTex"),xa:i},t.v=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,t.v),r.enableVertexAttribArray(t.l.O),r.vertexAttribPointer(t.l.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),t.u=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,t.u),r.enableVertexAttribArray(t.l.N),r.vertexAttribPointer(t.l.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(i,0)}n=t.l,r.useProgram(t.s),r.canvas.width=e.width,r.canvas.height=e.height,r.viewport(0,0,e.width,e.height),r.activeTexture(r.TEXTURE0),t.i.bindTexture2d(e.glName),r.enableVertexAttribArray(n.O),r.bindBuffer(r.ARRAY_BUFFER,t.v),r.vertexAttribPointer(n.O,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,t.u),r.vertexAttribPointer(n.N,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.O),r.disableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,null),t.i.bindTexture2d(0)}function Jr(t){this.h=t}var qr=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function tn(t,e){return e+t}function ur(t,e){window[t]=e}function en(t){var e=document.createElement("script");return e.setAttribute("src",t),e.setAttribute("crossorigin","anonymous"),new Promise(function(r){e.addEventListener("load",function(){r()},!1),e.addEventListener("error",function(){r()},!1),document.body.appendChild(e)})}function rn(){return O(function(t){switch(t.h){case 1:return t.s=2,x(t,WebAssembly.instantiate(qr),4);case 4:t.h=3,t.s=0;break;case 2:return t.s=0,t.l=null,t.return(!1);case 3:return t.return(!0)}})}function Qt(t){if(this.h=t,this.listeners={},this.l={},this.L={},this.s={},this.v={},this.M=this.u=this.ga=!0,this.I=Promise.resolve(),this.fa="",this.D={},this.locateFile=t&&t.locateFile||tn,typeof window=="object")var e=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")e=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.ha=e,t.options){e=F(Object.keys(t.options));for(var r=e.next();!r.done;r=e.next()){r=r.value;var n=t.options[r].default;n!==void 0&&(this.l[r]=typeof n=="function"?n():n)}}}j=Qt.prototype,j.close=function(){return this.j&&this.j.delete(),Promise.resolve()};function nn(t){var e,r,n,i,u,o,s,l,f,a,p;return O(function(h){switch(h.h){case 1:return t.ga?(e=t.h.files===void 0?[]:typeof t.h.files=="function"?t.h.files(t.l):t.h.files,x(h,rn(),2)):h.return();case 2:if(r=h.i,typeof window=="object")return ur("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),ur("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),o=e.filter(function(c){return c.data!==void 0}),s=e.filter(function(c){return c.data===void 0}),l=Promise.all(o.map(function(c){var v=jt(t,c.url);if(c.path!==void 0){var d=c.path;v=v.then(function(g){return t.overrideFile(d,g),Promise.resolve(g)})}return v})),f=Promise.all(s.map(function(c){return c.simd===void 0||c.simd&&r||!c.simd&&!r?en(t.locateFile(c.url,t.ha)):Promise.resolve()})).then(function(){var c,v,d;return O(function(g){if(g.h==1)return c=window.createMediapipeSolutionsWasm,v=window.createMediapipeSolutionsPackedAssets,d=t,x(g,c(v),2);d.i=g.i,g.h=0})}),a=(function(){return O(function(c){return t.h.graph&&t.h.graph.url?c=x(c,jt(t,t.h.graph.url),0):(c.h=0,c=void 0),c})})(),x(h,Promise.all([f,l,a]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return n=e.filter(function(c){return c.simd===void 0||c.simd&&r||!c.simd&&!r}).map(function(c){return t.locateFile(c.url,t.ha)}),importScripts.apply(null,qt(n)),i=t,x(h,createMediapipeSolutionsWasm(Module),6);case 6:i.i=h.i,t.m=new OffscreenCanvas(1,1),t.i.canvas=t.m,u=t.i.GL.createContext(t.m,{antialias:!1,alpha:!1,ua:typeof WebGL2RenderingContext<"u"?2:1}),t.i.GL.makeContextCurrent(u),h.h=4;break;case 7:if(t.m=document.createElement("canvas"),p=t.m.getContext("webgl2",{}),!p&&(p=t.m.getContext("webgl",{}),!p))return alert("Failed to create WebGL canvas context when passing video frame."),h.return();t.K=p,t.i.canvas=t.m,t.i.createContext(t.m,!0,!0,{});case 4:t.j=new t.i.SolutionWasm,t.ga=!1,h.h=0}})}function on(t){var e,r,n,i,u,o,s,l;return O(function(f){if(f.h==1){if(t.h.graph&&t.h.graph.url&&t.fa===t.h.graph.url)return f.return();if(t.u=!0,!t.h.graph||!t.h.graph.url){f.h=2;return}return t.fa=t.h.graph.url,x(f,jt(t,t.h.graph.url),3)}for(f.h!=2&&(e=f.i,t.j.loadGraph(e)),r=F(Object.keys(t.D)),n=r.next();!n.done;n=r.next())i=n.value,t.j.overrideFile(i,t.D[i]);if(t.D={},t.h.listeners)for(u=F(t.h.listeners),o=u.next();!o.done;o=u.next())s=o.value,fn(t,s);l=t.l,t.l={},t.setOptions(l),f.h=0})}j.reset=function(){var t=this;return O(function(e){t.j&&(t.j.reset(),t.s={},t.v={}),e.h=0})},j.setOptions=function(t,e){var r=this;if(e=e||this.h.options){for(var n=[],i=[],u={},o=F(Object.keys(t)),s=o.next();!s.done;u={X:u.X,Y:u.Y},s=o.next())if(s=s.value,!(s in this.l&&this.l[s]===t[s])){this.l[s]=t[s];var l=e[s];l!==void 0&&(l.onChange&&(u.X=l.onChange,u.Y=t[s],n.push((function(f){return function(){var a;return O(function(p){if(p.h==1)return x(p,f.X(f.Y),2);a=p.i,a===!0&&(r.u=!0),p.h=0})}})(u))),l.graphOptionXref&&(s=Object.assign({},{calculatorName:"",calculatorIndex:0},l.graphOptionXref,{valueNumber:l.type===1?t[s]:0,valueBoolean:l.type===0?t[s]:!1,valueString:l.type===2?t[s]:""}),i.push(s)))}(n.length!==0||i.length!==0)&&(this.u=!0,this.H=(this.H===void 0?[]:this.H).concat(i),this.F=(this.F===void 0?[]:this.F).concat(n))}};function un(t){var e,r,n,i,u,o,s;return O(function(l){switch(l.h){case 1:if(!t.u)return l.return();if(!t.F){l.h=2;break}e=F(t.F),r=e.next();case 3:if(r.done){l.h=5;break}return n=r.value,x(l,n(),4);case 4:r=e.next(),l.h=3;break;case 5:t.F=void 0;case 2:if(t.H){for(i=new t.i.GraphOptionChangeRequestList,u=F(t.H),o=u.next();!o.done;o=u.next())s=o.value,i.push_back(s);t.j.changeOptions(i),i.delete(),t.H=void 0}t.u=!1,l.h=0}})}j.initialize=function(){var t=this;return O(function(e){return e.h==1?x(e,nn(t),2):e.h!=3?x(e,on(t),3):x(e,un(t),0)})};function jt(t,e){var r,n;return O(function(i){return e in t.L?i.return(t.L[e]):(r=t.locateFile(e,""),n=fetch(r).then(function(u){return u.arrayBuffer()}),t.L[e]=n,i.return(n))})}j.overrideFile=function(t,e){this.j?this.j.overrideFile(t,e):this.D[t]=e},j.clearOverriddenFiles=function(){this.D={},this.j&&this.j.clearOverriddenFiles()},j.send=function(t,e){var r=this,n,i,u,o,s,l,f,a,p;return O(function(h){switch(h.h){case 1:return r.h.inputs?(n=1e3*(e??performance.now()),x(h,r.I,2)):h.return();case 2:return x(h,r.initialize(),3);case 3:for(i=new r.i.PacketDataList,u=F(Object.keys(t)),o=u.next();!o.done;o=u.next())if(s=o.value,l=r.h.inputs[s]){t:{var c=t[s];switch(l.type){case"video":var v=r.s[l.stream];if(v||(v=new $t(r.i,r.K),r.s[l.stream]=v),v.m===0&&(v.m=v.i.createTexture()),typeof HTMLVideoElement<"u"&&c instanceof HTMLVideoElement)var d=c.videoWidth,g=c.videoHeight;else typeof HTMLImageElement<"u"&&c instanceof HTMLImageElement?(d=c.naturalWidth,g=c.naturalHeight):(d=c.width,g=c.height);g={glName:v.m,width:d,height:g},d=v.h,d.canvas.width=g.width,d.canvas.height=g.height,d.activeTexture(d.TEXTURE0),v.i.bindTexture2d(v.m),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,c),v.i.bindTexture2d(0),v=g;break t;case"detections":for(v=r.s[l.stream],v||(v=new Jr(r.i),r.s[l.stream]=v),v.data||(v.data=new v.h.DetectionListData),v.data.reset(c.length),g=0;g<c.length;++g){d=c[g];var m=v.data,E=m.setBoundingBox,P=g,U=d.la,y=new At;if(B(y,1,U.ra),B(y,2,U.sa),B(y,3,U.height),B(y,4,U.width),B(y,5,U.rotation),L(y,6,U.pa),U=y.l(),E.call(m,P,U),d.ea)for(m=0;m<d.ea.length;++m){y=d.ea[m],E=v.data,P=E.addNormalizedLandmark,U=g,y=Object.assign({},y,{visibility:y.visibility?y.visibility:0});var _=new $;B(_,1,y.x),B(_,2,y.y),B(_,3,y.z),y.visibility&&B(_,4,y.visibility),y=_.l(),P.call(E,U,y)}if(d.ba)for(m=0;m<d.ba.length;++m)E=v.data,P=E.addClassification,U=g,y=d.ba[m],_=new Z,B(_,2,y.score),y.index&&L(_,1,y.index),y.label&&L(_,3,y.label),y.displayName&&L(_,4,y.displayName),y=_.l(),P.call(E,U,y)}v=v.data;break t;default:v={}}}switch(f=v,a=l.stream,l.type){case"video":i.pushTexture2d(Object.assign({},f,{stream:a,timestamp:n}));break;case"detections":p=f,p.stream=a,p.timestamp=n,i.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return r.j.send(i),x(h,r.I,4);case 4:i.delete(),h.h=0}})};function sn(t,e,r){var n,i,u,o,s,l,f,a,p,h,c,v,d,g;return O(function(m){switch(m.h){case 1:if(!r)return m.return(e);for(n={},i=0,u=F(Object.keys(r)),o=u.next();!o.done;o=u.next())s=o.value,l=r[s],typeof l!="string"&&l.type==="texture"&&e[l.stream]!==void 0&&++i;1<i&&(t.M=!1),f=F(Object.keys(r)),o=f.next();case 2:if(o.done){m.h=4;break}if(a=o.value,p=r[a],typeof p=="string")return d=n,g=a,x(m,ln(t,a,e[p]),14);if(h=e[p.stream],p.type==="detection_list"){if(h){for(var E=h.getRectList(),P=h.getLandmarksList(),U=h.getClassificationsList(),y=[],_=0;_<E.size();++_){var G=$r(E.get(_)),an=D(G,1),cn=D(G,2),hn=D(G,3),pn=D(G,4),vn=D(G,5,0),xt=void 0;xt=xt===void 0?0:xt,G={la:{ra:an,sa:cn,height:hn,width:pn,rotation:vn,pa:yt(C(G,6),xt)},ea:dt(qe(P.get(_)),$,1).map(nr),ba:rr($e(U.get(_)))},y.push(G)}E=y}else E=[];n[a]=E,m.h=7;break}if(p.type==="proto_list"){if(h){for(E=Array(h.size()),P=0;P<h.size();P++)E[P]=h.get(P);h.delete()}else E=[];n[a]=E,m.h=7;break}if(h===void 0){m.h=3;break}if(p.type==="float_list"){n[a]=h,m.h=7;break}if(p.type==="proto"){n[a]=h,m.h=7;break}if(p.type!=="texture")throw Error("Unknown output config type: '"+p.type+"'");return c=t.v[a],c||(c=new $t(t.i,t.K),t.v[a]=c),x(m,or(c,h,t.M),13);case 13:v=m.i,n[a]=v;case 7:p.transform&&n[a]&&(n[a]=p.transform(n[a])),m.h=3;break;case 14:d[g]=m.i;case 3:o=f.next(),m.h=2;break;case 4:return m.return(n)}})}function ln(t,e,r){var n;return O(function(i){return typeof r=="number"||r instanceof Uint8Array||r instanceof t.i.Uint8BlobList?i.return(r):r instanceof t.i.Texture2dDataOut?(n=t.v[e],n||(n=new $t(t.i,t.K),t.v[e]=n),i.return(or(n,r,t.M))):i.return(void 0)})}function fn(t,e){for(var r=e.name||"$",n=[].concat(qt(e.wants)),i=new t.i.StringList,u=F(e.wants),o=u.next();!o.done;o=u.next())i.push_back(o.value);u=t.i.PacketListener.implement({onResults:function(s){for(var l={},f=0;f<e.wants.length;++f)l[n[f]]=s.get(f);var a=t.listeners[r];a&&(t.I=sn(t,l,e.outs).then(function(p){p=a(p);for(var h=0;h<e.wants.length;++h){var c=l[n[h]];typeof c=="object"&&c.hasOwnProperty&&c.hasOwnProperty("delete")&&c.delete()}p&&(t.I=p)}))}}),t.j.attachMultiListener(i,u),i.delete()}j.onResults=function(t,e){this.listeners[e||"$"]=t},tt("Solution",Qt),tt("OptionType",{BOOL:0,NUMBER:1,ta:2,0:"BOOL",1:"NUMBER",2:"STRING"});function sr(t){return t===void 0&&(t=0),t===1?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function lr(t){var e=this;t=t||{},this.h=new Qt({locateFile:t.locateFile,files:function(r){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:sr(r.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:ir},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:ir},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(r){return r.map(function(n){return rr($e(n))[0]})}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:typeof window!="object"||window.navigator===void 0?!1:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(r){var n,i,u;return O(function(o){return o.h==1?(n=sr(r),i="third_party/mediapipe/modules/hand_landmark/"+n,x(o,jt(e.h,n),2)):(u=o.i,e.h.overrideFile(i,u),o.return(!0))})}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}j=lr.prototype,j.close=function(){return this.h.close(),Promise.resolve()},j.onResults=function(t){this.h.onResults(t)},j.initialize=function(){var t=this;return O(function(e){return x(e,t.h.initialize(),0)})},j.reset=function(){this.h.reset()},j.send=function(t){var e=this;return O(function(r){return x(r,e.h.send(t),0)})},j.setOptions=function(t){this.h.setOptions(t)},tt("Hands",lr),tt("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),tt("VERSION","0.4.1675469240")}).call(Jt)),Jt}var cr=mn();const gn=dn(cr),An=yn({__proto__:null,default:gn},[cr]);export{An as h};