tiny-essentials 1.28.19 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (555) hide show
  1. package/README.md +1 -1
  2. package/changelog/1/28/19.md +24 -0
  3. package/changelog/1/29/0.md +58 -0
  4. package/dist/v1/ColorSafeStringify.min.js +1 -1
  5. package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
  6. package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
  7. package/dist/v1/TinyAnalogClock.min.js +1 -1
  8. package/dist/v1/TinyArrayComparator.min.js +1 -1
  9. package/dist/v1/TinyArrayPaginator.min.js +1 -1
  10. package/dist/v1/TinyBasicsEs.min.js +1 -1
  11. package/dist/v1/TinyBrowserMonitor.min.js +1 -0
  12. package/dist/v1/TinyClassManager.min.js +1 -1
  13. package/dist/v1/TinyClipboard.min.js +1 -1
  14. package/dist/v1/TinyCloner.min.js +1 -0
  15. package/dist/v1/TinyColorConverter.min.js +1 -1
  16. package/dist/v1/TinyColorValidator.min.js +1 -1
  17. package/dist/v1/TinyCookieConsent.min.js +1 -1
  18. package/dist/v1/TinyDayNightCycle.min.js +1 -1
  19. package/dist/v1/TinyDebugger.min.js +1 -1
  20. package/dist/v1/TinyDomReadyManager.min.js +1 -1
  21. package/dist/v1/TinyDragDropDetector.min.js +1 -1
  22. package/dist/v1/TinyDragger.min.js +1 -1
  23. package/dist/v1/TinyElementObserver.min.js +1 -1
  24. package/dist/v1/TinyEssentials.min.js +1 -1
  25. package/dist/v1/TinyGamepad.min.js +1 -1
  26. package/dist/v1/TinyHtml.min.js +1 -1
  27. package/dist/v1/TinyHtmlTagRegexBuilder.min.js +1 -0
  28. package/dist/v1/TinyHttpResponseRegistry.min.js +1 -0
  29. package/dist/v1/TinyI18.min.js +1 -1
  30. package/dist/v1/TinyIframeEvents.min.js +1 -1
  31. package/dist/v1/TinyInventory.min.js +1 -1
  32. package/dist/v1/TinyInventoryTrader.min.js +1 -1
  33. package/dist/v1/TinyLevelUp.min.js +1 -1
  34. package/dist/v1/TinyLoadingScreen.min.js +1 -1
  35. package/dist/v1/TinyLocalStorage.min.js +1 -1
  36. package/dist/v1/TinyMaInSys.min.js +1 -1
  37. package/dist/v1/TinyMapCache.min.js +1 -0
  38. package/dist/v1/TinyMediaPlayer.min.js +1 -1
  39. package/dist/v1/TinyNeedBar.min.js +1 -1
  40. package/dist/v1/TinyNewWinEvents.min.js +1 -1
  41. package/dist/v1/TinyNotificationAdapter.min.js +1 -0
  42. package/dist/v1/TinyNotifications.min.js +1 -1
  43. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  44. package/dist/v1/TinyOPFSFileSystem.min.js +1 -0
  45. package/dist/v1/TinyPasswordValidator.min.js +1 -0
  46. package/dist/v1/TinyPluginPackage.min.js +1 -0
  47. package/dist/v1/TinyPromiseQueue.min.js +1 -1
  48. package/dist/v1/TinyPushManager.min.js +1 -0
  49. package/dist/v1/TinyPushPayload.min.js +1 -0
  50. package/dist/v1/TinyPushRouter.min.js +1 -0
  51. package/dist/v1/TinyRadioFm.min.js +1 -1
  52. package/dist/v1/TinyRateLimiter.min.js +1 -1
  53. package/dist/v1/TinyRegexEs.min.js +1 -0
  54. package/dist/v1/TinyRouter.min.js +1 -0
  55. package/dist/v1/TinyServiceWorker.min.js +1 -0
  56. package/dist/v1/TinyServiceWorkerEngine.min.js +1 -0
  57. package/dist/v1/TinySetMapPackage.min.js +1 -0
  58. package/dist/v1/TinySimpleDice.min.js +1 -1
  59. package/dist/v1/TinySmartScroller.min.js +1 -1
  60. package/dist/v1/TinyStorageBucketFileSystem.min.js +1 -0
  61. package/dist/v1/TinyTextDiffer.min.js +1 -1
  62. package/dist/v1/TinyTextRangeEditor.min.js +1 -1
  63. package/dist/v1/TinyTextarea.min.js +1 -1
  64. package/dist/v1/TinyThrottledApi.min.js +1 -0
  65. package/dist/v1/TinyTimeout.min.js +1 -1
  66. package/dist/v1/TinyToastNotify.min.js +1 -1
  67. package/dist/v1/TinyUploadClicker.min.js +1 -1
  68. package/dist/v1/TinyUriParser.min.js +1 -0
  69. package/dist/v1/TinyVersion.min.js +1 -0
  70. package/dist/v1/TinyWebWorker.min.js +1 -0
  71. package/dist/v1/TinyWebWorkerEngine.min.js +1 -0
  72. package/dist/v1/UltraRandomMsgGen.min.js +1 -1
  73. package/dist/v1/basics/array.cjs +2 -2
  74. package/dist/v1/basics/array.d.mts +2 -0
  75. package/dist/v1/basics/array.d.mts.map +1 -1
  76. package/dist/v1/basics/array.mjs +2 -1
  77. package/dist/v1/basics/browserDetector.cjs +37 -12
  78. package/dist/v1/basics/browserDetector.d.mts +8 -0
  79. package/dist/v1/basics/browserDetector.d.mts.map +1 -1
  80. package/dist/v1/basics/browserDetector.mjs +32 -13
  81. package/dist/v1/basics/crypto.cjs +23 -0
  82. package/dist/v1/basics/crypto.d.mts +10 -0
  83. package/dist/v1/basics/crypto.d.mts.map +1 -0
  84. package/dist/v1/basics/crypto.mjs +18 -0
  85. package/dist/v1/basics/html.cjs +0 -3
  86. package/dist/v1/basics/html.d.mts.map +1 -1
  87. package/dist/v1/basics/html.mjs +0 -2
  88. package/dist/v1/basics/index.cjs +8 -1
  89. package/dist/v1/basics/index.d.mts +6 -5
  90. package/dist/v1/basics/index.d.mts.map +1 -1
  91. package/dist/v1/basics/index.mjs +6 -5
  92. package/dist/v1/basics/objChecker.cjs +88 -0
  93. package/dist/v1/basics/objChecker.d.mts +26 -0
  94. package/dist/v1/basics/objChecker.d.mts.map +1 -1
  95. package/dist/v1/basics/objChecker.mjs +74 -0
  96. package/dist/v1/basics/objFilter.cjs +234 -93
  97. package/dist/v1/basics/objFilter.d.mts +96 -22
  98. package/dist/v1/basics/objFilter.d.mts.map +1 -1
  99. package/dist/v1/basics/objFilter.mjs +216 -92
  100. package/dist/v1/basics/promiseUtils.cjs +48 -12
  101. package/dist/v1/basics/promiseUtils.d.mts +45 -12
  102. package/dist/v1/basics/promiseUtils.d.mts.map +1 -1
  103. package/dist/v1/basics/promiseUtils.mjs +47 -12
  104. package/dist/v1/basics/text.cjs +0 -12
  105. package/dist/v1/basics/text.d.mts +0 -10
  106. package/dist/v1/basics/text.d.mts.map +1 -1
  107. package/dist/v1/basics/text.mjs +0 -10
  108. package/dist/v1/index.cjs +88 -3
  109. package/dist/v1/index.d.mts +31 -6
  110. package/dist/v1/index.d.mts.map +1 -1
  111. package/dist/v1/index.mjs +32 -7
  112. package/dist/v1/jsdoc/EventEmitter.cjs +4 -0
  113. package/dist/v1/jsdoc/EventEmitter.d.mts +33 -0
  114. package/dist/v1/jsdoc/EventEmitter.d.mts.map +1 -0
  115. package/dist/v1/jsdoc/EventEmitter.mjs +18 -0
  116. package/dist/v1/libs/array/TinyArrayComparator.cjs +240 -25
  117. package/dist/v1/libs/array/TinyArrayComparator.d.mts +130 -22
  118. package/dist/v1/libs/array/TinyArrayComparator.d.mts.map +1 -1
  119. package/dist/v1/libs/array/TinyArrayComparator.mjs +210 -24
  120. package/dist/v1/libs/fs/constants.cjs +74 -0
  121. package/dist/v1/libs/fs/constants.d.mts +22 -0
  122. package/dist/v1/libs/fs/constants.d.mts.map +1 -0
  123. package/dist/v1/libs/fs/constants.mjs +53 -0
  124. package/dist/v1/libs/fs/encoding.cjs +118 -0
  125. package/dist/v1/libs/fs/encoding.d.mts +50 -0
  126. package/dist/v1/libs/fs/encoding.d.mts.map +1 -0
  127. package/dist/v1/libs/fs/encoding.mjs +102 -0
  128. package/dist/v1/libs/fs/error.cjs +188 -0
  129. package/dist/v1/libs/fs/error.d.mts +105 -0
  130. package/dist/v1/libs/fs/error.d.mts.map +1 -0
  131. package/dist/v1/libs/fs/error.mjs +158 -0
  132. package/dist/v1/libs/fs/handle.cjs +121 -0
  133. package/dist/v1/libs/fs/handle.d.mts +56 -0
  134. package/dist/v1/libs/fs/handle.d.mts.map +1 -0
  135. package/dist/v1/libs/fs/handle.mjs +100 -0
  136. package/dist/v1/libs/fs/index.cjs +700 -0
  137. package/dist/v1/libs/fs/index.d.mts +377 -0
  138. package/dist/v1/libs/fs/index.d.mts.map +1 -0
  139. package/dist/v1/libs/fs/index.mjs +630 -0
  140. package/dist/v1/libs/fs/path.cjs +234 -0
  141. package/dist/v1/libs/fs/path.d.mts +176 -0
  142. package/dist/v1/libs/fs/path.d.mts.map +1 -0
  143. package/dist/v1/libs/fs/path.mjs +197 -0
  144. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.cjs +202 -0
  145. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts +121 -0
  146. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts.map +1 -0
  147. package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.mjs +172 -0
  148. package/dist/v1/libs/fs/plugins/OPFS/index.cjs +334 -0
  149. package/dist/v1/libs/fs/plugins/OPFS/index.d.mts +98 -0
  150. package/dist/v1/libs/fs/plugins/OPFS/index.d.mts.map +1 -0
  151. package/dist/v1/libs/fs/plugins/OPFS/index.mjs +300 -0
  152. package/dist/v1/libs/fs/stats.cjs +245 -0
  153. package/dist/v1/libs/fs/stats.d.mts +226 -0
  154. package/dist/v1/libs/fs/stats.d.mts.map +1 -0
  155. package/dist/v1/libs/fs/stats.mjs +197 -0
  156. package/dist/v1/libs/html/events/TinyIframeEvents.cjs +10 -1
  157. package/dist/v1/libs/html/events/TinyIframeEvents.d.mts +9 -2
  158. package/dist/v1/libs/html/events/TinyIframeEvents.d.mts.map +1 -1
  159. package/dist/v1/libs/html/events/TinyIframeEvents.mjs +8 -1
  160. package/dist/v1/libs/html/events/TinyNewWinEvents.cjs +14 -3
  161. package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts +21 -5
  162. package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts.map +1 -1
  163. package/dist/v1/libs/html/events/TinyNewWinEvents.mjs +12 -3
  164. package/dist/v1/libs/html/scroll/TinySmartScroller.cjs +13 -1
  165. package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts +29 -2
  166. package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts.map +1 -1
  167. package/dist/v1/libs/html/scroll/TinySmartScroller.mjs +11 -1
  168. package/dist/v1/libs/math/TinyAdvancedRaffle.cjs +13 -1
  169. package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts +32 -2
  170. package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts.map +1 -1
  171. package/dist/v1/libs/math/TinyAdvancedRaffle.mjs +11 -1
  172. package/dist/v1/libs/math/TinyTimeout.cjs +0 -14
  173. package/dist/v1/libs/math/TinyTimeout.d.mts +0 -11
  174. package/dist/v1/libs/math/TinyTimeout.d.mts.map +1 -1
  175. package/dist/v1/libs/math/TinyTimeout.mjs +0 -13
  176. package/dist/v1/libs/media/TinyMediaPlayer/index.cjs +25 -1
  177. package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts +35 -2
  178. package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts.map +1 -1
  179. package/dist/v1/libs/media/TinyMediaPlayer/index.mjs +23 -1
  180. package/dist/v1/libs/media/TinyMediaPlayer.cjs +2 -2
  181. package/dist/v1/libs/media/TinyMediaPlayer.d.mts +2 -2
  182. package/dist/v1/libs/media/TinyMediaPlayer.d.mts.map +1 -1
  183. package/dist/v1/libs/media/TinyMediaPlayer.mjs +2 -2
  184. package/dist/v1/libs/media/TinyRadioFm.cjs +19 -1
  185. package/dist/v1/libs/media/TinyRadioFm.d.mts +78 -2
  186. package/dist/v1/libs/media/TinyRadioFm.d.mts.map +1 -1
  187. package/dist/v1/libs/media/TinyRadioFm.mjs +17 -1
  188. package/dist/v1/libs/plugin/TinyPlugin.cjs +1630 -0
  189. package/dist/v1/libs/plugin/TinyPlugin.d.mts +753 -0
  190. package/dist/v1/libs/plugin/TinyPlugin.d.mts.map +1 -0
  191. package/dist/v1/libs/plugin/TinyPlugin.mjs +1376 -0
  192. package/dist/v1/libs/plugin/TinyVersion.cjs +204 -0
  193. package/dist/v1/libs/plugin/TinyVersion.d.mts +70 -0
  194. package/dist/v1/libs/plugin/TinyVersion.d.mts.map +1 -0
  195. package/dist/v1/libs/plugin/TinyVersion.mjs +179 -0
  196. package/dist/v1/libs/router/TinyRouter.cjs +661 -0
  197. package/dist/v1/libs/router/TinyRouter.d.mts +320 -0
  198. package/dist/v1/libs/router/TinyRouter.d.mts.map +1 -0
  199. package/dist/v1/libs/router/TinyRouter.mjs +572 -0
  200. package/dist/v1/libs/storage/TinyLocalStorage.cjs +20 -1
  201. package/dist/v1/libs/storage/TinyLocalStorage.d.mts +64 -2
  202. package/dist/v1/libs/storage/TinyLocalStorage.d.mts.map +1 -1
  203. package/dist/v1/libs/storage/TinyLocalStorage.mjs +18 -1
  204. package/dist/v1/libs/storage/TinyMapCache.cjs +373 -0
  205. package/dist/v1/libs/storage/TinyMapCache.d.mts +274 -0
  206. package/dist/v1/libs/storage/TinyMapCache.d.mts.map +1 -0
  207. package/dist/v1/libs/storage/TinyMapCache.mjs +333 -0
  208. package/dist/v1/libs/storage/TinySetMapDatabase.cjs +1167 -0
  209. package/dist/v1/libs/storage/TinySetMapDatabase.d.mts +603 -0
  210. package/dist/v1/libs/storage/TinySetMapDatabase.d.mts.map +1 -0
  211. package/dist/v1/libs/storage/TinySetMapDatabase.mjs +1059 -0
  212. package/dist/v1/libs/sw/browser/TinyNotificationAdapter.cjs +126 -0
  213. package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts +132 -0
  214. package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts.map +1 -0
  215. package/dist/v1/libs/sw/browser/TinyNotificationAdapter.mjs +109 -0
  216. package/dist/v1/libs/sw/browser/TinyPushManager.cjs +310 -0
  217. package/dist/v1/libs/sw/browser/TinyPushManager.d.mts +168 -0
  218. package/dist/v1/libs/sw/browser/TinyPushManager.d.mts.map +1 -0
  219. package/dist/v1/libs/sw/browser/TinyPushManager.mjs +264 -0
  220. package/dist/v1/libs/sw/browser/TinyServiceWorker.cjs +1060 -0
  221. package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts +348 -0
  222. package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts.map +1 -0
  223. package/dist/v1/libs/sw/browser/TinyServiceWorker.mjs +933 -0
  224. package/dist/v1/libs/sw/browser/plugins/TabManager.cjs +315 -0
  225. package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts +178 -0
  226. package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts.map +1 -0
  227. package/dist/v1/libs/sw/browser/plugins/TabManager.mjs +274 -0
  228. package/dist/v1/libs/sw/browser/utils.cjs +28 -0
  229. package/dist/v1/libs/sw/browser/utils.d.mts +8 -0
  230. package/dist/v1/libs/sw/browser/utils.d.mts.map +1 -0
  231. package/dist/v1/libs/sw/browser/utils.mjs +21 -0
  232. package/dist/v1/libs/sw/service/TinyPushRouter.cjs +222 -0
  233. package/dist/v1/libs/sw/service/TinyPushRouter.d.mts +138 -0
  234. package/dist/v1/libs/sw/service/TinyPushRouter.d.mts.map +1 -0
  235. package/dist/v1/libs/sw/service/TinyPushRouter.mjs +201 -0
  236. package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.cjs +3016 -0
  237. package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts +993 -0
  238. package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts.map +1 -0
  239. package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.mjs +2558 -0
  240. package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.cjs +88 -0
  241. package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts +32 -0
  242. package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts.map +1 -0
  243. package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.mjs +69 -0
  244. package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.cjs +112 -0
  245. package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts +31 -0
  246. package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts.map +1 -0
  247. package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.mjs +91 -0
  248. package/dist/v1/libs/sw/service/plugins/Ping.cjs +32 -0
  249. package/dist/v1/libs/sw/service/plugins/Ping.d.mts +9 -0
  250. package/dist/v1/libs/sw/service/plugins/Ping.d.mts.map +1 -0
  251. package/dist/v1/libs/sw/service/plugins/Ping.mjs +25 -0
  252. package/dist/v1/libs/sw/service/plugins/TabManager.cjs +457 -0
  253. package/dist/v1/libs/sw/service/plugins/TabManager.d.mts +91 -0
  254. package/dist/v1/libs/sw/service/plugins/TabManager.d.mts.map +1 -0
  255. package/dist/v1/libs/sw/service/plugins/TabManager.mjs +372 -0
  256. package/dist/v1/libs/sw/service/plugins/ViteFileDetector.cjs +180 -0
  257. package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts +28 -0
  258. package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts.map +1 -0
  259. package/dist/v1/libs/sw/service/plugins/ViteFileDetector.mjs +148 -0
  260. package/dist/v1/libs/sw/service/shared/TinyPushPayload.cjs +199 -0
  261. package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts +80 -0
  262. package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts.map +1 -0
  263. package/dist/v1/libs/sw/service/shared/TinyPushPayload.mjs +174 -0
  264. package/dist/v1/libs/sw/utils.cjs +57 -0
  265. package/dist/v1/libs/sw/utils.d.mts +173 -0
  266. package/dist/v1/libs/sw/utils.d.mts.map +1 -0
  267. package/dist/v1/libs/sw/utils.mjs +50 -0
  268. package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.cjs +57 -0
  269. package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts +39 -0
  270. package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts.map +1 -0
  271. package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.mjs +48 -0
  272. package/dist/v1/libs/text/TinyI18/Browser.cjs +64 -0
  273. package/dist/v1/libs/text/TinyI18/Browser.d.mts +47 -0
  274. package/dist/v1/libs/text/TinyI18/Browser.d.mts.map +1 -0
  275. package/dist/v1/libs/text/TinyI18/Browser.mjs +57 -0
  276. package/dist/v1/libs/text/TinyI18/Node.cjs +49 -0
  277. package/dist/v1/libs/text/TinyI18/Node.d.mts +38 -0
  278. package/dist/v1/libs/text/TinyI18/Node.d.mts.map +1 -0
  279. package/dist/v1/libs/text/TinyI18/Node.mjs +43 -0
  280. package/dist/v1/libs/text/TinyI18/browser-utils.cjs +17 -0
  281. package/dist/v1/libs/text/TinyI18/browser-utils.d.mts +8 -0
  282. package/dist/v1/libs/text/TinyI18/browser-utils.d.mts.map +1 -0
  283. package/dist/v1/libs/text/TinyI18/browser-utils.mjs +13 -0
  284. package/dist/v1/libs/text/{TinyI18.cjs → TinyI18/index.cjs} +205 -104
  285. package/dist/v1/libs/text/{TinyI18.d.mts → TinyI18/index.d.mts} +141 -92
  286. package/dist/v1/libs/text/TinyI18/index.d.mts.map +1 -0
  287. package/dist/v1/libs/text/{TinyI18.mjs → TinyI18/index.mjs} +195 -101
  288. package/dist/v1/libs/tools/TinyBrowserMonitor.cjs +1088 -0
  289. package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts +621 -0
  290. package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts.map +1 -0
  291. package/dist/v1/libs/tools/TinyBrowserMonitor.mjs +940 -0
  292. package/dist/v1/libs/tools/TinyDebugger.cjs +180 -19
  293. package/dist/v1/libs/tools/TinyDebugger.d.mts +220 -24
  294. package/dist/v1/libs/tools/TinyDebugger.d.mts.map +1 -1
  295. package/dist/v1/libs/tools/TinyDebugger.mjs +161 -19
  296. package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.cjs +256 -0
  297. package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts +125 -0
  298. package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts.map +1 -0
  299. package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.mjs +223 -0
  300. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.cjs +23 -0
  301. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts +17 -0
  302. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts.map +1 -0
  303. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.mjs +19 -0
  304. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.cjs +23 -0
  305. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts +17 -0
  306. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts.map +1 -0
  307. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.mjs +19 -0
  308. package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.cjs +390 -0
  309. package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts +9 -0
  310. package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts.map +1 -0
  311. package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.mjs +387 -0
  312. package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.cjs +2 -0
  313. package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts +27 -0
  314. package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts.map +1 -0
  315. package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.mjs +12 -0
  316. package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/LICENSE +53 -0
  317. package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.cjs +405 -0
  318. package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts +34 -0
  319. package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts.map +1 -0
  320. package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.mjs +342 -0
  321. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.cjs +23 -0
  322. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts +17 -0
  323. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts.map +1 -0
  324. package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.mjs +19 -0
  325. package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.cjs +327 -0
  326. package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts +9 -0
  327. package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts.map +1 -0
  328. package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.mjs +324 -0
  329. package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.cjs +268 -0
  330. package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts +107 -0
  331. package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts.map +1 -0
  332. package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.mjs +238 -0
  333. package/dist/v1/libs/tools/TinyPasswordValidator.cjs +491 -0
  334. package/dist/v1/libs/tools/TinyPasswordValidator.d.mts +246 -0
  335. package/dist/v1/libs/tools/TinyPasswordValidator.d.mts.map +1 -0
  336. package/dist/v1/libs/tools/TinyPasswordValidator.mjs +434 -0
  337. package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +48 -0
  338. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +14 -0
  339. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -1
  340. package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +44 -0
  341. package/dist/v1/libs/tools/TinySiteMap.cjs +1029 -0
  342. package/dist/v1/libs/tools/TinySiteMap.d.mts +429 -0
  343. package/dist/v1/libs/tools/TinySiteMap.d.mts.map +1 -0
  344. package/dist/v1/libs/tools/TinySiteMap.mjs +910 -0
  345. package/dist/v1/libs/tools/TinySiteMapStream.cjs +121 -0
  346. package/dist/v1/libs/tools/TinySiteMapStream.d.mts +51 -0
  347. package/dist/v1/libs/tools/TinySiteMapStream.d.mts.map +1 -0
  348. package/dist/v1/libs/tools/TinySiteMapStream.mjs +85 -0
  349. package/dist/v1/libs/tools/TinyURLSecurityVerifier.cjs +444 -0
  350. package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts +217 -0
  351. package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts.map +1 -0
  352. package/dist/v1/libs/tools/TinyURLSecurityVerifier.mjs +394 -0
  353. package/dist/v1/libs/tools/TinyUriParser/BlueSky.cjs +613 -0
  354. package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts +152 -0
  355. package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts.map +1 -0
  356. package/dist/v1/libs/tools/TinyUriParser/BlueSky.mjs +527 -0
  357. package/dist/v1/libs/tools/TinyUriParser/Discord.cjs +1119 -0
  358. package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts +306 -0
  359. package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts.map +1 -0
  360. package/dist/v1/libs/tools/TinyUriParser/Discord.mjs +968 -0
  361. package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.cjs +469 -0
  362. package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts +80 -0
  363. package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts.map +1 -0
  364. package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.mjs +379 -0
  365. package/dist/v1/libs/tools/TinyUriParser.cjs +217 -0
  366. package/dist/v1/libs/tools/TinyUriParser.d.mts +109 -0
  367. package/dist/v1/libs/tools/TinyUriParser.d.mts.map +1 -0
  368. package/dist/v1/libs/tools/TinyUriParser.mjs +183 -0
  369. package/dist/v1/libs/utils/TinyCloner.cjs +466 -0
  370. package/dist/v1/libs/utils/TinyCloner.d.mts +221 -0
  371. package/dist/v1/libs/utils/TinyCloner.d.mts.map +1 -0
  372. package/dist/v1/libs/utils/TinyCloner.mjs +416 -0
  373. package/dist/v1/libs/utils/TinyPromiseQueue.cjs +1 -1
  374. package/dist/v1/libs/utils/TinyPromiseQueue.d.mts +2 -2
  375. package/dist/v1/libs/utils/TinyPromiseQueue.d.mts.map +1 -1
  376. package/dist/v1/libs/utils/TinyPromiseQueue.mjs +1 -1
  377. package/dist/v1/libs/utils/TinyThrottledApi.cjs +333 -0
  378. package/dist/v1/libs/utils/TinyThrottledApi.d.mts +163 -0
  379. package/dist/v1/libs/utils/TinyThrottledApi.d.mts.map +1 -0
  380. package/dist/v1/libs/utils/TinyThrottledApi.mjs +294 -0
  381. package/dist/v1/libs/worker/browser/TinyWebWorker.cjs +342 -0
  382. package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts +97 -0
  383. package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts.map +1 -0
  384. package/dist/v1/libs/worker/browser/TinyWebWorker.mjs +305 -0
  385. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.cjs +346 -0
  386. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts +127 -0
  387. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts.map +1 -0
  388. package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.mjs +304 -0
  389. package/dist/v1/regexp/Email.cjs +185 -0
  390. package/dist/v1/regexp/Email.d.mts +73 -0
  391. package/dist/v1/regexp/Email.d.mts.map +1 -0
  392. package/dist/v1/regexp/Email.mjs +153 -0
  393. package/dist/v1/regexp/Glob.cjs +293 -0
  394. package/dist/v1/regexp/Glob.d.mts +45 -0
  395. package/dist/v1/regexp/Glob.d.mts.map +1 -0
  396. package/dist/v1/regexp/Glob.mjs +260 -0
  397. package/dist/v1/regexp/Ipv4.cjs +57 -0
  398. package/dist/v1/regexp/Ipv4.d.mts +29 -0
  399. package/dist/v1/regexp/Ipv4.d.mts.map +1 -0
  400. package/dist/v1/regexp/Ipv4.mjs +45 -0
  401. package/dist/v1/regexp/Ipv6.cjs +67 -0
  402. package/dist/v1/regexp/Ipv6.d.mts +29 -0
  403. package/dist/v1/regexp/Ipv6.d.mts.map +1 -0
  404. package/dist/v1/regexp/Ipv6.mjs +54 -0
  405. package/dist/v1/regexp/SegmentExtractor.cjs +145 -0
  406. package/dist/v1/regexp/SegmentExtractor.d.mts +91 -0
  407. package/dist/v1/regexp/SegmentExtractor.d.mts.map +1 -0
  408. package/dist/v1/regexp/SegmentExtractor.mjs +116 -0
  409. package/dist/v1/regexp/UrlDetector.cjs +125 -0
  410. package/dist/v1/regexp/UrlDetector.d.mts +67 -0
  411. package/dist/v1/regexp/UrlDetector.d.mts.map +1 -0
  412. package/dist/v1/regexp/UrlDetector.mjs +102 -0
  413. package/dist/v1/regexp/Username/index.cjs +233 -0
  414. package/dist/v1/regexp/Username/index.d.mts +77 -0
  415. package/dist/v1/regexp/Username/index.d.mts.map +1 -0
  416. package/dist/v1/regexp/Username/index.mjs +199 -0
  417. package/dist/v1/regexp/Username/jsDoc.cjs +2 -0
  418. package/dist/v1/regexp/Username/jsDoc.d.mts +57 -0
  419. package/dist/v1/regexp/Username/jsDoc.d.mts.map +1 -0
  420. package/dist/v1/regexp/Username/jsDoc.mjs +18 -0
  421. package/dist/v1/regexp/Username/templates/BlueSky.cjs +56 -0
  422. package/dist/v1/regexp/Username/templates/BlueSky.d.mts +35 -0
  423. package/dist/v1/regexp/Username/templates/BlueSky.d.mts.map +1 -0
  424. package/dist/v1/regexp/Username/templates/BlueSky.mjs +52 -0
  425. package/dist/v1/regexp/Username/templates/Discord.cjs +505 -0
  426. package/dist/v1/regexp/Username/templates/Discord.d.mts +209 -0
  427. package/dist/v1/regexp/Username/templates/Discord.d.mts.map +1 -0
  428. package/dist/v1/regexp/Username/templates/Discord.mjs +458 -0
  429. package/dist/v1/regexp/Username/templates/MatrixProtocol.cjs +143 -0
  430. package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts +70 -0
  431. package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts.map +1 -0
  432. package/dist/v1/regexp/Username/templates/MatrixProtocol.mjs +128 -0
  433. package/dist/v1/regexp/Username/templates/deprecated/Discord.cjs +24 -0
  434. package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts +17 -0
  435. package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts.map +1 -0
  436. package/dist/v1/regexp/Username/templates/deprecated/Discord.mjs +20 -0
  437. package/dist/v1/regexp/Username/templates/index.cjs +11 -0
  438. package/dist/v1/regexp/Username/templates/index.d.mts +5 -0
  439. package/dist/v1/regexp/Username/templates/index.d.mts.map +1 -0
  440. package/dist/v1/regexp/Username/templates/index.mjs +4 -0
  441. package/dist/v1/regexp/index.cjs +41 -0
  442. package/dist/v1/regexp/index.d.mts +9 -0
  443. package/dist/v1/regexp/index.d.mts.map +1 -0
  444. package/dist/v1/regexp/index.mjs +8 -0
  445. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.cjs +64 -0
  446. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts +11 -0
  447. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts.map +1 -0
  448. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.mjs +51 -0
  449. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.cjs +66 -0
  450. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts +11 -0
  451. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts.map +1 -0
  452. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.mjs +51 -0
  453. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.cjs +39 -0
  454. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts +11 -0
  455. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts.map +1 -0
  456. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.mjs +28 -0
  457. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.cjs +494 -0
  458. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts +142 -0
  459. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts.map +1 -0
  460. package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.mjs +445 -0
  461. package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.cjs +30 -4
  462. package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts +5 -2
  463. package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts.map +1 -1
  464. package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.mjs +29 -5
  465. package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.cjs +135 -0
  466. package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts +83 -0
  467. package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts.map +1 -0
  468. package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.mjs +120 -0
  469. package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.cjs +127 -0
  470. package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts +95 -0
  471. package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts.map +1 -0
  472. package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.mjs +109 -0
  473. package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.cjs +83 -0
  474. package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts +46 -0
  475. package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts.map +1 -0
  476. package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.mjs +71 -0
  477. package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.cjs +493 -0
  478. package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts +67 -0
  479. package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts.map +1 -0
  480. package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.mjs +399 -0
  481. package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.cjs +35 -0
  482. package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts +6 -0
  483. package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts.map +1 -0
  484. package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.mjs +29 -0
  485. package/docs/info/RegExp.md +74 -0
  486. package/docs/v1/Exports.md +101 -0
  487. package/docs/v1/README.md +113 -15
  488. package/docs/v1/basics/asyncReplace.md +2 -0
  489. package/docs/v1/basics/browserDetector.md +28 -11
  490. package/docs/v1/basics/crypto.md +85 -0
  491. package/docs/v1/basics/deprecated/html.md +2 -0
  492. package/docs/v1/basics/deprecated/objFilter.md +2 -0
  493. package/docs/v1/basics/html.md +2 -0
  494. package/docs/v1/basics/objChecker.md +55 -0
  495. package/docs/v1/basics/objFilter.md +57 -86
  496. package/docs/v1/basics/promiseUtils.md +12 -3
  497. package/docs/v1/basics/text.md +0 -1
  498. package/docs/v1/libs/array/TinyArrayComparator.md +50 -39
  499. package/docs/v1/libs/fs/TinyFS.md +752 -0
  500. package/docs/v1/libs/fs/TinyOPFSFileSystem.md +495 -0
  501. package/docs/v1/libs/fs/TinyStorageBucketFileSystem.md +407 -0
  502. package/docs/v1/libs/plugin/TinyPlugin.md +441 -0
  503. package/docs/v1/libs/plugin/TinyVersion.md +145 -0
  504. package/docs/v1/libs/router/TinyRouter.md +216 -0
  505. package/docs/v1/libs/storage/TinyMapCache.md +219 -0
  506. package/docs/v1/libs/storage/TinySetMapDatabase.md +478 -0
  507. package/docs/v1/libs/sw/browser/TinyNotificationAdapter.md +280 -0
  508. package/docs/v1/libs/sw/browser/TinyPushManager.md +782 -0
  509. package/docs/v1/libs/sw/browser/TinyServiceWorker.md +365 -0
  510. package/docs/v1/libs/sw/browser/plugins/TabManager.md +133 -0
  511. package/docs/v1/libs/sw/service/TinyPushRouter.md +314 -0
  512. package/docs/v1/libs/sw/service/TinyServiceWorkerEngine.md +748 -0
  513. package/docs/v1/libs/sw/service/plugins/GlobBypassPlugin.md +229 -0
  514. package/docs/v1/libs/sw/service/plugins/GlobCachePlugin.md +91 -0
  515. package/docs/v1/libs/sw/service/plugins/Ping.md +36 -0
  516. package/docs/v1/libs/sw/service/plugins/TabManager.md +64 -0
  517. package/docs/v1/libs/sw/service/plugins/ViteFileDetector.md +92 -0
  518. package/docs/v1/libs/sw/service/shared/TinyPushPayload.md +316 -0
  519. package/docs/v1/libs/text/TinyI18.md +80 -56
  520. package/docs/v1/libs/tools/TinyBrowserMonitor.md +170 -0
  521. package/docs/v1/libs/tools/TinyDebugger.md +117 -1
  522. package/docs/v1/libs/tools/TinyHtmlTagRegexBuilder.md +141 -0
  523. package/docs/v1/libs/tools/TinyHttpResponseRegistry.md +129 -0
  524. package/docs/v1/libs/tools/TinyPasswordValidator.md +153 -0
  525. package/docs/v1/libs/tools/TinyPkgExportValidator.md +45 -1
  526. package/docs/v1/libs/tools/TinySiteMap.md +134 -0
  527. package/docs/v1/libs/tools/TinySiteMapStream.md +97 -0
  528. package/docs/v1/libs/tools/TinyURLSecurityVerifier.md +146 -0
  529. package/docs/v1/libs/tools/TinyUriParser/Discord.md +374 -0
  530. package/docs/v1/libs/tools/TinyUriParser/MatrixProtocol.md +54 -0
  531. package/docs/v1/libs/tools/TinyUriParser.md +128 -0
  532. package/docs/v1/libs/utils/TinyCloner.md +126 -0
  533. package/docs/v1/libs/utils/TinyPromiseQueue.md +1 -1
  534. package/docs/v1/libs/utils/TinyThrottledApi.md +219 -0
  535. package/docs/v1/libs/worker/browser/TinyWebWorker.md +331 -0
  536. package/docs/v1/libs/worker/engine/TinyWebWorkerEngine.md +137 -0
  537. package/docs/v1/regexp/Email.md +127 -0
  538. package/docs/v1/regexp/Glob.md +155 -0
  539. package/docs/v1/regexp/IPv4.md +103 -0
  540. package/docs/v1/regexp/IPv6.md +122 -0
  541. package/docs/v1/regexp/SegmentExtractor.md +120 -0
  542. package/docs/v1/regexp/UrlDetector.md +117 -0
  543. package/docs/v1/regexp/Username/Base.md +131 -0
  544. package/docs/v1/regexp/Username/Discord.md +267 -0
  545. package/docs/v1/regexp/Username/MatrixProtocol.md +131 -0
  546. package/docs/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters.md +569 -0
  547. package/docs/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.md +19 -7
  548. package/docs/v1/webTemplates/media/MediaValidator/v1/Browser.md +123 -0
  549. package/docs/v1/webTemplates/media/MediaValidator/v1/Node.md +136 -0
  550. package/docs/v1/webTemplates/multiformats/14.0/IPFSHasher.md +310 -0
  551. package/docs/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.md +131 -0
  552. package/docs/v1/webTemplates/vite/7.3/plugins/githubUtils.md +50 -0
  553. package/package.json +303 -13
  554. package/types/EventEmitter.d.ts +48 -0
  555. package/dist/v1/libs/text/TinyI18.d.mts.map +0 -1
@@ -1 +1 @@
1
- (()=>{"use strict";const e={d:(t,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var i=r[a++],n=r[a++];e.o(t,i)?0===n&&a++:0===n?Object.defineProperty(t,i,{enumerable:!0,value:r[a++]}):Object.defineProperty(t,i,{enumerable:!0,get:n})}else for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{FuzzySet:()=>n,MamdaniInferenceSystem:()=>s});const r=e=>{if(!Array.isArray(e))throw new TypeError("Parameter 'sets' must be an array.");if(!e.every(e=>e instanceof n))throw new TypeError("All elements in the array must be instances of FuzzySet.")},a=(e,t,r,a,i,n=!1)=>{if(n){if(e<=t||e>=i)return 0;if(e>=r&&e<=a)return 1}const s=t===r?1:(e-t)/(r-t),o=a===i?1:(i-e)/(i-a),u=Math.max(0,Math.min(s,1,o));return isNaN(u)?0:u},i=(e,t,r)=>{if(typeof e!==t)throw new TypeError(`Parameter '${r}' must be a ${t}.`)};class n{static trapezoid(e,t,r,i,n,s=!1){return a(e,t,r,i,n,s)}#e="";#t=0;#r=0;#a=0;#i=0;#n=!1;get name(){return this.#e}set name(e){i(e,"string","FuzzySet.name"),this.#e=e}get a(){return this.#t}set a(e){i(e,"number","FuzzySet.a"),this.#t=e}get b(){return this.#r}set b(e){i(e,"number","FuzzySet.b"),this.#r=e}get c(){return this.#a}set c(e){i(e,"number","FuzzySet.c"),this.#a=e}get d(){return this.#i}set d(e){i(e,"number","FuzzySet.d"),this.#i=e}get optimize(){return this.#n}set optimize(e){i(e,"boolean","FuzzySet.optimize"),this.#n=e}constructor(e,t,r,a,i,n=!1){this.name=e,this.a=t,this.b=r,this.c=a,this.d=i,this.optimize=n}calculate(e){return i(e,"number","calculate.x"),n.trapezoid(e,this.#t,this.#r,this.#a,this.#i,this.#n)}}class s{#s=new Map;addVariable(e,t){i(e,"string","addVariable.name"),r(t),this.#s.set(e,t)}removeVariable(e){return i(e,"string","removeVariable.name"),this.#s.delete(e)}getVariable(e){i(e,"string","getVariable.name");const t=this.#s.get(e);if(!t)throw new Error(`Linguistic variable '${e}' not found in the inference system.`);return[...t]}hasVariable(e){return i(e,"string","hasVariable.name"),this.#s.has(e)}fuzzify(e,t){i(e,"string","fuzzify.varName"),i(t,"number","fuzzify.value");const r=this.#s.get(e)||[],a={};return r.forEach(e=>{a[e.name]=e.calculate(t)}),a}}e.d(t,["defuzzifyCentroid",0,(e,t,a=.5)=>{i(e,"object","defuzzifyCentroid.fuzzyOutput");for(const t in e)i(e[t],"number",`fuzzyOutput['${t}']`);r(t),i(a,"number","defuzzifyCentroid.step");let n=0,s=0;for(let r=0;r<=100;r+=a){let a=0;t.forEach(t=>{const i=e[t.name]||0,n=Math.min(i,t.calculate(r));a=Math.max(a,n)}),n+=r*a,s+=a}return 0===s?0:n/s},"trapezoid",0,a]),window.TinyMaInSys=t})();
1
+ (()=>{"use strict";const e={d:(t,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var i=r[a++],n=r[a++],s=0===n?{enumerable:!0,value:r[a++]}:{enumerable:!0,get:n};e.o(t,i)||Object.defineProperty(t,i,s)}else for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{FuzzySet:()=>n,MamdaniInferenceSystem:()=>s});const r=e=>{if(!Array.isArray(e))throw new TypeError("Parameter 'sets' must be an array.");if(!e.every(e=>e instanceof n))throw new TypeError("All elements in the array must be instances of FuzzySet.")},a=(e,t,r,a,i,n=!1)=>{if(n){if(e<=t||e>=i)return 0;if(e>=r&&e<=a)return 1}const s=t===r?1:(e-t)/(r-t),u=a===i?1:(i-e)/(i-a),o=Math.max(0,Math.min(s,1,u));return isNaN(o)?0:o},i=(e,t,r)=>{if(typeof e!==t)throw new TypeError(`Parameter '${r}' must be a ${t}.`)};class n{static trapezoid(e,t,r,i,n,s=!1){return a(e,t,r,i,n,s)}#e="";#t=0;#r=0;#a=0;#i=0;#n=!1;get name(){return this.#e}set name(e){i(e,"string","FuzzySet.name"),this.#e=e}get a(){return this.#t}set a(e){i(e,"number","FuzzySet.a"),this.#t=e}get b(){return this.#r}set b(e){i(e,"number","FuzzySet.b"),this.#r=e}get c(){return this.#a}set c(e){i(e,"number","FuzzySet.c"),this.#a=e}get d(){return this.#i}set d(e){i(e,"number","FuzzySet.d"),this.#i=e}get optimize(){return this.#n}set optimize(e){i(e,"boolean","FuzzySet.optimize"),this.#n=e}constructor(e,t,r,a,i,n=!1){this.name=e,this.a=t,this.b=r,this.c=a,this.d=i,this.optimize=n}calculate(e){return i(e,"number","calculate.x"),n.trapezoid(e,this.#t,this.#r,this.#a,this.#i,this.#n)}}class s{#s=new Map;addVariable(e,t){i(e,"string","addVariable.name"),r(t),this.#s.set(e,t)}removeVariable(e){return i(e,"string","removeVariable.name"),this.#s.delete(e)}getVariable(e){i(e,"string","getVariable.name");const t=this.#s.get(e);if(!t)throw new Error(`Linguistic variable '${e}' not found in the inference system.`);return[...t]}hasVariable(e){return i(e,"string","hasVariable.name"),this.#s.has(e)}fuzzify(e,t){i(e,"string","fuzzify.varName"),i(t,"number","fuzzify.value");const r=this.#s.get(e)||[],a={};return r.forEach(e=>{a[e.name]=e.calculate(t)}),a}}e.d(t,["defuzzifyCentroid",0,(e,t,a=.5)=>{i(e,"object","defuzzifyCentroid.fuzzyOutput");for(const t in e)i(e[t],"number",`fuzzyOutput['${t}']`);r(t),i(a,"number","defuzzifyCentroid.step");let n=0,s=0;for(let r=0;r<=100;r+=a){let a=0;t.forEach(t=>{const i=e[t.name]||0,n=Math.min(i,t.calculate(r));a=Math.max(a,n)}),n+=r*a,s+=a}return 0===s?0:n/s},"trapezoid",0,a]),window.TinyMaInSys=t})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";const e={cw:e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyMapCache:()=>s});var n=e.cw(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}d(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&d(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var i,s,o,a;if(c(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=o.length,a=h,console&&console.warn&&console.warn(a)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function l(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):y(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function d(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,h=y(c,u);for(n=0;n<u;++n)i(h[n],this,t)}return!0},o.prototype.addListener=function(e,t){return h(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return h(this,e,t,!0)},o.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});n();const r=n().EventEmitter;class i extends r{static#e=new Set;static get activeInstances(){return Array.from(i.#e)}static get activeInstancesSize(){return i.#e.size}constructor(){super()}#t=new Map;#n=3e5;get ttl(){return this.#n}set ttl(e){if("number"!=typeof e)throw new TypeError("The TTL value must be a number.");if(e<0)throw new RangeError("The TTL value cannot be negative.");this.#n=e}get size(){return this.#t.size}has(e){if("string"!=typeof e)throw new TypeError("The cache key must be a string.");return this.purgeExpired(!0),this.#t.has(e)}delete(e){if("string"!=typeof e)throw new TypeError("The cache key must be a string.");this.purgeExpired(!0);const t=this.#t.delete(e);if(t){const t={key:e};this.emit("delete",t)}return t}set(e,t){if("string"!=typeof e)throw new TypeError("The cache key must be a string.");this.purgeExpired(!0),i.#e.has(this)||i.#e.add(this),this.#t.set(e,{data:t,timestamp:Date.now()});const n={key:e,data:t};this.emit("set",n)}get(e){if("string"!=typeof e)throw new TypeError("The cache key must be a string.");this.purgeExpired(!0);const t=this.#t.get(e);return t?t.data:null}get[Symbol.toStringTag](){return"TinyMapCache"}keys(){return this.purgeExpired(!0),this.#r().map(([e])=>e).values()}values(){return this.purgeExpired(!0),this.#r().map(([,e])=>e).values()}entries(){return this.purgeExpired(!0),this.#r().values()}[Symbol.iterator](){return this.entries()}forEach(e,t){if("function"!=typeof e)throw new TypeError("The callback must be a function.");this.purgeExpired(!0);for(const[n,r]of this.#r())e.call(t,r,n,this)}#r(){const e=[];for(const[t,n]of this.#t.entries())e.push([t,n.data]);return e}purgeExpired(e=!1){const t=Date.now();let n=0;for(const[e,r]of this.#t.entries())if(t-r.timestamp>this.#n){this.#t.delete(e),n++;const t={key:e,data:r.data};this.emit("expire",t)}if(n>0){const e={count:n};this.emit("purge",e)}this.#t.size<1&&i.#e.delete(this),e&&i.#e.forEach(e=>{e!==this&&e.purgeExpired(!1)})}clear(){i.#e.delete(this),this.#t.clear(),this.emit("clear")}}const s=i;window.TinyMapCache=t.TinyMapCache})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={206(e,t,r){r.d(t,{TinyMediaPlayer:()=>S});var o=r.cjs(function(e,t){var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,o){function i(r){e.removeListener(t,n),o(r)}function n(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,n,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,o){var i,n,a,s;if(l(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),n=e._events),a=n[t]),void 0===a)a=n[t]=r,++e._eventsCount;else if("function"==typeof a?a=n[t]=o?[r,a]:[a,r]:o?a.unshift(r):a.push(r),(i=d(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(o);return i.listener=r,o.wrapFn=i,i}function p(e,t,r){var o=e._events;if(void 0===o)return[];var i=o[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):y(i,i.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}function f(e,t,r,o){if("function"==typeof e.on)o.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(n){o.once&&e.removeEventListener(t,i),r(n)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return d(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,n=this._events;if(void 0!==n)o=o&&void 0===n.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var d=l.length,u=y(l,d);for(r=0;r<d;++r)i(u[r],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,m(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,m(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,o,i,n,a;if(l(t),void 0===(o=this._events))return this;if(void 0===(r=o[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,n=r.length-1;n>=0;n--)if(r[n]===t||r[n].listener===t){a=r[n].listener,i=n;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(o[e]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,n=Object.keys(r);for(o=0;o<n.length;++o)"removeListener"!==(i=n[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},a.prototype.listenerCount=c,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function i(e){if(!Array.isArray(e)&&!n(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function n(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function a(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const s=["chrome","firefox","ie","edge","safari","opera","yandex","other"];class l extends o.EventEmitter{#e;#t;#r;#o;#i;#n=new Map([["log",""],["info",""],["warn",""],["error",""],["debug",""],["reset",""],["black",""],["red",""],["green",""],["yellow",""],["blue",""],["magenta",""],["cyan",""],["white",""],["gray",""]]);#a=new Map([["log","[_log_LOG_reset_]"],["info","[_info_INFO_reset_]"],["warn","[_warn_WARN_reset_]"],["error","[_error_ERROR_reset_]"],["debug","[_debug_DEBUG_reset_]"]]);constructor({logger:e,id:t,debugMode:r,canEmitLogs:o=!1,useLogColors:i=!1}){if(super(),!a(e))throw new TypeError("Logger must be an object that implements the Console interface.");if("string"!=typeof t)throw new TypeError("Logger instance id must be a string.");if("boolean"!=typeof r)throw new TypeError("debugMode must be a boolean.");if("boolean"!=typeof o)throw new TypeError("canEmitLogs must be a boolean.");if("boolean"!=typeof i)throw new TypeError("useLogColors must be a boolean.");this.#t=t,this.#e=e,this.#o=r,this.#r=o,this.#i="firefox"!==function(e=[]){const t=function(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!s.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[function(){const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}()]++;const r=function(){const e=(Array.prototype.slice.call(window.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1];return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const o=function(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),o=!!document.documentMode,i=!o&&!!window.StyleMedia,n=!!window.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:o,isEdge:i,isChrome:n,isBlink:(n||e)&&!!window.CSS}}();return o.isOpera&&e.indexOf("opera")<0&&t.opera++,o.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,o.isSafari&&e.indexOf("safari")<0&&t.safari++,o.isIE&&e.indexOf("ie")<0&&t.ie++,o.isEdge&&e.indexOf("edge")<0&&t.edge++,o.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}()&&i,this.log("info","Emit logs of debug mode set to: "+(this.#o?"ON":"OFF")),this.log("info","Custom logger assigned.")}get logId(){return this.#t}get canEmitLogs(){return this.#r}get useLogColors(){return this.#i}set useLogColors(e){if("boolean"!=typeof e)throw new TypeError("useLogColors must be a boolean.");this.#i=e,this.log("info","Log Colors usage mode set to: "+(this.#i?"ON":"OFF")),this.emit("setDebugMode",e)}get debugMode(){return this.#o}set debugMode(e){if("boolean"!=typeof e)throw new TypeError("debugMode must be a boolean.");this.#o=e,this.log("info","Debug mode set to: "+(this.#o?"ON":"OFF")),this.emit("setDebugMode",e)}_addLogColor(e,t){this.#n.set(e,t)}_removeLogColor(e){this.#n.delete(e)}_addLogPrefix(e,t){this.#a.set(e,t)}_removeLogPrefix(e){this.#a.delete(e)}#s(e){if("string"!=typeof e)return e;let t=e;for(const[e,r]of this.#a){const o=new RegExp(`\\:${e}\\:`,"g");t=t.replace(o,r)}for(const[e,r]of this.#n){const o=new RegExp(`\\_${e}\\_`,"g");t=t.replace(o,this.#i?r:"")}return t}logClear(){if(this.#o)return this.#r&&this.emit("debug:clear"),this.#e.clear?this.#e.clear():console.clear()}logGroupEnd(){if(this.#o)return this.#r&&this.emit("debug:groupEnd"),this.#e.groupEnd?this.#e.groupEnd():console.groupEnd()}logLabel(e,t){if(!this.#o)return;const r=["count","countReset","time","timeEnd","profile","profileEnd","timeStamp"];if(!r.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${r.join(", ")}`);if(void 0!==t&&"string"!=typeof t)throw new TypeError("The label must be a string.");const o=this.#e[e]?this.#e[e]:console[e];if(!o)throw new TypeError(`The log type "${e}" is not supported by the provided logger or console.`);return this.#r&&this.emit("debug:logLabel",e,t),o(t)}logTimeLabel(e,...t){if(this.#o)return this.#r&&this.emit("debug:timeLog",e,...t),this.#e.timeLog?this.#e.timeLog(e,...t):console.timeLog(e,...t)}logAssert(e,...t){if(this.#o)return this.#r&&this.emit("debug:assert",e,...t),this.#e.assert?this.#e.assert(e,...t):console.assert(e,...t)}logDir(e,t){if(this.#o)return this.#r&&this.emit("debug:dir",e,t),this.#e.dir?this.#e.dir(e,t):console.dir(e,t)}logTable(e,t){if(this.#o){if(!(void 0===t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("Properties must be an array of strings.");return this.#r&&this.emit("debug:table",e,t),this.#e.table?this.#e.table(e,t):console.table(e,t)}}log(e,t,...r){if(!this.#o)return;const o=["log","info","warn","error","debug","dirxml","group","groupCollapsed","trace"];if(!o.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${o.join(", ")}`);if("string"!=typeof t)throw new TypeError("The message must be a string.");let i=this.#t,n=t;i=this.#s(i),n=this.#s(n);const a=this.#e[e]?this.#e[e]:console[e];return a?(this.#r&&this.emit("debug:log",i,n,...r),a(i,n,...r)):(this.#r&&this.emit("debug:log",i,n,...r),console.log(i,n,...r))}}const d=l;function u(e,t){if(void 0!==t.obj&&"function"!=typeof t.obj)throw new TypeError("filter.obj must be a function if provided.");if(void 0!==t.value&&"function"!=typeof t.value)throw new TypeError("filter.value must be a function if provided.");if(void 0!==t.array&&"function"!=typeof t.array)throw new TypeError("filter.array must be a function if provided.");let r;r=e instanceof Map?new Map:e instanceof Set?new Set:{};const o=(i=e)instanceof Map?Array.from(i.entries()):i instanceof Set?Array.from(i.values()).map(e=>[void 0,e]):Object.entries(i);var i;const n=(e,r)=>{const o=[];for(let i=0;i<e.length;i++){const s=e[i];if(Array.isArray(s))o.push(n(s,r));else if(a(s)){const r=u(s,t);(void 0===t.obj||t.obj(r,i,e))&&o.push(r)}else(void 0===t.value||t.value([r,s],i,e))&&o.push(s)}return o};for(let e=0;e<o.length;e++){const[i,s]=o[e];if(Array.isArray(s)){const a=n(s,i);(void 0===t.array||t.array([i,a],e,o))&&(r instanceof Map||r instanceof Set?r instanceof Map?r.set(i,a):r.add(a):r[i]=a)}else if(a(s)){const n=u(s,t);(void 0===t.obj||t.obj(n,e,o))&&(r instanceof Map?r.set(i,n):r instanceof Set?r.add(n):r[i]=n)}else(void 0===t.value||t.value([i,s],e,o))&&(r instanceof Map?r.set(i,s):r instanceof Set?r.add(s):r[i]=s)}return r}const h=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},m=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},p=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},c=(e,t=!1)=>!t&&void 0===e,y=(e,t=!1)=>c(e,t)||"string"==typeof e||!t&&null===e,f=(e,t=!1)=>c(e,t)||"number"==typeof e||!t&&null===e,g=(e,t=!1)=>c(e,t)||"boolean"==typeof e||!t&&null===e,w=(e,t)=>!!c(e)||(m(t,"valueValidator"),Array.isArray(e)&&e.every(t)),b=new Map;class v extends Error{constructor(e,t,r){if(h(e,"message"),h(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const E=async e=>{h(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},T=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);h(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=b.get(t);return b.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const o=e.split(",")[1],i=atob(o),n=new Uint8Array(i.length);for(let e=0;e<i.length;e++)n[e]=i.charCodeAt(e);return r(new Blob([n],{type:t}))}return"string"==typeof e?e:""},I=(e,t=!1)=>{if(n(e)){if(4!==i(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}x(e.common),p(e.native,"_fetchData.native"),p(e.format,"_fetchData.format"),p(e.quality,"_fetchData.quality");for(const r in e.native){const o=e.native[r];if(!w(o,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},x=e=>{if(p(e,"common"),I(e._fetchData),!y(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!y(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!y(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!y(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!g(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!g(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!g(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!g(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!f(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!f(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!f(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!f(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!f(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!f(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!f(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!f(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!f(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!f(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!f(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!y(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!y(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!y(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!y(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!y(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!y(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!y(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!y(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!y(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!y(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!y(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!y(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!y(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!y(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!y(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!y(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!y(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!y(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!y(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!y(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!y(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!y(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!y(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!y(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!y(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!y(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!y(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!y(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!y(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!y(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!y(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!y(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!y(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!y(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!y(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!y(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!w(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!w(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!w(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!w(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!w(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!w(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!w(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!w(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!w(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!w(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!w(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!w(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!w(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!w(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!w(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!w(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!w(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!w(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!w(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!w(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!w(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!w(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!w(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!w(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!w(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!w(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!w(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!w(e.comment,e=>null!==e&&"object"==typeof e&&y(e.descriptor)&&y(e.language)&&y(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!w(e.lyrics,e=>null!==e&&"object"==typeof e&&y(e.text)&&y(e.descriptor)&&y(e.language)&&(!Array.isArray(e)||w(e.syncText,e=>null!==e&&"object"==typeof e&&y(e.text)&&f(e.timestamp)))&&(e=>void 0===e||null!==e&&"object"==typeof e&&f(e.notSynchronized)&&f(e.mpegFrameNumber)&&f(e.milliseconds))(e.timeStampFormat)&&(e=>void 0===e||null!==e&&"object"==typeof e&&f(e.other)&&f(e.lyrics)&&f(e.text)&&f(e.movement_part)&&f(e.events)&&f(e.chord)&&f(e.trivia_pop))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!w(e.rating,e=>null!==e&&"object"==typeof e&&y(e.source)&&f(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!c(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},A=async(e,t,r=!0)=>{h(e,"url"),m(t,"parseFile");const o=await fetch(e);if(!o.ok)throw new Error(`Failed to fetch audio file: ${o.status} ${o.statusText}`);const n=await o.blob(),a=await t(n);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),I(a);const s=a.common;x(s);const l=s?.picture?.map(e=>({...e,data:r?T(e.data,e.format):e.data}))??[];a.common={...a.common,picture:l.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=s?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(l[t])return{...e,value:{...e.value,data:""}}}return e})});const d=u({title:s?.title,album:s?.album,albumartist:s?.albumartist,albumartists:s?.albumartists,genre:s?.genre,label:s?.label,composer:s?.composer,year:s?.year,artist:s?.artist,artists:s?.artists,disk:s?.disk?{no:s.disk.no,of:s.disk.of}:void 0,track:s?.track?{no:s.track.no,of:s.track.of}:void 0,movementIndex:s?.movementIndex?{no:s.movementIndex.no,of:s.movementIndex.of}:void 0,picture:l,date:s?.date,originaldate:s?.originaldate,originalyear:s?.originalyear,releasedate:s?.releasedate,comment:s?.comment,lyrics:s?.lyrics,albumsort:s?.albumsort,titlesort:s?.titlesort,work:s?.work,artistsort:s?.artistsort,albumartistsort:s?.albumartistsort,composersort:s?.composersort,lyricist:s?.lyricist,writer:s?.writer,conductor:s?.conductor,remixer:s?.remixer,arranger:s?.arranger,engineer:s?.engineer,publisher:s?.publisher,producer:s?.producer,djmixer:s?.djmixer,mixer:s?.mixer,technician:s?.technician,grouping:s?.grouping,subtitle:s?.subtitle,description:s?.description,longDescription:s?.longDescription,discsubtitle:s?.discsubtitle,totaltracks:s?.totaltracks,totaldiscs:s?.totaldiscs,movementTotal:s?.movementTotal,compilation:s?.compilation,rating:s?.rating,bpm:s?.bpm,mood:s?.mood,media:s?.media,catalognumber:s?.catalognumber,tvShow:s?.tvShow,tvShowSort:s?.tvShowSort,tvSeason:s?.tvSeason,tvEpisode:s?.tvEpisode,tvEpisodeId:s?.tvEpisodeId,tvNetwork:s?.tvNetwork,podcast:s?.podcast,podcasturl:s?.podcasturl,releasestatus:s?.releasestatus,releasetype:s?.releasetype,releasecountry:s?.releasecountry,script:s?.script,language:s?.language,copyright:s?.copyright,license:s?.license,encodedby:s?.encodedby,encodersettings:s?.encodersettings,gapless:s?.gapless,barcode:s?.barcode,isrc:s?.isrc,asin:s?.asin,website:s?.website,performer_instrument:s?.performer_instrument,averageLevel:s?.averageLevel,peakLevel:s?.peakLevel,notes:s?.notes,originalalbum:s?.originalalbum,originalartist:s?.originalartist,key:s?.key,category:s?.category,hdVideo:s?.hdVideo,keywords:s?.keywords,movement:s?.movement,podcastId:s?.podcastId,showMovement:s?.showMovement,stik:s?.stik,playCounter:s?.playCounter},{value:([e,t])=>null!=t,obj:e=>i(e)>0,array:([e,t])=>t.length>0});return d._fetchData=a,d},k=e=>t=>{if(t)throw new Error(`This ${e} instance has been destroyed and can no longer be used.`)},M=k("BaseMediaAdapter");class C extends o.EventEmitter{constructor(){if(new.target===C)throw new Error("BaseMediaAdapter is an abstract class and cannot be instantiated directly.");super()}#l=!1;get destroyed(){return this.#l}static getThumbnailUrl(e){if("string"!=typeof e||""===e.trim())throw new TypeError('The "trackId" must be a non-empty string.');return""}static canHandle(e){throw new Error('Method "canHandle" must be implemented by the subclass.')}isReady(){throw M(this.#l),new Error('Method "isReady" must be implemented by the subclass.')}isPaused(){throw M(this.#l),new Error('Method "isPaused" must be implemented by the subclass.')}isEnded(){throw M(this.#l),new Error('Method "isEnded" must be implemented by the subclass.')}async waitIsReady(){throw M(this.#l),new Error('Method "waitIsReady" must be implemented by the subclass.')}canHandle(e){return M(this.#l),C.canHandle(e)}async play(e){throw M(this.#l),new Error('Method "play" must be implemented by the subclass.')}async pause(){throw M(this.#l),new Error('Method "pause" must be implemented by the subclass.')}async stop(){throw M(this.#l),new Error('Method "stop" must be implemented by the subclass.')}async seek(e){throw M(this.#l),new Error('Method "seek" must be implemented by the subclass.')}isMuted(){throw M(this.#l),new Error('Method "isMuted" must be implemented by the subclass.')}async mute(){throw M(this.#l),new Error('Method "mute" must be implemented by the subclass.')}async unMute(){throw M(this.#l),new Error('Method "unMute" must be implemented by the subclass.')}getCurrentTime(){throw M(this.#l),new Error('Method "getCurrentTime" must be implemented by the subclass.')}getTotalDuration(){throw M(this.#l),new Error('Method "getTotalDuration" must be implemented by the subclass.')}getRemainingTime(){throw M(this.#l),new Error('Method "getRemainingTime" must be implemented by the subclass.')}getPlaybackPercentage(){throw M(this.#l),new Error('Method "getPlaybackPercentage" must be implemented by the subclass.')}getTimeData(){throw M(this.#l),new Error('Method "getTimeData" must be implemented by the subclass.')}setVolume(e){throw M(this.#l),new Error('Method "setVolume" must be implemented by the subclass.')}getVolume(){throw M(this.#l),new Error('Method "getVolume" must be implemented by the subclass.')}async getContentData(){throw M(this.#l),new Error('Method "getContentData" must be implemented by the subclass.')}destroy(){this.#l||(this.removeAllListeners(),this.#l=!0,this.emit("destroyed"))}}const L=k("TinyMediaPlayer");class P extends d{static BaseMediaAdapter=C;static#d="Unknown Artist";static get unknownArtist(){return P.#d}static set unknownArtist(e){if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("unknownArtist must be a string or a function.");P.#d=e}static async parseContent(e,t,r,o,i,a){return(async(e,t={},r={},o=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},i={},a=!0,s="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(p(t,"defaultMetadata"),p(r,"metadata"),m(o,"parseFile"),p(i,"callbacks"),i.onProgress&&"function"!=typeof i.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(i.onError&&"function"!=typeof i.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof s&&"function"!=typeof s)throw new TypeError("unknownArtist must be a string or a function returning a string.");let l,d="";const u=(t,r)=>{if(h(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');i.onProgress&&i.onProgress({event:r,status:"loading",stage:t,url:d||(e instanceof HTMLMediaElement?e.src:"unknown")})},c=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');h(r,"stage"),i.onError&&i.onError({error:t instanceof Error?t:new Error(String(t)),url:d||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{u("INITIALIZING"),"string"==typeof e?(d=e,l=new Audio(d)):(l=e,d=l.src);try{await new Promise((e,t)=>{const r=e=>u("DOWNLOADING",e),o=()=>{n(),e(void 0)},i=e=>{n(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},n=()=>{l.removeEventListener("progress",r),l.removeEventListener("loadedmetadata",o),l.removeEventListener("error",i)};l.addEventListener("progress",r),l.addEventListener("loadedmetadata",o),l.addEventListener("error",i),l.readyState>=1&&(n(),e(void 0))}),u("METADATA_LOADED")}catch(e){throw new v(e instanceof Error?e.message:"UNKNOWN ERROR",d,"METADATA")}const m={id:r.id||await E(d),duration:Math.floor(1e3*l.duration),url:d,weight:r.weight??1};let p={};u("EXTRACTING_ID3");try{p=await A(d,o,a)}catch(e){c(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${d}. Falling back to filename.`)}const y=e=>{h(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},f=e=>{const t={...e};return n(t._fetchData)&&(n(p._fetchData)&&(t._fetchData={...p._fetchData}),n(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},g={...m,...f(t),...p,...f(r),title:p.title||r.title||y(d),artist:p.artist||r.artist||("string"==typeof s?s:String(s()))};return i.onProgress&&i.onProgress({status:"success",stage:"COMPLETE",url:d}),g}catch(e){if(e instanceof v)throw e;const t=new v(e instanceof Error?e.message:"UNKNOWN ERROR",d,"INITIALIZING");throw c(t,"INITIALIZING"),t}})(e,t,r,o,i,a,P.#d)}#l=!1;get destroyed(){return this.#l}#u=new Set;#h=new WeakMap;#m=[];#p=-1;#c="NONE";#y=!1;#f=!1;#g=!1;#w=1;#b;#v;#E;#T=!1;#I;#x;#A=null;#k=null;#M=300;get fadeVolumeSpeed(){return L(this.#l),this.#M}set fadeVolumeSpeed(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("fadeVolumeSpeed must be a number.");if(e<0)throw new RangeError("fadeVolumeSpeed cannot be negative.");this.#M=e,this.emit("fadeVolumeSpeedChange",this.#M)}#C=2e3;get prevClickTimeoutDuration(){return L(this.#l),this.#C}set prevClickTimeoutDuration(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("prevClickTimeoutDuration must be a number.");if(e<0)throw new RangeError("prevClickTimeoutDuration cannot be negative.");this.#C=e,this.emit("prevClickTimeoutDurationChange",this.#C)}get repeatCurrentOnPrev(){return L(this.#l),this.#E}set repeatCurrentOnPrev(e){if(L(this.#l),"boolean"!=typeof e)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e,this.emit("repeatCurrentOnPrevChange",this.#E)}get smoothPlayPauseVolume(){return L(this.#l),this.#I}set smoothPlayPauseVolume(e){if(L(this.#l),"boolean"!=typeof e)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e,this.emit("smoothPlayPauseVolumeChange",this.#I)}get smoothStopVolume(){return L(this.#l),this.#x}set smoothStopVolume(e){if(L(this.#l),"boolean"!=typeof e)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e,this.emit("smoothStopVolumeChange",this.#x)}constructor(e={}){if(!a(e))throw new TypeError("Options must be a non-null object.");if(super({id:"[_blue_TinyMediaPlayer_reset_] :debug:",logger:e.logger??console,debugMode:e.debugMode??!1,useLogColors:e.useLogColors??!1}),void 0!==e.persistVolume){if("boolean"!=typeof e.persistVolume)throw new TypeError("persistVolume must be a boolean.");this.#b=e.persistVolume}else this.#b=!1;if(void 0!==e.volumeStorageKey){if("string"!=typeof e.volumeStorageKey)throw new TypeError("volumeStorageKey must be a string.");this.#v=e.volumeStorageKey}else this.#v="tiny_media_player_volume";if(void 0!==e.repeatCurrentOnPrev){if("boolean"!=typeof e.repeatCurrentOnPrev)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e.repeatCurrentOnPrev}else this.#E=!1;if(void 0!==e.smoothPlayPauseVolume){if("boolean"!=typeof e.smoothPlayPauseVolume)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e.smoothPlayPauseVolume}else this.#I=!1;if(void 0!==e.smoothStopVolume){if("boolean"!=typeof e.smoothStopVolume)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e.smoothStopVolume}else this.#x=!1;this.#b&&this.#L(),this.log("info","Instance initialized.",{options:e})}#L(){try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(this.#v);if(null!==e){const t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1&&(this.#w=t,this.log("info",`Volume loaded from storage: ${this.#w}`))}}}catch(e){console.warn("[TinyMediaPlayer] Failed to read volume from localStorage.",e)}}#P(){try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.setItem(this.#v,this.#w.toString()),this.log("info",`Volume saved to storage: ${this.#w}`))}catch(e){console.warn("[TinyMediaPlayer] Failed to save volume to localStorage.",e)}}_getWeightedRandomIndex(){if(0===this.#m.length)return-1;if(1===this.#m.length)return 0;let e=0;for(let t=0;t<this.#m.length;t++){if(t===this.#p)continue;const r=this.#m[t];e+="number"==typeof r.weight&&r.weight>0?r.weight:1}let t=Math.random()*e;for(let e=0;e<this.#m.length;e++){if(e===this.#p)continue;const r=this.#m[e],o="number"==typeof r.weight&&r.weight>0?r.weight:1;if(t<o)return e;t-=o}return this.#p===this.#m.length-1?0:this.#m.length-1}async#S(e){this.#A&&this.#A.abort(),this.#A=new AbortController;const{signal:t}=this.#A,r=this.#_();if(!r)return;const o=r.getVolume(),i=performance.now(),n=this.#M;return this.log("info",`Starting volume fade: ${o} -> ${e}`),new Promise(a=>{const s=l=>{if(t.aborted)return this.log("info","Volume fade aborted."),a();const d=l-i,u=Math.min(d/n,1),h=o+(e-o)*u,m=Math.max(0,Math.min(1,h));r.setVolume(m),u<1?requestAnimationFrame(s):(r.setVolume(e),this.log("info",`Volume fade completed: ${e}`),a())};requestAnimationFrame(s)})}get playlist(){return L(this.#l),[...this.#m]}set playlist(e){if(L(this.#l),!Array.isArray(e))throw new TypeError("Playlist must be an array of MediaContent objects.");e.forEach(e=>x(e));const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#m=e,this.log("info",`Playlist updated. New size: ${this.#m.length}`),this.emit("playlistUpdate",this.playlist),0===this.#m.length?this.#p=-1:(this.#p>=this.#m.length||-1===this.#p)&&(this.#p=0),this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on playlist update:",e),console.warn("[TinyMediaPlayer] Background transition error on playlist update:",e)}})()}get currentIndex(){return L(this.#l),this.#p}set currentIndex(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Current index must be a number.");if(e<-1||e>=this.#m.length&&this.#m.length>0)throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);if(this.#p===e)return;this.log("info",`Index change requested: ${this.#p} -> ${e}`);const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#p=e,this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on index update:",e),console.warn("[TinyMediaPlayer] Background transition error on index update:",e)}})()}get loopMode(){return L(this.#l),this.#c}set loopMode(e){L(this.#l);const t=["NONE","TRACK","PLAYLIST"];if(!t.includes(e))throw new TypeError(`Loop mode must be one of: ${t.join(", ")}.`);this.#c=e,this.log("info",`Loop mode changed to: ${this.#c}`),this.emit("loopModeChange",this.#c)}get isRandom(){return L(this.#l),this.#y}set isRandom(e){if(L(this.#l),"boolean"!=typeof e)throw new TypeError("Random mode state must be a boolean.");this.#y=e,this.log("info",`Random mode: ${this.#y}`),this.emit("randomModeChange",this.#y)}get isPlaying(){return L(this.#l),this.#f}get volume(){return L(this.#l),this.#w}set volume(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Volume must be a number.");if(e<0||e>1)throw new RangeError("Volume must be tightly constrained between 0.0 and 1.0.");if(this.#A&&this.#A.abort(),this.log("info",`Volume changed: ${this.#w} -> ${e}`),this.#w=e,this.#P(),this.emit("volumeChange",this.#w),-1!==this.#p&&this.#m.length>0)try{const e=this.#_();e&&e.setVolume(this.#w)}catch(e){}}get persistVolume(){return L(this.#l),this.#b}set persistVolume(e){if(L(this.#l),"boolean"!=typeof e)throw new TypeError("Persist volume parameter must be a boolean.");this.#b=e,this.log("info",`Persist volume: ${this.#b}`),e&&this.#P()}get volumeStorageKey(){return L(this.#l),this.#v}set volumeStorageKey(e){if(L(this.#l),"string"!=typeof e)throw new TypeError("Volume storage key must be a string.");if(""===e.trim())throw new TypeError("Volume storage key cannot be an empty string.");const t=this.#v;this.#v=e;try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.removeItem(t),this.#P())}catch(e){console.warn("[TinyMediaPlayer] Failed to migrate volume storage key.",e)}}get isMuted(){return L(this.#l),this.#g}async mute(){L(this.#l);const e=this.#_();e&&(await e.mute(),this.#g=!0,this.emit("muteChange",this.#g),this.log("info","Playback muted successfully."))}async unMute(){L(this.#l);const e=this.#_();e&&(await e.unMute(),this.#g=!1,this.emit("muteChange",this.#g),this.log("info","Playback unmuted successfully."))}get adapters(){return Array.from(this.#u)}get adaptersSize(){return this.#u.size}static#O=["timeupdate","ended"];static get defaultAdapterEventNames(){return structuredClone(P.#O)}static set defaultAdapterEventNames(e){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError("TinyMediaPlayer.defaultAdapterEventNames must be an array of strings.");P.#O=[...e]}#V=new Set(P.defaultAdapterEventNames);#R(e){const t=this.#h.get(e);t&&(this.#V.forEach(r=>{const o=t.get(r);o&&e.off(r,o)}),t.clear(),this.#h.delete(e))}registerAdapter(e){if(L(this.#l),!(e instanceof C))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Registering new adapter:",e);const t=new Map;this.#h.set(e,t),this.#V.forEach(t=>{this.#j(e,t)}),this.#u.add(e)}removeAdapter(e){if(L(this.#l),!(e instanceof C))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.log("info","Removing adapter:",e),this.#R(e),this.#u.delete(e)}destroyAdapter(e){if(L(this.#l),!(e instanceof C))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Destroying adapter:",e),this.#R(e);const t=this.#u.delete(e);return t&&e.destroy(),t}hasAdapter(e){if(L(this.#l),!(e instanceof C))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.#u.has(e)}destroyAllAdapters(){L(this.#l),this.log("info","Destroying all adapters."),this.#u.forEach(e=>{this.#R(e),e.destroy()}),this.#u.clear()}clearAdapters(){L(this.#l),this.log("info","Clearing all adapters."),this.#u.forEach(e=>this.#R(e)),this.#u.clear()}getMediaAdapter(e){if(!a(e))throw new TypeError("Content must be a valid object.");for(const t of this.#u.values())if(t.canHandle(e))return t;return null}#_(){if(-1===this.#p||0===this.#m.length)return null;const e=this.#m[this.#p],t=this.getMediaAdapter(e);if(t)return t;const r=`No compatible adapter found for content ID: ${e.id}.`;throw this.log("error",r),new Error(r)}addAdapterEvent(e){if(L(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)||(this.log("info",`Adding adapter event listener: ${e}`),this.#V.add(e),this.#u.forEach(t=>{this.#j(t,e)}))}removeAdapterEvent(e){if(L(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)&&(this.log("info",`Removing adapter event listener: ${e}`),this.#V.delete(e),this.#u.forEach(t=>{this.#N(t,e)}))}resetAdapterEvents(){L(this.#l);const e=P.defaultAdapterEventNames,t=Array.from(this.#V);for(const r of t)e.includes(r)||this.removeAdapterEvent(r);for(const t of e)this.#V.has(t)||this.addAdapterEvent(t)}#j(e,t){const r=this.#h.get(e);if(!r)return;const o=(...e)=>{this.#l||("timeupdate"!==t&&this.log("debug",`Adapter event triggered: ${t}`,...e),this.emit(t,...e))};e.on(t,o),r.set(t,o)}#N(e,t){const r=this.#h.get(e);if(!r)return;const o=r.get(t);o&&(e.off(t,o),r.delete(t))}addTrack(e){if(L(this.#l),!a(e)||"string"!=typeof e.url)throw new TypeError("Track content must be a valid MediaContent object containing a URL.");const t={id:"",title:"",artist:"",url:"",duration:0,weight:1,...e};x(t);const r=this.#m.push(t);return this.log("info",`Track added. New length: ${r}`,t),-1===this.#p&&(this.#p=0,this.emit("trackChange",this.#p)),this.emit("playlistUpdate",this.playlist),r}existsTrack(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");return e>=0&&e<this.#m.length}getTrack(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);return this.#m[e]}async removeTrack(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Removing track at index: ${e}`),e===this.#p?(await this.stop(),this.#m.splice(e,1),0===this.#m.length?this.#p=-1:this.#p>=this.#m.length&&(this.#p=0),this.emit("trackChange",this.#p)):(this.#m.splice(e,1),e<this.#p&&(this.#p-=1,this.emit("trackChange",this.#p))),this.emit("playlistUpdate",this.playlist)}searchTrack(e){if(L(this.#l),"string"!=typeof e&&"function"!=typeof e)throw new TypeError("Search query must be a string or a boolean evaluation function.");this.log("info","Searching playlist...",{query:e});const t=[];for(let r=0;r<this.#m.length;r++){const o=this.#m[r];let i=!1;if("function"==typeof e)i=Boolean(e(o));else{const t=e.toLowerCase(),r=o.title&&o.title.toLowerCase().includes(t),n=o.artist&&o.artist.toLowerCase().includes(t),a=o.album&&o.album.toLowerCase().includes(t);i=Boolean(r||n||a)}i&&t.push({track:o,index:r})}return this.log("info",`Search completed. Found ${t.length} results.`),t}async clearPlaylist(){L(this.#l),this.log("info","Clearing entire playlist."),await this.stop(),this.#m=[],this.#p=-1,this.emit("playlistUpdate",this.playlist),this.emit("trackChange",this.#p)}async play(){L(this.#l),this.log("info",`Attempting to play track at index: ${this.#p}`);const e=this.#_();if(e){this.#I?await this.#S(this.#w):e.setVolume(this.#w);try{await e.play(this.#m[this.#p]),this.#g&&await e.mute(),this.#f=!0,this.log("info","Playback started successfully."),this.emit("play",this.#p)}catch(e){throw this.log("error","Failed to play track:",e),e}}else this.log("error","Failed to play track:",`Active adapter not found for track at index ${this.#p}.`)}async pause(){L(this.#l),this.log("info","Attempting to pause playback.");const e=this.#_();e&&(this.#I&&await this.#S(0),await e.pause(),this.#f=!1,this.log("info","Playback paused."),this.emit("pause",this.#p))}async stop(){L(this.#l),this.log("info","Attempting to stop playback.");const e=this.#_();e&&(this.#x&&await this.#S(0),await e.stop(),this.#f=!1,this.log("info","Playback stopped."),this.emit("stop",this.#p))}async next(){if(L(this.#l),0!==this.#m.length){if(this.log("info","Next track requested."),await this.stop(),"TRACK"===this.#c)return this.log("info","Loop mode: TRACK. Repeating current track."),void await this.play();if(this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p+1;if(e>=this.#m.length){if("PLAYLIST"!==this.#c)return void this.log("info","End of playlist reached. Stopping.");e=0,this.log("info","Loop mode: PLAYLIST. Returning to start.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async prev(){if(L(this.#l),0!==this.#m.length){if(this.#E&&!this.#T)return this.log("info",'UX: Repeat current track on first "prev" click.'),this.#T=!0,this.#k&&clearTimeout(this.#k),this.#k=setTimeout(()=>{this.#T=!1,this.#k=null},2e3),await this.stop(),void await this.play();if(this.#k&&(clearTimeout(this.#k),this.#k=null),this.#T=!1,this.log("info","Previous track requested."),await this.stop(),this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p-1;if(e<0){if("PLAYLIST"!==this.#c)return void this.log("info","Start of playlist reached. Stopping.");e=this.#m.length-1,this.log("info","Loop mode: PLAYLIST. Returning to end.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async skipTo(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Skipping to index: ${e}`),await this.stop(),this.#p=e,this.emit("trackChange",this.#p),await this.play()}async seek(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Seek time must be a number in milliseconds.");if(e<0)throw new RangeError("Seek time cannot be negative.");this.log("info",`Seeking to: ${e}ms`);const t=this.#_();t&&(await t.seek(e),this.emit("seek",e))}async step(e){if(L(this.#l),"number"!=typeof e)throw new TypeError("Step amount must be a number in milliseconds.");this.log("info",`Stepping by: ${e}ms`);const t=this.#_();if(!t)return;let r=t.getCurrentTime()+e;r<0&&(r=0),await this.seek(r)}getCurrentTime(){L(this.#l);try{const e=this.#_();return e?e.getCurrentTime():0}catch{return 0}}getTotalDuration(){L(this.#l);try{const e=this.#_();return e?e.getTotalDuration():0}catch{return 0}}getRemainingTime(){L(this.#l);try{const e=this.#_();return e?e.getRemainingTime():0}catch{return 0}}getPlaybackPercentage(){L(this.#l);try{const e=this.#_();return e?e.getPlaybackPercentage():0}catch{return 0}}get isPaused(){L(this.#l);try{const e=this.#_();return!!e&&e.isPaused()}catch{return!1}}get isEnded(){L(this.#l);try{const e=this.#_();return!e||e.isEnded()}catch{return!0}}async getContentData(){L(this.#l);const e={id:"",createdAt:"",artistId:"",artistName:"",description:"",title:"",duration:0,avatar:"",url:""};try{const t=this.#_();return t?t.getContentData():e}catch{return e}}async waitIsReady(){L(this.#l);const e=this.#_();if(e)return e.waitIsReady()}async destroy(){if(!this.#l){this.log("info","Destroying TinyMediaPlayer instance.");try{this.#f&&await this.stop()}catch(e){this.log("error","Non-fatal error during playback termination:",e),console.warn("[TinyMediaPlayer] Non-fatal error during playback termination:",e)}this.#k&&clearTimeout(this.#k),this.#m=[],this.#p=-1,this.#f=!1,this.#T=!1,this.destroyAllAdapters(),this.removeAllListeners(),this.#V.clear(),this.#l=!0,this.emit("destroyed")}}}const S=P}};const t={};function r(o){const i=t[o];if(void 0!==i)return i.exports;const n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var i=t[o++],n=t[o++];r.o(e,i)?0===n&&o++:0===n?Object.defineProperty(e,i,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,i,{enumerable:!0,get:n})}else for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let o=r(206);window.TinyMediaPlayer=o.TinyMediaPlayer})();
1
+ (()=>{"use strict";const e={cw:e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyMediaPlayer:()=>O});var r=e.cw(function(e,t){var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,o){function i(r){e.removeListener(t,n),o(r)}function n(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,n,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,o){var i,n,a,s;if(l(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),n=e._events),a=n[t]),void 0===a)a=n[t]=r,++e._eventsCount;else if("function"==typeof a?a=n[t]=o?[r,a]:[a,r]:o?a.unshift(r):a.push(r),(i=d(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(o);return i.listener=r,o.wrapFn=i,i}function p(e,t,r){var o=e._events;if(void 0===o)return[];var i=o[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):f(i,i.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}function y(e,t,r,o){if("function"==typeof e.on)o.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(n){o.once&&e.removeEventListener(t,i),r(n)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return d(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,n=this._events;if(void 0!==n)o=o&&void 0===n.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var d=l.length,u=f(l,d);for(r=0;r<d;++r)i(u[r],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return l(t),this.on(e,m(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,m(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,o,i,n,a;if(l(t),void 0===(o=this._events))return this;if(void 0===(r=o[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,n=r.length-1;n>=0;n--)if(r[n]===t||r[n].listener===t){a=r[n].listener,i=n;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(o[e]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,n=Object.keys(r);for(o=0;o<n.length;++o)"removeListener"!==(i=n[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},a.prototype.listenerCount=c,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function o(e){if(!Array.isArray(e)&&!i(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function n(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}r();const a="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:null,s="undefined"!=typeof document?document:null,l=["chrome","firefox","ie","edge","safari","opera","yandex","other"];const d=r().EventEmitter,u=class extends d{#e;#t;#r=null;#o;#i;#n;#a;#s=new Map([["log",""],["info",""],["warn",""],["error",""],["debug",""],["main_class",""],["sub_class",""],["reset",""],["black",""],["red",""],["green",""],["yellow",""],["blue",""],["magenta",""],["cyan",""],["white",""],["gray",""]]);#l=new Map([["log","[_log_LOG_reset_]"],["info","[_info_INFO_reset_]"],["warn","[_warn_WARN_reset_]"],["error","[_error_ERROR_reset_]"],["debug","[_debug_DEBUG_reset_]"]]);constructor({logger:e,id:t,debugMode:r,canEmitLogs:o=!1,useLogColors:i=!1,autoHideId:d=!1}){if(super(),!n(e))throw new TypeError("Logger must be an object that implements the Console interface.");if("string"!=typeof t)throw new TypeError("Logger instance id must be a string.");if("boolean"!=typeof r)throw new TypeError("debugMode must be a boolean.");if("boolean"!=typeof o)throw new TypeError("canEmitLogs must be a boolean.");if("boolean"!=typeof i)throw new TypeError("useLogColors must be a boolean.");if("boolean"!=typeof d)throw new TypeError("autoHideId must be a boolean.");this.#t=t,this.#e=e,this.#i=r,this.#o=o,this.#a=d,this.#n="firefox"!==function(e=[]){const t=function(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!l.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[function(){if("undefined"==typeof navigator)return"other";const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}()]++;const r=function(){const e=a?.getComputedStyle?(Array.prototype.slice.call(a.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1]:"";return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const o=function(){const e=!!a?.opr&&!!opr.addons||!!a?.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=!!a?.HTMLElement&&/constructor/i.test(a.HTMLElement)||"[object SafariRemoteNotification]"===(!a.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),o=!!s?.documentMode,i=!o&&!!a?.StyleMedia,n=!!a?.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:o,isEdge:i,isChrome:n,isBlink:(n||e)&&!!a?.CSS}}();return o.isOpera&&e.indexOf("opera")<0&&t.opera++,o.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,o.isSafari&&e.indexOf("safari")<0&&t.safari++,o.isIE&&e.indexOf("ie")<0&&t.ie++,o.isEdge&&e.indexOf("edge")<0&&t.edge++,o.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}()&&i,this.log("info","Emit logs of debug mode set to: "+(this.#i?"ON":"OFF")),this.log("info","Custom logger assigned.")}get logId(){return this.#t}get logSubId(){if("string"!=typeof this.#r)throw new Error('logSubId has not been set yet. Assign a string to "logSubId" before reading it.');return this.#r}set logSubId(e){if("string"!=typeof e)throw new TypeError(`logSubId must be a string. Received: ${typeof e}.`);if(null!==this.#r)throw new Error(`logSubId is already set to "${this.#r}" and cannot be reassigned.`);this.#r=e,this.emit("setLogSubId",e)}get canEmitLogs(){return this.#o}get useLogColors(){return this.#n}set useLogColors(e){if("boolean"!=typeof e)throw new TypeError("useLogColors must be a boolean.");this.#n=e,this.log("info","Log Colors usage mode set to: "+(this.#n?"ON":"OFF")),this.emit("setUseLogColors",e)}get debugMode(){return this.#i}set debugMode(e){if("boolean"!=typeof e)throw new TypeError("debugMode must be a boolean.");this.#i=e,this.log("info","Debug mode set to: "+(this.#i?"ON":"OFF")),this.emit("setDebugMode",e)}_addLogColor(e,t){this.#s.set(e,t)}_removeLogColor(e){this.#s.delete(e)}_addLogPrefix(e,t){this.#l.set(e,t)}_removeLogPrefix(e){this.#l.delete(e)}#d(e){if("string"!=typeof e)return e;let t=e;for(const[e,r]of this.#l){const o=new RegExp(`\\:${e}\\:`,"g");t=t.replace(o,r)}for(const[e,r]of this.#s){const o=new RegExp(`\\_${e}\\_`,"g");t=t.replace(o,this.#n?r:"")}return t}_applyLogFormatting(e){return this.#d(e)}logClear(){if(this.#i)return this.#o&&this.emit("debug:clear"),this.#e.clear?this.#e.clear():console.clear()}logGroupEnd(){if(this.#i)return this.#o&&this.emit("debug:groupEnd"),this.#e.groupEnd?this.#e.groupEnd():console.groupEnd()}logLabel(e,t){if(!this.#i)return;const r=["count","countReset","time","timeEnd","profile","profileEnd","timeStamp"];if(!r.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${r.join(", ")}`);if(void 0!==t&&"string"!=typeof t)throw new TypeError("The label must be a string.");const o=this.#e[e]?this.#e[e]:console[e];if(!o)throw new TypeError(`The log type "${e}" is not supported by the provided logger or console.`);return this.#o&&this.emit("debug:logLabel",e,t),o(t)}logTimeLabel(e,...t){if(this.#i)return this.#o&&this.emit("debug:timeLog",e,...t),this.#e.timeLog?this.#e.timeLog(e,...t):console.timeLog(e,...t)}logAssert(e,...t){if(this.#i)return this.#o&&this.emit("debug:assert",e,...t),this.#e.assert?this.#e.assert(e,...t):console.assert(e,...t)}logDir(e,t){if(this.#i)return this.#o&&this.emit("debug:dir",e,t),this.#e.dir?this.#e.dir(e,t):console.dir(e,t)}logTable(e,t){if(this.#i){if(!(void 0===t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("Properties must be an array of strings.");return this.#o&&this.emit("debug:table",e,t),this.#e.table?this.#e.table(e,t):console.table(e,t)}}log(e,t,...r){if(!this.#i)return;const o=["log","info","warn","error","debug","dirxml","group","groupCollapsed","trace"];if(!o.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${o.join(", ")}`);if("string"!=typeof t)throw new TypeError("The message must be a string.");let i=this.#t,n=this.#r??"",a=t;const s=!this.#a||"string"!=typeof this.#r;i=s?this.#d(i):"",n&&(n=this.#d(n)),a=this.#d(a);const l=`${i}${n?s?` ${n}`:n:""}`,d=this.#e[e]?this.#e[e]:console[e];return d?(this.#o&&this.emit("debug:log",l,a,...r),d(l,a,...r)):(this.#o&&this.emit("debug:log",l,a,...r),console.log(l,a,...r))}#u(e,t){const[r="",...o]=t;return"string"==typeof r?this.log(e,r,...o):this.log(e,"",r,...o)}toConsole(){return{log:(...e)=>this.#u("log",e),info:(...e)=>this.#u("info",e),warn:(...e)=>this.#u("warn",e),error:(...e)=>this.#u("error",e),debug:(...e)=>this.#u("debug",e),dirxml:(...e)=>this.#u("dirxml",e),group:(...e)=>this.#u("group",e),groupCollapsed:(...e)=>this.#u("groupCollapsed",e),trace:(...e)=>this.#u("trace",e),assert:(e,...t)=>this.logAssert(e,...t),dir:(e,t)=>this.logDir(e,t),table:(e,t)=>this.logTable(e,t),clear:()=>this.logClear(),groupEnd:()=>this.logGroupEnd(),count:e=>this.logLabel("count",e),countReset:e=>this.logLabel("countReset",e),time:e=>this.logLabel("time",e),timeEnd:e=>this.logLabel("timeEnd",e),timeLog:(e,...t)=>this.logTimeLabel(e,...t),timeStamp:e=>this.logLabel("timeStamp",e),profile:e=>this.logLabel("profile",e),profileEnd:e=>this.logLabel("profileEnd",e)}}};function h(e,t){if(void 0!==t.obj&&"function"!=typeof t.obj)throw new TypeError("filter.obj must be a function if provided.");if(void 0!==t.value&&"function"!=typeof t.value)throw new TypeError("filter.value must be a function if provided.");if(void 0!==t.array&&"function"!=typeof t.array)throw new TypeError("filter.array must be a function if provided.");let r;r=e instanceof Map?new Map:e instanceof Set?new Set:{};const o=(i=e)instanceof Map?Array.from(i.entries()):i instanceof Set?Array.from(i.values()).map(e=>[void 0,e]):Object.entries(i);var i;const a=(e,r)=>{const o=[];for(let i=0;i<e.length;i++){const s=e[i];if(Array.isArray(s))o.push(a(s,r));else if(n(s)){const r=h(s,t);(void 0===t.obj||t.obj(r,i,e))&&o.push(r)}else(void 0===t.value||t.value([r,s],i,e))&&o.push(s)}return o};for(let e=0;e<o.length;e++){const[i,s]=o[e];if(Array.isArray(s)){const n=a(s,i);(void 0===t.array||t.array([i,n],e,o))&&(r instanceof Map||r instanceof Set?r instanceof Map?r.set(i,n):r.add(n):r[i]=n)}else if(n(s)){const n=h(s,t);(void 0===t.obj||t.obj(n,e,o))&&(r instanceof Map?r.set(i,n):r instanceof Set?r.add(n):r[i]=n)}else(void 0===t.value||t.value([i,s],e,o))&&(r instanceof Map?r.set(i,s):r instanceof Set?r.add(s):r[i]=s)}return r}const m=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},p=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},c=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},f=(e,t=!1)=>!t&&void 0===e,y=(e,t=!1)=>f(e,t)||"string"==typeof e||!t&&null===e,g=(e,t=!1)=>f(e,t)||"number"==typeof e||!t&&null===e,w=(e,t=!1)=>f(e,t)||"boolean"==typeof e||!t&&null===e,b=(e,t)=>!!f(e)||(p(t,"valueValidator"),Array.isArray(e)&&e.every(t)),v=new Map;class E extends Error{constructor(e,t,r){if(m(e,"message"),m(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const T=async e=>{m(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},I=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);m(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=v.get(t);return v.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const o=e.split(",")[1],i=atob(o),n=new Uint8Array(i.length);for(let e=0;e<i.length;e++)n[e]=i.charCodeAt(e);return r(new Blob([n],{type:t}))}return"string"==typeof e?e:""},x=(e,t=!1)=>{if(i(e)){if(4!==o(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}A(e.common),c(e.native,"_fetchData.native"),c(e.format,"_fetchData.format"),c(e.quality,"_fetchData.quality");for(const r in e.native){const o=e.native[r];if(!b(o,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},A=e=>{if(c(e,"common"),x(e._fetchData),!y(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!y(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!y(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!y(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!w(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!w(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!w(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!w(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!g(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!g(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!g(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!g(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!g(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!g(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!g(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!g(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!g(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!g(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!g(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!y(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!y(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!y(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!y(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!y(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!y(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!y(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!y(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!y(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!y(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!y(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!y(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!y(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!y(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!y(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!y(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!y(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!y(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!y(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!y(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!y(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!y(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!y(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!y(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!y(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!y(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!y(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!y(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!y(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!y(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!y(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!y(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!y(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!y(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!y(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!y(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!b(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!b(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!b(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!b(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!b(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!b(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!b(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!b(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!b(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!b(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!b(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!b(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!b(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!b(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!b(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!b(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!b(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!b(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!b(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!b(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!b(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!b(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!b(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!b(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!b(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!b(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!b(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!b(e.comment,e=>null!==e&&"object"==typeof e&&y(e.descriptor)&&y(e.language)&&y(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!b(e.lyrics,e=>null!==e&&"object"==typeof e&&y(e.text)&&y(e.descriptor)&&y(e.language)&&(!Array.isArray(e)||b(e.syncText,e=>null!==e&&"object"==typeof e&&y(e.text)&&g(e.timestamp)))&&(e=>void 0===e||null!==e&&"object"==typeof e&&g(e.notSynchronized)&&g(e.mpegFrameNumber)&&g(e.milliseconds))(e.timeStampFormat)&&(e=>void 0===e||null!==e&&"object"==typeof e&&g(e.other)&&g(e.lyrics)&&g(e.text)&&g(e.movement_part)&&g(e.events)&&g(e.chord)&&g(e.trivia_pop))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!b(e.rating,e=>null!==e&&"object"==typeof e&&y(e.source)&&g(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!f(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},k=async(e,t,r=!0)=>{m(e,"url"),p(t,"parseFile");const i=await fetch(e);if(!i.ok)throw new Error(`Failed to fetch audio file: ${i.status} ${i.statusText}`);const n=await i.blob(),a=await t(n);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),x(a);const s=a.common;A(s);const l=s?.picture?.map(e=>({...e,data:r?I(e.data,e.format):e.data}))??[];a.common={...a.common,picture:l.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=s?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(l[t])return{...e,value:{...e.value,data:""}}}return e})});const d=h({title:s?.title,album:s?.album,albumartist:s?.albumartist,albumartists:s?.albumartists,genre:s?.genre,label:s?.label,composer:s?.composer,year:s?.year,artist:s?.artist,artists:s?.artists,disk:s?.disk?{no:s.disk.no,of:s.disk.of}:void 0,track:s?.track?{no:s.track.no,of:s.track.of}:void 0,movementIndex:s?.movementIndex?{no:s.movementIndex.no,of:s.movementIndex.of}:void 0,picture:l,date:s?.date,originaldate:s?.originaldate,originalyear:s?.originalyear,releasedate:s?.releasedate,comment:s?.comment,lyrics:s?.lyrics,albumsort:s?.albumsort,titlesort:s?.titlesort,work:s?.work,artistsort:s?.artistsort,albumartistsort:s?.albumartistsort,composersort:s?.composersort,lyricist:s?.lyricist,writer:s?.writer,conductor:s?.conductor,remixer:s?.remixer,arranger:s?.arranger,engineer:s?.engineer,publisher:s?.publisher,producer:s?.producer,djmixer:s?.djmixer,mixer:s?.mixer,technician:s?.technician,grouping:s?.grouping,subtitle:s?.subtitle,description:s?.description,longDescription:s?.longDescription,discsubtitle:s?.discsubtitle,totaltracks:s?.totaltracks,totaldiscs:s?.totaldiscs,movementTotal:s?.movementTotal,compilation:s?.compilation,rating:s?.rating,bpm:s?.bpm,mood:s?.mood,media:s?.media,catalognumber:s?.catalognumber,tvShow:s?.tvShow,tvShowSort:s?.tvShowSort,tvSeason:s?.tvSeason,tvEpisode:s?.tvEpisode,tvEpisodeId:s?.tvEpisodeId,tvNetwork:s?.tvNetwork,podcast:s?.podcast,podcasturl:s?.podcasturl,releasestatus:s?.releasestatus,releasetype:s?.releasetype,releasecountry:s?.releasecountry,script:s?.script,language:s?.language,copyright:s?.copyright,license:s?.license,encodedby:s?.encodedby,encodersettings:s?.encodersettings,gapless:s?.gapless,barcode:s?.barcode,isrc:s?.isrc,asin:s?.asin,website:s?.website,performer_instrument:s?.performer_instrument,averageLevel:s?.averageLevel,peakLevel:s?.peakLevel,notes:s?.notes,originalalbum:s?.originalalbum,originalartist:s?.originalartist,key:s?.key,category:s?.category,hdVideo:s?.hdVideo,keywords:s?.keywords,movement:s?.movement,podcastId:s?.podcastId,showMovement:s?.showMovement,stik:s?.stik,playCounter:s?.playCounter},{value:([e,t])=>null!=t,obj:e=>o(e)>0,array:([e,t])=>t.length>0});return d._fetchData=a,d},L=e=>t=>{if(t)throw new Error(`This ${e} instance has been destroyed and can no longer be used.`)},M=L("BaseMediaAdapter"),C=r().EventEmitter;class S extends C{constructor(){if(new.target===S)throw new Error("BaseMediaAdapter is an abstract class and cannot be instantiated directly.");super()}#h=!1;get destroyed(){return this.#h}static getThumbnailUrl(e){if("string"!=typeof e||""===e.trim())throw new TypeError('The "trackId" must be a non-empty string.');return""}static canHandle(e){throw new Error('Method "canHandle" must be implemented by the subclass.')}isReady(){throw M(this.#h),new Error('Method "isReady" must be implemented by the subclass.')}isPaused(){throw M(this.#h),new Error('Method "isPaused" must be implemented by the subclass.')}isEnded(){throw M(this.#h),new Error('Method "isEnded" must be implemented by the subclass.')}async waitIsReady(){throw M(this.#h),new Error('Method "waitIsReady" must be implemented by the subclass.')}canHandle(e){return M(this.#h),S.canHandle(e)}async play(e){throw M(this.#h),new Error('Method "play" must be implemented by the subclass.')}async pause(){throw M(this.#h),new Error('Method "pause" must be implemented by the subclass.')}async stop(){throw M(this.#h),new Error('Method "stop" must be implemented by the subclass.')}async seek(e){throw M(this.#h),new Error('Method "seek" must be implemented by the subclass.')}isMuted(){throw M(this.#h),new Error('Method "isMuted" must be implemented by the subclass.')}async mute(){throw M(this.#h),new Error('Method "mute" must be implemented by the subclass.')}async unMute(){throw M(this.#h),new Error('Method "unMute" must be implemented by the subclass.')}getCurrentTime(){throw M(this.#h),new Error('Method "getCurrentTime" must be implemented by the subclass.')}getTotalDuration(){throw M(this.#h),new Error('Method "getTotalDuration" must be implemented by the subclass.')}getRemainingTime(){throw M(this.#h),new Error('Method "getRemainingTime" must be implemented by the subclass.')}getPlaybackPercentage(){throw M(this.#h),new Error('Method "getPlaybackPercentage" must be implemented by the subclass.')}getTimeData(){throw M(this.#h),new Error('Method "getTimeData" must be implemented by the subclass.')}setVolume(e){throw M(this.#h),new Error('Method "setVolume" must be implemented by the subclass.')}getVolume(){throw M(this.#h),new Error('Method "getVolume" must be implemented by the subclass.')}async getContentData(){throw M(this.#h),new Error('Method "getContentData" must be implemented by the subclass.')}destroy(){this.#h||(this.removeAllListeners(),this.#h=!0,this.emit("destroyed"))}}const P=L("TinyMediaPlayer");class _ extends u{static BaseMediaAdapter=S;static#m="Unknown Artist";static get unknownArtist(){return _.#m}static set unknownArtist(e){if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("unknownArtist must be a string or a function.");_.#m=e}static async parseContent(e,t,r,o,n,a){return(async(e,t={},r={},o=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},n={},a=!0,s="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(c(t,"defaultMetadata"),c(r,"metadata"),p(o,"parseFile"),c(n,"callbacks"),n.onProgress&&"function"!=typeof n.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(n.onError&&"function"!=typeof n.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof s&&"function"!=typeof s)throw new TypeError("unknownArtist must be a string or a function returning a string.");let l,d="";const u=(t,r)=>{if(m(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');n.onProgress&&n.onProgress({event:r,status:"loading",stage:t,url:d||(e instanceof HTMLMediaElement?e.src:"unknown")})},h=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');m(r,"stage"),n.onError&&n.onError({error:t instanceof Error?t:new Error(String(t)),url:d||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{u("INITIALIZING"),"string"==typeof e?(d=e,l=new Audio(d)):(l=e,d=l.src);try{await new Promise((e,t)=>{const r=e=>u("DOWNLOADING",e),o=()=>{n(),e(void 0)},i=e=>{n(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},n=()=>{l.removeEventListener("progress",r),l.removeEventListener("loadedmetadata",o),l.removeEventListener("error",i)};l.addEventListener("progress",r),l.addEventListener("loadedmetadata",o),l.addEventListener("error",i),l.readyState>=1&&(n(),e(void 0))}),u("METADATA_LOADED")}catch(e){throw new E(e instanceof Error?e.message:"UNKNOWN ERROR",d,"METADATA")}const p={id:r.id||await T(d),duration:Math.floor(1e3*l.duration),url:d,weight:r.weight??1};let c={};u("EXTRACTING_ID3");try{c=await k(d,o,a)}catch(e){h(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${d}. Falling back to filename.`)}const f=e=>{m(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},y=e=>{const t={...e};return i(t._fetchData)&&(i(c._fetchData)&&(t._fetchData={...c._fetchData}),i(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},g={...p,...y(t),...c,...y(r),title:c.title||r.title||f(d),artist:c.artist||r.artist||("string"==typeof s?s:String(s()))};return n.onProgress&&n.onProgress({status:"success",stage:"COMPLETE",url:d}),g}catch(e){if(e instanceof E)throw e;const t=new E(e instanceof Error?e.message:"UNKNOWN ERROR",d,"INITIALIZING");throw h(t,"INITIALIZING"),t}})(e,t,r,o,n,a,_.#m)}#h=!1;get destroyed(){return this.#h}#p=new Set;#c=new WeakMap;#f=[];#y=-1;#g="NONE";#w=!1;#b=!1;#v=!1;#E=1;#T;#I;#x;#A=!1;#k;#L;#M=null;#C=null;#S=300;get fadeVolumeSpeed(){return P(this.#h),this.#S}set fadeVolumeSpeed(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("fadeVolumeSpeed must be a number.");if(e<0)throw new RangeError("fadeVolumeSpeed cannot be negative.");this.#S=e,this.emit("fadeVolumeSpeedChange",this.#S)}#P=2e3;get prevClickTimeoutDuration(){return P(this.#h),this.#P}set prevClickTimeoutDuration(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("prevClickTimeoutDuration must be a number.");if(e<0)throw new RangeError("prevClickTimeoutDuration cannot be negative.");this.#P=e,this.emit("prevClickTimeoutDurationChange",this.#P)}get repeatCurrentOnPrev(){return P(this.#h),this.#x}set repeatCurrentOnPrev(e){if(P(this.#h),"boolean"!=typeof e)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#x=e,this.emit("repeatCurrentOnPrevChange",this.#x)}get smoothPlayPauseVolume(){return P(this.#h),this.#k}set smoothPlayPauseVolume(e){if(P(this.#h),"boolean"!=typeof e)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#k=e,this.emit("smoothPlayPauseVolumeChange",this.#k)}get smoothStopVolume(){return P(this.#h),this.#L}set smoothStopVolume(e){if(P(this.#h),"boolean"!=typeof e)throw new TypeError("smoothStopVolume must be a boolean.");this.#L=e,this.emit("smoothStopVolumeChange",this.#L)}constructor(e={}){if(!n(e))throw new TypeError("Options must be a non-null object.");if(super({id:"[_main_class_TinyMediaPlayer_reset_]",logger:e.logger??console,debugMode:e.debugMode??!1,useLogColors:e.useLogColors??!1}),void 0!==e.persistVolume){if("boolean"!=typeof e.persistVolume)throw new TypeError("persistVolume must be a boolean.");this.#T=e.persistVolume}else this.#T=!1;if(void 0!==e.volumeStorageKey){if("string"!=typeof e.volumeStorageKey)throw new TypeError("volumeStorageKey must be a string.");this.#I=e.volumeStorageKey}else this.#I="tiny_media_player_volume";if(void 0!==e.repeatCurrentOnPrev){if("boolean"!=typeof e.repeatCurrentOnPrev)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#x=e.repeatCurrentOnPrev}else this.#x=!1;if(void 0!==e.smoothPlayPauseVolume){if("boolean"!=typeof e.smoothPlayPauseVolume)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#k=e.smoothPlayPauseVolume}else this.#k=!1;if(void 0!==e.smoothStopVolume){if("boolean"!=typeof e.smoothStopVolume)throw new TypeError("smoothStopVolume must be a boolean.");this.#L=e.smoothStopVolume}else this.#L=!1;this.#T&&this.#_(),this.log("info","Instance initialized.",{options:e})}#_(){try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(this.#I);if(null!==e){const t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1&&(this.#E=t,this.log("info",`Volume loaded from storage: ${this.#E}`))}}}catch(e){console.warn("[TinyMediaPlayer] Failed to read volume from localStorage.",e)}}#O(){try{this.#T&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.setItem(this.#I,this.#E.toString()),this.log("info",`Volume saved to storage: ${this.#E}`))}catch(e){console.warn("[TinyMediaPlayer] Failed to save volume to localStorage.",e)}}_getWeightedRandomIndex(){if(0===this.#f.length)return-1;if(1===this.#f.length)return 0;let e=0;for(let t=0;t<this.#f.length;t++){if(t===this.#y)continue;const r=this.#f[t];e+="number"==typeof r.weight&&r.weight>0?r.weight:1}let t=Math.random()*e;for(let e=0;e<this.#f.length;e++){if(e===this.#y)continue;const r=this.#f[e],o="number"==typeof r.weight&&r.weight>0?r.weight:1;if(t<o)return e;t-=o}return this.#y===this.#f.length-1?0:this.#f.length-1}async#V(e){this.#M&&this.#M.abort(),this.#M=new AbortController;const{signal:t}=this.#M,r=this.#R();if(!r)return;const o=r.getVolume(),i=performance.now(),n=this.#S;return this.log("info",`Starting volume fade: ${o} -> ${e}`),new Promise(a=>{const s=l=>{if(t.aborted)return this.log("info","Volume fade aborted."),a();const d=l-i,u=Math.min(d/n,1),h=o+(e-o)*u,m=Math.max(0,Math.min(1,h));r.setVolume(m),u<1?requestAnimationFrame(s):(r.setVolume(e),this.log("info",`Volume fade completed: ${e}`),a())};requestAnimationFrame(s)})}get playlist(){return P(this.#h),[...this.#f]}set playlist(e){if(P(this.#h),!Array.isArray(e))throw new TypeError("Playlist must be an array of MediaContent objects.");e.forEach(e=>A(e));const t=this.#b;let r=null;if(-1!==this.#y&&this.#f.length>0)try{r=this.#R()}catch(e){}this.#f=e,this.log("info",`Playlist updated. New size: ${this.#f.length}`),this.emit("playlistUpdate",this.playlist),0===this.#f.length?this.#y=-1:(this.#y>=this.#f.length||-1===this.#y)&&(this.#y=0),this.emit("trackChange",this.#y),t&&(async()=>{try{r&&await r.stop(),-1!==this.#y&&await this.play()}catch(e){this.log("error","Background transition error on playlist update:",e),console.warn("[TinyMediaPlayer] Background transition error on playlist update:",e)}})()}get currentIndex(){return P(this.#h),this.#y}set currentIndex(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Current index must be a number.");if(e<-1||e>=this.#f.length&&this.#f.length>0)throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);if(this.#y===e)return;this.log("info",`Index change requested: ${this.#y} -> ${e}`);const t=this.#b;let r=null;if(-1!==this.#y&&this.#f.length>0)try{r=this.#R()}catch(e){}this.#y=e,this.emit("trackChange",this.#y),t&&(async()=>{try{r&&await r.stop(),-1!==this.#y&&await this.play()}catch(e){this.log("error","Background transition error on index update:",e),console.warn("[TinyMediaPlayer] Background transition error on index update:",e)}})()}get loopMode(){return P(this.#h),this.#g}set loopMode(e){P(this.#h);const t=["NONE","TRACK","PLAYLIST"];if(!t.includes(e))throw new TypeError(`Loop mode must be one of: ${t.join(", ")}.`);this.#g=e,this.log("info",`Loop mode changed to: ${this.#g}`),this.emit("loopModeChange",this.#g)}get isRandom(){return P(this.#h),this.#w}set isRandom(e){if(P(this.#h),"boolean"!=typeof e)throw new TypeError("Random mode state must be a boolean.");this.#w=e,this.log("info",`Random mode: ${this.#w}`),this.emit("randomModeChange",this.#w)}get isPlaying(){return P(this.#h),this.#b}get volume(){return P(this.#h),this.#E}set volume(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Volume must be a number.");if(e<0||e>1)throw new RangeError("Volume must be tightly constrained between 0.0 and 1.0.");if(this.#M&&this.#M.abort(),this.log("info",`Volume changed: ${this.#E} -> ${e}`),this.#E=e,this.#O(),this.emit("volumeChange",this.#E),-1!==this.#y&&this.#f.length>0)try{const e=this.#R();e&&e.setVolume(this.#E)}catch(e){}}get persistVolume(){return P(this.#h),this.#T}set persistVolume(e){if(P(this.#h),"boolean"!=typeof e)throw new TypeError("Persist volume parameter must be a boolean.");this.#T=e,this.log("info",`Persist volume: ${this.#T}`),e&&this.#O()}get volumeStorageKey(){return P(this.#h),this.#I}set volumeStorageKey(e){if(P(this.#h),"string"!=typeof e)throw new TypeError("Volume storage key must be a string.");if(""===e.trim())throw new TypeError("Volume storage key cannot be an empty string.");const t=this.#I;this.#I=e;try{this.#T&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.removeItem(t),this.#O())}catch(e){console.warn("[TinyMediaPlayer] Failed to migrate volume storage key.",e)}}get isMuted(){return P(this.#h),this.#v}async mute(){P(this.#h);const e=this.#R();e&&(await e.mute(),this.#v=!0,this.emit("muteChange",this.#v),this.log("info","Playback muted successfully."))}async unMute(){P(this.#h);const e=this.#R();e&&(await e.unMute(),this.#v=!1,this.emit("muteChange",this.#v),this.log("info","Playback unmuted successfully."))}get adapters(){return Array.from(this.#p)}get adaptersSize(){return this.#p.size}static#j=["timeupdate","ended"];static get defaultAdapterEventNames(){return structuredClone(_.#j)}static set defaultAdapterEventNames(e){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError("TinyMediaPlayer.defaultAdapterEventNames must be an array of strings.");_.#j=[...e]}#N=new Set(_.defaultAdapterEventNames);#D(e){const t=this.#c.get(e);t&&(this.#N.forEach(r=>{const o=t.get(r);o&&e.off(r,o)}),t.clear(),this.#c.delete(e))}registerAdapter(e){if(P(this.#h),!(e instanceof S))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Registering new adapter:",e);const t=new Map;this.#c.set(e,t),this.#N.forEach(t=>{this.#$(e,t)}),this.#p.add(e)}removeAdapter(e){if(P(this.#h),!(e instanceof S))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.log("info","Removing adapter:",e),this.#D(e),this.#p.delete(e)}destroyAdapter(e){if(P(this.#h),!(e instanceof S))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Destroying adapter:",e),this.#D(e);const t=this.#p.delete(e);return t&&e.destroy(),t}hasAdapter(e){if(P(this.#h),!(e instanceof S))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.#p.has(e)}destroyAllAdapters(){P(this.#h),this.log("info","Destroying all adapters."),this.#p.forEach(e=>{this.#D(e),e.destroy()}),this.#p.clear()}clearAdapters(){P(this.#h),this.log("info","Clearing all adapters."),this.#p.forEach(e=>this.#D(e)),this.#p.clear()}getMediaAdapter(e){if(!n(e))throw new TypeError("Content must be a valid object.");for(const t of this.#p.values())if(t.canHandle(e))return t;return null}#R(){if(-1===this.#y||0===this.#f.length)return null;const e=this.#f[this.#y],t=this.getMediaAdapter(e);if(t)return t;const r=`No compatible adapter found for content ID: ${e.id}.`;throw this.log("error",r),new Error(r)}addAdapterEvent(e){if(P(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#N.has(e)||(this.log("info",`Adding adapter event listener: ${e}`),this.#N.add(e),this.#p.forEach(t=>{this.#$(t,e)}))}removeAdapterEvent(e){if(P(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#N.has(e)&&(this.log("info",`Removing adapter event listener: ${e}`),this.#N.delete(e),this.#p.forEach(t=>{this.#F(t,e)}))}resetAdapterEvents(){P(this.#h);const e=_.defaultAdapterEventNames,t=Array.from(this.#N);for(const r of t)e.includes(r)||this.removeAdapterEvent(r);for(const t of e)this.#N.has(t)||this.addAdapterEvent(t)}#$(e,t){const r=this.#c.get(e);if(!r)return;const o=(...e)=>{this.#h||("timeupdate"!==t&&this.log("debug",`Adapter event triggered: ${t}`,...e),this.emit(t,...e))};e.on(t,o),r.set(t,o)}#F(e,t){const r=this.#c.get(e);if(!r)return;const o=r.get(t);o&&(e.off(t,o),r.delete(t))}addTrack(e){if(P(this.#h),!n(e)||"string"!=typeof e.url)throw new TypeError("Track content must be a valid MediaContent object containing a URL.");const t={id:"",title:"",artist:"",url:"",duration:0,weight:1,...e};A(t);const r=this.#f.push(t);return this.log("info",`Track added. New length: ${r}`,t),-1===this.#y&&(this.#y=0,this.emit("trackChange",this.#y)),this.emit("playlistUpdate",this.playlist),r}existsTrack(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Index must be a number.");return e>=0&&e<this.#f.length}getTrack(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);return this.#f[e]}async removeTrack(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Removing track at index: ${e}`),e===this.#y?(await this.stop(),this.#f.splice(e,1),0===this.#f.length?this.#y=-1:this.#y>=this.#f.length&&(this.#y=0),this.emit("trackChange",this.#y)):(this.#f.splice(e,1),e<this.#y&&(this.#y-=1,this.emit("trackChange",this.#y))),this.emit("playlistUpdate",this.playlist)}searchTrack(e){if(P(this.#h),"string"!=typeof e&&"function"!=typeof e)throw new TypeError("Search query must be a string or a boolean evaluation function.");this.log("info","Searching playlist...",{query:e});const t=[];for(let r=0;r<this.#f.length;r++){const o=this.#f[r];let i=!1;if("function"==typeof e)i=Boolean(e(o));else{const t=e.toLowerCase(),r=o.title&&o.title.toLowerCase().includes(t),n=o.artist&&o.artist.toLowerCase().includes(t),a=o.album&&o.album.toLowerCase().includes(t);i=Boolean(r||n||a)}i&&t.push({track:o,index:r})}return this.log("info",`Search completed. Found ${t.length} results.`),t}async clearPlaylist(){P(this.#h),this.log("info","Clearing entire playlist."),await this.stop(),this.#f=[],this.#y=-1,this.emit("playlistUpdate",this.playlist),this.emit("trackChange",this.#y)}async play(){P(this.#h),this.log("info",`Attempting to play track at index: ${this.#y}`);const e=this.#R();if(e){this.#k?await this.#V(this.#E):e.setVolume(this.#E);try{await e.play(this.#f[this.#y]),this.#v&&await e.mute(),this.#b=!0,this.log("info","Playback started successfully."),this.emit("play",this.#y)}catch(e){throw this.log("error","Failed to play track:",e),e}}else this.log("error","Failed to play track:",`Active adapter not found for track at index ${this.#y}.`)}async pause(){P(this.#h),this.log("info","Attempting to pause playback.");const e=this.#R();e&&(this.#k&&await this.#V(0),await e.pause(),this.#b=!1,this.log("info","Playback paused."),this.emit("pause",this.#y))}async stop(){P(this.#h),this.log("info","Attempting to stop playback.");const e=this.#R();e&&(this.#L&&await this.#V(0),await e.stop(),this.#b=!1,this.log("info","Playback stopped."),this.emit("stop",this.#y))}async next(){if(P(this.#h),0!==this.#f.length){if(this.log("info","Next track requested."),await this.stop(),"TRACK"===this.#g)return this.log("info","Loop mode: TRACK. Repeating current track."),void await this.play();if(this.#w)this.#y=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#y}`);else{let e=this.#y+1;if(e>=this.#f.length){if("PLAYLIST"!==this.#g)return void this.log("info","End of playlist reached. Stopping.");e=0,this.log("info","Loop mode: PLAYLIST. Returning to start.")}this.#y=e}this.emit("trackChange",this.#y),await this.play()}}async prev(){if(P(this.#h),0!==this.#f.length){if(this.#x&&!this.#A)return this.log("info",'UX: Repeat current track on first "prev" click.'),this.#A=!0,this.#C&&clearTimeout(this.#C),this.#C=setTimeout(()=>{this.#A=!1,this.#C=null},2e3),await this.stop(),void await this.play();if(this.#C&&(clearTimeout(this.#C),this.#C=null),this.#A=!1,this.log("info","Previous track requested."),await this.stop(),this.#w)this.#y=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#y}`);else{let e=this.#y-1;if(e<0){if("PLAYLIST"!==this.#g)return void this.log("info","Start of playlist reached. Stopping.");e=this.#f.length-1,this.log("info","Loop mode: PLAYLIST. Returning to end.")}this.#y=e}this.emit("trackChange",this.#y),await this.play()}}async skipTo(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Skipping to index: ${e}`),await this.stop(),this.#y=e,this.emit("trackChange",this.#y),await this.play()}async seek(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Seek time must be a number in milliseconds.");if(e<0)throw new RangeError("Seek time cannot be negative.");this.log("info",`Seeking to: ${e}ms`);const t=this.#R();t&&(await t.seek(e),this.emit("seek",e))}async step(e){if(P(this.#h),"number"!=typeof e)throw new TypeError("Step amount must be a number in milliseconds.");this.log("info",`Stepping by: ${e}ms`);const t=this.#R();if(!t)return;let r=t.getCurrentTime()+e;r<0&&(r=0),await this.seek(r)}getCurrentTime(){P(this.#h);try{const e=this.#R();return e?e.getCurrentTime():0}catch{return 0}}getTotalDuration(){P(this.#h);try{const e=this.#R();return e?e.getTotalDuration():0}catch{return 0}}getRemainingTime(){P(this.#h);try{const e=this.#R();return e?e.getRemainingTime():0}catch{return 0}}getPlaybackPercentage(){P(this.#h);try{const e=this.#R();return e?e.getPlaybackPercentage():0}catch{return 0}}get isPaused(){P(this.#h);try{const e=this.#R();return!!e&&e.isPaused()}catch{return!1}}get isEnded(){P(this.#h);try{const e=this.#R();return!e||e.isEnded()}catch{return!0}}async getContentData(){P(this.#h);const e={id:"",createdAt:"",artistId:"",artistName:"",description:"",title:"",duration:0,avatar:"",url:""};try{const t=this.#R();return t?t.getContentData():e}catch{return e}}async waitIsReady(){P(this.#h);const e=this.#R();if(e)return e.waitIsReady()}async destroy(){if(!this.#h){this.log("info","Destroying TinyMediaPlayer instance.");try{this.#b&&await this.stop()}catch(e){this.log("error","Non-fatal error during playback termination:",e),console.warn("[TinyMediaPlayer] Non-fatal error during playback termination:",e)}this.#C&&clearTimeout(this.#C),this.#f=[],this.#y=-1,this.#b=!1,this.#A=!1,this.destroyAllAdapters(),this.removeAllListeners(),this.#N.clear(),this.#h=!0,this.emit("destroyed")}}}const O=_;window.TinyMediaPlayer=t.TinyMediaPlayer})();
@@ -1 +1 @@
1
- (()=>{"use strict";const e={d:(t,r)=>{if(Array.isArray(r))for(var i=0;i<r.length;){var n=r[i++],a=r[i++];e.o(t,n)?0===a&&i++:0===a?Object.defineProperty(t,n,{enumerable:!0,value:r[i++]}):Object.defineProperty(t,n,{enumerable:!0,get:a})}else for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNeedBar:()=>i});class r{#e=new Map;#t;#r;#i;get factors(){const e={};for(let[t,r]of this.#e.entries())e[t]={...r};return e}get currentPercent(){return this.#r/this.#t*100}set maxValue(e){if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new TypeError("maxValue must be a positive number.");this.#t=e,this.#r=Math.min(this.#r,e)}get maxValue(){return this.#t}get currentValue(){return this.#r}set infiniteValue(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("infiniteValue must be a number.");this.#i=e,this.#r=Math.max(0,e),this.#r=Math.min(this.#r,this.#t)}get infiniteValue(){return this.#i}constructor(e=100,t=1,r=1){if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new TypeError("maxValue must be a positive number.");this.#t=e,this.setFactor("main",t,r),this.#r=e,this.#i=e}getFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");const t=this.#e.get(e);if(!t)throw new Error(`Factor with key "${e}" not found.`);return{...t}}hasFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");return this.#e.has(e)}setFactor(e,t,r=1){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof t||Number.isNaN(t))throw new TypeError("Amount must be a valid number.");if("number"!=typeof r||Number.isNaN(r))throw new TypeError("Multiplier must be a valid number.");this.#e.set(e,{amount:t,multiplier:r})}removeFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");return this.#e.delete(e)}#n(e){const t=this.#i;return this.#i-=e,this.#r=Math.max(0,this.#r-e),{prevValue:t,removedTotal:e,removedPercent:e/this.#t*100,currentPercent:this.currentPercent,remainingValue:this.#r,infiniteRemaining:this.#i}}tick(){let e=0;for(let[t,r]of this.#e.entries())e+=r.amount*r.multiplier;return this.#n(e)}tickWithTempFactor(e){if("object"!=typeof e||null===e)throw new TypeError("You must provide a valid factor object.");if("number"!=typeof e.amount||Number.isNaN(e.amount))throw new TypeError('Temp factor "amount" must be a valid number.');if("multiplier"in e&&("number"!=typeof e.multiplier||Number.isNaN(e.multiplier)))throw new TypeError('Temp factor "multiplier" must be a valid number if provided.');let t=0;for(let[e,r]of this.#e.entries())t+=r.amount*r.multiplier;return e&&(t+=e.amount*(e.multiplier??1)),this.#n(t)}tickSingleFactor(e){if("object"!=typeof e||null===e)throw new TypeError("You must provide a valid factor object.");if("number"!=typeof e.amount||Number.isNaN(e.amount))throw new TypeError('Temp factor "amount" must be a valid number.');if("multiplier"in e&&("number"!=typeof e.multiplier||Number.isNaN(e.multiplier)))throw new TypeError('Temp factor "multiplier" must be a valid number if provided.');if(!e)throw new Error("You must provide a factor to apply.");const t=e.amount*(e.multiplier??1);return this.#n(t)}toJSON(){return{maxValue:this.#t,currentValue:this.#r,infiniteValue:this.#i,factors:this.factors}}static fromJSON(e){const t=new r(e.maxValue,0,0);t.infiniteValue=e.infiniteValue,t.#e.clear();for(const[r,i]of Object.entries(e.factors))t.setFactor(r,i.amount,i.multiplier);return t}clone(){return r.fromJSON(this.toJSON())}clearFactors(){this.#e.clear()}}const i=r;window.TinyNeedBar=t.TinyNeedBar})();
1
+ (()=>{"use strict";const e={d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNeedBar:()=>i});class r{#e=new Map;#t;#r;#i;get factors(){const e={};for(let[t,r]of this.#e.entries())e[t]={...r};return e}get currentPercent(){return this.#r/this.#t*100}set maxValue(e){if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new TypeError("maxValue must be a positive number.");this.#t=e,this.#r=Math.min(this.#r,e)}get maxValue(){return this.#t}get currentValue(){return this.#r}set infiniteValue(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("infiniteValue must be a number.");this.#i=e,this.#r=Math.max(0,e),this.#r=Math.min(this.#r,this.#t)}get infiniteValue(){return this.#i}constructor(e=100,t=1,r=1){if("number"!=typeof e||Number.isNaN(e)||e<=0)throw new TypeError("maxValue must be a positive number.");this.#t=e,this.setFactor("main",t,r),this.#r=e,this.#i=e}getFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");const t=this.#e.get(e);if(!t)throw new Error(`Factor with key "${e}" not found.`);return{...t}}hasFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");return this.#e.has(e)}setFactor(e,t,r=1){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof t||Number.isNaN(t))throw new TypeError("Amount must be a valid number.");if("number"!=typeof r||Number.isNaN(r))throw new TypeError("Multiplier must be a valid number.");this.#e.set(e,{amount:t,multiplier:r})}removeFactor(e){if("string"!=typeof e||!e)throw new TypeError("Key must be a non-empty string.");return this.#e.delete(e)}#n(e){const t=this.#i;return this.#i-=e,this.#r=Math.max(0,this.#r-e),{prevValue:t,removedTotal:e,removedPercent:e/this.#t*100,currentPercent:this.currentPercent,remainingValue:this.#r,infiniteRemaining:this.#i}}tick(){let e=0;for(let[t,r]of this.#e.entries())e+=r.amount*r.multiplier;return this.#n(e)}tickWithTempFactor(e){if("object"!=typeof e||null===e)throw new TypeError("You must provide a valid factor object.");if("number"!=typeof e.amount||Number.isNaN(e.amount))throw new TypeError('Temp factor "amount" must be a valid number.');if("multiplier"in e&&("number"!=typeof e.multiplier||Number.isNaN(e.multiplier)))throw new TypeError('Temp factor "multiplier" must be a valid number if provided.');let t=0;for(let[e,r]of this.#e.entries())t+=r.amount*r.multiplier;return e&&(t+=e.amount*(e.multiplier??1)),this.#n(t)}tickSingleFactor(e){if("object"!=typeof e||null===e)throw new TypeError("You must provide a valid factor object.");if("number"!=typeof e.amount||Number.isNaN(e.amount))throw new TypeError('Temp factor "amount" must be a valid number.');if("multiplier"in e&&("number"!=typeof e.multiplier||Number.isNaN(e.multiplier)))throw new TypeError('Temp factor "multiplier" must be a valid number if provided.');if(!e)throw new Error("You must provide a factor to apply.");const t=e.amount*(e.multiplier??1);return this.#n(t)}toJSON(){return{maxValue:this.#t,currentValue:this.#r,infiniteValue:this.#i,factors:this.factors}}static fromJSON(e){const t=new r(e.maxValue,0,0);t.infiniteValue=e.infiniteValue,t.#e.clear();for(const[r,i]of Object.entries(e.factors))t.setFactor(r,i.amount,i.multiplier);return t}clone(){return r.fromJSON(this.toJSON())}clearFactors(){this.#e.clear()}}const i=r;window.TinyNeedBar=t.TinyNeedBar})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={208(e,t,n){n.d(t,{TinyNewWinEvents:()=>a});var r=n.cjs(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,a=f,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):c(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function c(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,f=c(h,u);for(n=0;n<u;++n)i(f[n],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});const i=e=>{if(e)throw new Error("This TinyNewWinEvents instance has been destroyed and can no longer be used.")};const s=new WeakMap;class o extends r.EventEmitter{#e;#t;#n=[];#r=!1;#i=!1;#s=null;#o="__TNE_READY__";#a="__TNE_ROUTE__";#h=!1;get destroyed(){return this.#h}get readyEventName(){return i(this.#h),this.#o}set readyEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: readyEventName must be a string.");this.#o=e}get routeEventName(){return i(this.#h),this.#a}set routeEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: routeEventName must be a string.");this.#a=e}constructor({targetOrigin:e,url:t,name:n,features:r}={}){if(super(),"string"==typeof n&&"_blank"===n)throw new Error('TinyNewWinEvents: The window name "_blank" is not supported. Please use a custom name to allow tracking.');if(void 0!==e&&"string"!=typeof e)throw new TypeError('TinyNewWinEvents: The "targetOrigin" option must be a string.');if(void 0!==t&&"string"!=typeof t)throw new TypeError('TinyNewWinEvents: The "url" option must be a string.');if(void 0!==r&&"string"!=typeof r)throw new TypeError('TinyNewWinEvents: The "features" option must be a string if provided.');if(void 0===t?this.#e=window.opener:(this.#e="string"==typeof t?window.open(t,n,r):t,this.#i=!0),!this.#e||s.has(this.#e))throw new Error("Invalid or duplicate window reference.");this.#t=e??window.location.origin,this._handleMessage=this.#u.bind(this),window.addEventListener("message",this._handleMessage,!1),this.#i||(this.#f(this.#o,null),this.#d())}getWin(){return i(this.#h),this.#e}#u(e){if(!e.source||this.#e&&e.source!==this.#e)return;const{type:t,route:n,payload:r}=e.data||{};if(t===this.#o)return this.#r=!0,this.#l(),this.#d(),void(this.#i&&this.#f(this.#o,null));t===this.#a&&this.emit(`win:${n}`,r,e)}#l(){for(;this.#n.length;){const e=this.#n.shift();if(e){const{route:t,payload:n}=e;this.winEmit(t,n)}}}#f(e,t,n=""){this.#e&&this.#e.closed||this.#e?.postMessage({type:e,route:n,payload:t},this.#t)}close(){if(i(this.#h),!this.#i)throw new Error("Only host can close the window.");this.#e&&!this.#e.closed&&this.#e.close()}winEmit(e,t){if(i(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.isDestroyed())throw new Error("Cannot emit: instance has been destroyed.");this.#r?this.#f(this.#a,t,e):this.#n.push({route:e,payload:t})}isConnected(){return i(this.#h),!(!this.#r||!this.#e||this.#e.closed)}#d(){this.#e&&!this.#s&&(this.#s=setInterval(()=>{this.#e?.closed&&(this.emit("WINDOW_REF_CLOSED"),this.destroy())},500),s.set(this.#e,this.#s))}onClose(e){i(this.#h),this.on("WINDOW_REF_CLOSED",e)}offClose(e){i(this.#h),this.off("WINDOW_REF_CLOSED",e)}isDestroyed(){return!this.#e}destroy(){this.#e&&(this.#s&&(clearInterval(this.#s),this.#s=null,s.delete(this.#e)),window.removeEventListener("message",this._handleMessage),this.#n=[],this.#r=!1,this.#e=null,this.removeAllListeners(),this.#h=!0)}}const a=o}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r=n(208);window.TinyNewWinEvents=r.TinyNewWinEvents})();
1
+ (()=>{"use strict";const e={cw:e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNewWinEvents:()=>o});var n=e.cw(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}w(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&w(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,a=f,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function v(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):c(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function c(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function w(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,f=c(h,u);for(n=0;n<u;++n)i(f[n],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return v(this,e,!0)},o.prototype.rawListeners=function(e){return v(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});n();const r=e=>{if(e)throw new Error("This TinyNewWinEvents instance has been destroyed and can no longer be used.")};const i=new WeakMap,s=n().EventEmitter,o=class extends s{#e;#t;#n=[];#r=!1;#i=!1;#s=null;#o="__TNE_READY__";#a="__TNE_ROUTE__";#h=!1;get destroyed(){return this.#h}get readyEventName(){return r(this.#h),this.#o}set readyEventName(e){if(r(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: readyEventName must be a string.");this.#o=e}get routeEventName(){return r(this.#h),this.#a}set routeEventName(e){if(r(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: routeEventName must be a string.");this.#a=e}constructor({targetOrigin:e,url:t,name:n,features:r}={}){if(super(),"string"==typeof n&&"_blank"===n)throw new Error('TinyNewWinEvents: The window name "_blank" is not supported. Please use a custom name to allow tracking.');if(void 0!==e&&"string"!=typeof e)throw new TypeError('TinyNewWinEvents: The "targetOrigin" option must be a string.');if(void 0!==t&&"string"!=typeof t)throw new TypeError('TinyNewWinEvents: The "url" option must be a string.');if(void 0!==r&&"string"!=typeof r)throw new TypeError('TinyNewWinEvents: The "features" option must be a string if provided.');if(void 0===t?this.#e=window.opener:(this.#e="string"==typeof t?window.open(t,n,r):t,this.#i=!0),!this.#e||i.has(this.#e))throw new Error("Invalid or duplicate window reference.");this.#t=e??window.location.origin,this._handleMessage=this.#u.bind(this),window.addEventListener("message",this._handleMessage,!1),this.#i||(this.#f(this.#o,null),this.#d())}getWin(){return r(this.#h),this.#e}#u(e){if(!e.source||this.#e&&e.source!==this.#e)return;const{type:t,route:n,payload:r}=e.data||{};if(t===this.#o)return this.#r=!0,this.#l(),this.#d(),void(this.#i&&this.#f(this.#o,null));t===this.#a&&this.emit(`win:${n}`,r,e)}#l(){for(;this.#n.length;){const e=this.#n.shift();if(e){const{route:t,payload:n}=e;this.winEmit(t,n)}}}#f(e,t,n=""){this.#e&&this.#e.closed||this.#e?.postMessage({type:e,route:n,payload:t},this.#t)}close(){if(r(this.#h),!this.#i)throw new Error("Only host can close the window.");this.#e&&!this.#e.closed&&this.#e.close()}winEmit(e,t){if(r(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.isDestroyed())throw new Error("Cannot emit: instance has been destroyed.");this.#r?this.#f(this.#a,t,e):this.#n.push({route:e,payload:t})}isConnected(){return r(this.#h),!(!this.#r||!this.#e||this.#e.closed)}#d(){this.#e&&!this.#s&&(this.#s=setInterval(()=>{this.#e?.closed&&(this.emit("WINDOW_REF_CLOSED"),this.destroy())},500),i.set(this.#e,this.#s))}onClose(e){r(this.#h),this.on("WINDOW_REF_CLOSED",e)}offClose(e){r(this.#h),this.off("WINDOW_REF_CLOSED",e)}isDestroyed(){return!this.#e}destroy(){this.#e&&(this.#s&&(clearInterval(this.#s),this.#s=null,i.delete(this.#e)),window.removeEventListener("message",this._handleMessage),this.#n=[],this.#r=!1,this.#e=null,this.removeAllListeners(),this.#h=!0)}};window.TinyNewWinEvents=t.TinyNewWinEvents})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";const t={d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o)};let o={};t.d(o,{TinyNotificationAdapter:()=>i});const e=Object.freeze({NOTIFICATION:"notification",DATA:"data",SYNC:"sync",COMMAND:"command",UNKNOWN:"unknown"});class r{static PUSH_TYPE=e;static#t=Object.freeze(["actions","badge"]);static toBrowser(t,o={}){if(null!==t&&("object"!=typeof t||Array.isArray(t)))throw new TypeError("[TinyNotificationAdapter] toBrowser: notification must be a non-null object.");if("object"!=typeof o||null===o||Array.isArray(o))throw new TypeError("[TinyNotificationAdapter] toBrowser: overrides must be a non-null object.");const{title:e,...i}=t??{},n={};for(const[t,o]of Object.entries(i))r.#t.includes(t)||void 0!==o&&(n[t]=o);return"auto"!==n.dir&&"ltr"!==n.dir&&"rtl"!==n.dir&&delete n.dir,!0===n.renotify&&"string"!=typeof n.tag&&delete n.renotify,{title:"string"==typeof e&&""!==e?e:"Notification",options:{...n,...o}}}static toServiceWorker(t,o={}){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("[TinyNotificationAdapter] toServiceWorker: notification must be a non-null object.");if("object"!=typeof o||null===o||Array.isArray(o))throw new TypeError("[TinyNotificationAdapter] toServiceWorker: overrides must be a non-null object.");const{title:e="Notification",options:r={}}=t,i={...r,...o};return{title:e,body:"string"==typeof i.body?i.body:"",options:i}}}const i=r;window.TinyNotificationAdapter=o.TinyNotificationAdapter})();
@@ -1 +1 @@
1
- (()=>{"use strict";const e={d:(t,i)=>{if(Array.isArray(i))for(var n=0;n<i.length;){var o=i[n++],r=i[n++];e.o(t,o)?0===r&&n++:0===r?Object.defineProperty(t,o,{enumerable:!0,value:i[n++]}):Object.defineProperty(t,o,{enumerable:!0,get:r})}else for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNotifications:()=>i});const i=class{#e=!1;#t=!1;#i=null;#n=100;#o=null;#r;constructor({audio:e=null,defaultIcon:t=null,bodyLimit:i=100,defaultOnClick:n=function(e){e.preventDefault(),window.focus&&window.focus(),this.close()}}={}){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("audio must be an instance of HTMLAudioElement or null.");if(null!==t&&"string"!=typeof t)throw new TypeError("defaultIcon must be a string or null.");if(!Number.isFinite(i)||i<0)throw new TypeError("bodyLimit must be a non-negative number.");if("function"!=typeof n)throw new TypeError("defaultOnClick must be a function.");this.#i="string"!=typeof e?e:new Audio(e),this.#o=t,this.#n=i,this.#r=n}requestPerm(){const e=this;return new Promise((t,i)=>{e.isCompatible()?"default"===Notification.permission?Notification.requestPermission().then(i=>{this.#t=!0,e.#e="granted"===i,t(e.#e)}).catch(i):(this.#t=!0,e.#e="granted"===Notification.permission,t(e.#e)):(this.#t=!0,e.#e=!1,t(!1))})}isCompatible(){return"Notification"in window}send(e,t={}){if(!this.#t)throw new Error("You must call requestPerm() before sending a notification.");if("string"!=typeof e)throw new TypeError("title must be a string.");if("object"!=typeof t||null===t)throw new TypeError("config must be a non-null object.");if(!this.#e)return null;const{icon:i=this.#o||void 0,vibrate:n=[200,100,200]}=t,o={...t};"string"==typeof i&&(o.icon=i),Array.isArray(n)&&(o.vibrate=n),"string"==typeof o.body&&(o.body=function(e,t,i=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof i||i<0||i>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${i}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*i?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}(o.body,this.#n));const r=new Notification(e,o);return r.addEventListener("show",()=>{this.#i instanceof HTMLAudioElement&&(this.#i.currentTime=0,this.#i.play().catch(e=>console.error(e)))}),"function"==typeof this.#r&&r.addEventListener("click",this.#r),r}wasPermissionRequested(){return this.#t}isAllowed(){return this.#e}getAudio(){return this.#i}setAudio(e){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("sound must be an instance of HTMLAudioElement or null.");this.#i="string"!=typeof e?e:new Audio(e)}getBodyLimit(){return this.#n}setBodyLimit(e){if(!Number.isFinite(e)||e<0)throw new TypeError("bodyLimit must be a non-negative number.");this.#n=e}getDefaultAvatar(){return this.#o}setDefaultAvatar(e){if("string"!=typeof e&&null!==e)throw new TypeError("defaultIcon must be a string or null.");this.#o=e}getDefaultOnClick(){return this.#r}setDefaultOnClick(e){if("function"!=typeof e)throw new TypeError("defaultOnClick must be a function.");this.#r=e}};window.TinyNotifications=t.TinyNotifications})();
1
+ (()=>{"use strict";const e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNotifications:()=>i});const i=class{#e=!1;#t=!1;#i=null;#n=100;#o=null;#r;constructor({audio:e=null,defaultIcon:t=null,bodyLimit:i=100,defaultOnClick:n=function(e){e.preventDefault(),window.focus&&window.focus(),this.close()}}={}){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("audio must be an instance of HTMLAudioElement or null.");if(null!==t&&"string"!=typeof t)throw new TypeError("defaultIcon must be a string or null.");if(!Number.isFinite(i)||i<0)throw new TypeError("bodyLimit must be a non-negative number.");if("function"!=typeof n)throw new TypeError("defaultOnClick must be a function.");this.#i="string"!=typeof e?e:new Audio(e),this.#o=t,this.#n=i,this.#r=n}requestPerm(){const e=this;return new Promise((t,i)=>{e.isCompatible()?"default"===Notification.permission?Notification.requestPermission().then(i=>{this.#t=!0,e.#e="granted"===i,t(e.#e)}).catch(i):(this.#t=!0,e.#e="granted"===Notification.permission,t(e.#e)):(this.#t=!0,e.#e=!1,t(!1))})}isCompatible(){return"Notification"in window}send(e,t={}){if(!this.#t)throw new Error("You must call requestPerm() before sending a notification.");if("string"!=typeof e)throw new TypeError("title must be a string.");if("object"!=typeof t||null===t)throw new TypeError("config must be a non-null object.");if(!this.#e)return null;const{icon:i=this.#o||void 0,vibrate:n=[200,100,200]}=t,o={...t};"string"==typeof i&&(o.icon=i),Array.isArray(n)&&(o.vibrate=n),"string"==typeof o.body&&(o.body=function(e,t,i=.6){if("string"!=typeof e)throw new TypeError("Expected a string for 'text', but received "+typeof e);if(!Number.isInteger(t)||t<=0)throw new TypeError(`Expected 'limit' to be a positive integer, but received ${t}`);if("number"!=typeof i||i<0||i>1)throw new TypeError(`Expected 'safeCutZone' to be a number between 0 and 1, but received ${i}`);let n=e.trim();if(n.length>t){const e=n.lastIndexOf(" ",t);return e>0&&e>=t*i?`${n.substring(0,e).trim()}...`:`${n.substring(0,t).trim()}...`}return n}(o.body,this.#n));const r=new Notification(e,o);return r.addEventListener("show",()=>{this.#i instanceof HTMLAudioElement&&(this.#i.currentTime=0,this.#i.play().catch(e=>console.error(e)))}),"function"==typeof this.#r&&r.addEventListener("click",this.#r),r}wasPermissionRequested(){return this.#t}isAllowed(){return this.#e}getAudio(){return this.#i}setAudio(e){if(!(e instanceof HTMLAudioElement)&&"string"!=typeof e&&null!==e)throw new TypeError("sound must be an instance of HTMLAudioElement or null.");this.#i="string"!=typeof e?e:new Audio(e)}getBodyLimit(){return this.#n}setBodyLimit(e){if(!Number.isFinite(e)||e<0)throw new TypeError("bodyLimit must be a non-negative number.");this.#n=e}getDefaultAvatar(){return this.#o}setDefaultAvatar(e){if("string"!=typeof e&&null!==e)throw new TypeError("defaultIcon must be a string or null.");this.#o=e}getDefaultOnClick(){return this.#r}setDefaultOnClick(e){if("function"!=typeof e)throw new TypeError("defaultOnClick must be a function.");this.#r=e}};window.TinyNotifications=t.TinyNotifications})();
@@ -1 +1 @@
1
- (()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var s=0;s<n.length;){var o=n[s++],i=n[s++];e.o(t,o)?0===i&&s++:0===i?Object.defineProperty(t,o,{enumerable:!0,value:n[s++]}):Object.defineProperty(t,o,{enumerable:!0,get:i})}else for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNotifyCenter:()=>o});const n=e=>{if(e)throw new Error("This TinyNotifyCenter instance has been destroyed and can no longer be used.")};class s{static getTemplate(){return'\n<div class="notify-overlay hidden">\n <div class="notify-center" id="notifCenter">\n <div class="header">\n <div>Notifications</div>\n <div class="options">\n <button class="clear-all" type="button">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="24"\n height="24"\n fill="currentColor"\n >\n <path\n d="M21.6 2.4a1 1 0 0 0-1.4 0L13 9.6l-1.3-1.3a1 1 0 0 0-1.4 0L3 15.6a1 1 0 0 0 0 1.4l4 4a1 1 0 0 0 1.4 0l7.3-7.3a1 1 0 0 0 0-1.4l-1.3-1.3 7.2-7.2a1 1 0 0 0 0-1.4zM6 17l3.5-3.5 1.5 1.5L7.5 18.5 6 17z"\n />\n </svg>\n </button>\n <button class="close">×</button>\n </div>\n </div>\n <div class="list"></div>\n </div>\n</div>\n\n<button class="notify-bell" aria-label="Open notifications">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n fill="currentColor"\n viewBox="0 0 24 24"\n >\n <path\n d="M12 2C10.3 2 9 3.3 9 5v1.1C6.7 7.2 5 9.4 5 12v5l-1 1v1h16v-1l-1-1v-5c0-2.6-1.7-4.8-4-5.9V5c0-1.7-1.3-3-3-3zm0 20c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z"\n />\n </svg>\n <span class="badge" id="notifBadge">0</span>\n</button>\n '}static insertTemplate(e="afterbegin"){document.body.insertAdjacentHTML(e,s.getTemplate())}#e=!1;get destroyed(){return this.#e}#t;#n;#s;#o;#i;#r=0;#l=99;#a=300;#c=!1;#d=new WeakMap;#h(e){if(this.#d.delete(e),!(e instanceof HTMLElement))throw new Error("Invalid HTMLElement to clear.");e.classList.add("removing"),setTimeout(()=>{this.markAsRead(e),e.remove()},this.#a)}#m(e){this.#r=Math.max(0,e),this.#s.setAttribute("data-value",String(this.#r)),this.#s.textContent=this.#r>this.#l?`${this.#l}+`:String(this.#r)}constructor(e={}){const{center:t=document.getElementById("notifCenter"),badge:n=document.getElementById("notifBadge"),button:s=document.querySelector(".notify-bell"),overlay:o=document.querySelector(".notify-overlay")}=e;if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "center" must be an HTMLElement. Got: ${t}`);if(!(o instanceof HTMLElement))throw new Error(`NotificationCenter: "overlay" must be an HTMLElement. Got: ${o}`);if(!(n instanceof HTMLElement))throw new Error(`NotificationCenter: "badge" must be an HTMLElement. Got: ${n}`);if(!(s instanceof HTMLElement))throw new Error(`NotificationCenter: "button" must be an HTMLElement. Got: ${s}`);const i=t?.querySelector(".clear-all"),r=t?.querySelector(".list")??null;if(!(r instanceof HTMLElement))throw new Error(`NotificationCenter: ".list" inside center must be an HTMLElement. Got: ${r}`);this.#t=t,this.#n=r,this.#s=n,this.#o=s,this.#i=o,this.#o.addEventListener("click",()=>this.toggle()),this.#t.querySelector(".close")?.addEventListener("click",()=>this.close()),i&&i.addEventListener("click",()=>this.clear()),this.#i.addEventListener("click",e=>{e.target===this.#i&&this.close()})}setMarkAllAsReadOnClose(e){if(n(this.#e),"boolean"!=typeof e)throw new TypeError("Expected boolean for markAllAsReadOnClose, got "+typeof e);this.#c=e}setRemoveDelay(e){if(n(this.#e),"number"!=typeof e)throw new Error('NotificationCenter: "ms" must be an number.');this.#a=e}getItemMode(e){n(this.#e);const t=this.getItem(e);return t?this.#d.get(t):null}getItem(e){n(this.#e);const t=this.#n.children.item(e);if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "item" must be an HTMLElement. Got: ${t}`);return t}hasItem(e){return n(this.#e),e>=0&&e<this.#n.children.length}markAsRead(e){n(this.#e);const t=e instanceof HTMLElement?e:this.getItem(e);t.classList.contains("unread")&&(t.classList.remove("unread"),this.#m(this.#r-1))}add(e,t="text"){n(this.#e);const s=document.createElement("div");s.className="item unread";let o=null,i=null,r=null,l=null;if("object"==typeof e&&null!==e?(o=e.title,i=e.message,r=e.avatar,l=e.onClick):i=e,r){const e=document.createElement("div");e.className="avatar",e.style.backgroundImage=`url("${r}")`,s.appendChild(e)}const a=document.createElement("div");if(a.className="content",o){const e=document.createElement("div");e.className="title",e.textContent=o,a.appendChild(e)}const c=document.createElement("div");c.className="message","html"===t?c.innerHTML=i:c.textContent=i,a.appendChild(c),"function"==typeof l&&(s.classList.add("clickable"),s.addEventListener("click",e=>{e.target instanceof HTMLElement&&!e.target.closest(".notify-close")&&l(e)}));const d=document.createElement("button");d.className="notify-close",d.setAttribute("type","button"),d.innerHTML="&times;",d.addEventListener("click",e=>{e.stopPropagation(),this.#h(s)}),s.append(a,d),this.#n.prepend(s),this.#d.set(s,t),this.#m(this.#r+1)}remove(e){n(this.#e);const t=this.getItem(e);this.#h(t)}clear(){n(this.#e);let e=!0;for(;e;){e=!1;const t=Array.from(this.#n.children);for(const n of t)n instanceof HTMLElement&&!n.classList.contains("removing")&&(this.#h(n),e=!0)}}open(){n(this.#e),this.#i.classList.remove("hidden"),this.#t.classList.add("open")}close(){if(n(this.#e),this.#i.classList.add("hidden"),this.#t.classList.remove("open"),this.#c){const e=this.#n.querySelectorAll(".item.unread");for(const t of e)t instanceof HTMLElement&&this.markAsRead(t)}}toggle(){n(this.#e),this.#t.classList.contains("open")?this.close():this.open()}recount(){n(this.#e);const e=this.#n.querySelectorAll(".item.unread").length;this.#m(e)}get count(){return this.#r}destroy(){this.#e||(this.#o?.removeEventListener("click",this.toggle),this.#t?.querySelector(".close")?.removeEventListener("click",this.close),this.#t?.querySelector(".clear-all")?.removeEventListener("click",this.clear),this.#i?.removeEventListener("click",this.close),this.clear(),this.#t?.remove(),this.#i?.remove(),this.#o?.remove(),this.#r=0,this.#d=new WeakMap,this.#e=!0)}}const o=s;window.TinyNotifyCenter=t.TinyNotifyCenter})();
1
+ (()=>{"use strict";const e={d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyNotifyCenter:()=>o});const n=e=>{if(e)throw new Error("This TinyNotifyCenter instance has been destroyed and can no longer be used.")};class s{static getTemplate(){return'\n<div class="notify-overlay hidden">\n <div class="notify-center" id="notifCenter">\n <div class="header">\n <div>Notifications</div>\n <div class="options">\n <button class="clear-all" type="button">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="24"\n height="24"\n fill="currentColor"\n >\n <path\n d="M21.6 2.4a1 1 0 0 0-1.4 0L13 9.6l-1.3-1.3a1 1 0 0 0-1.4 0L3 15.6a1 1 0 0 0 0 1.4l4 4a1 1 0 0 0 1.4 0l7.3-7.3a1 1 0 0 0 0-1.4l-1.3-1.3 7.2-7.2a1 1 0 0 0 0-1.4zM6 17l3.5-3.5 1.5 1.5L7.5 18.5 6 17z"\n />\n </svg>\n </button>\n <button class="close">×</button>\n </div>\n </div>\n <div class="list"></div>\n </div>\n</div>\n\n<button class="notify-bell" aria-label="Open notifications">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n fill="currentColor"\n viewBox="0 0 24 24"\n >\n <path\n d="M12 2C10.3 2 9 3.3 9 5v1.1C6.7 7.2 5 9.4 5 12v5l-1 1v1h16v-1l-1-1v-5c0-2.6-1.7-4.8-4-5.9V5c0-1.7-1.3-3-3-3zm0 20c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z"\n />\n </svg>\n <span class="badge" id="notifBadge">0</span>\n</button>\n '}static insertTemplate(e="afterbegin"){document.body.insertAdjacentHTML(e,s.getTemplate())}#e=!1;get destroyed(){return this.#e}#t;#n;#s;#o;#i;#r=0;#l=99;#a=300;#c=!1;#d=new WeakMap;#h(e){if(this.#d.delete(e),!(e instanceof HTMLElement))throw new Error("Invalid HTMLElement to clear.");e.classList.add("removing"),setTimeout(()=>{this.markAsRead(e),e.remove()},this.#a)}#m(e){this.#r=Math.max(0,e),this.#s.setAttribute("data-value",String(this.#r)),this.#s.textContent=this.#r>this.#l?`${this.#l}+`:String(this.#r)}constructor(e={}){const{center:t=document.getElementById("notifCenter"),badge:n=document.getElementById("notifBadge"),button:s=document.querySelector(".notify-bell"),overlay:o=document.querySelector(".notify-overlay")}=e;if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "center" must be an HTMLElement. Got: ${t}`);if(!(o instanceof HTMLElement))throw new Error(`NotificationCenter: "overlay" must be an HTMLElement. Got: ${o}`);if(!(n instanceof HTMLElement))throw new Error(`NotificationCenter: "badge" must be an HTMLElement. Got: ${n}`);if(!(s instanceof HTMLElement))throw new Error(`NotificationCenter: "button" must be an HTMLElement. Got: ${s}`);const i=t?.querySelector(".clear-all"),r=t?.querySelector(".list")??null;if(!(r instanceof HTMLElement))throw new Error(`NotificationCenter: ".list" inside center must be an HTMLElement. Got: ${r}`);this.#t=t,this.#n=r,this.#s=n,this.#o=s,this.#i=o,this.#o.addEventListener("click",()=>this.toggle()),this.#t.querySelector(".close")?.addEventListener("click",()=>this.close()),i&&i.addEventListener("click",()=>this.clear()),this.#i.addEventListener("click",e=>{e.target===this.#i&&this.close()})}setMarkAllAsReadOnClose(e){if(n(this.#e),"boolean"!=typeof e)throw new TypeError("Expected boolean for markAllAsReadOnClose, got "+typeof e);this.#c=e}setRemoveDelay(e){if(n(this.#e),"number"!=typeof e)throw new Error('NotificationCenter: "ms" must be an number.');this.#a=e}getItemMode(e){n(this.#e);const t=this.getItem(e);return t?this.#d.get(t):null}getItem(e){n(this.#e);const t=this.#n.children.item(e);if(!(t instanceof HTMLElement))throw new Error(`NotificationCenter: "item" must be an HTMLElement. Got: ${t}`);return t}hasItem(e){return n(this.#e),e>=0&&e<this.#n.children.length}markAsRead(e){n(this.#e);const t=e instanceof HTMLElement?e:this.getItem(e);t.classList.contains("unread")&&(t.classList.remove("unread"),this.#m(this.#r-1))}add(e,t="text"){n(this.#e);const s=document.createElement("div");s.className="item unread";let o=null,i=null,r=null,l=null;if("object"==typeof e&&null!==e?(o=e.title,i=e.message,r=e.avatar,l=e.onClick):i=e,r){const e=document.createElement("div");e.className="avatar",e.style.backgroundImage=`url("${r}")`,s.appendChild(e)}const a=document.createElement("div");if(a.className="content",o){const e=document.createElement("div");e.className="title",e.textContent=o,a.appendChild(e)}const c=document.createElement("div");c.className="message","html"===t?c.innerHTML=i:c.textContent=i,a.appendChild(c),"function"==typeof l&&(s.classList.add("clickable"),s.addEventListener("click",e=>{e.target instanceof HTMLElement&&!e.target.closest(".notify-close")&&l(e)}));const d=document.createElement("button");d.className="notify-close",d.setAttribute("type","button"),d.innerHTML="&times;",d.addEventListener("click",e=>{e.stopPropagation(),this.#h(s)}),s.append(a,d),this.#n.prepend(s),this.#d.set(s,t),this.#m(this.#r+1)}remove(e){n(this.#e);const t=this.getItem(e);this.#h(t)}clear(){n(this.#e);let e=!0;for(;e;){e=!1;const t=Array.from(this.#n.children);for(const n of t)n instanceof HTMLElement&&!n.classList.contains("removing")&&(this.#h(n),e=!0)}}open(){n(this.#e),this.#i.classList.remove("hidden"),this.#t.classList.add("open")}close(){if(n(this.#e),this.#i.classList.add("hidden"),this.#t.classList.remove("open"),this.#c){const e=this.#n.querySelectorAll(".item.unread");for(const t of e)t instanceof HTMLElement&&this.markAsRead(t)}}toggle(){n(this.#e),this.#t.classList.contains("open")?this.close():this.open()}recount(){n(this.#e);const e=this.#n.querySelectorAll(".item.unread").length;this.#m(e)}get count(){return this.#r}destroy(){this.#e||(this.#o?.removeEventListener("click",this.toggle),this.#t?.querySelector(".close")?.removeEventListener("click",this.close),this.#t?.querySelector(".clear-all")?.removeEventListener("click",this.clear),this.#i?.removeEventListener("click",this.close),this.clear(),this.#t?.remove(),this.#i?.remove(),this.#o?.remove(),this.#r=0,this.#d=new WeakMap,this.#e=!0)}}const o=s;window.TinyNotifyCenter=t.TinyNotifyCenter})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";const t={d:(e,i)=>{for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};let e={};t.d(e,{TinyOPFSFileSystem:()=>y});const i=Object.freeze({F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4,O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_TRUNC:512,O_APPEND:1024}),r=(Object.freeze({OWNER_READ:256,OWNER_WRITE:128,OWNER_EXECUTE:64,GROUP_READ:32,GROUP_WRITE:16,GROUP_EXECUTE:8,OTHER_READ:4,OTHER_WRITE:2,OTHER_EXECUTE:1,SETUID:2048,SETGID:1024,STICKY:512}),Object.freeze({FILE:32768,DIRECTORY:16384,SYMBOLIC_LINK:40960})),a=Object.freeze(["utf8","utf-8","base64","hex"]),n=(t,e,i,r="")=>{const a=r.length>0?`, ${r}`:"",n=new Error(`${t}: ${e} '${i}'${a}`);return n.code=t,n.errno=t,n.syscall=e,n.path=i,n},s=(t,e,i,r="ENOTDIR")=>{if("undefined"!=typeof DOMException&&t instanceof DOMException)switch(t.name){case"NotFoundError":return n("ENOENT",e,i);case"TypeMismatchError":return n(r,e,i);case"InvalidModificationError":return n("ENOTEMPTY",e,i);case"NoModificationAllowedError":return n("EBUSY",e,i);case"NotAllowedError":return n("EACCES",e,i);default:return n("EIO",e,i,t.message)}return t instanceof Error?t:new Error(String(t))},o=(t,e)=>{if("string"!=typeof t)throw new TypeError(`The "${e}" argument must be of type string. Received ${null===t?"null":typeof t}`);if(0===t.length)throw n("ENOENT","open",t,"path must not be empty");if(t.includes("\0"))throw new TypeError('The "path" argument must not contain null bytes');return t},c=(t,e)=>{if(null===t||"object"!=typeof t||Array.isArray(t)){const i=null===t?"null":Array.isArray(t)?"Array":typeof t;throw new TypeError(`The "options" argument must be of type object. Received ${i} in ${e}()`)}return t},h=(t,e)=>{if(null==t)return null;if("string"!=typeof t||!a.includes(t))throw new TypeError(`The "encoding" option must be one of ${a.join(", ")}. Received ${String(t)} in ${e}()`);return t},d=(t,e)=>{if("number"!=typeof t||!Number.isInteger(t))throw new TypeError(`The "${e}" argument must be an integer`);if(t<0)throw new RangeError(`The "${e}" argument must not be negative`);return t};class u{#t;constructor(t){this.#t=Object.freeze({...t})}get path(){return this.#t.path}get name(){return this.#t.name}get size(){return"directory"===this.#t.kind?0:this.#t.size}get mode(){return this.#t.mode}get uid(){return this.#t.uid}get gid(){return this.#t.gid}get ino(){return this.#t.ino}get nlink(){return 1}get atimeMs(){return this.#t.atimeMs}get mtimeMs(){return this.#t.mtimeMs}get birthtimeMs(){return this.#t.birthtimeMs}get atime(){return new Date(this.#t.atimeMs)}get mtime(){return new Date(this.#t.mtimeMs)}get ctime(){return new Date(this.#t.mtimeMs)}get birthtime(){return new Date(this.#t.birthtimeMs)}isFile(){return"file"===this.#t.kind}isDirectory(){return"directory"===this.#t.kind}isSymbolicLink(){return"symbolic-link"===this.#t.kind}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}isSocket(){return!1}get modeWithType(){return(this.isDirectory()?r.DIRECTORY:r.FILE)|this.#t.mode}}class l{#e;#i;constructor(t,e){this.#e=t,this.#i=e}get name(){return this.#e}isFile(){return"file"===this.#i}isDirectory(){return"directory"===this.#i}isSymbolicLink(){return"symbolic-link"===this.#i}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}isSocket(){return!1}}class m{#r;#a;#n;#s;constructor(t,e,i){this.#r=t,this.#a=e,this.#n=i,this.#s=!1}get path(){return this.#a}get flags(){return this.#n}get closed(){return this.#s}async readFile(t){return this.#o(),this.#r.readFile(this.#a,t)}async writeFile(t,e){return this.#o(),this.#r.writeFile(this.#a,t,e)}async appendFile(t,e){return this.#o(),this.#r.appendFile(this.#a,t,e)}async stat(){return this.#o(),this.#r.stat(this.#a)}async truncate(t){return this.#o(),this.#r.truncate(this.#a,t)}async close(){this.#s=!0}#o(){if(this.#s)throw n("EBADF","read",this.#a,"file handle is closed")}}const w=t=>{const e=[];for(const i of t.split("/"))0!==i.length&&"."!==i&&(".."!==i?e.push(i):e.pop());return e},p=class{#c=new Map;#h;#d;#u;constructor(t={}){const{cwd:e="/",umask:i=18,identity:r}=c(t,"constructor");this.#h="string"==typeof e?e:"/",this.#d="number"==typeof i?i:18,this.#u={uid:r?.uid??0,gid:r?.gid??0,groups:r?.groups??[]}}static get capabilities(){return Object.freeze({permissions:!1,ownership:!1,symlinks:!1,timestamps:!1,atomicRename:!1,seekableHandles:!1})}get cwd(){return this.#h}get umask(){return this.#d}get identity(){return this.#u}async _readFile(t){throw this.#l("readFile",t)}async _writeFile(t,e,i){throw this.#l("writeFile",t)}async _readdir(t){throw this.#l("readdir",t)}async _mkdir(t,e){throw this.#l("mkdir",t)}async _rm(t,e){throw this.#l("rm",t)}async _stat(t){throw this.#l("stat",t)}async _rename(t,e){throw this.#l("rename",t)}async _copyFile(t,e,i){throw this.#l("copyFile",t)}async _readMetadata(t){return this.#c.get(t)??{mode:null,uid:null,gid:null,atimeMs:null,mtimeMs:null,birthtimeMs:null}}async _writeMetadata(t,e){this.#c.set(t,e)}async readFile(t,e={}){const i=o(t,"path"),{encoding:r}=c(e,"readFile"),a=h(r,"readFile");return((t,e)=>null===e?t:"base64"===e?(t=>{let e="";for(const i of t)e+=String.fromCharCode(i);return btoa(e)})(t):"hex"===e?(t=>Array.from(t,t=>t.toString(16).padStart(2,"0")).join(""))(t):new TextDecoder("utf-8").decode(t))(await this._readFile(i),a)}async writeFile(t,e,i={}){const r=o(t,"path"),{encoding:a,append:n,mode:s}=c(i,"writeFile"),d=((t,e)=>{if("string"==typeof t)return"base64"===e?(t=>{const e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t+=1)i[t]=e.charCodeAt(t);return i})(t):"hex"===e?(t=>{if(t.length%2!=0)throw new TypeError('The "hex" encoded string must have an even length');const e=new Uint8Array(t.length/2);for(let i=0;i<e.length;i+=1)e[i]=Number.parseInt(t.slice(2*i,2*i+2),16);return e})(t):(new TextEncoder).encode(t);if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new TypeError('The "data" argument must be a string, an ArrayBuffer or an ArrayBufferView')})(e,h(a,"writeFile")),u=await this.exists(r);if(await this._writeFile(r,d,{append:!0===n,mode:"number"==typeof s?s:void 0}),!u){const t="number"==typeof s?s:438;await this._writeMetadata(r,{mode:null,uid:null,gid:null,atimeMs:null,mtimeMs:null,birthtimeMs:null,mode:t&~this.#d,uid:this.#u.uid,gid:this.#u.gid,birthtimeMs:Date.now(),mtimeMs:Date.now(),atimeMs:Date.now()})}}async appendFile(t,e,i={}){const r=o(t,"path"),a=c(i,"appendFile");return this.writeFile(r,e,{...a,append:!0})}async readdir(t,e={}){const i=o(t,"path"),{withFileTypes:r,recursive:a}=c(e,"readdir"),n=await this._readdir(i),s=[];for(const t of n)if(s.push(!0===r?new l(t.name,t.kind):t.name),!0===a&&"directory"===t.kind){const a=`${i.replace(/\/$/,"")}/${t.name}`,n=await this.readdir(a,e);for(const e of n){const i="string"==typeof e?e:e.name;s.push(!0===r?new l(`${t.name}/${i}`,"file"):`${t.name}/${i}`)}}return s}async mkdir(t,e={}){const i=o(t,"path"),{recursive:r,mode:a}=c(e,"mkdir");await this._mkdir(i,{recursive:!0===r});const n="number"==typeof a?a:511;return await this._writeMetadata(i,{mode:null,uid:null,gid:null,atimeMs:null,mtimeMs:null,birthtimeMs:null,mode:n&~this.#d,uid:this.#u.uid,gid:this.#u.gid,birthtimeMs:Date.now(),mtimeMs:Date.now(),atimeMs:Date.now()}),!0===r?i:void 0}async rm(t,e={}){const i=o(t,"path"),{recursive:r,force:a}=c(e,"rm");await this._rm(i,{recursive:!0===r,force:!0===a}),this.#c.delete(i)}async unlink(t){const e=o(t,"path"),i=await this.__stat(e);if(i?.isDirectory())throw n("EISDIR","unlink",e);await this.rm(e,{force:!1})}async rmdir(t,e={}){const i=o(t,"path"),{recursive:r}=c(e,"rmdir");await this.rm(i,{recursive:!0===r})}async rename(t,e){const i=o(t,"oldPath"),r=o(e,"newPath");await this._rename(i,r);const a=await this._readMetadata(i);await this._writeMetadata(r,a),this.#c.delete(i)}async copyFile(t,e,i=0){const r=o(t,"sourcePath"),a=o(e,"destinationPath"),n="number"==typeof i?i:0;await this._copyFile(r,a,n);const s=await this._readMetadata(r);await this._writeMetadata(a,s)}async __stat(t,e={}){const i=o(t,"path"),{throwIfNoEntry:r}=c(e,"stat"),a=await this._stat(i);if(void 0===a){if(!1===r)return;throw n("ENOENT","stat",i)}const s=await this._readMetadata(i),h="directory"===a.kind?511:438;return new u({path:i,name:a.name,kind:a.kind,size:a.size,mode:s.mode??h,uid:s.uid??0,gid:s.gid??0,atimeMs:s.atimeMs??a.mtimeMs,mtimeMs:s.mtimeMs??a.mtimeMs,birthtimeMs:s.birthtimeMs??a.mtimeMs,ino:0})}async stat(t,e={}){const i=o(t,"path"),r=await this.__stat(i,e);if(void 0===r)throw n("ENOENT","stat",i);return r}async lstat(t,e={}){return this.stat(t,e)}async access(t,e=i.F_OK){const r=o(t,"path");if("number"!=typeof e||!Number.isInteger(e))throw new TypeError('The "mode" argument must be an integer');const a=await this.__stat(r);if(e===i.F_OK)return;if(!a)throw n("ENOENT","access",r);const s=this.#m(a.uid,a.gid),c=a.mode>>s&7;if(e&i.R_OK&&!(4&c))throw n("EACCES","access",r);if(e&i.W_OK&&!(2&c))throw n("EACCES","access",r);if(e&i.X_OK&&!(1&c))throw n("EACCES","access",r)}async chmod(t,e){const i=o(t,"path"),r=((t,e)=>{if("number"!=typeof t||!Number.isInteger(t))throw new TypeError(`The "${e}" argument must be an integer`);if(t<0||t>4095)throw new RangeError(`The "${e}" argument must be between 0o0000 and 0o7777`);return t})(e,"mode"),a=await this._readMetadata(i);await this._writeMetadata(i,{...a,mode:r})}async chown(t,e,i){const r=o(t,"path"),a=d(e,"uid"),n=void 0===i?a:d(i,"gid"),s=await this._readMetadata(r);await this._writeMetadata(r,{...s,uid:a,gid:n})}async utimes(t,e,i){const r=o(t,"path"),a=d(e,"atimeMs"),n=void 0===i?a:d(i,"mtimeMs"),s=await this._readMetadata(r);await this._writeMetadata(r,{...s,atimeMs:a,mtimeMs:n})}async truncate(t,e=0){const i=o(t,"path"),r=d(e,"length"),a=await this.readFile(i),n=new Uint8Array(r);n.set(a.subarray(0,r)),await this.writeFile(i,n)}async realpath(t){const e=o(t,"path");return await this.__stat(e),`/${w(e).join("/")}`}async open(t,e="r"){const i=o(t,"path");if("string"!=typeof e)throw new TypeError('The "flags" argument must be of type string');return e.includes("w")?await this.writeFile(i,new Uint8Array(0)):e.includes("a")?await this.writeFile(i,new Uint8Array(0),{append:!0}):await this.__stat(i),new m(this,i,e)}async exists(t){return void 0!==await this.__stat(t,{throwIfNoEntry:!1})}#l(t,e){return n("ENOSYS",t,e,`${t}() is not implemented by ${this.constructor.name}`)}#m(t,e){return t===this.#u.uid?6:e===this.#u.gid||this.#u.groups.includes(e)?3:0}},y=class extends p{#w;constructor(t={}){super(t),this.#w=t.root??null}static get capabilities(){return Object.freeze({permissions:!1,ownership:!1,symlinks:!1,timestamps:!1,atomicRename:!1,seekableHandles:!1})}async _resolveRoot(){if(null!==this.#w)return this.#w;if("undefined"==typeof navigator||"function"!=typeof navigator.storage?.getDirectory)throw n("ENOSYS","getDirectory","/","OPFS is not available in this environment");return this.#w=await navigator.storage.getDirectory(),this.#w}async#p(t,e,i,r){let a=await this._resolveRoot();for(const n of t)try{a=await a.getDirectoryHandle(n,{create:e})}catch(t){throw s(t,i,r)}return a}async#y(t,e){const i=w(t),r=i.pop();if(void 0===r)throw n("EINVAL",e,t,"the root has no parent");return{parent:await this.#p(i,!1,e,t),name:r}}async#f(t,e){const i=[];try{for await(const[e,r]of t.entries())i.push({name:e,kind:r.kind})}catch(t){throw s(t,"readdir",e)}return i.sort((t,e)=>t.name.localeCompare(e.name))}async#g(t,e){for await(const[i,r]of t.entries()){if("directory"===r.kind){const t=await e.getDirectoryHandle(i,{create:!0});await this.#g(r,t);continue}const t=r,a=await t.getFile(),n=await e.getFileHandle(i,{create:!0}),s=await n.createWritable();await s.write(await a.arrayBuffer()),await s.close()}}async _readFile(t){const{parent:e,name:i}=await this.#y(t,"readFile");try{const t=await e.getFileHandle(i),r=await t.getFile();return new Uint8Array(await r.arrayBuffer())}catch(e){throw s(e,"readFile",t,"EISDIR")}}async _writeFile(t,e,i){const{parent:r,name:a}=await this.#y(t,"writeFile"),n=e;try{const t=await r.getFileHandle(a,{create:!0}),e=await t.createWritable({keepExistingData:!0===i.append});if(!0===i.append){const i=await t.getFile();await e.write({type:"write",position:i.size,data:n})}else await e.write(n);await e.close()}catch(e){throw s(e,"writeFile",t)}}async _readdir(t){const e=await this.#p(w(t),!1,"readdir",t);return this.#f(e,t)}async _mkdir(t,e){const i=w(t);if(0===i.length){if(!0===e.recursive)return;throw n("EEXIST","mkdir",t)}if(!0===e.recursive)return void await this.#p(i,!0,"mkdir",t);const{parent:r,name:a}=await this.#y(t,"mkdir");if((await this.#f(r,t)).some(t=>t.name===a))throw n("EEXIST","mkdir",t);try{await r.getDirectoryHandle(a,{create:!0})}catch(e){throw s(e,"mkdir",t)}}async _rm(t,e){const{parent:i,name:r}=await this.#y(t,"rm"),a=(await this.#f(i,t)).find(t=>t.name===r);if(void 0===a){if(!0===e.force)return;throw n("ENOENT","rm",t)}if("directory"===a.kind&&!0!==e.recursive){const e=await i.getDirectoryHandle(r);if((await this.#f(e,t)).length>0)throw n("ENOTEMPTY","rm",t)}try{await i.removeEntry(r,{recursive:!0===e.recursive})}catch(e){throw s(e,"rm",t)}}async _stat(t){const e=w(t);if(0===e.length)return{name:"/",kind:"directory",size:0,mtimeMs:Date.now()};const i=e.pop(),r=await this.#p(e,!1,"stat",t),a=(await this.#f(r,t)).find(t=>t.name===i);if(void 0===a)return;if("directory"===a.kind)return{name:i,kind:"directory",size:0,mtimeMs:Date.now()};const n=await r.getFileHandle(i),s=await n.getFile();return{name:i,kind:"file",size:s.size,mtimeMs:s.lastModified}}async _rename(t,e){const i=await this._stat(t);if(void 0===i)throw n("ENOENT","rename",t);if("directory"===i.kind){const i=await this.#p(w(t),!1,"rename",t),r=await this.#p(w(e),!0,"rename",e);await this.#g(i,r)}else{const i=await this._readFile(t);await this._writeFile(e,i,{append:!1})}await this._rm(t,{recursive:!0,force:!0})}async _copyFile(t,e){const i=await this._readFile(t);await this._writeFile(e,i,{append:!1})}};window.TinyOPFSFileSystem=e.TinyOPFSFileSystem})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";const e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};let t={};e.d(t,{TinyPasswordValidator:()=>s});class r{static#e=Object.freeze({1:"Password must have at least {value} characters.",2:"Password cannot exceed {value} characters.",3:"Password must contain at least one lowercase letter.",4:"Password must contain at least one uppercase letter.",5:"Password must contain at least one number.",6:"Password must contain at least one special character (@$!%*?&)."});static#t=Object.freeze({lowercase:/[a-z]/,uppercase:/[A-Z]/,numbers:/\d/,special:/[@$!%*?&]/});static#r="^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$";static#s(){return new RegExp(r.#r)}static get fullPatternString(){return r.#r}static get getFullPattern(){return r.#s}static#a=async e=>e;static get hashText(){return r.#a}static set hashText(e){if("function"!=typeof e)throw new TypeError("The value provided to hashText must be a function.");r.#a=e}#i={requireLowercase:!0,requireUppercase:!0,requireNumbers:!0,requireSpecial:!0,minLength:8,maxLength:128};get requireLowercase(){return this.#i.requireLowercase}get requireUppercase(){return this.#i.requireUppercase}get requireNumbers(){return this.#i.requireNumbers}get requireSpecial(){return this.#i.requireSpecial}get minLength(){return this.#i.minLength}get maxLength(){return this.#i.maxLength}#n=[];add(e){if(!e||"object"!=typeof e)throw new TypeError("Validator must be a valid object.");if("string"!=typeof e.id)throw new TypeError('Validator must have a string "id".');if("string"!=typeof e.name)throw new TypeError('Validator must have a string "name".');if("function"!=typeof e.validate)throw new TypeError('Validator must have a "validate" function.');if(this.#n.some(t=>t.id===e.id))throw new Error(`Validator with id "${e.id}" already exists.`);this.#n.push(e)}remove(e){if("string"!=typeof e)throw new TypeError("The ID to remove must be a string.");const t=this.#n.findIndex(t=>t.id===e);if(-1===t)throw new Error(`Validator with id "${e}" not found.`);this.#n.splice(t,1)}reorder(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("Indices must be integers.");if(e<0||e>=this.#n.length)throw new RangeError("oldIndex is out of bounds.");if(t<0||t>=this.#n.length)throw new RangeError("newIndex is out of bounds.");const[r]=this.#n.splice(e,1);this.#n.splice(t,0,r)}sort(e){if("function"!=typeof e)throw new TypeError("The comparator must be a function.");this.#n.sort(e)}clear(){this.#n=[]}get size(){return this.#n.length}constructor(e={},t=null){this.setRules(e),t&&(r.hashText=t)}#o(e){if(!e||"object"!=typeof e)throw new TypeError("Rules must be a valid object.");const t=["requireLowercase","requireUppercase","requireNumbers","requireSpecial"];for(const r of t)if("boolean"!=typeof e[r])throw new TypeError(`Property "${r}" must be a boolean.`);if("number"!=typeof e.minLength||"number"!=typeof e.maxLength)throw new TypeError("minLength and maxLength must be numbers.");if(!Number.isInteger(e.minLength)||!Number.isInteger(e.maxLength))throw new TypeError("minLength and maxLength must be integers.");if(e.minLength<0||e.maxLength<0)throw new RangeError("Size values cannot be negative.");if(e.minLength>e.maxLength)throw new RangeError("minLength cannot be greater than maxLength.")}get rules(){return{...this.#i}}set rules(e){if(!e||"object"!=typeof e)throw new TypeError("New rules must be an object.");this.#o(e),this.#i=e}setRules(e){if(!e||"object"!=typeof e)throw new TypeError("New rules must be an object.");const t={...this.#i,...e};this.#o(t),this.#i=t}execute(e){if("string"!=typeof e)throw new TypeError("The password must be a string.");const t=this.#n.map(t=>t.validate(e));return{allPassed:t.every(e=>e.isValid),details:t}}validate(e){if("string"!=typeof e)throw new TypeError("The password must be a string.");const t=[],s=[];let a=0,i=1;e.length<this.#i.minLength?(s.push(1),t.push(r.#e[1].replace("{value}",String(this.#i.minLength)))):e.length>this.#i.maxLength?(s.push(2),t.push(r.#e[2].replace("{value}",String(this.#i.maxLength)))):a+=1,this.#i.requireLowercase&&(i++,r.#t.lowercase.test(e)?a++:(s.push(3),t.push(r.#e[3]))),this.#i.requireUppercase&&(i++,r.#t.uppercase.test(e)?a++:(s.push(4),t.push(r.#e[4]))),this.#i.requireNumbers&&(i++,r.#t.numbers.test(e)?a++:(s.push(5),t.push(r.#e[5]))),this.#i.requireSpecial&&(i++,r.#t.special.test(e)?a++:(s.push(6),t.push(r.#e[6])));let n="weak";return 0===t.length?n="strong":a/i>=.7&&(n="medium"),{isValid:0===t.length,score:a,totalPossiblePoints:i,strength:n,errors:t,errorCodes:s}}}const s=r;window.TinyPasswordValidator=t.TinyPasswordValidator})();