tiny-essentials 1.28.18 → 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.
- package/README.md +1 -1
- package/changelog/1/28/19.md +24 -0
- package/changelog/1/29/0.md +58 -0
- package/dist/v1/ColorSafeStringify.min.js +1 -1
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyAnalogClock.min.js +1 -1
- package/dist/v1/TinyArrayComparator.min.js +1 -1
- package/dist/v1/TinyArrayPaginator.min.js +1 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyBrowserMonitor.min.js +1 -0
- package/dist/v1/TinyClassManager.min.js +1 -1
- package/dist/v1/TinyClipboard.min.js +1 -1
- package/dist/v1/TinyCloner.min.js +1 -0
- package/dist/v1/TinyColorConverter.min.js +1 -1
- package/dist/v1/TinyColorValidator.min.js +1 -1
- package/dist/v1/TinyCookieConsent.min.js +1 -1
- package/dist/v1/TinyDayNightCycle.min.js +1 -1
- package/dist/v1/TinyDebugger.min.js +1 -1
- package/dist/v1/TinyDomReadyManager.min.js +1 -1
- package/dist/v1/TinyDragDropDetector.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyElementObserver.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyGamepad.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyHtmlTagRegexBuilder.min.js +1 -0
- package/dist/v1/TinyHttpResponseRegistry.min.js +1 -0
- package/dist/v1/TinyI18.min.js +1 -1
- package/dist/v1/TinyIframeEvents.min.js +1 -1
- package/dist/v1/TinyInventory.min.js +1 -1
- package/dist/v1/TinyInventoryTrader.min.js +1 -1
- package/dist/v1/TinyLevelUp.min.js +1 -1
- package/dist/v1/TinyLoadingScreen.min.js +1 -1
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyMaInSys.min.js +1 -1
- package/dist/v1/TinyMapCache.min.js +1 -0
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyNeedBar.min.js +1 -1
- package/dist/v1/TinyNewWinEvents.min.js +1 -1
- package/dist/v1/TinyNotificationAdapter.min.js +1 -0
- package/dist/v1/TinyNotifications.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyOPFSFileSystem.min.js +1 -0
- package/dist/v1/TinyPasswordValidator.min.js +1 -0
- package/dist/v1/TinyPluginPackage.min.js +1 -0
- package/dist/v1/TinyPromiseQueue.min.js +1 -1
- package/dist/v1/TinyPushManager.min.js +1 -0
- package/dist/v1/TinyPushPayload.min.js +1 -0
- package/dist/v1/TinyPushRouter.min.js +1 -0
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinyRegexEs.min.js +1 -0
- package/dist/v1/TinyRouter.min.js +1 -0
- package/dist/v1/TinyServiceWorker.min.js +1 -0
- package/dist/v1/TinyServiceWorkerEngine.min.js +1 -0
- package/dist/v1/TinySetMapPackage.min.js +1 -0
- package/dist/v1/TinySimpleDice.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyStorageBucketFileSystem.min.js +1 -0
- package/dist/v1/TinyTextDiffer.min.js +1 -1
- package/dist/v1/TinyTextRangeEditor.min.js +1 -1
- package/dist/v1/TinyTextarea.min.js +1 -1
- package/dist/v1/TinyThrottledApi.min.js +1 -0
- package/dist/v1/TinyTimeout.min.js +1 -1
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/TinyUriParser.min.js +1 -0
- package/dist/v1/TinyVersion.min.js +1 -0
- package/dist/v1/TinyWebWorker.min.js +1 -0
- package/dist/v1/TinyWebWorkerEngine.min.js +1 -0
- package/dist/v1/UltraRandomMsgGen.min.js +1 -1
- package/dist/v1/basics/array.cjs +2 -2
- package/dist/v1/basics/array.d.mts +2 -0
- package/dist/v1/basics/array.d.mts.map +1 -1
- package/dist/v1/basics/array.mjs +2 -1
- package/dist/v1/basics/browserDetector.cjs +37 -12
- package/dist/v1/basics/browserDetector.d.mts +8 -0
- package/dist/v1/basics/browserDetector.d.mts.map +1 -1
- package/dist/v1/basics/browserDetector.mjs +32 -13
- package/dist/v1/basics/crypto.cjs +23 -0
- package/dist/v1/basics/crypto.d.mts +10 -0
- package/dist/v1/basics/crypto.d.mts.map +1 -0
- package/dist/v1/basics/crypto.mjs +18 -0
- package/dist/v1/basics/html.cjs +0 -3
- package/dist/v1/basics/html.d.mts.map +1 -1
- package/dist/v1/basics/html.mjs +0 -2
- package/dist/v1/basics/index.cjs +8 -1
- package/dist/v1/basics/index.d.mts +6 -5
- package/dist/v1/basics/index.d.mts.map +1 -1
- package/dist/v1/basics/index.mjs +6 -5
- package/dist/v1/basics/objChecker.cjs +88 -0
- package/dist/v1/basics/objChecker.d.mts +26 -0
- package/dist/v1/basics/objChecker.d.mts.map +1 -1
- package/dist/v1/basics/objChecker.mjs +74 -0
- package/dist/v1/basics/objFilter.cjs +234 -93
- package/dist/v1/basics/objFilter.d.mts +96 -22
- package/dist/v1/basics/objFilter.d.mts.map +1 -1
- package/dist/v1/basics/objFilter.mjs +216 -92
- package/dist/v1/basics/promiseUtils.cjs +48 -12
- package/dist/v1/basics/promiseUtils.d.mts +45 -12
- package/dist/v1/basics/promiseUtils.d.mts.map +1 -1
- package/dist/v1/basics/promiseUtils.mjs +47 -12
- package/dist/v1/basics/text.cjs +0 -12
- package/dist/v1/basics/text.d.mts +0 -10
- package/dist/v1/basics/text.d.mts.map +1 -1
- package/dist/v1/basics/text.mjs +0 -10
- package/dist/v1/css/TinyCookieConsent.min.css +1 -0
- package/dist/v1/css/TinyCookieConsent.min.css.map +1 -0
- package/dist/v1/css/TinyDraggerExample.min.css +1 -0
- package/dist/v1/css/TinyDraggerExample.min.css.map +1 -0
- package/dist/v1/css/TinyLoadingScreen.min.css +1 -0
- package/dist/v1/css/TinyLoadingScreen.min.css.map +1 -0
- package/dist/v1/css/TinyNotify.min.css +1 -0
- package/dist/v1/css/TinyNotify.min.css.map +1 -0
- package/dist/v1/css/aiMarker.min.css +1 -0
- package/dist/v1/css/aiMarker.min.css.map +1 -0
- package/dist/v1/index.cjs +88 -3
- package/dist/v1/index.d.mts +31 -6
- package/dist/v1/index.d.mts.map +1 -1
- package/dist/v1/index.mjs +32 -7
- package/dist/v1/jsdoc/EventEmitter.cjs +4 -0
- package/dist/v1/jsdoc/EventEmitter.d.mts +33 -0
- package/dist/v1/jsdoc/EventEmitter.d.mts.map +1 -0
- package/dist/v1/jsdoc/EventEmitter.mjs +18 -0
- package/dist/v1/libs/array/TinyArrayComparator.cjs +240 -25
- package/dist/v1/libs/array/TinyArrayComparator.d.mts +130 -22
- package/dist/v1/libs/array/TinyArrayComparator.d.mts.map +1 -1
- package/dist/v1/libs/array/TinyArrayComparator.mjs +210 -24
- package/dist/v1/libs/fs/constants.cjs +74 -0
- package/dist/v1/libs/fs/constants.d.mts +22 -0
- package/dist/v1/libs/fs/constants.d.mts.map +1 -0
- package/dist/v1/libs/fs/constants.mjs +53 -0
- package/dist/v1/libs/fs/encoding.cjs +118 -0
- package/dist/v1/libs/fs/encoding.d.mts +50 -0
- package/dist/v1/libs/fs/encoding.d.mts.map +1 -0
- package/dist/v1/libs/fs/encoding.mjs +102 -0
- package/dist/v1/libs/fs/error.cjs +188 -0
- package/dist/v1/libs/fs/error.d.mts +105 -0
- package/dist/v1/libs/fs/error.d.mts.map +1 -0
- package/dist/v1/libs/fs/error.mjs +158 -0
- package/dist/v1/libs/fs/handle.cjs +121 -0
- package/dist/v1/libs/fs/handle.d.mts +56 -0
- package/dist/v1/libs/fs/handle.d.mts.map +1 -0
- package/dist/v1/libs/fs/handle.mjs +100 -0
- package/dist/v1/libs/fs/index.cjs +700 -0
- package/dist/v1/libs/fs/index.d.mts +377 -0
- package/dist/v1/libs/fs/index.d.mts.map +1 -0
- package/dist/v1/libs/fs/index.mjs +630 -0
- package/dist/v1/libs/fs/path.cjs +234 -0
- package/dist/v1/libs/fs/path.d.mts +176 -0
- package/dist/v1/libs/fs/path.d.mts.map +1 -0
- package/dist/v1/libs/fs/path.mjs +197 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.cjs +202 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts +121 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.d.mts.map +1 -0
- package/dist/v1/libs/fs/plugins/OPFS/StorageBucket.mjs +172 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.cjs +334 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts +98 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.d.mts.map +1 -0
- package/dist/v1/libs/fs/plugins/OPFS/index.mjs +300 -0
- package/dist/v1/libs/fs/stats.cjs +245 -0
- package/dist/v1/libs/fs/stats.d.mts +226 -0
- package/dist/v1/libs/fs/stats.d.mts.map +1 -0
- package/dist/v1/libs/fs/stats.mjs +197 -0
- package/dist/v1/libs/html/events/TinyIframeEvents.cjs +10 -1
- package/dist/v1/libs/html/events/TinyIframeEvents.d.mts +9 -2
- package/dist/v1/libs/html/events/TinyIframeEvents.d.mts.map +1 -1
- package/dist/v1/libs/html/events/TinyIframeEvents.mjs +8 -1
- package/dist/v1/libs/html/events/TinyNewWinEvents.cjs +14 -3
- package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts +21 -5
- package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts.map +1 -1
- package/dist/v1/libs/html/events/TinyNewWinEvents.mjs +12 -3
- package/dist/v1/libs/html/scroll/TinySmartScroller.cjs +13 -1
- package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts +29 -2
- package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts.map +1 -1
- package/dist/v1/libs/html/scroll/TinySmartScroller.mjs +11 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.cjs +13 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts +32 -2
- package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts.map +1 -1
- package/dist/v1/libs/math/TinyAdvancedRaffle.mjs +11 -1
- package/dist/v1/libs/math/TinyTimeout.cjs +0 -14
- package/dist/v1/libs/math/TinyTimeout.d.mts +0 -11
- package/dist/v1/libs/math/TinyTimeout.d.mts.map +1 -1
- package/dist/v1/libs/math/TinyTimeout.mjs +0 -13
- package/dist/v1/libs/media/TinyMediaPlayer/index.cjs +25 -1
- package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts +35 -2
- package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyMediaPlayer/index.mjs +23 -1
- package/dist/v1/libs/media/TinyMediaPlayer.cjs +2 -2
- package/dist/v1/libs/media/TinyMediaPlayer.d.mts +2 -2
- package/dist/v1/libs/media/TinyMediaPlayer.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyMediaPlayer.mjs +2 -2
- package/dist/v1/libs/media/TinyRadioFm.cjs +19 -1
- package/dist/v1/libs/media/TinyRadioFm.d.mts +78 -2
- package/dist/v1/libs/media/TinyRadioFm.d.mts.map +1 -1
- package/dist/v1/libs/media/TinyRadioFm.mjs +17 -1
- package/dist/v1/libs/plugin/TinyPlugin.cjs +1630 -0
- package/dist/v1/libs/plugin/TinyPlugin.d.mts +753 -0
- package/dist/v1/libs/plugin/TinyPlugin.d.mts.map +1 -0
- package/dist/v1/libs/plugin/TinyPlugin.mjs +1376 -0
- package/dist/v1/libs/plugin/TinyVersion.cjs +204 -0
- package/dist/v1/libs/plugin/TinyVersion.d.mts +70 -0
- package/dist/v1/libs/plugin/TinyVersion.d.mts.map +1 -0
- package/dist/v1/libs/plugin/TinyVersion.mjs +179 -0
- package/dist/v1/libs/router/TinyRouter.cjs +661 -0
- package/dist/v1/libs/router/TinyRouter.d.mts +320 -0
- package/dist/v1/libs/router/TinyRouter.d.mts.map +1 -0
- package/dist/v1/libs/router/TinyRouter.mjs +572 -0
- package/dist/v1/libs/storage/TinyLocalStorage.cjs +20 -1
- package/dist/v1/libs/storage/TinyLocalStorage.d.mts +64 -2
- package/dist/v1/libs/storage/TinyLocalStorage.d.mts.map +1 -1
- package/dist/v1/libs/storage/TinyLocalStorage.mjs +18 -1
- package/dist/v1/libs/storage/TinyMapCache.cjs +373 -0
- package/dist/v1/libs/storage/TinyMapCache.d.mts +274 -0
- package/dist/v1/libs/storage/TinyMapCache.d.mts.map +1 -0
- package/dist/v1/libs/storage/TinyMapCache.mjs +333 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.cjs +1167 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.d.mts +603 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.d.mts.map +1 -0
- package/dist/v1/libs/storage/TinySetMapDatabase.mjs +1059 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.cjs +126 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts +132 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyNotificationAdapter.mjs +109 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.cjs +310 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.d.mts +168 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyPushManager.mjs +264 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.cjs +1060 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts +348 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/TinyServiceWorker.mjs +933 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.cjs +315 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts +178 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/plugins/TabManager.mjs +274 -0
- package/dist/v1/libs/sw/browser/utils.cjs +28 -0
- package/dist/v1/libs/sw/browser/utils.d.mts +8 -0
- package/dist/v1/libs/sw/browser/utils.d.mts.map +1 -0
- package/dist/v1/libs/sw/browser/utils.mjs +21 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.cjs +222 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.d.mts +138 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/TinyPushRouter.mjs +201 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.cjs +3016 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts +993 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/TinyServiceWorkerEngine.mjs +2558 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.cjs +88 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts +32 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/GlobBypassPlugin.mjs +69 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.cjs +112 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts +31 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/GlobCachePlugin.mjs +91 -0
- package/dist/v1/libs/sw/service/plugins/Ping.cjs +32 -0
- package/dist/v1/libs/sw/service/plugins/Ping.d.mts +9 -0
- package/dist/v1/libs/sw/service/plugins/Ping.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/Ping.mjs +25 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.cjs +457 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.d.mts +91 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/TabManager.mjs +372 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.cjs +180 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts +28 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/plugins/ViteFileDetector.mjs +148 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.cjs +199 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts +80 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.d.mts.map +1 -0
- package/dist/v1/libs/sw/service/shared/TinyPushPayload.mjs +174 -0
- package/dist/v1/libs/sw/utils.cjs +57 -0
- package/dist/v1/libs/sw/utils.d.mts +173 -0
- package/dist/v1/libs/sw/utils.d.mts.map +1 -0
- package/dist/v1/libs/sw/utils.mjs +50 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.cjs +57 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts +39 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Browser-NON-DOM.mjs +48 -0
- package/dist/v1/libs/text/TinyI18/Browser.cjs +64 -0
- package/dist/v1/libs/text/TinyI18/Browser.d.mts +47 -0
- package/dist/v1/libs/text/TinyI18/Browser.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Browser.mjs +57 -0
- package/dist/v1/libs/text/TinyI18/Node.cjs +49 -0
- package/dist/v1/libs/text/TinyI18/Node.d.mts +38 -0
- package/dist/v1/libs/text/TinyI18/Node.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/Node.mjs +43 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.cjs +17 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.d.mts +8 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.d.mts.map +1 -0
- package/dist/v1/libs/text/TinyI18/browser-utils.mjs +13 -0
- package/dist/v1/libs/text/{TinyI18.cjs → TinyI18/index.cjs} +205 -104
- package/dist/v1/libs/text/{TinyI18.d.mts → TinyI18/index.d.mts} +141 -92
- package/dist/v1/libs/text/TinyI18/index.d.mts.map +1 -0
- package/dist/v1/libs/text/{TinyI18.mjs → TinyI18/index.mjs} +195 -101
- package/dist/v1/libs/tools/TinyBrowserMonitor.cjs +1088 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts +621 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyBrowserMonitor.mjs +940 -0
- package/dist/v1/libs/tools/TinyDebugger.cjs +180 -19
- package/dist/v1/libs/tools/TinyDebugger.d.mts +220 -24
- package/dist/v1/libs/tools/TinyDebugger.d.mts.map +1 -1
- package/dist/v1/libs/tools/TinyDebugger.mjs +161 -19
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.cjs +256 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts +125 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHtmlTagRegexBuilder.mjs +223 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser-NON-DOM.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Browser.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.cjs +390 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts +9 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/EmptyRequestCodes.mjs +387 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.cjs +2 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts +27 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/JsDoc.mjs +12 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/LICENSE +53 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.cjs +405 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts +34 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/MozillaRequestCodes/index.mjs +342 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.cjs +23 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts +17 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/Node.mjs +19 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.cjs +327 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts +9 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/RequestCodes.mjs +324 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.cjs +268 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts +107 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyHttpResponseRegistry/index.mjs +238 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.cjs +491 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.d.mts +246 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyPasswordValidator.mjs +434 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +48 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +14 -0
- package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -1
- package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +44 -0
- package/dist/v1/libs/tools/TinySiteMap.cjs +1029 -0
- package/dist/v1/libs/tools/TinySiteMap.d.mts +429 -0
- package/dist/v1/libs/tools/TinySiteMap.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinySiteMap.mjs +910 -0
- package/dist/v1/libs/tools/TinySiteMapStream.cjs +121 -0
- package/dist/v1/libs/tools/TinySiteMapStream.d.mts +51 -0
- package/dist/v1/libs/tools/TinySiteMapStream.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinySiteMapStream.mjs +85 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.cjs +444 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts +217 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyURLSecurityVerifier.mjs +394 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.cjs +613 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts +152 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/BlueSky.mjs +527 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.cjs +1119 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts +306 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/Discord.mjs +968 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.cjs +469 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts +80 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser/MatrixProtocol.mjs +379 -0
- package/dist/v1/libs/tools/TinyUriParser.cjs +217 -0
- package/dist/v1/libs/tools/TinyUriParser.d.mts +109 -0
- package/dist/v1/libs/tools/TinyUriParser.d.mts.map +1 -0
- package/dist/v1/libs/tools/TinyUriParser.mjs +183 -0
- package/dist/v1/libs/utils/TinyCloner.cjs +466 -0
- package/dist/v1/libs/utils/TinyCloner.d.mts +221 -0
- package/dist/v1/libs/utils/TinyCloner.d.mts.map +1 -0
- package/dist/v1/libs/utils/TinyCloner.mjs +416 -0
- package/dist/v1/libs/utils/TinyPromiseQueue.cjs +1 -1
- package/dist/v1/libs/utils/TinyPromiseQueue.d.mts +2 -2
- package/dist/v1/libs/utils/TinyPromiseQueue.d.mts.map +1 -1
- package/dist/v1/libs/utils/TinyPromiseQueue.mjs +1 -1
- package/dist/v1/libs/utils/TinyThrottledApi.cjs +333 -0
- package/dist/v1/libs/utils/TinyThrottledApi.d.mts +163 -0
- package/dist/v1/libs/utils/TinyThrottledApi.d.mts.map +1 -0
- package/dist/v1/libs/utils/TinyThrottledApi.mjs +294 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.cjs +342 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts +97 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.d.mts.map +1 -0
- package/dist/v1/libs/worker/browser/TinyWebWorker.mjs +305 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.cjs +346 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts +127 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.d.mts.map +1 -0
- package/dist/v1/libs/worker/engine/TinyWebWorkerEngine.mjs +304 -0
- package/dist/v1/regexp/Email.cjs +185 -0
- package/dist/v1/regexp/Email.d.mts +73 -0
- package/dist/v1/regexp/Email.d.mts.map +1 -0
- package/dist/v1/regexp/Email.mjs +153 -0
- package/dist/v1/regexp/Glob.cjs +293 -0
- package/dist/v1/regexp/Glob.d.mts +45 -0
- package/dist/v1/regexp/Glob.d.mts.map +1 -0
- package/dist/v1/regexp/Glob.mjs +260 -0
- package/dist/v1/regexp/Ipv4.cjs +57 -0
- package/dist/v1/regexp/Ipv4.d.mts +29 -0
- package/dist/v1/regexp/Ipv4.d.mts.map +1 -0
- package/dist/v1/regexp/Ipv4.mjs +45 -0
- package/dist/v1/regexp/Ipv6.cjs +67 -0
- package/dist/v1/regexp/Ipv6.d.mts +29 -0
- package/dist/v1/regexp/Ipv6.d.mts.map +1 -0
- package/dist/v1/regexp/Ipv6.mjs +54 -0
- package/dist/v1/regexp/SegmentExtractor.cjs +145 -0
- package/dist/v1/regexp/SegmentExtractor.d.mts +91 -0
- package/dist/v1/regexp/SegmentExtractor.d.mts.map +1 -0
- package/dist/v1/regexp/SegmentExtractor.mjs +116 -0
- package/dist/v1/regexp/UrlDetector.cjs +125 -0
- package/dist/v1/regexp/UrlDetector.d.mts +67 -0
- package/dist/v1/regexp/UrlDetector.d.mts.map +1 -0
- package/dist/v1/regexp/UrlDetector.mjs +102 -0
- package/dist/v1/regexp/Username/index.cjs +233 -0
- package/dist/v1/regexp/Username/index.d.mts +77 -0
- package/dist/v1/regexp/Username/index.d.mts.map +1 -0
- package/dist/v1/regexp/Username/index.mjs +199 -0
- package/dist/v1/regexp/Username/jsDoc.cjs +2 -0
- package/dist/v1/regexp/Username/jsDoc.d.mts +57 -0
- package/dist/v1/regexp/Username/jsDoc.d.mts.map +1 -0
- package/dist/v1/regexp/Username/jsDoc.mjs +18 -0
- package/dist/v1/regexp/Username/templates/BlueSky.cjs +56 -0
- package/dist/v1/regexp/Username/templates/BlueSky.d.mts +35 -0
- package/dist/v1/regexp/Username/templates/BlueSky.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/BlueSky.mjs +52 -0
- package/dist/v1/regexp/Username/templates/Discord.cjs +505 -0
- package/dist/v1/regexp/Username/templates/Discord.d.mts +209 -0
- package/dist/v1/regexp/Username/templates/Discord.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/Discord.mjs +458 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.cjs +143 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts +70 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/MatrixProtocol.mjs +128 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.cjs +24 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts +17 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/deprecated/Discord.mjs +20 -0
- package/dist/v1/regexp/Username/templates/index.cjs +11 -0
- package/dist/v1/regexp/Username/templates/index.d.mts +5 -0
- package/dist/v1/regexp/Username/templates/index.d.mts.map +1 -0
- package/dist/v1/regexp/Username/templates/index.mjs +4 -0
- package/dist/v1/regexp/index.cjs +41 -0
- package/dist/v1/regexp/index.d.mts +9 -0
- package/dist/v1/regexp/index.d.mts.map +1 -0
- package/dist/v1/regexp/index.mjs +8 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.cjs +64 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Browser.mjs +51 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.cjs +66 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/FileInput.mjs +51 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.cjs +39 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts +11 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Node.mjs +28 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.cjs +494 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts +142 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.d.mts.map +1 -0
- package/dist/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters/Template.mjs +445 -0
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.cjs +725 -0
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts +293 -0
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.d.mts.map +1 -0
- package/dist/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.mjs +614 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/input/Placeholder-Colors-Fix.scss +64 -0
- package/dist/v1/webTemplates/bootstrap/5.3/scss/spacing/Spacing-Plus.scss +31 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.cjs +135 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts +83 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Browser/index.mjs +120 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.cjs +127 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts +95 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/media/MediaValidator/v1/Node/index.mjs +109 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.cjs +83 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts +46 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.d.mts.map +1 -0
- package/dist/v1/webTemplates/multiformats/14.0/IPFSHasher/index.mjs +71 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.cjs +493 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts +67 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.d.mts.map +1 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.mjs +399 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.cjs +35 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts +6 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.d.mts.map +1 -0
- package/dist/v1/webTemplates/vite/7.3/plugins/githubUtils.mjs +29 -0
- package/docs/info/RegExp.md +74 -0
- package/docs/v1/Exports.md +111 -0
- package/docs/v1/README.md +117 -13
- package/docs/v1/basics/asyncReplace.md +2 -0
- package/docs/v1/basics/browserDetector.md +28 -11
- package/docs/v1/basics/crypto.md +85 -0
- package/docs/v1/basics/deprecated/html.md +2 -0
- package/docs/v1/basics/deprecated/objFilter.md +2 -0
- package/docs/v1/basics/html.md +2 -0
- package/docs/v1/basics/objChecker.md +55 -0
- package/docs/v1/basics/objFilter.md +57 -86
- package/docs/v1/basics/promiseUtils.md +12 -3
- package/docs/v1/basics/text.md +0 -1
- package/docs/v1/libs/array/TinyArrayComparator.md +50 -39
- package/docs/v1/libs/fs/TinyFS.md +752 -0
- package/docs/v1/libs/fs/TinyOPFSFileSystem.md +495 -0
- package/docs/v1/libs/fs/TinyStorageBucketFileSystem.md +407 -0
- package/docs/v1/libs/plugin/TinyPlugin.md +441 -0
- package/docs/v1/libs/plugin/TinyVersion.md +145 -0
- package/docs/v1/libs/router/TinyRouter.md +216 -0
- package/docs/v1/libs/storage/TinyMapCache.md +219 -0
- package/docs/v1/libs/storage/TinySetMapDatabase.md +478 -0
- package/docs/v1/libs/sw/browser/TinyNotificationAdapter.md +280 -0
- package/docs/v1/libs/sw/browser/TinyPushManager.md +782 -0
- package/docs/v1/libs/sw/browser/TinyServiceWorker.md +365 -0
- package/docs/v1/libs/sw/browser/plugins/TabManager.md +133 -0
- package/docs/v1/libs/sw/service/TinyPushRouter.md +314 -0
- package/docs/v1/libs/sw/service/TinyServiceWorkerEngine.md +748 -0
- package/docs/v1/libs/sw/service/plugins/GlobBypassPlugin.md +229 -0
- package/docs/v1/libs/sw/service/plugins/GlobCachePlugin.md +91 -0
- package/docs/v1/libs/sw/service/plugins/Ping.md +36 -0
- package/docs/v1/libs/sw/service/plugins/TabManager.md +64 -0
- package/docs/v1/libs/sw/service/plugins/ViteFileDetector.md +92 -0
- package/docs/v1/libs/sw/service/shared/TinyPushPayload.md +316 -0
- package/docs/v1/libs/text/TinyI18.md +80 -56
- package/docs/v1/libs/tools/TinyBrowserMonitor.md +170 -0
- package/docs/v1/libs/tools/TinyDebugger.md +117 -1
- package/docs/v1/libs/tools/TinyHtmlTagRegexBuilder.md +141 -0
- package/docs/v1/libs/tools/TinyHttpResponseRegistry.md +129 -0
- package/docs/v1/libs/tools/TinyPasswordValidator.md +153 -0
- package/docs/v1/libs/tools/TinyPkgExportValidator.md +45 -1
- package/docs/v1/libs/tools/TinySiteMap.md +134 -0
- package/docs/v1/libs/tools/TinySiteMapStream.md +97 -0
- package/docs/v1/libs/tools/TinyURLSecurityVerifier.md +146 -0
- package/docs/v1/libs/tools/TinyUriParser/Discord.md +374 -0
- package/docs/v1/libs/tools/TinyUriParser/MatrixProtocol.md +54 -0
- package/docs/v1/libs/tools/TinyUriParser.md +128 -0
- package/docs/v1/libs/utils/TinyCloner.md +126 -0
- package/docs/v1/libs/utils/TinyPromiseQueue.md +1 -1
- package/docs/v1/libs/utils/TinyThrottledApi.md +219 -0
- package/docs/v1/libs/worker/browser/TinyWebWorker.md +331 -0
- package/docs/v1/libs/worker/engine/TinyWebWorkerEngine.md +137 -0
- package/docs/v1/regexp/Email.md +127 -0
- package/docs/v1/regexp/Glob.md +155 -0
- package/docs/v1/regexp/IPv4.md +103 -0
- package/docs/v1/regexp/IPv6.md +122 -0
- package/docs/v1/regexp/SegmentExtractor.md +120 -0
- package/docs/v1/regexp/UrlDetector.md +117 -0
- package/docs/v1/regexp/Username/Base.md +131 -0
- package/docs/v1/regexp/Username/Discord.md +267 -0
- package/docs/v1/regexp/Username/MatrixProtocol.md +131 -0
- package/docs/v1/webTemplates/ag-psd/31.0/ProcessSolidFilters.md +569 -0
- package/docs/v1/webTemplates/bootstrap/5.3/html/BootstrapDialogs.md +174 -0
- package/docs/v1/webTemplates/media/MediaValidator/v1/Browser.md +123 -0
- package/docs/v1/webTemplates/media/MediaValidator/v1/Node.md +136 -0
- package/docs/v1/webTemplates/multiformats/14.0/IPFSHasher.md +310 -0
- package/docs/v1/webTemplates/vite/7.3/plugins/TinyVitePwaPlugin.md +131 -0
- package/docs/v1/webTemplates/vite/7.3/plugins/githubUtils.md +50 -0
- package/package.json +313 -18
- package/types/EventEmitter.d.ts +48 -0
- package/dist/v1/libs/text/TinyI18.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={516(t,e,r){r.d(e,{TinySmartScroller:()=>V});var n={};r.r(n),r.d(n,{iu:()=>a,cq:()=>l,P8:()=>p,BO:()=>f,eh:()=>m,L2:()=>u,lP:()=>c,Kr:()=>s,wE:()=>d,D6:()=>h,PN:()=>S,t_:()=>v,aI:()=>b,ej:()=>E,kx:()=>g,Pd:()=>y,NW:()=>T,Qv:()=>w});var o={};r.r(o),r.d(o,{areElsCollBottom:()=>a,areElsCollLeft:()=>l,areElsCollPerfBottom:()=>p,areElsCollPerfLeft:()=>f,areElsCollPerfRight:()=>m,areElsCollPerfTop:()=>u,areElsCollRight:()=>c,areElsCollTop:()=>s,areElsColliding:()=>d,areElsPerfColliding:()=>h,getElsCollDetails:()=>S,getElsCollDirDepth:()=>v,getElsCollOverlap:()=>b,getElsCollOverlapPos:()=>E,getElsColliding:()=>g,getElsPerfColliding:()=>y,getElsRelativeCenterOffset:()=>T,getRectCenter:()=>w});var i=r.cjs(function(t,e){var r,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise(function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}g(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,o)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var o,i,s,a;if(l(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function p(){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 f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function m(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):h(o,o.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function o(i){n.once&&t.removeEventListener(e,o),r(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.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},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var c=l.length,u=h(l,c);for(r=0;r<c;++r)o(u[r],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return l(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,o,i,s;if(l(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;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[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return m(this,t,!0)},s.prototype.rawListeners=function(t){return m(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});const s=(t,e)=>t.bottom<e.top,a=(t,e)=>t.top>e.bottom,l=(t,e)=>t.right<e.left,c=(t,e)=>t.left>e.right,u=(t,e)=>t.bottom<=e.top,p=(t,e)=>t.top>=e.bottom,f=(t,e)=>t.right<=e.left,m=(t,e)=>t.left>=e.right,d=(t,e)=>!(l(t,e)||c(t,e)||s(t,e)||a(t,e)),h=(t,e)=>!(f(t,e)||m(t,e)||u(t,e)||p(t,e)),g=(t,e)=>l(t,e)?"left":c(t,e)?"right":s(t,e)?"top":a(t,e)?"bottom":null,y=(t,e)=>f(t,e)?"left":m(t,e)?"right":u(t,e)?"top":p(t,e)?"bottom":null,b=(t,e)=>({overlapLeft:e.right-t.left,overlapRight:t.right-e.left,overlapTop:e.bottom-t.top,overlapBottom:t.bottom-e.top}),E=({overlapLeft:t=-1,overlapRight:e=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:t<e?"right":"left",dirY:r<n?"bottom":"top"}),w=t=>({x:t.left+t.width/2,y:t.top+t.height/2});function T(t,e){const r=t.left+t.width/2,n=t.top+t.height/2;return{x:e.left+e.width/2-r,y:e.top+e.height/2-n}}function v(t,e){if(!h(t,e))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}=b(t,e),{dirX:s,dirY:a}=E({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}),l=Math.min(r,n),c=Math.min(o,i);let u;return u=l<c?s:a,{inDir:u,dirX:s,dirY:a,depthX:l,depthY:c}}function S(t,e){const r=h(t,e),n={in:null,x:null,y:null},o={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:c}=b(e,t);i.top=l,i.bottom=c,i.left=s,i.right=a;const u=Object.entries(i).filter(([,t])=>t>0).sort((t,e)=>t[1]-e[1]),{dirX:p,dirY:f}=E({overlapLeft:a,overlapRight:s,overlapTop:c,overlapBottom:l});return n.y=f,n.x=p,i.bottom<0?o.y="bottom":i.top<0&&(o.y="top"),i.left<0?o.x="left":i.right<0&&(o.x="right"),n.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":u.length?u[0][0]:"top":null,{dirs:n,depth:i,isNeg:o}}const A=t=>e=>{if(e)throw new Error(`This ${t} instance has been destroyed and can no longer be used.`)},_=A("TinyElementObserver"),x=class{#t=!1;get destroyed(){return this.#t}#e;get el(){return _(this.#t),this.#e}#r={};get settings(){return _(this.#t),this.#r}set settings(t){if(_(this.#t),"object"!=typeof t||null===t)throw new TypeError("settings must be a non-null object.");this.#r=t}#n=null;get observer(){return _(this.#t),this.#n}#o=[];get detectors(){return _(this.#t),this.#o.map(t=>[t[0],t[1]])}set detectors(t){if(_(this.#t),!Array.isArray(t))throw new TypeError("detectors must be an array.");const e=[];for(const[r,n]of t){if("string"!=typeof r)throw new TypeError("Detector name must be a string.");if("function"!=typeof n)throw new TypeError(`Detector handler for "${r}" must be a function.`);e.push([r,n])}this.#o=e}get isActive(){return _(this.#t),!!this.#n}get size(){return _(this.#t),this.#o.length}constructor(t,{initDetectors:e=[],initCfg:r={}}={}){this.#e=t,e.length&&(this.detectors=e),r&&(this.settings=r)}clear(){_(this.#t),this.#o=[]}start(){if(_(this.#t),!this.#e)throw new Error("Cannot start observation: no target element has been set.");this.#n||(this.#n=new MutationObserver(t=>{t.forEach((t,e,r)=>this.#o.forEach(n=>n[1](t,e,r)))}),this.#n.observe(this.#e,this.#r))}stop(){_(this.#t),this.#n&&(this.#n.disconnect(),this.#n=null)}add(t,e){_(this.#t),this.#i(t,e),this.#o.push([t,e])}insertAtStart(t,e){_(this.#t),this.#i(t,e),this.#o.unshift([t,e])}insertAt(t,e,r,n="after"){if(_(this.#t),this.#i(e,r),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for insertDetectorAt.");const o="before"===n?t:t+1;this.#o.splice(o,0,[e,r])}removeAt(t){if(_(this.#t),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for removeDetectorAt.");this.#o.splice(t,1)}removeAround(t,e=0,r=0){if(_(this.#t),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for removeDetectorsAround.");const n=Math.max(0,t-e),o=e+1+r;this.#o.splice(n,o)}isIndexUsed(t){return _(this.#t),t>=0&&t<this.#o.length}hasHandler(t){if(_(this.#t),"function"!=typeof t)throw new TypeError("Handler must be a function.");return this.#o.some(([e,r])=>r===t)}#i(t,e){if("string"!=typeof t||!t.trim())throw new TypeError("Detector name must be a non-empty string.");if("function"!=typeof e)throw new TypeError(`Detector handler for "${t}" must be a function.`)}destroy(){this.#t||(this.stop(),this.clear(),this.#t=!0)}},{wE:C,D6:L,Kr:N,iu:D,cq:B,lP:P}=n,W=new WeakMap,k=new WeakMap,O=new WeakMap,H=new WeakMap,I={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class F{static Utils={...o};static#s=1;static get version(){return this.#s}static#a=!1;static get elemDebug(){return F.#a}static set elemDebug(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value for elemDebug");F.#a=t}static _debugElemError(t,e){if(!F.#a)return;const r="[TinyHtml Debug] Element validation error";if(console.groupCollapsed(`${r}${e?" — details below":""}`),console.error(r),"undefined"!=typeof Error&&"function"==typeof Error.captureStackTrace){const t=new Error(r);Error.captureStackTrace(t,F._debugElemError),console.error(t.stack)}else console.trace(r);if(Array.isArray(t)){const e=t.map((t,e)=>({index:e,typeOf:null===t?"null":typeof t,constructor:t?.constructor?.name??(null===t?"null":"primitive"),summary:"undefined"!=typeof Element&&t instanceof Element?`${t.tagName?.toLowerCase?.()??"element"}#${t.id||""}.${String(t.className||"").trim().replace(/\s+/g,".")}`:t&&"object"==typeof t&&"nodeType"in t?`nodeType:${t.nodeType}`:"",value:t}));console.table(e)}else console.warn('[TinyHtml Debug] "elems" is not an array:',t);arguments.length>1&&(console.error("[TinyHtml Debug] Problematic element:",e),e&&"object"==typeof e&&console.dir(e)),console.groupEnd()}static parseStyle(t){const e={};return t.split(";").forEach(t=>{const[r,n]=t.split(":").map(t=>t&&t.trim());r&&n&&(e[r]=n)}),e}static#l="undefined"!=typeof window&&void 0!==window.document?new x(window.document.documentElement,{initDetectors:[["tinyStyleEvent",t=>{if("attributes"!==t.type||"style"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.getAttribute("style")||"",n=function(t,e){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("Expected an object for 'oldStrings', but received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("Expected an object for 'newStrings', but received "+(null===e?"null":typeof e));const r={added:{},removed:{},modified:{}};for(const n in t)n in e?t[n]!==e[n]&&(r.modified[n]={old:t[n],new:e[n]}):r.removed[n]=t[n];for(const n in e)n in t||(r.added[n]=e[n]);return r}(F.parseStyle(e),F.parseStyle(r));(Object.keys(n.added).length||Object.keys(n.removed).length||Object.keys(n.modified).length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.stylechanged",{detail:n}))}],["tinyClassEvent",t=>{if("attributes"!==t.type||"class"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.className||"",n=function(t,e){if(!Array.isArray(t))throw new TypeError("Argument 'oldItems' must be an array.");if(!Array.isArray(e))throw new TypeError("Argument 'newItems' must be an array.");const r=t.filter(t=>!e.includes(t));return{added:e.filter(e=>!t.includes(e)),removed:r}}(e.split(/\s+/).filter(Boolean),r.split(/\s+/).filter(Boolean));(n.added.length||n.removed.length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.classchanged",{detail:n}))}]],initCfg:{attributeOldValue:!0,attributes:!0,subtree:!0,attributeFilter:["style","class"]}}):void 0;static get tinyObserver(){return F.#l}static async fetchHtmlFile(t,e={method:"GET"}){const r=await fetch(t,e),n=r.headers.get("Content-Type")||"";if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);if(!n.includes("text/html"))throw new Error(`Invalid content type: ${n} (expected text/html)`);const o=await r.text();return F.htmlToJson(o)}static async fetchHtmlNodes(t,e){const r=await F.fetchHtmlFile(t,e);return F.jsonToNodes(r)}static async fetchHtmlTinyElems(t,e){const r=await F.fetchHtmlNodes(t,e);return F.toTinyElm(r)}static templateToJson(t){return F.htmlToJson([...t.content.childNodes].map(t=>t instanceof Element?t.getHTML():t instanceof Text?t.textContent:"").join(""))}static templateToNodes(t){const e=[];return[...t.content.cloneNode(!0).childNodes].map(t=>{if(!(t instanceof Element||t instanceof Text||t instanceof Comment))throw new Error(`Expected only Element nodes in <template>, but found: ${t.constructor.name}`);t instanceof Comment||e.push(t)}),e}static templateToTinyElems(t){return F.toTinyElm(F.templateToNodes(t))}static htmlToJson(t){const e=document.createElement("div");e.innerHTML=t.trim();const r=[],n=t=>{if(t instanceof Comment)return null;if(t instanceof Text){const e=t.textContent?.trim();return e||null}if(!(t instanceof Element))return null;const e=t.tagName.toLowerCase(),r={};for(const e of t.attributes)r[F.getPropName(e.name)]=e.value;const o=Array.from(t.childNodes).map(n).filter(Boolean);return o.length>0?[e,r,...o]:[e,r]};for(const t of e.childNodes){const e=n(t);e&&r.push(e)}return e.innerHTML="",r}static jsonToNodes(t){const e=t=>{if("string"==typeof t)return document.createTextNode(t);if(!Array.isArray(t))return document.createTextNode("");const[r,n,...o]=t,i=document.createElement(r);for(const[t,e]of Object.entries(n))i.setAttribute(F.getAttrName(t),e);for(const t of o){const r=e(t);r instanceof Comment||i.appendChild(r)}return i};return t.map(e).filter(t=>!(t instanceof Comment))}static jsonToTinyElems(t){return F.toTinyElm(F.jsonToNodes(t))}static createFrom(t,e){if("string"!=typeof t)throw new TypeError('The "tagName" must be a string.');if(void 0!==e&&"object"!=typeof e)throw new TypeError('The "attrs" must be a object.');const r=F.createElement(t);if("object"==typeof e)for(const t in e)r.setAttr(t,e[t]);return r}static createElement(t,e){if("string"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==e&&"object"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new F(document.createElement(t,e))}static createTextNode(t){if("string"!=typeof t)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new F(document.createTextNode(t))}static createElementFromHTML(t){const e=document.createElement("template");if(!(t=t.trim()).startsWith("<"))return F.createTextNode(t);if(e.innerHTML=t,!(e.content.firstChild instanceof Element))throw new Error("The HTML string must contain a valid HTML element.");return new F(e.content.firstChild)}static createFromHTML(t){const e=document.createElement("template");t=t.trim(),e.innerHTML=t;const r=Array.from(e.content.childNodes);if(!r.every(t=>t instanceof Element||t instanceof Text))throw new Error("The HTML string must contain a valid HTML element.");return new F(r)}static createFromHtml(t){return F.createFromHTML(t)}static query(t,e=document){const r=e.querySelector(t);return r?new F(r):null}querySelector(t){return F.query(t,F._preElem(this,"query"))}static queryAll(t,e=document){return new F(e.querySelectorAll(t))}querySelectorAll(t){return F.queryAll(t,F._preElem(this,"queryAll"))}static getById(t){const e=document.getElementById(t);return e?new F(e):null}static getByClassName(t,e=document){return new F(e.getElementsByClassName(t))}getElementsByClassName(t){return F.getByClassName(t,F._preElem(this,"getByClassName"))}static getByName(t){return new F(document.getElementsByName(t))}static getByTagNameNS(t,e="http://www.w3.org/1999/xhtml",r=document){return new F(r.getElementsByTagNameNS(e,t))}getElementsByTagNameNS(t,e="http://www.w3.org/1999/xhtml"){return F.getByTagNameNS(t,e,F._preElem(this,"getByTagNameNS"))}get elements(){return[...this.#e]}forEach(t){const e=this.elements.map((t,e)=>this.extract(e));for(const r in e)t(e[r],Number(r),e);return this}get(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#e[t])throw new Error(`No element found at index ${t}.`);return this.#e[t]}extract(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#e[t])throw new Error(`Cannot extract: no element exists at index ${t}.`);return new F(this.#e[t])}exists(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");return!!this.#e[t]}_getElement(t,e){if(!(this.#e[e]instanceof Element||this.#e[e]instanceof Window||this.#e[e]instanceof Document||this.#e[e]instanceof Text))throw F._debugElemError([...this.#e],this.#e[e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return this.#e[e]}_getElements(t){if(!this.#e.every(t=>t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text))throw F._debugElemError([...this.#e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return[...this.#e]}static _preElemsTemplate(t,e,r,n){const o=t=>{const o=[];return t.map(i=>(i instanceof F?i._getElements(e):[i]).map(i=>{let s=!1;for(const t of r)if(i instanceof t){s=!0;break}if(!s)throw F._debugElemError([...t],i),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return o.push(i),i})),o};return Array.isArray(t)?o(t):o([t])}_preElemsTemplate(t,e,r){return F._preElemsTemplate(this,t,e,r)}static _preElemTemplate(t,e,r,n,o=!1){const i=t=>{const i=t[0],s=i instanceof F?i._getElements(e):[i];if(s.length>1)throw F._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${s.length}/1).`);let a=!1;for(const t of r)if(s[0]instanceof t){a=!0;break}if(!o||null!==s[0]&&void 0!==s[0]||(s[0]=null,a=!0),!a)throw F._debugElemError([...t],s[0]),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return s[0]};if(!Array.isArray(t))return i([t]);if(t.length>1)throw F._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${t.length}/1).`);return i(t)}_preElemTemplate(t,e,r,n=!1){return F._preElemTemplate(this,t,e,r,n)}static _preElems(t,e){return F._preElemsTemplate(t,e,[Element],["Element"])}_preElems(t){return F._preElems(this,t)}static _preElem(t,e){return F._preElemTemplate(t,e,[Element],["Element"])}_preElem(t){return F._preElem(this,t)}static _preNodeElems(t,e){return F._preElemsTemplate(t,e,[Node],["Node"])}_preNodeElems(t){return F._preNodeElems(this,t)}static _preNodeElem(t,e){return F._preElemTemplate(t,e,[Node],["Node"])}_preNodeElem(t){return F._preNodeElem(this,t)}static _preNodeElemWithNull(t,e){return F._preElemTemplate(t,e,[Node],["Node"],!0)}_preNodeElemWithNull(t){return F._preNodeElemWithNull(this,t)}static _preHtmlElems(t,e){return F._preElemsTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElems(t){return F._preHtmlElems(this,t)}static _preHtmlElem(t,e){return F._preElemTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElem(t){return F._preHtmlElem(this,t)}static _preInputElems(t,e){return F._preElemsTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElems(t){return F._preInputElems(this,t)}static _preInputElem(t,e){return F._preElemTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElem(t){return F._preInputElem(this,t)}static _preEventTargetElems(t,e){return F._preElemsTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElems(t){return F._preEventTargetElems(this,t)}static _preEventTargetElem(t,e){return F._preElemTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElem(t){return F._preEventTargetElem(this,t)}static _preElemsAndWindow(t,e){return F._preElemsTemplate(t,e,[Element,Window],["Element","Window"])}_preElemsAndWindow(t){return F._preElemsAndWindow(this,t)}static _preElemAndWindow(t,e){return F._preElemTemplate(t,e,[Element,Window],["Element","Window"])}_preElemAndWindow(t){return F._preElemAndWindow(this,t)}static _preElemsAndWinAndDoc(t,e){return F._preElemsTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]).map(t=>t instanceof Document?t.documentElement:t)}_preElemsAndWinAndDoc(t){return F._preElemsAndWinAndDoc(this,t)}static _preElemAndWinAndDoc(t,e){const r=F._preElemTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}_preElemAndWinAndDoc(t){return F._preElemAndWinAndDoc(this,t)}static _preElemsWithDoc(t,e){return F._preElemsTemplate(t,e,[Element,Document],["Element","Document"])}_preElemsWithDoc(t){return F._preElemsWithDoc(this,t)}static _preElemWithDoc(t,e){return F._preElemTemplate(t,e,[Element,Document],["Element","Document"])}_preElemWithDoc(t){return F._preElemWithDoc(this,t)}static toTinyElm(t){const e=t=>t.map(t=>t instanceof F?t:new F(t));return Array.isArray(t)?e(t):e([t])}static fromTinyElm(t){const e=t=>{const e=[];return t.map(t=>(t instanceof F?t._getElements("fromTinyElm"):[t]).map(t=>e.push(t))),e};return Array.isArray(t)?e(t):e([t])}static winnow(t,e,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof e)return F._preElems(t,r).filter((t,r)=>!!e.call(t,r,t)!==n);if(e instanceof Element)return F._preElems(t,r).filter(t=>t===e!==n);if(Array.isArray(e)||"string"!=typeof e&&null!=e.length)return F._preElems(t,r).filter(t=>e.includes(t)!==n);let o=e;return n&&(o=`:not(${o})`),F._preElems(t,r).filter(t=>1===t.nodeType&&t.matches(o))}static filter(t,e,r=!1){return r&&(e=`:not(${e})`),F._preElems(t,"filter").filter(t=>1===t.nodeType&&t.matches(e))}static filterOnly(t,e){return F.winnow(t,e,"filterOnly",!1)}static not(t,e){return F.winnow(t,e,"not",!0)}not(t){return F.not(this,t)}static find(t,e){const r=[];for(const n of F._preElems(t,"find"))r.push(...n.querySelectorAll(e));return[...new Set(r)]}find(t){return F.find(this,t)}static is(t,e){return F.winnow(t,e,"is",!1).length>0}is(t){return F.is(this,t)}static has(t,e){const r="string"==typeof e?[...document.querySelectorAll(e)]:F._preElems(e,"has");return F._preElems(t,"has").filter(t=>r.some(e=>t&&t.contains(e)))}has(t){return F.has(this,t)}static closest(t,e,r){const n=[];for(const o of F._preElems(t,"closest")){let t=o;for(;t&&t!==r;){if(1===t.nodeType&&("string"==typeof e?t.matches(e):t===e)){n.push(t);break}t=t.parentElement}}return[...new Set(n)]}closest(t,e){return F.closest(this,t,e)}static isSameDom(t,e){return F._preNodeElem(t,"isSameDom")===F._preNodeElem(e,"isSameDom")}isSameDom(t){return F.isSameDom(this,t)}#c={};get _data(){return{...this.#c}}set _data(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("value must be a non-null object.");this.#c=t}static _dataSelector={public:(t,e)=>{const r=F._preElem(e,t);let n=k.get(r);return n||(n={},k.set(r,n)),n},private:(t,e)=>{if(!(e instanceof F))throw new Error(`Element must be a TinyHtml instance to execute ${t}().`);return e.#c}};static data(t,e,r=!1){const n=F._dataSelector[r?"private":"public"]("data",t);if(null==e)return{...n};if("string"!=typeof e)throw new TypeError("The key must be a string.");return n.hasOwnProperty(e)?n[e]:void 0}data(t,e){return F.data(this,t,e)}static setData(t,e,r,n=!1){const o=F._dataSelector[n?"private":"public"]("setData",t);if("string"!=typeof e)throw new TypeError("The key must be a string.");return void 0!==r?o[e]=r:F.removeData(t,e),t}setData(t,e,r=!1){return F.setData(this,t,e,r)}static hasData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");const n=F._dataSelector[r?"private":"public"]("hasData",t);return Object.prototype.hasOwnProperty.call(n,e)}hasData(t,e=!1){return F.hasData(this,t,e)}static removeData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");return delete F._dataSelector[r?"private":"public"]("removeData",t)[e]}removeData(t,e=!1){return F.removeData(this,t,e)}static _getSibling(t,e,r){let n=F._preNodeElemWithNull(t,r);for(;n&&(n=n[e])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(t,e){let r=t;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==e&&n.push(r);return n}static domDir(t,e,r,n="domDir"){if("string"!=typeof e)throw new TypeError('The "direction" must be a string.');let o=F._preNodeElemWithNull(t,n);const i=[];for(;o&&(o=o[e]);)if(1===o.nodeType){if(r&&("string"==typeof r?o.matches(r):o===r))break;i.push(o)}return i}static parent(t){let e=F._preNodeElemWithNull(t,"parent");const r=e?e.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return F.parent(this)}static parents(t,e){return F.domDir(t,"parentNode",e,"parents")}parents(t){return F.parents(this,t)}static next(t){return F._getSibling(t,"nextSibling","next")}next(){return F.next(this)}static prev(t){return F._getSibling(t,"previousSibling","prev")}prev(){return F.prev(this)}static nextAll(t){return F.domDir(t,"nextSibling",void 0,"nextAll")}nextAll(){return F.nextAll(this)}static prevAll(t){return F.domDir(t,"previousSibling",void 0,"prevAll")}prevAll(){return F.prevAll(this)}static nextUntil(t,e){return F.domDir(t,"nextSibling",e,"nextUtil")}nextUntil(t){return F.nextUntil(this,t)}static prevUntil(t,e){return F.domDir(t,"previousSibling",e,"prevUtil")}prevUntil(t){return F.prevUntil(this,t)}static siblings(t){const e=F._preNodeElemWithNull(t,"siblings");return F._getSiblings(e&&e.parentNode?e.parentNode.firstChild:null,e)}siblings(){return F.siblings(this)}static children(t){const e=F._preNodeElemWithNull(t,"children");return F._getSiblings(e?e.firstChild:null)}children(){return F.children(this)}static contents(t){const e=F._preNodeElemWithNull(t,"contents");return e instanceof HTMLIFrameElement&&null!=e.contentDocument&&Object.getPrototypeOf(e.contentDocument)?[e.contentDocument]:e instanceof HTMLTemplateElement?Array.from((e.content||e).childNodes):e?Array.from(e.childNodes):[]}contents(){return F.contents(this)}static clone(t,e=!0){if("boolean"!=typeof e)throw new TypeError('The "deep" must be a boolean.');return F._preNodeElems(t,"clone").map(t=>t.cloneNode(e))}clone(t){return F.clone(this,t)[0]}static _appendChecker(t,...e){const r=[];for(const n of e)if(null!=n&&!1!==n)if("string"!=typeof n&&"number"!=typeof n)if(n instanceof Node||n instanceof F)r.push(...F._preNodeElems(n,t));else if(Array.isArray(n))r.push(...F._appendChecker(t,...n));else for(const e in n){const o=n[e];r.push(...F._appendChecker(t,o))}else r.push(n);return r}static append(t,...e){return F._preElem(t,"append").append(...F._appendChecker("append",...e)),t}append(...t){return F.append(this,...t)}static prepend(t,...e){return F._preElem(t,"prepend").prepend(...F._appendChecker("prepend",...e)),t}prepend(...t){return F.prepend(this,...t)}static before(t,...e){return F._preElem(t,"before").before(...F._appendChecker("before",...e)),t}before(...t){return F.before(this,...t)}static after(t,...e){return F._preElem(t,"after").after(...F._appendChecker("after",...e)),t}after(...t){return F.after(this,...t)}static replaceWith(t,...e){return F._preElem(t,"replaceWith").replaceWith(...F._appendChecker("replaceWith",...e)),t}replaceWith(...t){return F.replaceWith(this,...t)}static appendTo(t,e){const r=F._preNodeElems(t,"appendTo"),n=F._preNodeElems(e,"appendTo");return n.forEach((t,e)=>{r.forEach(r=>t.appendChild(e===n.length-1?r:r.cloneNode(!0)))}),t}appendTo(t){return F.appendTo(this,t)}static prependTo(t,e){const r=F._preElems(t,"prependTo"),n=F._preElems(e,"prependTo");return n.forEach((t,e)=>{r.slice().reverse().forEach(r=>t.prepend(e===n.length-1?r:r.cloneNode(!0)))}),t}prependTo(t){return F.prependTo(this,t)}static insertBefore(t,e,r=null){const n=F._preNodeElem(t,"insertBefore"),o=F._preNodeElem(e,"insertBefore"),i=F._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert before.");return o.parentNode.insertBefore(n,i||o),t}insertBefore(t,e){return F.insertBefore(this,t,e)}static insertAfter(t,e,r=null){const n=F._preNodeElem(t,"insertAfter"),o=F._preNodeElem(e,"insertBefore"),i=F._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert after.");return o.parentNode.insertBefore(n,i||o.nextSibling),t}insertAfter(t,e){return F.insertAfter(this,t,e)}static replaceAll(t,e){const r=F._preNodeElems(t,"replaceAll"),n=F._preNodeElems(e,"replaceAll");return n.forEach((t,e)=>{const o=t.parentNode;r.forEach(r=>{o&&o.replaceChild(e===n.length-1?r:r.cloneNode(!0),t)})}),t}replaceAll(t){return F.replaceAll(this,t)}#e;get size(){return this.#e.length}static _elCheck(t){for(const e of t)if(!(e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.")}add(t){return new F([...this.#e,...F._selector(t)])}static _selector(t){if(t instanceof F)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");const e=t=>Array.from(new Set(t)),r="string"!=typeof t?t:document.querySelectorAll(t);if(Array.isArray(r))return F._elCheck(r),e(r);if(r instanceof NodeList||r instanceof HTMLCollection){const t=[...r];return F._elCheck(t),e(t)}{const t=[r];return F._elCheck(t),e(t)}}constructor(t){this.#e=F._selector(t),this.#u=F.#p}static isWindow(t){return null!=t&&t===t.window}static css(t){const e=F._preElem(t,"css");return window.getComputedStyle(e)}css(){return F.css(this)}static cssString(t,e){const r=F._preElem(t,"cssString");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(t){return F.cssString(this,t)}static cssList(t,e){const r=F._preElem(t,"cssList");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)void 0!==t&&(o[t]=n.getPropertyValue(t));return o}cssList(t){return F.cssList(this,t)}static cssFloat(t,e){const r=F._preElem(t,"cssFloat");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return parseFloat(n)||0}cssFloat(t){return F.cssFloat(this,t)}static cssFloats(t,e){const r=F._preElem(t,"cssFloats");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)o[t]=parseFloat(n[t])||0;return o}cssFloats(t){return F.cssFloats(this,t)}static#f={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(F.#f,{set:(t,e,r)=>(t[e]=r,F.cssPropRevAliases[r]=e,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(F.#f).map(([t,e])=>[e,t]));static toStyleKc(t){return"string"==typeof F.cssPropAliases[t]?F.cssPropAliases[t]:t}static toStyleCc(t){return"string"==typeof F.cssPropRevAliases[t]?F.cssPropRevAliases[t]:t}static setStyle(t,e,r=null){return F._preHtmlElems(t,"setStyle").forEach(t=>{if("object"==typeof e)for(const[r,n]of Object.entries(e))t.style.setProperty(F.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else t.style.setProperty(F.toStyleKc(e),r)}),t}setStyle(t,e){return F.setStyle(this,t,e)}static getStyle(t,e){return F._preHtmlElem(t,"getStyle").style.getPropertyValue(F.toStyleKc(e))}getStyle(t){return F.getStyle(this,t)}static style(t,{camelCase:e=!1,rawAttr:r=!1}={}){if("boolean"!=typeof e)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof e);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=F._preHtmlElem(t,"style"),o={};if(r){const t=(n.getAttribute("style")||"").split(";");for(const r of t){const[t,n]=r.split(":");if(!t||!n)continue;const i=t.trim(),s=n.trim();o[e?F.toStyleCc(i):i]=s}}else{const t=n.style;for(let r=0;r<t.length;r++){const n=t[r],i=t.getPropertyValue(n);o[e?F.toStyleCc(n):n]=i}}return o}style(t){return F.style(this,t)}static removeStyle(t,e){return F._preHtmlElems(t,"removeStyle").forEach(t=>{if(Array.isArray(e))for(const r of e)t.style.removeProperty(F.toStyleKc(r));else t.style.removeProperty(F.toStyleKc(e))}),t}removeStyle(t){return F.removeStyle(this,t)}static toggleStyle(t,e,r,n){return F._preHtmlElems(t,"toggleStyle").forEach(t=>{const o=F.getStyle(t,e).trim()===F.toStyleKc(r)?n:r;F.setStyle(t,e,o)}),t}toggleStyle(t,e,r){return F.toggleStyle(this,t,e,r)}static clearStyle(t){return F._preElems(t,"clearStyle").forEach(t=>t.removeAttribute("style")),t}clearStyle(){return F.clearStyle(this)}static focus(t){return F._preHtmlElem(t,"focus").focus(),t}focus(){return F.focus(this)}static blur(t){return F._preHtmlElem(t,"blur").blur(),t}blur(){return F.blur(this)}static select(t){const e=F._preHtmlElem(t,"select");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("Element must be an <input> or <textarea> to use select().");return e.select(),t}select(){return F.select(this)}static boolCheck(t){return void 0!==t&&("true"===t||"1"===t||!0===t||"on"===t||"number"==typeof t&&t>0)}static setWinScrollTop(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");F.setScrollTop(window,t)}static setWinScrollLeft(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");F.setScrollLeft(window,t)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(t,e,r="content"){const n=F._preElemAndWinAndDoc(t,"getDimension");if("string"!=typeof e)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const o="width"===e?"Width":"Height";if(F.isWindow(n))return"margin"===r?n["inner"+o]:n.document.documentElement["client"+o];const i=n;if(9===i.nodeType){const t=i.documentElement;return Math.max(i.body["scroll"+o],t["scroll"+o],i.body["offset"+o],t["offset"+o],t["client"+o])}let s=i.getBoundingClientRect()[e];function a(t){return"width"===e?F.cssFloat(i,t+"Left")+F.cssFloat(i,t+"Right"):F.cssFloat(i,t+"Top")+F.cssFloat(i,t+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(t,e){return F.getDimension(this,t,e)}static setHeight(t,e){const r=F._preHtmlElem(t,"setHeight");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof e?`${e}px`:e,t}setHeight(t){return F.setHeight(this,t)}set height(t){F.setHeight(this,t)}static setWidth(t,e){const r=F._preHtmlElem(t,"setWidth");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof e?`${e}px`:e,t}setWidth(t){return F.setWidth(this,t)}set width(t){F.setWidth(this,t)}static height(t){const e=F._preElemAndWinAndDoc(t,"height");return F.getDimension(e,"height","content")}get height(){return F.height(this)}static width(t){const e=F._preElemAndWinAndDoc(t,"width");return F.getDimension(e,"width","content")}get width(){return F.width(this)}static innerHeight(t){const e=F._preElemAndWinAndDoc(t,"innerHeight");return F.getDimension(e,"height","padding")}innerHeight(){return F.innerHeight(this)}static innerWidth(t){const e=F._preElemAndWinAndDoc(t,"innerWidth");return F.getDimension(e,"width","padding")}innerWidth(){return F.innerWidth(this)}static outerHeight(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=F._preElemAndWinAndDoc(t,"outerHeight");return F.getDimension(r,"height",e?"margin":"border")}outerHeight(t){return F.outerHeight(this,t)}static outerWidth(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=F._preElemAndWinAndDoc(t,"outerWidth");return F.getDimension(r,"width",e?"margin":"border")}outerWidth(t){return F.outerWidth(this,t)}#u="";get mainDisplay(){return this.#u}set mainDisplay(t){if("string"!=typeof t)throw new TypeError("mainDisplay must be a string.");this.#u=t}static#p="block";static get defaultDisplay(){return F.#p}static set defaultDisplay(t){if("string"!=typeof t)throw new TypeError("defaultDisplay must be a string.");F.#p=t}static getAnimateData(t,e){let r=O.get(t);return r||(r={},O.set(t,r)),r[e]}static setAnimateData(t,e,r){if(!(t instanceof HTMLElement))throw new TypeError("setAnimateData: el must be an HTMLElement.");if("string"!=typeof e)throw new TypeError("setAnimateData: where must be a string.");if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("setAnimateData: value must be a string or number.");let n=O.get(t);n||(n={},O.set(t,n)),n[e]=r}static#m=!0;static get cancelOldStyleFx(){return F.#m}static set cancelOldStyleFx(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value.");F.#m=t}static#d={slow:{duration:600,easing:"ease"},fast:{duration:200,easing:"ease-out"},_default:{duration:400,easing:"linear"}};static get styleFxSpeeds(){const t={};for(const e in F.#d){const r=F.#d[e];t[e]="object"==typeof r?{...r}:r}return t}static set styleFxSpeeds(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleFxSpeeds must be an object.");for(const[e,r]of Object.entries(t))if("number"!=typeof r&&"object"!=typeof r)throw new TypeError(`styleFxSpeeds["${e}"] must be a number or KeyframeAnimationOptions.`);F.#d={};for(const[e,r]of Object.entries(t))F.setStyleFxSpeed(e,r)}static getStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=F.#d[t];return"object"==typeof e?{...e}:e}static setStyleFxSpeed(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("number"!=typeof e&&"object"!=typeof e)throw new TypeError("styleFxSpeed must be a number or KeyframeAnimationOptions");F.#d[t]="object"==typeof e?{...e}:e}static deleteStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete F.#d[t]}static hasStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(F.#d,t)}static#h=["Top","Right","Bottom","Left"];static#g={slideDown:F.genStyleFx("show"),slideUp:F.genStyleFx("hide"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}};static get styleEffects(){return JSON.parse(JSON.stringify(F.#g))}static set styleEffects(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffects must be an object");for(const e in t)for(const[r,n]of Object.entries(t[e]))if(!("string"==typeof n||Array.isArray(n)&&n.every(t=>"string"==typeof t||"number"==typeof t)))throw new TypeError(`Invalid styleEffect["${r}"]`);F.#g={};for(const e in t)F.setStyleEffect(e,t[e])}static getStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=F.#g[t];return e?JSON.parse(JSON.stringify(e)):void 0}static setStyleEffect(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffect must be an object");const r={};for(const[t,n]of Object.entries(e))if("string"==typeof n)r[t]=n;else{if(!Array.isArray(n)||!n.every(t=>"string"==typeof t||"number"==typeof t))throw new TypeError(`Invalid styleEffect["${t}"]`);r[t]=[...n]}F.#g[t]=r}static deleteStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete F.#g[t]}static hasStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(F.#g,t)}static#y={slideDown:"slideUp",slideUp:"slideDown",fadeIn:"fadeOut",fadeOut:"fadeIn",fadeTo:"fadeIn"};static get styleEffectInverse(){return{...F.#y}}static set styleEffectInverse(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectInverse must be an object.");for(const[e,r]of Object.entries(t))if("string"!=typeof r)throw new TypeError(`styleEffectInverse["${e}"] must be a string.`);F.#y={};for(const[e,r]of Object.entries(t))F.setStyleEffectInverse(e,r)}static getStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return F.#y[t]||null}static setStyleEffectInverse(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("string"!=typeof e)throw new TypeError(`styleEffectInverse["${t}"] must be a string.`);F.#y[t]=e}static deleteStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete F.#y[t]}static hasStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(F.#y,t)}static#b={slideDown:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),slideUp:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),fadeIn:t=>Number(t.opacity[0])===Number(t.opacity[1]),fadeOut:t=>Number(t.opacity[0])===Number(t.opacity[1])};static get styleEffectsRd(){return{...F.#b}}static set styleEffectsRd(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectsRd must be an object.");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsRd["${e}"] must be a function.`);F.#b={};for(const[e,r]of Object.entries(t))F.setStyleEffectRd(e,r)}static getStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return F.#b[t]||null}static setStyleEffectRd(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsRd["${t}"] must be a function.`);F.#b[t]=e}static deleteStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete F.#b[t]}static hasStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(F.#b,t)}static#E={show:(t,e,r,n)=>{if("height"===r||"width"===r){const o=F.getAnimateData(t,`orig${r}`)||t.scrollHeight+"px";F.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,o]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=F.getAnimateData(t,r)||n[r];F.setAnimateData(t,r,o),e[r]=["0px",o]}else if("opacity"===r){const t=n.opacity;e[r]=[t,1]}else{const o=F.getAnimateData(t,r)||n[r];F.setAnimateData(t,r,o),e[r]=[o,n[r]||1]}},hide:(t,e,r,n)=>{if("height"===r||"width"===r){const o=F.getAnimateData(t,`orig${r}`)||n[r];F.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,0]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=F.getAnimateData(t,r)||n[r];F.setAnimateData(t,r,o),e[r]=[n[r],"0px"]}else if("opacity"===r){const t=n.opacity;e[r]=[t,0]}else{const o=F.getAnimateData(t,r)||n[r];F.setAnimateData(t,r,o),e[r]=[o,0]}}};static get styleEffectsProps(){return{...F.#E}}static set styleEffectsProps(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffectsProps must be an object");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsProps["${e}"] must be a function`);F.#E={};for(const[e,r]of Object.entries(t))F.setStyleEffectProp(e,r)}static getStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return F.#E[t]||null}static setStyleEffectProp(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsProps["${t}"] must be a function`);F.#E[t]=e}static deleteStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete F.#E[t]}static hasStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(F.#E,t)}static genStyleFx(t,e=!1){if("string"!=typeof t)throw new TypeError("genStyleFx: type must be a string.");if("boolean"!=typeof e)throw new TypeError("genStyleFx: includeWidth must be a boolean.");let r,n=0;const o={height:t},i=e?1:0;for(;n<4;n+=2-i)r=F.#h[n],o["margin"+r]=t,o["padding"+r]=t;return e&&(o.opacity=t,o.width=t),o}static applyStyleFx(t,e,r,n){if("string"!=typeof e)throw new TypeError("applyStyleFx: id must be a string.");if("object"!=typeof r||null===r)throw new TypeError("applyStyleFx: props must be a non-null object.");if(void 0!==n&&"number"!=typeof n&&"string"!=typeof n&&("object"!=typeof n||null===n))throw new TypeError("applyStyleFx: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return F._preHtmlElems(t,"applyStyleFx").forEach(i=>{const s={};for(const[t,e]of Object.entries(r))if("string"==typeof e&&this.#E[e]){const r=getComputedStyle(i);this.#E[e](i,s,t,r)}else{if("object"!=typeof e)throw new TypeError(`applyStyleFx: invalid action for prop "${t}". Must be string or array.`);s[t]=e}if("function"==typeof F.#b[e]&&F.#b[e](s))return void o.set(i,null);const a=[],l=s[Object.keys(s)[0]].length;for(let t=0;t<l;t++){const e={};for(const r in s)e[r]=s[r][t];a.push(e)}o.set(i,F.animate(t,a,n,e)[0])}),o}applyStyleFx(t,e,r){return F.applyStyleFx(this,t,e,r)}static getCurrentAnimationId(t){if(!(t instanceof HTMLElement))throw new TypeError("Expected an HTMLElement.");return H.get(t)?.id??void 0}static animate(t,e,r=F.#d._default,n=null,o=F.#m){const i="string"==typeof r?F.#d[r]??void 0:"number"!=typeof r?{...r}:r;"object"==typeof i&&void 0===i.fill&&(i.fill="forwards");const s=[];return F._preHtmlElems(t,"animate").forEach(t=>{if(o){const e=H.get(t);e&&e.animation.cancel()}const r=t.animate(e,i);s.push(r),H.set(t,{animation:r,id:n??""}),r.addEventListener("finish",()=>{H.get(t)?.animation===r&&H.delete(t)})}),s}animate(t,e,r,n){return F.animate(this,t,e,r,n)}static stop(t){const e=[];return F._preHtmlElems(t,"stop").forEach(t=>{const r=H.get(t);r?(r.animation.cancel(),H.delete(t),e.push(!0)):e.push(!1)}),e}stop(){return F.stop(this)}static slideDown(t,e){return F.applyStyleFx(t,"slideDown",this.#g.slideDown,e??{duration:500,easing:"ease-out"})}slideDown(t){return F.slideDown(this,t)}static slideUp(t,e){return F.applyStyleFx(t,"slideUp",this.#g.slideUp,e??{duration:500,easing:"ease-out"})}slideUp(t){return F.slideUp(this,t)}static slideToggle(t,e){const r=F._preHtmlElem(t,"slideToggle"),n=getComputedStyle(r),o=F.getCurrentAnimationId(r),i="none"===n.display||0===r.offsetHeight;return("string"==typeof o?"slideUp"===o:i)?F.slideDown(t,e):F.slideUp(t,e)}slideToggle(t){return F.slideToggle(this,t)}static fadeIn(t,e){return F.applyStyleFx(t,"fadeIn",this.#g.fadeIn,e)}fadeIn(t){return F.fadeIn(this,t)}static fadeOut(t,e){return F.applyStyleFx(t,"fadeOut",this.#g.fadeOut,e)}fadeOut(t){return F.fadeOut(this,t)}static fadeToggle(t,e){const r=F._preHtmlElem(t,"fadeToggle"),n=getComputedStyle(r),o=F.getCurrentAnimationId(r),i="0"===n.opacity||null===r.offsetParent;return("string"==typeof o?"fadeOut"===o:i)?F.fadeIn(t,e):F.fadeOut(t,e)}fadeToggle(t){return F.fadeToggle(this,t)}static fadeTo(t,e,r,n=F.#p){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new TypeError("fadeTo: opacity must be a number between 0 and 1.");if(void 0!==r&&"number"!=typeof r&&"string"!=typeof r&&("object"!=typeof r||null===r))throw new TypeError("fadeTo: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return F._preHtmlElems(t,"fadeTo").forEach(i=>{const s=getComputedStyle(i);if(!(t instanceof Element&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length))){const t=F.getAnimateData(i,"origdisplay");i.style.display="string"==typeof t?t:n}const a=[s.opacity,e].map(t=>({opacity:t}));o.set(i,F.animate(i,a,r,"fadeTo")[0])}),o}fadeTo(t,e,r=this.#u){return F.fadeTo(this,t,e,r)}static offset(t){const e=F._preElem(t,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:e.top+r,left:e.left+n}}offset(){return F.offset(this)}static position(t){const e=F._preHtmlElem(t,"position");let r,n,o={top:0,left:0};if("fixed"===window.getComputedStyle(e).position)n=e.getBoundingClientRect();else{n=F.offset(e),r=e.offsetParent||document.documentElement;const{position:t}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===t;)r=r.parentNode;if(r instanceof HTMLElement&&r!==e&&1===r.nodeType){const{borderTopWidth:t,borderLeftWidth:e}=F.cssFloats(r,["borderTopWidth","borderLeftWidth"]);o=F.offset(r),o.top+=t,o.left+=e}}return{top:n.top-o.top-F.cssFloat(e,"marginTop"),left:n.left-o.left-F.cssFloat(e,"marginLeft")}}position(){return F.position(this)}static offsetParent(t){let e=F._preHtmlElem(t,"offsetParent").offsetParent;for(;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position;)e=e.offsetParent;return e instanceof HTMLElement?e:document.documentElement}offsetParent(){return F.offsetParent(this)}static scrollTop(t){const e=F._preElemAndWindow(t,"scrollTop");return F.isWindow(e)?e.pageYOffset:9===e.nodeType?e.defaultView.pageYOffset:e.scrollTop}scrollTop(){return F.scrollTop(this)}static scrollLeft(t){const e=F._preElemAndWindow(t,"scrollLeft");return F.isWindow(e)?e.pageXOffset:9===e.nodeType?e.defaultView.pageXOffset:e.scrollLeft}scrollLeft(){return F.scrollLeft(this)}static easings={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};static scrollToXY(t,{targetX:e,targetY:r,duration:n,easing:o,onAnimation:i}={}){if(void 0!==e&&"number"!=typeof e)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==n&&"number"!=typeof n)throw new TypeError("`duration` must be a number if provided.");if(void 0!==o&&"string"!=typeof o)throw new TypeError("`easing` must be a string if provided.");if(void 0!==o&&"function"!=typeof F.easings[o])throw new TypeError(`Unknown easing function: "${o}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(t,e,r,n)=>{if(t instanceof Window)window.scrollTo(e,r);else if(9===t.nodeType)t.defaultView.scrollTo(e,r);else{const n=t instanceof Window?window.scrollX:t.scrollLeft,o=t instanceof Window?window.scrollY:t.scrollTop;n!==e&&(t.scrollLeft=e),o!==r&&(t.scrollTop=r)}"function"==typeof i&&i({x:e,y:r,isComplete:n>=1,time:n})};return F._preElemsAndWindow(t,"scrollToXY").forEach(t=>{const i=t instanceof Window?window.scrollX:t.scrollLeft,a=t instanceof Window?window.scrollY:t.scrollTop,l=e??i,c=r??a,u=l-i,p=c-a,f="string"==typeof o&&F.easings[o]||null;if("number"!=typeof n||"function"!=typeof f)return s(t,l,c,1);const m=performance.now(),d=n??0;requestAnimationFrame(function e(r){if("function"!=typeof f)return;const n=Math.min(1,(r-m)/d),o=f(n);s(t,i+u*o,a+p*o,n),n<1&&requestAnimationFrame(e)})}),t}scrollToXY({targetX:t,targetY:e,duration:r,easing:n,onAnimation:o}={}){return F.scrollToXY(this,{targetX:t,targetY:e,duration:r,easing:n,onAnimation:o})}static setScrollTop(t,e){if("number"!=typeof e)throw new TypeError("ScrollTop value must be a number.");return F.scrollToXY(t,{targetY:e})}setScrollTop(t){return F.setScrollTop(this,t)}static setScrollLeft(t,e){if("number"!=typeof e)throw new TypeError("ScrollLeft value must be a number.");return F.scrollToXY(t,{targetX:e})}setScrollLeft(t){return F.setScrollLeft(this,t)}static borderWidth(t){const e=F._preElem(t,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:o,borderBottomWidth:i}=F.cssFloats(e,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}borderWidth(){return F.borderWidth(this)}static border(t){const e=F._preElem(t,"border"),{borderLeft:r,borderRight:n,borderTop:o,borderBottom:i}=F.cssFloats(e,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}border(){return F.border(this)}static margin(t){const e=F._preElem(t,"margin"),{marginLeft:r,marginRight:n,marginTop:o,marginBottom:i}=F.cssFloats(e,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}margin(){return F.margin(this)}static padding(t){const e=F._preElem(t,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:o,paddingBottom:i}=F.cssFloats(e,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}padding(){return F.padding(this)}static#w=!1;static get classCanWhitespace(){return this.#w}static set classCanWhitespace(t){if("boolean"!=typeof t)throw new TypeError("classCanWhitespace must be a boolean");this.#w=t}static addClass(t,...e){const r=[];for(const t of e)if(F.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return F._preElems(t,"addClass").forEach(t=>t.classList.add(...r)),t}addClass(...t){return F.addClass(this,...t)}static removeClass(t,...e){const r=[];for(const t of e)if(F.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return F._preElems(t,"removeClass").forEach(t=>t.classList.remove(...r)),t}removeClass(...t){return F.removeClass(this,...t)}static replaceClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return F._preElems(t,"replaceClass").forEach(t=>n.push(t.classList.replace(e,r))),n}replaceClass(t,e){return F.replaceClass(this,t,e)[0]}static classItem(t,e){const r=F._preElem(t,"classItem");if("number"!=typeof e)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(e)}classItem(t){return F.classItem(this,t)}static toggleClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return F._preElems(t,"toggleClass").forEach(t=>n.push(t.classList.toggle(e,r))),n}toggleClass(t,e){return F.toggleClass(this,t,e)[0]}static hasClass(t,e){const r=F._preElem(t,"hasClass");if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(e)}hasClass(t){return F.hasClass(this,t)}static classLength(t){return F._preElem(t,"classLength").classList.length}classLength(){return F.classLength(this)}static classList(t){return F._preElem(t,"classList").classList.values().toArray()}classList(){return F.classList(this)}static tagName(t){return F._preElem(t,"tagName").tagName}tagName(){return F.tagName(this)}static id(t){return F._preElem(t,"id").id}get id(){return F.id(this)}set id(t){F.setAttr(this,"id",t)}static toBigInt(t){const e=F._preElem(t,"toBigInt"),r=e.textContent?.trim();let n=null;try{n=BigInt(r??"")}catch{n=null}return n}toBigInt(){return F.toBigInt(this)}static setBigInt(t,e){if("bigint"!=typeof e)throw new Error("Value is not a valid BigInt.");const r=e.toString();return F._preElems(t,"setBigInt").forEach(t=>t.textContent=r),t}setBigInt(t){return F.setBigInt(this,t)}static toDate(t){const e=F._preElem(t,"toDate"),r=e.textContent?.trim();if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}toDate(){return F.toDate(this)}static setDate(t,e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new Error("Value is not a valid Date.");const r=e.toISOString();return F._preElems(t,"setDate").forEach(t=>t.textContent=r),t}setDate(t){return F.setDate(this,t)}static toJson(t){const e=F._preElem(t,"toJson"),r=e.textContent?.trim();if(!r)return null;try{return JSON.parse(r)}catch{return null}}toJson(){return F.toJson(this)}static setJson(t,e,r,n){const o=JSON.stringify(e,r,n);return F._preElems(t,"setJson").forEach(t=>t.textContent=o),t}setJson(t,e,r){return F.setJson(this,t,e,r)}static toNumber(t){const e=F._preElem(t,"toNumber");return"string"==typeof e.textContent?parseFloat(e.textContent.trim()):null}toNumber(){return F.toNumber(this)}static setNumber(t,e){if("number"!=typeof e)throw new Error("Value is not a valid number.");const r=e.toString();return F._preElems(t,"setNumber").forEach(t=>t.textContent=r),t}setNumber(t){return F.setNumber(this,t)}static toBoolean(t){const e=F._preElem(t,"toBoolean"),r=e.textContent?.trim();return null==r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}toBoolean(){return F.toBoolean(this)}static setBoolean(t,e){if("boolean"!=typeof e)throw new Error("Value is not a valid boolean.");const r=e.toString();return F._preElems(t,"setBoolean").forEach(t=>t.textContent=r),t}setBoolean(t){return F.setBoolean(this,t)}static toString(t){const e=F._preElem(t,"toString");return"string"==typeof e.textContent?e.textContent:null}toString(){return F.toString(this)}static setString(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return F._preElems(t,"setString").forEach(t=>t.textContent=e),t}setString(t){return F.setString(this,t)}static text(t){return F._preElem(t,"text").textContent}text(){return F.text(this)}static setText(t,e){const r=null!=e?String(e):"";return F._preElems(t,"setText").forEach(t=>t.textContent=r),t}setText(t){return F.setText(this,t)}static empty(t){return F._preElems(t,"empty").forEach(t=>t.textContent=""),t}empty(){return F.empty(this)}static html(t,e){return F._preElem(t,"html").getHTML(e)}html(t){return F.html(this,t)}static setHtml(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return F._preElems(t,"setHtml").forEach(t=>t.innerHTML=e),t}setHtml(t){return F.setHtml(this,t)}static _valHooks={option:{get:t=>{const e=t.getAttribute("value");return null!=e?e:t.textContent}},select:{get:t=>{const e=t.options,r=t.selectedIndex,n="select-one"===t.type,o=n?r+1:e.length,i=[];let s=r<0?o:n?r:0;for(;s<o;s++){const t=e[s],o=t.parentNode;if((t.selected||s===r)&&!t.disabled&&(!o||!o.disabled||"OPTGROUP"!==o.tagName)){const e=F._valHooks.option.get(t);if(n)return e;i.push(e)}}return i},set:(t,e)=>{const r=t.options,n=Array.isArray(e)?e.map(String):[String(e)];let o=!1;for(let t=0;t<r.length;t++){const e=r[t],i=F._valHooks.option.get(e);"string"==typeof i&&(e.selected=n.includes(i))&&(o=!0)}return o||(t.selectedIndex=-1),n}},radio:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e){const r=t.closest("label");return e&&r&&r.querySelectorAll('input[type="radio"]').forEach(e=>{e instanceof HTMLInputElement&&e!==t&&(e.checked=!1)}),t.checked=e,e}}},checkbox:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e)return t.checked=e,e}}};static setVal(t,e){return F._preInputElems(t,"setVal").forEach(t=>{if(1!==t.nodeType)return;let r="function"==typeof e?e(t,F.val(t)):e;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=((t,e)=>{const r=[];for(let n=0;n<t.length;n++)r.push(e(t[n]));return r})(r,t=>null==t?"":String(t)));const n=F._valHooks[t.type]||F._valHooks[t.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(t,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(t.value=r)}}),t}setVal(t){return F.setVal(this,t)}static _valTypes={string:t=>t.value,date:t=>t.valueAsDate,number:t=>t.valueAsNumber};static _getValByType(t,e,r){if("string"!=typeof e)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof F._valTypes[e])throw new Error(`No handler found for type "${e}" in ${r}().`);return F._valTypes[e](t)}static _val(t,e,r){const n=F._preInputElem(t,e),o=F._valHooks[n.type]||F._valHooks[n.nodeName.toLowerCase()];if(o&&"function"==typeof o.get){const t=o.get(n,"value",r);if(void 0!==t)return"string"==typeof t?t.replace(/\r/g,""):t}return F._getValByType(n,r,e)}_val(t,e){return F._val(this,t,e)}static val(t){return F._val(t,"val","string")}val(){return F.val(this)}static valTxt(t){const e=F._val(t,"valTxt","string");if("string"!=typeof e&&null!==e)throw new Error("Value is not a valid string.");return null==e?"":"string"==typeof e?e.replace(/\r/g,""):e}valTxt(){return F.valTxt(this)}static _valArr(t,e,r){const n=F._val(t,e,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(t,e){return F._valArr(this,t,e)}static valArr(t){return F._valArr(t,"valArr","string")}valArr(){return F.valArr(this)}static valNb(t){if(!(F._preInputElem(t,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=F._val(t,"valNb","number");if(Number.isNaN(e))throw new Error("Value is not a valid number.");return e}valNb(){return F.valNb(this)}static valDate(t){if(!(F._preInputElem(t,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=F._val(t,"valDate","date");if(!(e instanceof Date))throw new Error("Value is not a valid date.");return e}valDate(){return F.valDate(this)}static valBool(t){const e=F._preInputElem(t,"valBool");if(!(e instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===F.val(e)}valBool(){return F.valBool(this)}static listenForPaste(t,{onFilePaste:e,onTextPaste:r}={}){if(void 0!==e&&"function"!=typeof e)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const n=t=>{if(!(t instanceof ClipboardEvent))return;const n=t.clipboardData?.items||[];for(const t of n)if("file"===t.kind){if("function"==typeof e){const r=t.getAsFile();r&&e(t,r)}}else"string"===t.kind&&"function"==typeof r&&t.getAsString(e=>r(t,e))};return F._preElemsWithDoc(t,"listenForPaste").forEach(t=>F.on(t,"paste",n)),n}listenForPaste({onFilePaste:t,onTextPaste:e}={}){return F.listenForPaste(this,{onFilePaste:t,onTextPaste:e})}static hasEventListener(t,e){const r=F._preEventTargetElem(t,"hasEventListener");if(!W.has(r))return!1;const n=W.get(r);return!!(n&&Array.isArray(n[e])&&n[e].length>0)}hasEventListener(t){return F.hasEventListener(this,t)}static hasExactEventListener(t,e,r){const n=F._preEventTargetElem(t,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!W.has(n))return!1;const o=W.get(n);return!(!o||!Array.isArray(o[e]))&&o[e].some(t=>t.handler===r)}hasExactEventListener(t,e){return F.hasExactEventListener(this,t,e)}static hover(t,e,r,n){return F.on(t,"mouseenter",e,n),F.on(t,"mouseleave",r||e,n),t}hover(t,e,r){return F.hover(this,t,e,r)}static on(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");F._preEventTargetElems(t,"on").forEach(t=>{t.addEventListener(o,r,n),W.has(t)||W.set(t,{});const e=W.get(t);e&&(Array.isArray(e[o])||(e[o]=[]),e[o].push({handler:r,options:n}))})}return t}on(t,e,r){return F.on(this,t,e,r)}static once(t,e,r,n={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");F._preEventTargetElems(t,"once").forEach(t=>{const e=n=>{F.off(t,o,e),"function"==typeof r&&r(n)};F.on(t,o,e,"boolean"==typeof n?n:{...n,once:!0})})}return t}once(t,e,r={}){return F.once(this,t,e,r)}static off(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");F._preEventTargetElems(t,"off").forEach(t=>{t.removeEventListener(o,r,n);const e=W.get(t);e&&e[o]&&(e[o]=e[o].filter(t=>t.handler!==r),0===e[o].length&&delete e[o])})}return t}off(t,e,r){return F.off(this,t,e,r)}static offAll(t,e){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const r of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof r)throw new TypeError("The event name must be a string.");F._preEventTargetElems(t,"offAll").forEach(t=>{const e=W.get(t);if(e&&e[r]){for(const n of e[r])t.removeEventListener(r,n.handler,n.options);delete e[r]}})}return t}offAll(t){return F.offAll(this,t)}static offAllTypes(t,e=null){if(null!==e&&"function"!=typeof e)throw new TypeError('The "filterFn" must be a function.');return F._preEventTargetElems(t,"offAllTypes").forEach(t=>{const r=W.get(t);if(r){for(const n in r)for(const o of r[n])("function"!=typeof e||e(o.handler,n))&&t.removeEventListener(n,o.handler,o.options);W.delete(t)}}),t}offAllTypes(t=null){return F.offAllTypes(this,t)}static trigger(t,e,r={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const n of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof n)throw new TypeError("The event name must be a string.");F._preEventTargetElems(t,"trigger").forEach(t=>{const e=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:r});t.dispatchEvent(e)})}return t}trigger(t,e={}){return F.trigger(this,t,e)}static#T={for:"htmlFor",class:"className"};static propFix=new Proxy(F.#T,{set:(t,e,r)=>(t[e]=r,F.attrFix[r]=e,!0)});static attrFix=Object.fromEntries(Object.entries(F.#T).map(([t,e])=>[e,t]));static getPropName(t){return"string"==typeof F.propFix[t]?F.propFix[t]:t}static getAttrName(t){return"string"==typeof F.attrFix[t]?F.attrFix[t]:t}static attrBigInt(t,e){const r=F._preElem(t,"attrBigInt").getAttribute(F.getAttrName(e));if(null==r)return null;try{return BigInt(r)}catch{return null}}attrBigInt(t){return F.attrBigInt(this,t)}static setAttrBigInt(t,e,r){if("bigint"!=typeof r)throw new Error("Value is not a valid BigInt.");return F.setAttr(t,e,r.toString())}setAttrBigInt(t,e){return F.setAttrBigInt(this,t,e)}static attrDate(t,e){const r=F._preElem(t,"attrDate").getAttribute(F.getAttrName(e));if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}attrDate(t){return F.attrDate(this,t)}static setAttrDate(t,e,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new Error("Value is not a valid Date.");return F.setAttr(t,e,r.toISOString())}setAttrDate(t,e){return F.setAttrDate(this,t,e)}static attrJson(t,e){const r=F._preElem(t,"attrJson").getAttribute(F.getAttrName(e));if(!r)return null;try{return JSON.parse(r)}catch{return null}}attrJson(t){return F.attrJson(this,t)}static setAttrJson(t,e,r,n,o){const i=JSON.stringify(r,n,o);return F.setAttr(t,e,i)}setAttrJson(t,e,r,n){return F.setAttrJson(this,t,e,r,n)}static attrNumber(t,e){const r=F._preElem(t,"attrNumber").getAttribute(F.getAttrName(e));return null!=r?parseFloat(r):null}attrNumber(t){return F.attrNumber(this,t)}static setAttrNumber(t,e,r){if("number"!=typeof r)throw new Error("Value is not a valid number.");return F.setAttr(t,e,r.toString())}setAttrNumber(t,e){return F.setAttrNumber(this,t,e)}static attrBoolean(t,e){const r=F._preElem(t,"attrBoolean").getAttribute(F.getAttrName(e));return null===r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}attrBoolean(t){return F.attrBoolean(this,t)}static setAttrBoolean(t,e,r){if("boolean"!=typeof r)throw new Error("Value is not a valid boolean.");return F.setAttr(t,e,r.toString())}setAttrBoolean(t,e){return F.setAttrBoolean(this,t,e)}static attrString(t,e){const r=F._preElem(t,"attrString").getAttribute(F.getAttrName(e));return"string"==typeof r?r:null}attrString(t){return F.attrString(this,t)}static setAttrString(t,e,r){if("string"!=typeof r)throw new Error("Value is not a valid string.");return F.setAttr(t,e,r)}setAttrString(t,e){return F.setAttrString(this,t,e)}static attr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return F._preElem(t,"attr").getAttribute(F.getAttrName(e))}attr(t){return F.attr(this,t)}static setAttr(t,e,r=null){const n=F._preElems(t,"setAttr");if("object"==typeof e&&null!==e)return Object.entries(e).forEach(([t,e])=>n.forEach(r=>{null===e?r.removeAttribute(F.getAttrName(t)):r.setAttribute(F.getAttrName(t),String(e))})),t;if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return n.forEach(t=>{null===r?t.removeAttribute(F.getAttrName(e)):t.setAttribute(F.getAttrName(e),String(r))}),t}setAttr(t,e){return F.setAttr(this,t,e)}static removeAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return F._preElems(t,"removeAttr").forEach(t=>t.removeAttribute(F.getAttrName(e))),t}removeAttr(t){return F.removeAttr(this,t)}static hasAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return F._preElem(t,"hasAttr").hasAttribute(F.getAttrName(e))}hasAttr(t){return F.hasAttr(this,t)}static hasProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return!!F._preElem(t,"hasProp")[F.getPropName(e)]}hasProp(t){return F.hasProp(this,t)}static addProp(t,...e){return F._preElems(t,"addProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[F.getPropName(e)]=!0})}),t}addProp(...t){return F.addProp(this,...t)}static removeProp(t,...e){return F._preElems(t,"removeProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[F.getPropName(e)]=!1})}),t}removeProp(...t){return F.removeProp(this,...t)}static toggleProp(t,e,r){const n=F._preElems(t,"toggleProp");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');return(Array.isArray(e)?e:[e]).forEach(t=>{if("string"!=typeof t)throw new TypeError("Each property name must be a string.");n.forEach(e=>{(void 0===r?!e[F.getPropName(t)]:r)?F.addProp(e,t):F.removeProp(e,t)})}),t}toggleProp(t,e){return F.toggleProp(this,t,e)}static prop(t,e){if("string"!=typeof e)throw new TypeError('Invalid arguments passed to prop(). Expected string for "name".');return F._preElem(t,"prop")[e]}prop(t){return F.prop(this,t)}static setProp(t,e,r){if("string"!=typeof e||""===e.trim())throw new Error("Property name must be a non-empty string.");return F._preElems(t,"setProp").forEach(t=>{t[e]=r}),t}setProp(t,e){return F.setProp(this,t,e)}static remove(t){return F._preElems(t,"remove").forEach(t=>t.remove()),t}remove(){return F.remove(this)}static index(t,e=null){const r=F._preElem(t,"index");if(!r)return-1;if(!e)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(e){const t="string"==typeof e?document.querySelectorAll(e):F._preElems(e,"index");return Array.prototype.indexOf.call(t,r)}return-1}index(t){return F.index(this,t)}static _getCustomRect(t,e){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const e in t)"number"==typeof t[e]&&(r[e]=t[e]);if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("extraRect must be a non-null object.");const{height:n=0,width:o=0,top:i=0,bottom:s=0,left:a=0,right:l=0}=e;if("number"!=typeof n)throw new Error("extraRect.height must be a number.");if("number"!=typeof o)throw new Error("extraRect.width must be a number.");if("number"!=typeof i)throw new Error("extraRect.top must be a number.");if("number"!=typeof s)throw new Error("extraRect.bottom must be a number.");if("number"!=typeof a)throw new Error("extraRect.left must be a number.");if("number"!=typeof l)throw new Error("extraRect.right must be a number.");return r.height+=n,r.width+=o,r.top+=i,r.bottom+=s,r.left+=a,r.right+=l,r}static isCollWith(t,e,r={}){const n=F._getCustomRect(F._preElem(t,"isCollWith").getBoundingClientRect(),r),o=F._preElem(e,"isCollWith").getBoundingClientRect();return C(n,o)}isCollWith(t,e){return F.isCollWith(this,t,e)}static isCollPerfWith(t,e,r={}){const n=F._getCustomRect(F._preElem(t,"isCollPerfWith").getBoundingClientRect(),r),o=F._preElem(e,"isCollPerfWith").getBoundingClientRect();return L(n,o)}isCollPerfWith(t,e){return F.isCollPerfWith(this,t,e)}static _isCollWithLock(t,e,r,n,o){const i=I[o];if(t)return i.has(n)||i.set(n,!0),!0;if(i.has(n)){let t=!1;switch(o){case"top":t=N(e,r);break;case"bottom":t=D(e,r);break;case"left":t=B(e,r);break;case"right":t=P(e,r)}return t&&i.delete(n),i.has(n)}return!1}static isCollWithLock(t,e,r,n={}){const o=F._preElem(t,"isCollWithLock"),i=F._preElem(e,"isCollWithLock"),s=F._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=C(s,a);return F._isCollWithLock(l,s,a,o,r)}isCollWithLock(t,e,r){return F.isCollWithLock(this,t,e,r)}static isCollPerfWithLock(t,e,r,n={}){const o=F._preElem(t,"isCollPerfWithLock"),i=F._preElem(e,"isCollPerfWithLock"),s=F._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=L(s,a);return F._isCollWithLock(l,s,a,o,r)}isCollPerfWithLock(t,e,r){return F.isCollPerfWithLock(this,t,e,r)}static resetCollLock(t){const e=F._preElem(t,"resetCollLock");let r=!1;for(const t of["top","bottom","left","right"])I[t].has(e)&&(I[t].delete(e),r=!0);return r}resetCollLock(){return F.resetCollLock(this)}static resetCollLockDir(t,e){const r=F._preElem(t,"resetCollLockDir"),n=I[e];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(t){return F.resetCollLockDir(this,t)}static isInViewport(t){const e=F._preElem(t,"isInViewport");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=F.offset(e).top,n=r+F.outerHeight(e),o=F.scrollTop(window),i=o+F.height(window);return n>o&&r<i}isInViewport(){return F.isInViewport(this)}static isScrolledIntoView(t){const e=F._preElem(t,"isScrolledIntoView");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=F.scrollTop(window),n=r+F.height(window),o=F.offset(e).top;return o+F.height(e)<=n&&o>=r}isScrolledIntoView(){return F.isScrolledIntoView(this)}static isInContainer(t,e){const r=F._preElem(t,"isInContainer"),n=F._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=o.bottom>i.top&&o.top<i.bottom,a=o.right>i.left&&o.left<i.right;return s&&a}isInContainer(t){return F.isInContainer(this,t)}static isFullyInContainer(t,e){const r=F._preElem(t,"isScrolledIntoView"),n=F._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();return o.top>=i.top&&o.bottom<=i.bottom&&o.left>=i.left&&o.right<=i.right}isFullyInContainer(t){return F.isFullyInContainer(this,t)}static hasScroll(t){const e=F._preElem(t,"hasScroll");return{v:e.scrollHeight>e.clientHeight,h:e.scrollWidth>e.clientWidth}}hasScroll(){return F.hasScroll(this)}}const M=F,R=A("TinySmartScroller");class j extends i.EventEmitter{static Utils={...o,TinyHtml:M};#v=new WeakMap;#S=new WeakMap;#A=new WeakMap;#_=new WeakMap;#x=new WeakMap;#C=new WeakMap;#L=null;#N=null;#D=new Set(["IMG","IFRAME","VIDEO"]);#B=null;#P=!1;#W=!1;#k=!1;#O=!1;#H=!1;#I=!1;#F=!1;#M=!1;#R="";#j=!1;#t=!1;#V=!1;#z=!1;#$=!1;#U=!1;#q=0;#J=0;#Y=0;#X=0;#K=0;#G;#Q;#Z;#tt=new Set;constructor(t,{extraScrollBoundary:e=0,autoScrollBottom:r=!0,observeMutations:n=!0,preserveScrollOnLayoutShift:o=!0,debounceTime:i=100,querySelector:s=null,attributeFilter:a=["class","style","src","data-*","height","width"]}={}){if(super(),!(t instanceof Element||t===window))throw new TypeError("TinySmartScroller: 'target' must be a DOM Element or 'window', but got "+typeof t);if("number"!=typeof e||Number.isNaN(e))throw new TypeError(`TinySmartScroller: 'extraScrollBoundary' must be a valid number, received ${e}`);if("boolean"!=typeof r)throw new TypeError("TinySmartScroller: 'autoScrollBottom' must be a boolean, received "+typeof r);if("boolean"!=typeof n)throw new TypeError("TinySmartScroller: 'observeMutations' must be a boolean, received "+typeof n);if("boolean"!=typeof o)throw new TypeError("TinySmartScroller: 'preserveScrollOnLayoutShift' must be a boolean, received "+typeof o);if("number"!=typeof i||i<0||Number.isNaN(i))throw new TypeError(`TinySmartScroller: 'debounceTime' must be a non-negative number, received ${i}`);if(null!==s&&"string"!=typeof s)throw new TypeError("TinySmartScroller: 'querySelector' must be a string or null, received "+typeof s);if(!(null===a||Array.isArray(a)||a instanceof Set))throw new TypeError("TinySmartScroller: 'attributeFilter' must be an array, Set, or null. Got "+typeof a);let l;this.#Z=t,this.#Q=t instanceof Window?document.documentElement:t,this.#j=t instanceof Window,this.#z=r,this.#$=n,this.#U=o,this.#q=i,this.#K=e,this.#R=s||"",this.#G=new Set(a||void 0),this.#B=()=>{this._scrollDataUpdater(),clearTimeout(l),l=setTimeout(()=>this._onScroll(),this.#q)},(this.#j?window:this.#Q).addEventListener("scroll",this.#B,{passive:!0}),this.#$&&(this._observeMutations(),this._observeResizes(this.#Q.children)),this._scrollDataUpdater()}getSimpleOnHeight(t=[]){if(R(this.#t),!Array.isArray(t))throw new TypeError("getSimpleOnHeight(filter): filter must be an array of tag names");return(e,r,n)=>{if(t.length>0&&!t.includes(e.tagName)||n.now!==n.old)return;const o=r.old;return{height:r.now.height-o.height,width:0}}}addSimpleOnHeight(t){if(R(this.#t),!Array.isArray(t))throw new TypeError("addSimpleOnHeight(filter): filter must be an array of tag names");const e=this.getSimpleOnHeight(t);return this.onSize(e),e}getLoadTags(){return R(this.#t),Array.from(this.#D)}addLoadTag(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("addLoadTag(tag): tag must be a string");this.#D.add(t.toUpperCase())}removeLoadTag(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("removeLoadTag(tag): tag must be a string");this.#D.delete(t.toUpperCase())}hasLoadTag(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("hasLoadTag(tag): tag must be a string");return this.#D.has(t.toUpperCase())}resetLoadTags(t=!1){if(R(this.#t),"boolean"!=typeof t)throw new TypeError("resetLoadTags(addDefault): addDefault must be a boolean");this.#D.clear(),t&&(this.#D.add("IMG"),this.#D.add("IFRAME"),this.#D.add("VIDEO"))}getAttributeFilters(){return R(this.#t),Array.from(this.#G)}addAttributeFilter(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("addAttributeFilter(attr): attr must be a string");this.#G.add(t)}removeAttributeFilter(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("removeAttributeFilter(attr): attr must be a string");this.#G.delete(t)}hasAttributeFilter(t){if(R(this.#t),"string"!=typeof t)throw new TypeError("hasAttributeFilter(attr): attr must be a string");return this.#G.has(t)}resetAttributeFilters(t=!1){if(R(this.#t),"boolean"!=typeof t)throw new TypeError("resetAttributeFilters(addDefault): addDefault must be a boolean");this.#G.clear(),t&&["class","style","src","data-*","height","width"].forEach(t=>this.#G.add(t))}onSize(t){if(R(this.#t),"function"!=typeof t)throw new TypeError("onSize(handler): handler must be a function");this.#tt.add(t)}offSize(t){if(R(this.#t),"function"!=typeof t)throw new TypeError("offSize(handler): handler must be a function");this.#tt.delete(t)}_scrollDataUpdater(){const t=new Map;return this.#Q.querySelectorAll(this.#R||"*").forEach(e=>{const r=this.#A.get(e)??!1;this.#_.set(e,r);const n=M.isInContainer(this.#Q,e);this.#A.set(e,n),t.set(e,{oldIsVisible:r,isVisible:n})}),t}_onScroll(){if(this.#t)return;const t=this._scrollDataUpdater(),e=this.#Q,r=e.scrollTop,n=e.scrollHeight,o=e.clientHeight,i={scrollTop:r,scrollHeight:n,clientHeight:o};let s=null,a=null;const l=0===r,c=r+o>=n-1,u=r<=0+this.#K,p=r+o>=n-1-this.#K;l&&c?s="all":l?s="top":c&&(s="bottom"),u&&p?a="all":u?a="top":p&&(a="bottom"),this.#W=this.#I??!1,this.#P=this.#H??!1,this.#k=this.#F??!1,this.#O=this.#M??!1,this.#I=l,this.#H=c,this.#F=u,this.#M=p,this.#V=!(this.#z&&this.#H),this.#X=n-r-o,this.emit("onScrollBoundary",{status:s,...i,scrollCache:t}),this.emit("onExtraScrollBoundary",{status:a,...i,scrollCache:t}),this.#V?this.emit("onScrollPause",{...i,scrollCache:t}):this.emit("onAutoScroll",{...i,scrollCache:t})}_fixScroll(t=[]){if(this.#t)return;if(!Array.isArray(t))throw new TypeError("_fixScroll: targets must be an array of Elements");const e=this.#Q.scrollHeight,r=this.#Q.scrollTop,n=this.#Q.scrollHeight-this.#Q.scrollTop-this.#Q.clientHeight,o=this.#Q.scrollHeight-e,i=()=>{const e={height:0,width:0};for(const r of t){const t=this.#v.get(r)||{height:0,width:0},n=this.#S.get(r)||{height:0,width:0};this.#tt.forEach(o=>{const i=o(r,{old:t,now:n},{old:this.#Y,now:this.#J});if(this.#A.get(r)||this.#x.get(r)){if(void 0!==i&&"object"!=typeof i)throw new Error("_fixScroll: size filter must return an object or undefined");if(void 0===i)return;e.height=i.height,e.width=i.width}})}if("number"!=typeof e.height&&e.height<0)throw new Error("_fixScroll: invalid scrollSize.height value");if("number"!=typeof e.width&&e.width<0)throw new Error("_fixScroll: invalid scrollSize.width value");if(0!==e.height||0!==e.width)for(const e of t)this.#x.set(e,this.#A.get(e)??!1),this.#C.set(e,this.#_.get(e)??!1);return e};if(this.#Y>0&&M.hasScroll(this.#Q).v&&this.#z&&this.#U&&!this.#H&&!this.#I){const t=i();this.#Q.scrollTop=r+o+t.height,t.width>0&&(this.#Q.scrollLeft=this.#Q.scrollLeft+t.width)}else!this.#V&&this.#z?(i(),this.scrollToBottom()):this.#z||this.#H||(i(),this.#Q.scrollTop=this.#Q.scrollHeight-this.#Q.clientHeight-n)}_observeMutations(){this.#N=new MutationObserver(t=>{this.#t||(this._scrollDataUpdater(),this.#Y=this.#J,this.#J=this.#Q.childElementCount,t.forEach(t=>{t.addedNodes.forEach(t=>{if(t instanceof Element&&1===t.nodeType&&(this._observeResizes([t]),this._listenLoadEvents(t),this.#R)){const e=t.querySelectorAll(this.#R);this._observeResizes(e),this._listenLoadEvents(e)}})}),this._fixScroll())}),this.#N.observe(this.#Q,{childList:!0,subtree:!0,attributes:!0,attributeFilter:this.#G.size>0?Array.from(this.#G):void 0})}_observeResizes(t){this.#L||(this.#L=new ResizeObserver(t=>{if(this.#t)return;this._scrollDataUpdater();const e=[];for(const r of t){const t=r.target,n=this.#S.get(t);n&&this.#v.set(t,n);const{width:o,height:i}=r.contentRect;this.#S.set(t,{width:o,height:i}),e.push(t)}this._fixScroll(e)})),Array.from(t).forEach(t=>{if(!this.#L)throw new Error("_observeResizes: ResizeObserver instance is not initialized");this.#L.observe(t)})}_listenLoadEvents(t){this.#t||(t instanceof NodeList?Array.from(t):[t]).forEach(t=>{this.#D.has(t.tagName)&&(t.complete||t.addEventListener("load",()=>{this._scrollDataUpdater(),!this.#V&&this.#z&&this.scrollToBottom()}))})}get target(){return this.#Z}get targetElement(){return this.#Q}getOldSize(t){return R(this.#t),this.#v.get(t)??null}getNewSize(t){return R(this.#t),this.#S.get(t)??null}wasVisible(t){return R(this.#t),this.#_.get(t)??!1}isVisible(t){return R(this.#t),this.#A.get(t)??!1}wasTimedVisible(t){return R(this.#t),this.#C.get(t)??!1}isTimedVisible(t){return R(this.#t),this.#x.get(t)??!1}setExtraScrollBoundary(t){if(R(this.#t),"number"!=typeof t||Number.isNaN(t))throw new TypeError("setExtraScrollBoundary(value): value must be a valid number");this.#K=t}getExtraScrollBoundary(){return R(this.#t),this.#K}getLastKnownScrollBottomOffset(){return R(this.#t),this.#X}scrollToBottom(){R(this.#t),this.#Q.scrollTop=this.#Q.scrollHeight}scrollToTop(){R(this.#t),this.#Q.scrollTop=0}isAtCustomBottom(){return R(this.#t),this.#M}isAtCustomTop(){return R(this.#t),this.#F}isAtBottom(){return R(this.#t),this.#H}isAtTop(){return R(this.#t),this.#I}isPastAtBottom(){return R(this.#t),this.#P}isPastAtTop(){return R(this.#t),this.#W}isPastAtCustomTop(){return R(this.#t),this.#k}isPastAtCustomBottom(){return R(this.#t),this.#O}isScrollPaused(){return R(this.#t),this.#V}isWindow(){return R(this.#t),this.#j}isDestroyed(){return this.#t}getAutoScrollBottom(){return R(this.#t),this.#z}getObserveMutations(){return R(this.#t),this.#$}getPreserveScrollOnLayoutShift(){return R(this.#t),this.#U}getDebounceTime(){return R(this.#t),this.#q}getElemAmount(){return R(this.#t),this.#J}getPrevElemAmount(){return R(this.#t),this.#Y}getQuerySelector(){return R(this.#t),this.#R}destroy(){if(this.#t)return;this.#N&&(this.#N.disconnect(),this.#N=null),this.#L&&(this.#L.disconnect(),this.#L=null);const t=this.#j?window:this.#Q;this.#B&&t.removeEventListener("scroll",this.#B),this.#v=new WeakMap,this.#S=new WeakMap,this.#A=new WeakMap,this.#_=new WeakMap,this.#x=new WeakMap,this.#C=new WeakMap,this.removeAllListeners(),this.#tt.clear(),this.#D.clear(),this.#t=!0}}const V=j}};const e={};function r(n){const o=e[n];if(void 0!==o)return o.exports;const i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var o=e[n++],i=e[n++];r.o(t,o)?0===i&&n++:0===i?Object.defineProperty(t,o,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,o,{enumerable:!0,get:i})}else for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.cjs=t=>{const e={exports:{}};return t.call(e.exports,e,e.exports),e.exports};let n=r(516);window.TinySmartScroller=n.TinySmartScroller})();
|
|
1
|
+
(()=>{"use strict";const t={cw:t=>{var e;return()=>{if(t){var r=t;t=0,e={exports:{}},r.call(e.exports,e,e.exports)}return e.exports}},d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.d(e,{TinySmartScroller:()=>V});var r=t.cw(function(t,e){var r,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise(function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}g(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,o)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var o,i,s,a;if(l(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=c(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function p(){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 f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function m(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):h(o,o.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function o(i){n.once&&t.removeEventListener(e,o),r(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.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},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var c=l.length,u=h(l,c);for(r=0;r<c;++r)o(u[r],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return l(e),this.on(t,f(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,f(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,o,i,s;if(l(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;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[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return m(this,t,!0)},s.prototype.rawListeners=function(t){return m(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}),n={};t.r(n),t.d(n,{iu:()=>s,cq:()=>a,P8:()=>u,BO:()=>p,eh:()=>f,L2:()=>c,lP:()=>l,Kr:()=>i,wE:()=>m,D6:()=>d,PN:()=>v,t_:()=>T,aI:()=>y,ej:()=>E,kx:()=>h,Pd:()=>g,NW:()=>w,Qv:()=>b});var o={};t.r(o),t.d(o,{areElsCollBottom:()=>s,areElsCollLeft:()=>a,areElsCollPerfBottom:()=>u,areElsCollPerfLeft:()=>p,areElsCollPerfRight:()=>f,areElsCollPerfTop:()=>c,areElsCollRight:()=>l,areElsCollTop:()=>i,areElsColliding:()=>m,areElsPerfColliding:()=>d,getElsCollDetails:()=>v,getElsCollDirDepth:()=>T,getElsCollOverlap:()=>y,getElsCollOverlapPos:()=>E,getElsColliding:()=>h,getElsPerfColliding:()=>g,getElsRelativeCenterOffset:()=>w,getRectCenter:()=>b}),r();const i=(t,e)=>t.bottom<e.top,s=(t,e)=>t.top>e.bottom,a=(t,e)=>t.right<e.left,l=(t,e)=>t.left>e.right,c=(t,e)=>t.bottom<=e.top,u=(t,e)=>t.top>=e.bottom,p=(t,e)=>t.right<=e.left,f=(t,e)=>t.left>=e.right,m=(t,e)=>!(a(t,e)||l(t,e)||i(t,e)||s(t,e)),d=(t,e)=>!(p(t,e)||f(t,e)||c(t,e)||u(t,e)),h=(t,e)=>a(t,e)?"left":l(t,e)?"right":i(t,e)?"top":s(t,e)?"bottom":null,g=(t,e)=>p(t,e)?"left":f(t,e)?"right":c(t,e)?"top":u(t,e)?"bottom":null,y=(t,e)=>({overlapLeft:e.right-t.left,overlapRight:t.right-e.left,overlapTop:e.bottom-t.top,overlapBottom:t.bottom-e.top}),E=({overlapLeft:t=-1,overlapRight:e=-1,overlapTop:r=-1,overlapBottom:n=-1}={})=>({dirX:t<e?"right":"left",dirY:r<n?"bottom":"top"}),b=t=>({x:t.left+t.width/2,y:t.top+t.height/2});function w(t,e){const r=t.left+t.width/2,n=t.top+t.height/2;return{x:e.left+e.width/2-r,y:e.top+e.height/2-n}}function T(t,e){if(!d(t,e))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}=y(t,e),{dirX:s,dirY:a}=E({overlapLeft:r,overlapRight:n,overlapTop:o,overlapBottom:i}),l=Math.min(r,n),c=Math.min(o,i);let u;return u=l<c?s:a,{inDir:u,dirX:s,dirY:a,depthX:l,depthY:c}}function v(t,e){const r=d(t,e),n={in:null,x:null,y:null},o={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:a,overlapTop:l,overlapBottom:c}=y(e,t);i.top=l,i.bottom=c,i.left=s,i.right=a;const u=Object.entries(i).filter(([,t])=>t>0).sort((t,e)=>t[1]-e[1]),{dirX:p,dirY:f}=E({overlapLeft:a,overlapRight:s,overlapTop:c,overlapBottom:l});return n.y=f,n.x=p,i.bottom<0?o.y="bottom":i.top<0&&(o.y="top"),i.left<0?o.x="left":i.right<0&&(o.x="right"),n.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":u.length?u[0][0]:"top":null,{dirs:n,depth:i,isNeg:o}}const S=t=>e=>{if(e)throw new Error(`This ${t} instance has been destroyed and can no longer be used.`)},A=S("TinyElementObserver"),_=class{#t=!1;get destroyed(){return this.#t}#e;get el(){return A(this.#t),this.#e}#r={};get settings(){return A(this.#t),this.#r}set settings(t){if(A(this.#t),"object"!=typeof t||null===t)throw new TypeError("settings must be a non-null object.");this.#r=t}#n=null;get observer(){return A(this.#t),this.#n}#o=[];get detectors(){return A(this.#t),this.#o.map(t=>[t[0],t[1]])}set detectors(t){if(A(this.#t),!Array.isArray(t))throw new TypeError("detectors must be an array.");const e=[];for(const[r,n]of t){if("string"!=typeof r)throw new TypeError("Detector name must be a string.");if("function"!=typeof n)throw new TypeError(`Detector handler for "${r}" must be a function.`);e.push([r,n])}this.#o=e}get isActive(){return A(this.#t),!!this.#n}get size(){return A(this.#t),this.#o.length}constructor(t,{initDetectors:e=[],initCfg:r={}}={}){this.#e=t,e.length&&(this.detectors=e),r&&(this.settings=r)}clear(){A(this.#t),this.#o=[]}start(){if(A(this.#t),!this.#e)throw new Error("Cannot start observation: no target element has been set.");this.#n||(this.#n=new MutationObserver(t=>{t.forEach((t,e,r)=>this.#o.forEach(n=>n[1](t,e,r)))}),this.#n.observe(this.#e,this.#r))}stop(){A(this.#t),this.#n&&(this.#n.disconnect(),this.#n=null)}add(t,e){A(this.#t),this.#i(t,e),this.#o.push([t,e])}insertAtStart(t,e){A(this.#t),this.#i(t,e),this.#o.unshift([t,e])}insertAt(t,e,r,n="after"){if(A(this.#t),this.#i(e,r),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for insertDetectorAt.");const o="before"===n?t:t+1;this.#o.splice(o,0,[e,r])}removeAt(t){if(A(this.#t),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for removeDetectorAt.");this.#o.splice(t,1)}removeAround(t,e=0,r=0){if(A(this.#t),"number"!=typeof t||t<0||t>=this.#o.length)throw new RangeError("Invalid index for removeDetectorsAround.");const n=Math.max(0,t-e),o=e+1+r;this.#o.splice(n,o)}isIndexUsed(t){return A(this.#t),t>=0&&t<this.#o.length}hasHandler(t){if(A(this.#t),"function"!=typeof t)throw new TypeError("Handler must be a function.");return this.#o.some(([e,r])=>r===t)}#i(t,e){if("string"!=typeof t||!t.trim())throw new TypeError("Detector name must be a non-empty string.");if("function"!=typeof e)throw new TypeError(`Detector handler for "${t}" must be a function.`)}destroy(){this.#t||(this.stop(),this.clear(),this.#t=!0)}},{wE:x,D6:C,Kr:L,iu:N,cq:D,lP:B}=n,P=new WeakMap,W=new WeakMap,k=new WeakMap,O=new WeakMap,H={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class I{static Utils={...o};static#s=1;static get version(){return this.#s}static#a=!1;static get elemDebug(){return I.#a}static set elemDebug(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value for elemDebug");I.#a=t}static _debugElemError(t,e){if(!I.#a)return;const r="[TinyHtml Debug] Element validation error";if(console.groupCollapsed(`${r}${e?" — details below":""}`),console.error(r),"undefined"!=typeof Error&&"function"==typeof Error.captureStackTrace){const t=new Error(r);Error.captureStackTrace(t,I._debugElemError),console.error(t.stack)}else console.trace(r);if(Array.isArray(t)){const e=t.map((t,e)=>({index:e,typeOf:null===t?"null":typeof t,constructor:t?.constructor?.name??(null===t?"null":"primitive"),summary:"undefined"!=typeof Element&&t instanceof Element?`${t.tagName?.toLowerCase?.()??"element"}#${t.id||""}.${String(t.className||"").trim().replace(/\s+/g,".")}`:t&&"object"==typeof t&&"nodeType"in t?`nodeType:${t.nodeType}`:"",value:t}));console.table(e)}else console.warn('[TinyHtml Debug] "elems" is not an array:',t);arguments.length>1&&(console.error("[TinyHtml Debug] Problematic element:",e),e&&"object"==typeof e&&console.dir(e)),console.groupEnd()}static parseStyle(t){const e={};return t.split(";").forEach(t=>{const[r,n]=t.split(":").map(t=>t&&t.trim());r&&n&&(e[r]=n)}),e}static#l="undefined"!=typeof window&&void 0!==window.document?new _(window.document.documentElement,{initDetectors:[["tinyStyleEvent",t=>{if("attributes"!==t.type||"style"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.getAttribute("style")||"",n=function(t,e){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("Expected an object for 'oldStrings', but received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("Expected an object for 'newStrings', but received "+(null===e?"null":typeof e));const r={added:{},removed:{},modified:{}};for(const n in t)n in e?t[n]!==e[n]&&(r.modified[n]={old:t[n],new:e[n]}):r.removed[n]=t[n];for(const n in e)n in t||(r.added[n]=e[n]);return r}(I.parseStyle(e),I.parseStyle(r));(Object.keys(n.added).length||Object.keys(n.removed).length||Object.keys(n.modified).length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.stylechanged",{detail:n}))}],["tinyClassEvent",t=>{if("attributes"!==t.type||"class"!==t.attributeName||!(t.target instanceof HTMLElement))return;const e=t.oldValue||"",r=t.target.className||"",n=function(t,e){if(!Array.isArray(t))throw new TypeError("Argument 'oldItems' must be an array.");if(!Array.isArray(e))throw new TypeError("Argument 'newItems' must be an array.");const r=t.filter(t=>!e.includes(t));return{added:e.filter(e=>!t.includes(e)),removed:r}}(e.split(/\s+/).filter(Boolean),r.split(/\s+/).filter(Boolean));(n.added.length||n.removed.length)&&t.target.dispatchEvent(new CustomEvent("tinyhtml.classchanged",{detail:n}))}]],initCfg:{attributeOldValue:!0,attributes:!0,subtree:!0,attributeFilter:["style","class"]}}):void 0;static get tinyObserver(){return I.#l}static async fetchHtmlFile(t,e={method:"GET"}){const r=await fetch(t,e),n=r.headers.get("Content-Type")||"";if(!r.ok)throw new Error(`Failed to fetch: ${r.status} ${r.statusText}`);if(!n.includes("text/html"))throw new Error(`Invalid content type: ${n} (expected text/html)`);const o=await r.text();return I.htmlToJson(o)}static async fetchHtmlNodes(t,e){const r=await I.fetchHtmlFile(t,e);return I.jsonToNodes(r)}static async fetchHtmlTinyElems(t,e){const r=await I.fetchHtmlNodes(t,e);return I.toTinyElm(r)}static templateToJson(t){return I.htmlToJson([...t.content.childNodes].map(t=>t instanceof Element?t.getHTML():t instanceof Text?t.textContent:"").join(""))}static templateToNodes(t){const e=[];return[...t.content.cloneNode(!0).childNodes].map(t=>{if(!(t instanceof Element||t instanceof Text||t instanceof Comment))throw new Error(`Expected only Element nodes in <template>, but found: ${t.constructor.name}`);t instanceof Comment||e.push(t)}),e}static templateToTinyElems(t){return I.toTinyElm(I.templateToNodes(t))}static htmlToJson(t){const e=document.createElement("div");e.innerHTML=t.trim();const r=[],n=t=>{if(t instanceof Comment)return null;if(t instanceof Text){const e=t.textContent?.trim();return e||null}if(!(t instanceof Element))return null;const e=t.tagName.toLowerCase(),r={};for(const e of t.attributes)r[I.getPropName(e.name)]=e.value;const o=Array.from(t.childNodes).map(n).filter(Boolean);return o.length>0?[e,r,...o]:[e,r]};for(const t of e.childNodes){const e=n(t);e&&r.push(e)}return e.innerHTML="",r}static jsonToNodes(t){const e=t=>{if("string"==typeof t)return document.createTextNode(t);if(!Array.isArray(t))return document.createTextNode("");const[r,n,...o]=t,i=document.createElement(r);for(const[t,e]of Object.entries(n))i.setAttribute(I.getAttrName(t),e);for(const t of o){const r=e(t);r instanceof Comment||i.appendChild(r)}return i};return t.map(e).filter(t=>!(t instanceof Comment))}static jsonToTinyElems(t){return I.toTinyElm(I.jsonToNodes(t))}static createFrom(t,e){if("string"!=typeof t)throw new TypeError('The "tagName" must be a string.');if(void 0!==e&&"object"!=typeof e)throw new TypeError('The "attrs" must be a object.');const r=I.createElement(t);if("object"==typeof e)for(const t in e)r.setAttr(t,e[t]);return r}static createElement(t,e){if("string"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==e&&"object"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new I(document.createElement(t,e))}static createTextNode(t){if("string"!=typeof t)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new I(document.createTextNode(t))}static createElementFromHTML(t){const e=document.createElement("template");if(!(t=t.trim()).startsWith("<"))return I.createTextNode(t);if(e.innerHTML=t,!(e.content.firstChild instanceof Element))throw new Error("The HTML string must contain a valid HTML element.");return new I(e.content.firstChild)}static createFromHTML(t){const e=document.createElement("template");t=t.trim(),e.innerHTML=t;const r=Array.from(e.content.childNodes);if(!r.every(t=>t instanceof Element||t instanceof Text))throw new Error("The HTML string must contain a valid HTML element.");return new I(r)}static createFromHtml(t){return I.createFromHTML(t)}static query(t,e=document){const r=e.querySelector(t);return r?new I(r):null}querySelector(t){return I.query(t,I._preElem(this,"query"))}static queryAll(t,e=document){return new I(e.querySelectorAll(t))}querySelectorAll(t){return I.queryAll(t,I._preElem(this,"queryAll"))}static getById(t){const e=document.getElementById(t);return e?new I(e):null}static getByClassName(t,e=document){return new I(e.getElementsByClassName(t))}getElementsByClassName(t){return I.getByClassName(t,I._preElem(this,"getByClassName"))}static getByName(t){return new I(document.getElementsByName(t))}static getByTagNameNS(t,e="http://www.w3.org/1999/xhtml",r=document){return new I(r.getElementsByTagNameNS(e,t))}getElementsByTagNameNS(t,e="http://www.w3.org/1999/xhtml"){return I.getByTagNameNS(t,e,I._preElem(this,"getByTagNameNS"))}get elements(){return[...this.#e]}forEach(t){const e=this.elements.map((t,e)=>this.extract(e));for(const r in e)t(e[r],Number(r),e);return this}get(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#e[t])throw new Error(`No element found at index ${t}.`);return this.#e[t]}extract(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");if(!this.#e[t])throw new Error(`Cannot extract: no element exists at index ${t}.`);return new I(this.#e[t])}exists(t){if("number"!=typeof t)throw new TypeError("The index must be a number.");return!!this.#e[t]}_getElement(t,e){if(!(this.#e[e]instanceof Element||this.#e[e]instanceof Window||this.#e[e]instanceof Document||this.#e[e]instanceof Text))throw I._debugElemError([...this.#e],this.#e[e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return this.#e[e]}_getElements(t){if(!this.#e.every(t=>t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text))throw I._debugElemError([...this.#e]),new Error(`[TinyHtml] Invalid Element in ${t}().`);return[...this.#e]}static _preElemsTemplate(t,e,r,n){const o=t=>{const o=[];return t.map(i=>(i instanceof I?i._getElements(e):[i]).map(i=>{let s=!1;for(const t of r)if(i instanceof t){s=!0;break}if(!s)throw I._debugElemError([...t],i),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return o.push(i),i})),o};return Array.isArray(t)?o(t):o([t])}_preElemsTemplate(t,e,r){return I._preElemsTemplate(this,t,e,r)}static _preElemTemplate(t,e,r,n,o=!1){const i=t=>{const i=t[0],s=i instanceof I?i._getElements(e):[i];if(s.length>1)throw I._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${s.length}/1).`);let a=!1;for(const t of r)if(s[0]instanceof t){a=!0;break}if(!o||null!==s[0]&&void 0!==s[0]||(s[0]=null,a=!0),!a)throw I._debugElemError([...t],s[0]),new Error(`[TinyHtml] Invalid element of the list "${n.join(",")}" in ${e}().`);return s[0]};if(!Array.isArray(t))return i([t]);if(t.length>1)throw I._debugElemError([...t]),new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${t.length}/1).`);return i(t)}_preElemTemplate(t,e,r,n=!1){return I._preElemTemplate(this,t,e,r,n)}static _preElems(t,e){return I._preElemsTemplate(t,e,[Element],["Element"])}_preElems(t){return I._preElems(this,t)}static _preElem(t,e){return I._preElemTemplate(t,e,[Element],["Element"])}_preElem(t){return I._preElem(this,t)}static _preNodeElems(t,e){return I._preElemsTemplate(t,e,[Node],["Node"])}_preNodeElems(t){return I._preNodeElems(this,t)}static _preNodeElem(t,e){return I._preElemTemplate(t,e,[Node],["Node"])}_preNodeElem(t){return I._preNodeElem(this,t)}static _preNodeElemWithNull(t,e){return I._preElemTemplate(t,e,[Node],["Node"],!0)}_preNodeElemWithNull(t){return I._preNodeElemWithNull(this,t)}static _preHtmlElems(t,e){return I._preElemsTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElems(t){return I._preHtmlElems(this,t)}static _preHtmlElem(t,e){return I._preElemTemplate(t,e,[HTMLElement],["HTMLElement"])}_preHtmlElem(t){return I._preHtmlElem(this,t)}static _preInputElems(t,e){return I._preElemsTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElems(t){return I._preInputElems(this,t)}static _preInputElem(t,e){return I._preElemTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}_preInputElem(t){return I._preInputElem(this,t)}static _preEventTargetElems(t,e){return I._preElemsTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElems(t){return I._preEventTargetElems(this,t)}static _preEventTargetElem(t,e){return I._preElemTemplate(t,e,[EventTarget],["EventTarget"])}_preEventTargetElem(t){return I._preEventTargetElem(this,t)}static _preElemsAndWindow(t,e){return I._preElemsTemplate(t,e,[Element,Window],["Element","Window"])}_preElemsAndWindow(t){return I._preElemsAndWindow(this,t)}static _preElemAndWindow(t,e){return I._preElemTemplate(t,e,[Element,Window],["Element","Window"])}_preElemAndWindow(t){return I._preElemAndWindow(this,t)}static _preElemsAndWinAndDoc(t,e){return I._preElemsTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]).map(t=>t instanceof Document?t.documentElement:t)}_preElemsAndWinAndDoc(t){return I._preElemsAndWinAndDoc(this,t)}static _preElemAndWinAndDoc(t,e){const r=I._preElemTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}_preElemAndWinAndDoc(t){return I._preElemAndWinAndDoc(this,t)}static _preElemsWithDoc(t,e){return I._preElemsTemplate(t,e,[Element,Document],["Element","Document"])}_preElemsWithDoc(t){return I._preElemsWithDoc(this,t)}static _preElemWithDoc(t,e){return I._preElemTemplate(t,e,[Element,Document],["Element","Document"])}_preElemWithDoc(t){return I._preElemWithDoc(this,t)}static toTinyElm(t){const e=t=>t.map(t=>t instanceof I?t:new I(t));return Array.isArray(t)?e(t):e([t])}static fromTinyElm(t){const e=t=>{const e=[];return t.map(t=>(t instanceof I?t._getElements("fromTinyElm"):[t]).map(t=>e.push(t))),e};return Array.isArray(t)?e(t):e([t])}static winnow(t,e,r,n=!1){if("boolean"!=typeof n)throw new TypeError('The "not" must be a boolean.');if("function"==typeof e)return I._preElems(t,r).filter((t,r)=>!!e.call(t,r,t)!==n);if(e instanceof Element)return I._preElems(t,r).filter(t=>t===e!==n);if(Array.isArray(e)||"string"!=typeof e&&null!=e.length)return I._preElems(t,r).filter(t=>e.includes(t)!==n);let o=e;return n&&(o=`:not(${o})`),I._preElems(t,r).filter(t=>1===t.nodeType&&t.matches(o))}static filter(t,e,r=!1){return r&&(e=`:not(${e})`),I._preElems(t,"filter").filter(t=>1===t.nodeType&&t.matches(e))}static filterOnly(t,e){return I.winnow(t,e,"filterOnly",!1)}static not(t,e){return I.winnow(t,e,"not",!0)}not(t){return I.not(this,t)}static find(t,e){const r=[];for(const n of I._preElems(t,"find"))r.push(...n.querySelectorAll(e));return[...new Set(r)]}find(t){return I.find(this,t)}static is(t,e){return I.winnow(t,e,"is",!1).length>0}is(t){return I.is(this,t)}static has(t,e){const r="string"==typeof e?[...document.querySelectorAll(e)]:I._preElems(e,"has");return I._preElems(t,"has").filter(t=>r.some(e=>t&&t.contains(e)))}has(t){return I.has(this,t)}static closest(t,e,r){const n=[];for(const o of I._preElems(t,"closest")){let t=o;for(;t&&t!==r;){if(1===t.nodeType&&("string"==typeof e?t.matches(e):t===e)){n.push(t);break}t=t.parentElement}}return[...new Set(n)]}closest(t,e){return I.closest(this,t,e)}static isSameDom(t,e){return I._preNodeElem(t,"isSameDom")===I._preNodeElem(e,"isSameDom")}isSameDom(t){return I.isSameDom(this,t)}#c={};get _data(){return{...this.#c}}set _data(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("value must be a non-null object.");this.#c=t}static _dataSelector={public:(t,e)=>{const r=I._preElem(e,t);let n=W.get(r);return n||(n={},W.set(r,n)),n},private:(t,e)=>{if(!(e instanceof I))throw new Error(`Element must be a TinyHtml instance to execute ${t}().`);return e.#c}};static data(t,e,r=!1){const n=I._dataSelector[r?"private":"public"]("data",t);if(null==e)return{...n};if("string"!=typeof e)throw new TypeError("The key must be a string.");return n.hasOwnProperty(e)?n[e]:void 0}data(t,e){return I.data(this,t,e)}static setData(t,e,r,n=!1){const o=I._dataSelector[n?"private":"public"]("setData",t);if("string"!=typeof e)throw new TypeError("The key must be a string.");return void 0!==r?o[e]=r:I.removeData(t,e),t}setData(t,e,r=!1){return I.setData(this,t,e,r)}static hasData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");const n=I._dataSelector[r?"private":"public"]("hasData",t);return Object.prototype.hasOwnProperty.call(n,e)}hasData(t,e=!1){return I.hasData(this,t,e)}static removeData(t,e,r=!1){if("string"!=typeof e)throw new TypeError("The key must be a string.");return delete I._dataSelector[r?"private":"public"]("removeData",t)[e]}removeData(t,e=!1){return I.removeData(this,t,e)}static _getSibling(t,e,r){let n=I._preNodeElemWithNull(t,r);for(;n&&(n=n[e])&&1!==n.nodeType;);return n instanceof Node?n:null}static _getSiblings(t,e){let r=t;const n=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==e&&n.push(r);return n}static domDir(t,e,r,n="domDir"){if("string"!=typeof e)throw new TypeError('The "direction" must be a string.');let o=I._preNodeElemWithNull(t,n);const i=[];for(;o&&(o=o[e]);)if(1===o.nodeType){if(r&&("string"==typeof r?o.matches(r):o===r))break;i.push(o)}return i}static parent(t){let e=I._preNodeElemWithNull(t,"parent");const r=e?e.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return I.parent(this)}static parents(t,e){return I.domDir(t,"parentNode",e,"parents")}parents(t){return I.parents(this,t)}static next(t){return I._getSibling(t,"nextSibling","next")}next(){return I.next(this)}static prev(t){return I._getSibling(t,"previousSibling","prev")}prev(){return I.prev(this)}static nextAll(t){return I.domDir(t,"nextSibling",void 0,"nextAll")}nextAll(){return I.nextAll(this)}static prevAll(t){return I.domDir(t,"previousSibling",void 0,"prevAll")}prevAll(){return I.prevAll(this)}static nextUntil(t,e){return I.domDir(t,"nextSibling",e,"nextUtil")}nextUntil(t){return I.nextUntil(this,t)}static prevUntil(t,e){return I.domDir(t,"previousSibling",e,"prevUtil")}prevUntil(t){return I.prevUntil(this,t)}static siblings(t){const e=I._preNodeElemWithNull(t,"siblings");return I._getSiblings(e&&e.parentNode?e.parentNode.firstChild:null,e)}siblings(){return I.siblings(this)}static children(t){const e=I._preNodeElemWithNull(t,"children");return I._getSiblings(e?e.firstChild:null)}children(){return I.children(this)}static contents(t){const e=I._preNodeElemWithNull(t,"contents");return e instanceof HTMLIFrameElement&&null!=e.contentDocument&&Object.getPrototypeOf(e.contentDocument)?[e.contentDocument]:e instanceof HTMLTemplateElement?Array.from((e.content||e).childNodes):e?Array.from(e.childNodes):[]}contents(){return I.contents(this)}static clone(t,e=!0){if("boolean"!=typeof e)throw new TypeError('The "deep" must be a boolean.');return I._preNodeElems(t,"clone").map(t=>t.cloneNode(e))}clone(t){return I.clone(this,t)[0]}static _appendChecker(t,...e){const r=[];for(const n of e)if(null!=n&&!1!==n)if("string"!=typeof n&&"number"!=typeof n)if(n instanceof Node||n instanceof I)r.push(...I._preNodeElems(n,t));else if(Array.isArray(n))r.push(...I._appendChecker(t,...n));else for(const e in n){const o=n[e];r.push(...I._appendChecker(t,o))}else r.push(n);return r}static append(t,...e){return I._preElem(t,"append").append(...I._appendChecker("append",...e)),t}append(...t){return I.append(this,...t)}static prepend(t,...e){return I._preElem(t,"prepend").prepend(...I._appendChecker("prepend",...e)),t}prepend(...t){return I.prepend(this,...t)}static before(t,...e){return I._preElem(t,"before").before(...I._appendChecker("before",...e)),t}before(...t){return I.before(this,...t)}static after(t,...e){return I._preElem(t,"after").after(...I._appendChecker("after",...e)),t}after(...t){return I.after(this,...t)}static replaceWith(t,...e){return I._preElem(t,"replaceWith").replaceWith(...I._appendChecker("replaceWith",...e)),t}replaceWith(...t){return I.replaceWith(this,...t)}static appendTo(t,e){const r=I._preNodeElems(t,"appendTo"),n=I._preNodeElems(e,"appendTo");return n.forEach((t,e)=>{r.forEach(r=>t.appendChild(e===n.length-1?r:r.cloneNode(!0)))}),t}appendTo(t){return I.appendTo(this,t)}static prependTo(t,e){const r=I._preElems(t,"prependTo"),n=I._preElems(e,"prependTo");return n.forEach((t,e)=>{r.slice().reverse().forEach(r=>t.prepend(e===n.length-1?r:r.cloneNode(!0)))}),t}prependTo(t){return I.prependTo(this,t)}static insertBefore(t,e,r=null){const n=I._preNodeElem(t,"insertBefore"),o=I._preNodeElem(e,"insertBefore"),i=I._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert before.");return o.parentNode.insertBefore(n,i||o),t}insertBefore(t,e){return I.insertBefore(this,t,e)}static insertAfter(t,e,r=null){const n=I._preNodeElem(t,"insertAfter"),o=I._preNodeElem(e,"insertBefore"),i=I._preNodeElemWithNull(r,"insertBefore");if(!o.parentNode)throw new Error("The target element has no parent node to insert after.");return o.parentNode.insertBefore(n,i||o.nextSibling),t}insertAfter(t,e){return I.insertAfter(this,t,e)}static replaceAll(t,e){const r=I._preNodeElems(t,"replaceAll"),n=I._preNodeElems(e,"replaceAll");return n.forEach((t,e)=>{const o=t.parentNode;r.forEach(r=>{o&&o.replaceChild(e===n.length-1?r:r.cloneNode(!0),t)})}),t}replaceAll(t){return I.replaceAll(this,t)}#e;get size(){return this.#e.length}static _elCheck(t){for(const e of t)if(!(e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.")}add(t){return new I([...this.#e,...I._selector(t)])}static _selector(t){if(t instanceof I)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");const e=t=>Array.from(new Set(t)),r="string"!=typeof t?t:document.querySelectorAll(t);if(Array.isArray(r))return I._elCheck(r),e(r);if(r instanceof NodeList||r instanceof HTMLCollection){const t=[...r];return I._elCheck(t),e(t)}{const t=[r];return I._elCheck(t),e(t)}}constructor(t){this.#e=I._selector(t),this.#u=I.#p}static isWindow(t){return null!=t&&t===t.window}static css(t){const e=I._preElem(t,"css");return window.getComputedStyle(e)}css(){return I.css(this)}static cssString(t,e){const r=I._preElem(t,"cssString");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return"string"==typeof n?n:"number"==typeof n?n.toString():null}cssString(t){return I.cssString(this,t)}static cssList(t,e){const r=I._preElem(t,"cssList");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)void 0!==t&&(o[t]=n.getPropertyValue(t));return o}cssList(t){return I.cssList(this,t)}static cssFloat(t,e){const r=I._preElem(t,"cssFloat");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const n=window.getComputedStyle(r)[e];return parseFloat(n)||0}cssFloat(t){return I.cssFloat(this,t)}static cssFloats(t,e){const r=I._preElem(t,"cssFloats");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const n=window.getComputedStyle(r),o={};for(const t of e)o[t]=parseFloat(n[t])||0;return o}cssFloats(t){return I.cssFloats(this,t)}static#f={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(I.#f,{set:(t,e,r)=>(t[e]=r,I.cssPropRevAliases[r]=e,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(I.#f).map(([t,e])=>[e,t]));static toStyleKc(t){return"string"==typeof I.cssPropAliases[t]?I.cssPropAliases[t]:t}static toStyleCc(t){return"string"==typeof I.cssPropRevAliases[t]?I.cssPropRevAliases[t]:t}static setStyle(t,e,r=null){return I._preHtmlElems(t,"setStyle").forEach(t=>{if("object"==typeof e)for(const[r,n]of Object.entries(e))t.style.setProperty(I.toStyleKc(r),"string"==typeof n?n:"number"==typeof n?`${n}px`:String(n));else t.style.setProperty(I.toStyleKc(e),r)}),t}setStyle(t,e){return I.setStyle(this,t,e)}static getStyle(t,e){return I._preHtmlElem(t,"getStyle").style.getPropertyValue(I.toStyleKc(e))}getStyle(t){return I.getStyle(this,t)}static style(t,{camelCase:e=!1,rawAttr:r=!1}={}){if("boolean"!=typeof e)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof e);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const n=I._preHtmlElem(t,"style"),o={};if(r){const t=(n.getAttribute("style")||"").split(";");for(const r of t){const[t,n]=r.split(":");if(!t||!n)continue;const i=t.trim(),s=n.trim();o[e?I.toStyleCc(i):i]=s}}else{const t=n.style;for(let r=0;r<t.length;r++){const n=t[r],i=t.getPropertyValue(n);o[e?I.toStyleCc(n):n]=i}}return o}style(t){return I.style(this,t)}static removeStyle(t,e){return I._preHtmlElems(t,"removeStyle").forEach(t=>{if(Array.isArray(e))for(const r of e)t.style.removeProperty(I.toStyleKc(r));else t.style.removeProperty(I.toStyleKc(e))}),t}removeStyle(t){return I.removeStyle(this,t)}static toggleStyle(t,e,r,n){return I._preHtmlElems(t,"toggleStyle").forEach(t=>{const o=I.getStyle(t,e).trim()===I.toStyleKc(r)?n:r;I.setStyle(t,e,o)}),t}toggleStyle(t,e,r){return I.toggleStyle(this,t,e,r)}static clearStyle(t){return I._preElems(t,"clearStyle").forEach(t=>t.removeAttribute("style")),t}clearStyle(){return I.clearStyle(this)}static focus(t){return I._preHtmlElem(t,"focus").focus(),t}focus(){return I.focus(this)}static blur(t){return I._preHtmlElem(t,"blur").blur(),t}blur(){return I.blur(this)}static select(t){const e=I._preHtmlElem(t,"select");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("Element must be an <input> or <textarea> to use select().");return e.select(),t}select(){return I.select(this)}static boolCheck(t){return void 0!==t&&("true"===t||"1"===t||!0===t||"on"===t||"number"==typeof t&&t>0)}static setWinScrollTop(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");I.setScrollTop(window,t)}static setWinScrollLeft(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");I.setScrollLeft(window,t)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(t,e,r="content"){const n=I._preElemAndWinAndDoc(t,"getDimension");if("string"!=typeof e)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const o="width"===e?"Width":"Height";if(I.isWindow(n))return"margin"===r?n["inner"+o]:n.document.documentElement["client"+o];const i=n;if(9===i.nodeType){const t=i.documentElement;return Math.max(i.body["scroll"+o],t["scroll"+o],i.body["offset"+o],t["offset"+o],t["client"+o])}let s=i.getBoundingClientRect()[e];function a(t){return"width"===e?I.cssFloat(i,t+"Left")+I.cssFloat(i,t+"Right"):I.cssFloat(i,t+"Top")+I.cssFloat(i,t+"Bottom")}switch(r){case"content":s-=a("padding"),s-=a("border");break;case"padding":s-=a("border");break;case"border":break;case"margin":s+=a("margin")}return s}getDimension(t,e){return I.getDimension(this,t,e)}static setHeight(t,e){const r=I._preHtmlElem(t,"setHeight");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof e?`${e}px`:e,t}setHeight(t){return I.setHeight(this,t)}set height(t){I.setHeight(this,t)}static setWidth(t,e){const r=I._preHtmlElem(t,"setWidth");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof e?`${e}px`:e,t}setWidth(t){return I.setWidth(this,t)}set width(t){I.setWidth(this,t)}static height(t){const e=I._preElemAndWinAndDoc(t,"height");return I.getDimension(e,"height","content")}get height(){return I.height(this)}static width(t){const e=I._preElemAndWinAndDoc(t,"width");return I.getDimension(e,"width","content")}get width(){return I.width(this)}static innerHeight(t){const e=I._preElemAndWinAndDoc(t,"innerHeight");return I.getDimension(e,"height","padding")}innerHeight(){return I.innerHeight(this)}static innerWidth(t){const e=I._preElemAndWinAndDoc(t,"innerWidth");return I.getDimension(e,"width","padding")}innerWidth(){return I.innerWidth(this)}static outerHeight(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=I._preElemAndWinAndDoc(t,"outerHeight");return I.getDimension(r,"height",e?"margin":"border")}outerHeight(t){return I.outerHeight(this,t)}static outerWidth(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=I._preElemAndWinAndDoc(t,"outerWidth");return I.getDimension(r,"width",e?"margin":"border")}outerWidth(t){return I.outerWidth(this,t)}#u="";get mainDisplay(){return this.#u}set mainDisplay(t){if("string"!=typeof t)throw new TypeError("mainDisplay must be a string.");this.#u=t}static#p="block";static get defaultDisplay(){return I.#p}static set defaultDisplay(t){if("string"!=typeof t)throw new TypeError("defaultDisplay must be a string.");I.#p=t}static getAnimateData(t,e){let r=k.get(t);return r||(r={},k.set(t,r)),r[e]}static setAnimateData(t,e,r){if(!(t instanceof HTMLElement))throw new TypeError("setAnimateData: el must be an HTMLElement.");if("string"!=typeof e)throw new TypeError("setAnimateData: where must be a string.");if("string"!=typeof r&&"number"!=typeof r)throw new TypeError("setAnimateData: value must be a string or number.");let n=k.get(t);n||(n={},k.set(t,n)),n[e]=r}static#m=!0;static get cancelOldStyleFx(){return I.#m}static set cancelOldStyleFx(t){if("boolean"!=typeof t)throw new TypeError("Expected a boolean value.");I.#m=t}static#d={slow:{duration:600,easing:"ease"},fast:{duration:200,easing:"ease-out"},_default:{duration:400,easing:"linear"}};static get styleFxSpeeds(){const t={};for(const e in I.#d){const r=I.#d[e];t[e]="object"==typeof r?{...r}:r}return t}static set styleFxSpeeds(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleFxSpeeds must be an object.");for(const[e,r]of Object.entries(t))if("number"!=typeof r&&"object"!=typeof r)throw new TypeError(`styleFxSpeeds["${e}"] must be a number or KeyframeAnimationOptions.`);I.#d={};for(const[e,r]of Object.entries(t))I.setStyleFxSpeed(e,r)}static getStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=I.#d[t];return"object"==typeof e?{...e}:e}static setStyleFxSpeed(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("number"!=typeof e&&"object"!=typeof e)throw new TypeError("styleFxSpeed must be a number or KeyframeAnimationOptions");I.#d[t]="object"==typeof e?{...e}:e}static deleteStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete I.#d[t]}static hasStyleFxSpeed(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(I.#d,t)}static#h=["Top","Right","Bottom","Left"];static#g={slideDown:I.genStyleFx("show"),slideUp:I.genStyleFx("hide"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}};static get styleEffects(){return JSON.parse(JSON.stringify(I.#g))}static set styleEffects(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffects must be an object");for(const e in t)for(const[r,n]of Object.entries(t[e]))if(!("string"==typeof n||Array.isArray(n)&&n.every(t=>"string"==typeof t||"number"==typeof t)))throw new TypeError(`Invalid styleEffect["${r}"]`);I.#g={};for(const e in t)I.setStyleEffect(e,t[e])}static getStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');const e=I.#g[t];return e?JSON.parse(JSON.stringify(e)):void 0}static setStyleEffect(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError("styleEffect must be an object");const r={};for(const[t,n]of Object.entries(e))if("string"==typeof n)r[t]=n;else{if(!Array.isArray(n)||!n.every(t=>"string"==typeof t||"number"==typeof t))throw new TypeError(`Invalid styleEffect["${t}"]`);r[t]=[...n]}I.#g[t]=r}static deleteStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete I.#g[t]}static hasStyleEffect(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(I.#g,t)}static#y={slideDown:"slideUp",slideUp:"slideDown",fadeIn:"fadeOut",fadeOut:"fadeIn",fadeTo:"fadeIn"};static get styleEffectInverse(){return{...I.#y}}static set styleEffectInverse(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectInverse must be an object.");for(const[e,r]of Object.entries(t))if("string"!=typeof r)throw new TypeError(`styleEffectInverse["${e}"] must be a string.`);I.#y={};for(const[e,r]of Object.entries(t))I.setStyleEffectInverse(e,r)}static getStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return I.#y[t]||null}static setStyleEffectInverse(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("string"!=typeof e)throw new TypeError(`styleEffectInverse["${t}"] must be a string.`);I.#y[t]=e}static deleteStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete I.#y[t]}static hasStyleEffectInverse(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(I.#y,t)}static#E={slideDown:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),slideUp:t=>t.height[0]===t.height[1]&&(!t.width||t.width[0]===t.width[1]),fadeIn:t=>Number(t.opacity[0])===Number(t.opacity[1]),fadeOut:t=>Number(t.opacity[0])===Number(t.opacity[1])};static get styleEffectsRd(){return{...I.#E}}static set styleEffectsRd(t){if("object"!=typeof t||null===t)throw new TypeError("styleEffectsRd must be an object.");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsRd["${e}"] must be a function.`);I.#E={};for(const[e,r]of Object.entries(t))I.setStyleEffectRd(e,r)}static getStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return I.#E[t]||null}static setStyleEffectRd(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsRd["${t}"] must be a function.`);I.#E[t]=e}static deleteStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete I.#E[t]}static hasStyleEffectRd(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(I.#E,t)}static#b={show:(t,e,r,n)=>{if("height"===r||"width"===r){const o=I.getAnimateData(t,`orig${r}`)||t.scrollHeight+"px";I.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,o]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=I.getAnimateData(t,r)||n[r];I.setAnimateData(t,r,o),e[r]=["0px",o]}else if("opacity"===r){const t=n.opacity;e[r]=[t,1]}else{const o=I.getAnimateData(t,r)||n[r];I.setAnimateData(t,r,o),e[r]=[o,n[r]||1]}},hide:(t,e,r,n)=>{if("height"===r||"width"===r){const o=I.getAnimateData(t,`orig${r}`)||n[r];I.setAnimateData(t,`orig${r}`,o);const i=n[r];e[r]=[i,0]}else if(r.startsWith("margin")||r.startsWith("padding")){const o=I.getAnimateData(t,r)||n[r];I.setAnimateData(t,r,o),e[r]=[n[r],"0px"]}else if("opacity"===r){const t=n.opacity;e[r]=[t,0]}else{const o=I.getAnimateData(t,r)||n[r];I.setAnimateData(t,r,o),e[r]=[o,0]}}};static get styleEffectsProps(){return{...I.#b}}static set styleEffectsProps(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new TypeError("styleEffectsProps must be an object");for(const[e,r]of Object.entries(t))if("function"!=typeof r)throw new TypeError(`styleEffectsProps["${e}"] must be a function`);I.#b={};for(const[e,r]of Object.entries(t))I.setStyleEffectProp(e,r)}static getStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return I.#b[t]||null}static setStyleEffectProp(t,e){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');if("function"!=typeof e)throw new TypeError(`styleEffectsProps["${t}"] must be a function`);I.#b[t]=e}static deleteStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return delete I.#b[t]}static hasStyleEffectProp(t){if("string"!=typeof t)throw new TypeError('The "name" parameter must be a string.');return Object.prototype.hasOwnProperty.call(I.#b,t)}static genStyleFx(t,e=!1){if("string"!=typeof t)throw new TypeError("genStyleFx: type must be a string.");if("boolean"!=typeof e)throw new TypeError("genStyleFx: includeWidth must be a boolean.");let r,n=0;const o={height:t},i=e?1:0;for(;n<4;n+=2-i)r=I.#h[n],o["margin"+r]=t,o["padding"+r]=t;return e&&(o.opacity=t,o.width=t),o}static applyStyleFx(t,e,r,n){if("string"!=typeof e)throw new TypeError("applyStyleFx: id must be a string.");if("object"!=typeof r||null===r)throw new TypeError("applyStyleFx: props must be a non-null object.");if(void 0!==n&&"number"!=typeof n&&"string"!=typeof n&&("object"!=typeof n||null===n))throw new TypeError("applyStyleFx: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return I._preHtmlElems(t,"applyStyleFx").forEach(i=>{const s={};for(const[t,e]of Object.entries(r))if("string"==typeof e&&this.#b[e]){const r=getComputedStyle(i);this.#b[e](i,s,t,r)}else{if("object"!=typeof e)throw new TypeError(`applyStyleFx: invalid action for prop "${t}". Must be string or array.`);s[t]=e}if("function"==typeof I.#E[e]&&I.#E[e](s))return void o.set(i,null);const a=[],l=s[Object.keys(s)[0]].length;for(let t=0;t<l;t++){const e={};for(const r in s)e[r]=s[r][t];a.push(e)}o.set(i,I.animate(t,a,n,e)[0])}),o}applyStyleFx(t,e,r){return I.applyStyleFx(this,t,e,r)}static getCurrentAnimationId(t){if(!(t instanceof HTMLElement))throw new TypeError("Expected an HTMLElement.");return O.get(t)?.id??void 0}static animate(t,e,r=I.#d._default,n=null,o=I.#m){const i="string"==typeof r?I.#d[r]??void 0:"number"!=typeof r?{...r}:r;"object"==typeof i&&void 0===i.fill&&(i.fill="forwards");const s=[];return I._preHtmlElems(t,"animate").forEach(t=>{if(o){const e=O.get(t);e&&e.animation.cancel()}const r=t.animate(e,i);s.push(r),O.set(t,{animation:r,id:n??""}),r.addEventListener("finish",()=>{O.get(t)?.animation===r&&O.delete(t)})}),s}animate(t,e,r,n){return I.animate(this,t,e,r,n)}static stop(t){const e=[];return I._preHtmlElems(t,"stop").forEach(t=>{const r=O.get(t);r?(r.animation.cancel(),O.delete(t),e.push(!0)):e.push(!1)}),e}stop(){return I.stop(this)}static slideDown(t,e){return I.applyStyleFx(t,"slideDown",this.#g.slideDown,e??{duration:500,easing:"ease-out"})}slideDown(t){return I.slideDown(this,t)}static slideUp(t,e){return I.applyStyleFx(t,"slideUp",this.#g.slideUp,e??{duration:500,easing:"ease-out"})}slideUp(t){return I.slideUp(this,t)}static slideToggle(t,e){const r=I._preHtmlElem(t,"slideToggle"),n=getComputedStyle(r),o=I.getCurrentAnimationId(r),i="none"===n.display||0===r.offsetHeight;return("string"==typeof o?"slideUp"===o:i)?I.slideDown(t,e):I.slideUp(t,e)}slideToggle(t){return I.slideToggle(this,t)}static fadeIn(t,e){return I.applyStyleFx(t,"fadeIn",this.#g.fadeIn,e)}fadeIn(t){return I.fadeIn(this,t)}static fadeOut(t,e){return I.applyStyleFx(t,"fadeOut",this.#g.fadeOut,e)}fadeOut(t){return I.fadeOut(this,t)}static fadeToggle(t,e){const r=I._preHtmlElem(t,"fadeToggle"),n=getComputedStyle(r),o=I.getCurrentAnimationId(r),i="0"===n.opacity||null===r.offsetParent;return("string"==typeof o?"fadeOut"===o:i)?I.fadeIn(t,e):I.fadeOut(t,e)}fadeToggle(t){return I.fadeToggle(this,t)}static fadeTo(t,e,r,n=I.#p){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new TypeError("fadeTo: opacity must be a number between 0 and 1.");if(void 0!==r&&"number"!=typeof r&&"string"!=typeof r&&("object"!=typeof r||null===r))throw new TypeError("fadeTo: ops must be a number, string, KeyframeAnimationOptions, or undefined.");const o=new Map;return I._preHtmlElems(t,"fadeTo").forEach(i=>{const s=getComputedStyle(i);if(!(t instanceof Element&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length))){const t=I.getAnimateData(i,"origdisplay");i.style.display="string"==typeof t?t:n}const a=[s.opacity,e].map(t=>({opacity:t}));o.set(i,I.animate(i,a,r,"fadeTo")[0])}),o}fadeTo(t,e,r=this.#u){return I.fadeTo(this,t,e,r)}static offset(t){const e=I._preElem(t,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft;return{top:e.top+r,left:e.left+n}}offset(){return I.offset(this)}static position(t){const e=I._preHtmlElem(t,"position");let r,n,o={top:0,left:0};if("fixed"===window.getComputedStyle(e).position)n=e.getBoundingClientRect();else{n=I.offset(e),r=e.offsetParent||document.documentElement;const{position:t}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===t;)r=r.parentNode;if(r instanceof HTMLElement&&r!==e&&1===r.nodeType){const{borderTopWidth:t,borderLeftWidth:e}=I.cssFloats(r,["borderTopWidth","borderLeftWidth"]);o=I.offset(r),o.top+=t,o.left+=e}}return{top:n.top-o.top-I.cssFloat(e,"marginTop"),left:n.left-o.left-I.cssFloat(e,"marginLeft")}}position(){return I.position(this)}static offsetParent(t){let e=I._preHtmlElem(t,"offsetParent").offsetParent;for(;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position;)e=e.offsetParent;return e instanceof HTMLElement?e:document.documentElement}offsetParent(){return I.offsetParent(this)}static scrollTop(t){const e=I._preElemAndWindow(t,"scrollTop");return I.isWindow(e)?e.pageYOffset:9===e.nodeType?e.defaultView.pageYOffset:e.scrollTop}scrollTop(){return I.scrollTop(this)}static scrollLeft(t){const e=I._preElemAndWindow(t,"scrollLeft");return I.isWindow(e)?e.pageXOffset:9===e.nodeType?e.defaultView.pageXOffset:e.scrollLeft}scrollLeft(){return I.scrollLeft(this)}static easings={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};static scrollToXY(t,{targetX:e,targetY:r,duration:n,easing:o,onAnimation:i}={}){if(void 0!==e&&"number"!=typeof e)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==n&&"number"!=typeof n)throw new TypeError("`duration` must be a number if provided.");if(void 0!==o&&"string"!=typeof o)throw new TypeError("`easing` must be a string if provided.");if(void 0!==o&&"function"!=typeof I.easings[o])throw new TypeError(`Unknown easing function: "${o}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(t,e,r,n)=>{if(t instanceof Window)window.scrollTo(e,r);else if(9===t.nodeType)t.defaultView.scrollTo(e,r);else{const n=t instanceof Window?window.scrollX:t.scrollLeft,o=t instanceof Window?window.scrollY:t.scrollTop;n!==e&&(t.scrollLeft=e),o!==r&&(t.scrollTop=r)}"function"==typeof i&&i({x:e,y:r,isComplete:n>=1,time:n})};return I._preElemsAndWindow(t,"scrollToXY").forEach(t=>{const i=t instanceof Window?window.scrollX:t.scrollLeft,a=t instanceof Window?window.scrollY:t.scrollTop,l=e??i,c=r??a,u=l-i,p=c-a,f="string"==typeof o&&I.easings[o]||null;if("number"!=typeof n||"function"!=typeof f)return s(t,l,c,1);const m=performance.now(),d=n??0;requestAnimationFrame(function e(r){if("function"!=typeof f)return;const n=Math.min(1,(r-m)/d),o=f(n);s(t,i+u*o,a+p*o,n),n<1&&requestAnimationFrame(e)})}),t}scrollToXY({targetX:t,targetY:e,duration:r,easing:n,onAnimation:o}={}){return I.scrollToXY(this,{targetX:t,targetY:e,duration:r,easing:n,onAnimation:o})}static setScrollTop(t,e){if("number"!=typeof e)throw new TypeError("ScrollTop value must be a number.");return I.scrollToXY(t,{targetY:e})}setScrollTop(t){return I.setScrollTop(this,t)}static setScrollLeft(t,e){if("number"!=typeof e)throw new TypeError("ScrollLeft value must be a number.");return I.scrollToXY(t,{targetX:e})}setScrollLeft(t){return I.setScrollLeft(this,t)}static borderWidth(t){const e=I._preElem(t,"borderWidth"),{borderLeftWidth:r,borderRightWidth:n,borderTopWidth:o,borderBottomWidth:i}=I.cssFloats(e,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}borderWidth(){return I.borderWidth(this)}static border(t){const e=I._preElem(t,"border"),{borderLeft:r,borderRight:n,borderTop:o,borderBottom:i}=I.cssFloats(e,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}border(){return I.border(this)}static margin(t){const e=I._preElem(t,"margin"),{marginLeft:r,marginRight:n,marginTop:o,marginBottom:i}=I.cssFloats(e,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}margin(){return I.margin(this)}static padding(t){const e=I._preElem(t,"padding"),{paddingLeft:r,paddingRight:n,paddingTop:o,paddingBottom:i}=I.cssFloats(e,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+n,y:o+i,left:r,right:n,top:o,bottom:i}}padding(){return I.padding(this)}static#w=!1;static get classCanWhitespace(){return this.#w}static set classCanWhitespace(t){if("boolean"!=typeof t)throw new TypeError("classCanWhitespace must be a boolean");this.#w=t}static addClass(t,...e){const r=[];for(const t of e)if(I.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return I._preElems(t,"addClass").forEach(t=>t.classList.add(...r)),t}addClass(...t){return I.addClass(this,...t)}static removeClass(t,...e){const r=[];for(const t of e)if(I.#w){const e=t.split(" ");for(const t of e)r.push(t)}else r.push(t);return I._preElems(t,"removeClass").forEach(t=>t.classList.remove(...r)),t}removeClass(...t){return I.removeClass(this,...t)}static replaceClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const n=[];return I._preElems(t,"replaceClass").forEach(t=>n.push(t.classList.replace(e,r))),n}replaceClass(t,e){return I.replaceClass(this,t,e)[0]}static classItem(t,e){const r=I._preElem(t,"classItem");if("number"!=typeof e)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(e)}classItem(t){return I.classItem(this,t)}static toggleClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const n=[];return I._preElems(t,"toggleClass").forEach(t=>n.push(t.classList.toggle(e,r))),n}toggleClass(t,e){return I.toggleClass(this,t,e)[0]}static hasClass(t,e){const r=I._preElem(t,"hasClass");if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(e)}hasClass(t){return I.hasClass(this,t)}static classLength(t){return I._preElem(t,"classLength").classList.length}classLength(){return I.classLength(this)}static classList(t){return I._preElem(t,"classList").classList.values().toArray()}classList(){return I.classList(this)}static tagName(t){return I._preElem(t,"tagName").tagName}tagName(){return I.tagName(this)}static id(t){return I._preElem(t,"id").id}get id(){return I.id(this)}set id(t){I.setAttr(this,"id",t)}static toBigInt(t){const e=I._preElem(t,"toBigInt"),r=e.textContent?.trim();let n=null;try{n=BigInt(r??"")}catch{n=null}return n}toBigInt(){return I.toBigInt(this)}static setBigInt(t,e){if("bigint"!=typeof e)throw new Error("Value is not a valid BigInt.");const r=e.toString();return I._preElems(t,"setBigInt").forEach(t=>t.textContent=r),t}setBigInt(t){return I.setBigInt(this,t)}static toDate(t){const e=I._preElem(t,"toDate"),r=e.textContent?.trim();if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}toDate(){return I.toDate(this)}static setDate(t,e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new Error("Value is not a valid Date.");const r=e.toISOString();return I._preElems(t,"setDate").forEach(t=>t.textContent=r),t}setDate(t){return I.setDate(this,t)}static toJson(t){const e=I._preElem(t,"toJson"),r=e.textContent?.trim();if(!r)return null;try{return JSON.parse(r)}catch{return null}}toJson(){return I.toJson(this)}static setJson(t,e,r,n){const o=JSON.stringify(e,r,n);return I._preElems(t,"setJson").forEach(t=>t.textContent=o),t}setJson(t,e,r){return I.setJson(this,t,e,r)}static toNumber(t){const e=I._preElem(t,"toNumber");return"string"==typeof e.textContent?parseFloat(e.textContent.trim()):null}toNumber(){return I.toNumber(this)}static setNumber(t,e){if("number"!=typeof e)throw new Error("Value is not a valid number.");const r=e.toString();return I._preElems(t,"setNumber").forEach(t=>t.textContent=r),t}setNumber(t){return I.setNumber(this,t)}static toBoolean(t){const e=I._preElem(t,"toBoolean"),r=e.textContent?.trim();return null==r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}toBoolean(){return I.toBoolean(this)}static setBoolean(t,e){if("boolean"!=typeof e)throw new Error("Value is not a valid boolean.");const r=e.toString();return I._preElems(t,"setBoolean").forEach(t=>t.textContent=r),t}setBoolean(t){return I.setBoolean(this,t)}static toString(t){const e=I._preElem(t,"toString");return"string"==typeof e.textContent?e.textContent:null}toString(){return I.toString(this)}static setString(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return I._preElems(t,"setString").forEach(t=>t.textContent=e),t}setString(t){return I.setString(this,t)}static text(t){return I._preElem(t,"text").textContent}text(){return I.text(this)}static setText(t,e){const r=null!=e?String(e):"";return I._preElems(t,"setText").forEach(t=>t.textContent=r),t}setText(t){return I.setText(this,t)}static empty(t){return I._preElems(t,"empty").forEach(t=>t.textContent=""),t}empty(){return I.empty(this)}static html(t,e){return I._preElem(t,"html").getHTML(e)}html(t){return I.html(this,t)}static setHtml(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return I._preElems(t,"setHtml").forEach(t=>t.innerHTML=e),t}setHtml(t){return I.setHtml(this,t)}static _valHooks={option:{get:t=>{const e=t.getAttribute("value");return null!=e?e:t.textContent}},select:{get:t=>{const e=t.options,r=t.selectedIndex,n="select-one"===t.type,o=n?r+1:e.length,i=[];let s=r<0?o:n?r:0;for(;s<o;s++){const t=e[s],o=t.parentNode;if((t.selected||s===r)&&!t.disabled&&(!o||!o.disabled||"OPTGROUP"!==o.tagName)){const e=I._valHooks.option.get(t);if(n)return e;i.push(e)}}return i},set:(t,e)=>{const r=t.options,n=Array.isArray(e)?e.map(String):[String(e)];let o=!1;for(let t=0;t<r.length;t++){const e=r[t],i=I._valHooks.option.get(e);"string"==typeof i&&(e.selected=n.includes(i))&&(o=!0)}return o||(t.selectedIndex=-1),n}},radio:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e){const r=t.closest("label");return e&&r&&r.querySelectorAll('input[type="radio"]').forEach(e=>{e instanceof HTMLInputElement&&e!==t&&(e.checked=!1)}),t.checked=e,e}}},checkbox:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e)return t.checked=e,e}}};static setVal(t,e){return I._preInputElems(t,"setVal").forEach(t=>{if(1!==t.nodeType)return;let r="function"==typeof e?e(t,I.val(t)):e;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=((t,e)=>{const r=[];for(let n=0;n<t.length;n++)r.push(e(t[n]));return r})(r,t=>null==t?"":String(t)));const n=I._valHooks[t.type]||I._valHooks[t.nodeName.toLowerCase()];if(!n||"function"!=typeof n.set||void 0===n.set(t,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(t.value=r)}}),t}setVal(t){return I.setVal(this,t)}static _valTypes={string:t=>t.value,date:t=>t.valueAsDate,number:t=>t.valueAsNumber};static _getValByType(t,e,r){if("string"!=typeof e)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof I._valTypes[e])throw new Error(`No handler found for type "${e}" in ${r}().`);return I._valTypes[e](t)}static _val(t,e,r){const n=I._preInputElem(t,e),o=I._valHooks[n.type]||I._valHooks[n.nodeName.toLowerCase()];if(o&&"function"==typeof o.get){const t=o.get(n,"value",r);if(void 0!==t)return"string"==typeof t?t.replace(/\r/g,""):t}return I._getValByType(n,r,e)}_val(t,e){return I._val(this,t,e)}static val(t){return I._val(t,"val","string")}val(){return I.val(this)}static valTxt(t){const e=I._val(t,"valTxt","string");if("string"!=typeof e&&null!==e)throw new Error("Value is not a valid string.");return null==e?"":"string"==typeof e?e.replace(/\r/g,""):e}valTxt(){return I.valTxt(this)}static _valArr(t,e,r){const n=I._val(t,e,r);if(!Array.isArray(n))throw new Error(`Value expected an array but got ${typeof n}.`);return n}_valArr(t,e){return I._valArr(this,t,e)}static valArr(t){return I._valArr(t,"valArr","string")}valArr(){return I.valArr(this)}static valNb(t){if(!(I._preInputElem(t,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=I._val(t,"valNb","number");if(Number.isNaN(e))throw new Error("Value is not a valid number.");return e}valNb(){return I.valNb(this)}static valDate(t){if(!(I._preInputElem(t,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=I._val(t,"valDate","date");if(!(e instanceof Date))throw new Error("Value is not a valid date.");return e}valDate(){return I.valDate(this)}static valBool(t){const e=I._preInputElem(t,"valBool");if(!(e instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===I.val(e)}valBool(){return I.valBool(this)}static listenForPaste(t,{onFilePaste:e,onTextPaste:r}={}){if(void 0!==e&&"function"!=typeof e)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const n=t=>{if(!(t instanceof ClipboardEvent))return;const n=t.clipboardData?.items||[];for(const t of n)if("file"===t.kind){if("function"==typeof e){const r=t.getAsFile();r&&e(t,r)}}else"string"===t.kind&&"function"==typeof r&&t.getAsString(e=>r(t,e))};return I._preElemsWithDoc(t,"listenForPaste").forEach(t=>I.on(t,"paste",n)),n}listenForPaste({onFilePaste:t,onTextPaste:e}={}){return I.listenForPaste(this,{onFilePaste:t,onTextPaste:e})}static hasEventListener(t,e){const r=I._preEventTargetElem(t,"hasEventListener");if(!P.has(r))return!1;const n=P.get(r);return!!(n&&Array.isArray(n[e])&&n[e].length>0)}hasEventListener(t){return I.hasEventListener(this,t)}static hasExactEventListener(t,e,r){const n=I._preEventTargetElem(t,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!P.has(n))return!1;const o=P.get(n);return!(!o||!Array.isArray(o[e]))&&o[e].some(t=>t.handler===r)}hasExactEventListener(t,e){return I.hasExactEventListener(this,t,e)}static hover(t,e,r,n){return I.on(t,"mouseenter",e,n),I.on(t,"mouseleave",r||e,n),t}hover(t,e,r){return I.hover(this,t,e,r)}static on(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");I._preEventTargetElems(t,"on").forEach(t=>{t.addEventListener(o,r,n),P.has(t)||P.set(t,{});const e=P.get(t);e&&(Array.isArray(e[o])||(e[o]=[]),e[o].push({handler:r,options:n}))})}return t}on(t,e,r){return I.on(this,t,e,r)}static once(t,e,r,n={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");I._preEventTargetElems(t,"once").forEach(t=>{const e=n=>{I.off(t,o,e),"function"==typeof r&&r(n)};I.on(t,o,e,"boolean"==typeof n?n:{...n,once:!0})})}return t}once(t,e,r={}){return I.once(this,t,e,r)}static off(t,e,r,n){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const o of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof o)throw new TypeError("The event name must be a string.");I._preEventTargetElems(t,"off").forEach(t=>{t.removeEventListener(o,r,n);const e=P.get(t);e&&e[o]&&(e[o]=e[o].filter(t=>t.handler!==r),0===e[o].length&&delete e[o])})}return t}off(t,e,r){return I.off(this,t,e,r)}static offAll(t,e){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const r of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof r)throw new TypeError("The event name must be a string.");I._preEventTargetElems(t,"offAll").forEach(t=>{const e=P.get(t);if(e&&e[r]){for(const n of e[r])t.removeEventListener(r,n.handler,n.options);delete e[r]}})}return t}offAll(t){return I.offAll(this,t)}static offAllTypes(t,e=null){if(null!==e&&"function"!=typeof e)throw new TypeError('The "filterFn" must be a function.');return I._preEventTargetElems(t,"offAllTypes").forEach(t=>{const r=P.get(t);if(r){for(const n in r)for(const o of r[n])("function"!=typeof e||e(o.handler,n))&&t.removeEventListener(n,o.handler,o.options);P.delete(t)}}),t}offAllTypes(t=null){return I.offAllTypes(this,t)}static trigger(t,e,r={}){if(!("string"==typeof e||Array.isArray(e)&&e.every(t=>"string"==typeof t)))throw new TypeError("The events must be a string or array of strings.");for(const n of Array.isArray(e)?Array.from(new Set(e)):[e]){if("string"!=typeof n)throw new TypeError("The event name must be a string.");I._preEventTargetElems(t,"trigger").forEach(t=>{const e=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:r});t.dispatchEvent(e)})}return t}trigger(t,e={}){return I.trigger(this,t,e)}static#T={for:"htmlFor",class:"className"};static propFix=new Proxy(I.#T,{set:(t,e,r)=>(t[e]=r,I.attrFix[r]=e,!0)});static attrFix=Object.fromEntries(Object.entries(I.#T).map(([t,e])=>[e,t]));static getPropName(t){return"string"==typeof I.propFix[t]?I.propFix[t]:t}static getAttrName(t){return"string"==typeof I.attrFix[t]?I.attrFix[t]:t}static attrBigInt(t,e){const r=I._preElem(t,"attrBigInt").getAttribute(I.getAttrName(e));if(null==r)return null;try{return BigInt(r)}catch{return null}}attrBigInt(t){return I.attrBigInt(this,t)}static setAttrBigInt(t,e,r){if("bigint"!=typeof r)throw new Error("Value is not a valid BigInt.");return I.setAttr(t,e,r.toString())}setAttrBigInt(t,e){return I.setAttrBigInt(this,t,e)}static attrDate(t,e){const r=I._preElem(t,"attrDate").getAttribute(I.getAttrName(e));if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?null:n}attrDate(t){return I.attrDate(this,t)}static setAttrDate(t,e,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new Error("Value is not a valid Date.");return I.setAttr(t,e,r.toISOString())}setAttrDate(t,e){return I.setAttrDate(this,t,e)}static attrJson(t,e){const r=I._preElem(t,"attrJson").getAttribute(I.getAttrName(e));if(!r)return null;try{return JSON.parse(r)}catch{return null}}attrJson(t){return I.attrJson(this,t)}static setAttrJson(t,e,r,n,o){const i=JSON.stringify(r,n,o);return I.setAttr(t,e,i)}setAttrJson(t,e,r,n){return I.setAttrJson(this,t,e,r,n)}static attrNumber(t,e){const r=I._preElem(t,"attrNumber").getAttribute(I.getAttrName(e));return null!=r?parseFloat(r):null}attrNumber(t){return I.attrNumber(this,t)}static setAttrNumber(t,e,r){if("number"!=typeof r)throw new Error("Value is not a valid number.");return I.setAttr(t,e,r.toString())}setAttrNumber(t,e){return I.setAttrNumber(this,t,e)}static attrBoolean(t,e){const r=I._preElem(t,"attrBoolean").getAttribute(I.getAttrName(e));return null===r||"true"!==r&&"false"!==r?null:/^true$/i.test(r)}attrBoolean(t){return I.attrBoolean(this,t)}static setAttrBoolean(t,e,r){if("boolean"!=typeof r)throw new Error("Value is not a valid boolean.");return I.setAttr(t,e,r.toString())}setAttrBoolean(t,e){return I.setAttrBoolean(this,t,e)}static attrString(t,e){const r=I._preElem(t,"attrString").getAttribute(I.getAttrName(e));return"string"==typeof r?r:null}attrString(t){return I.attrString(this,t)}static setAttrString(t,e,r){if("string"!=typeof r)throw new Error("Value is not a valid string.");return I.setAttr(t,e,r)}setAttrString(t,e){return I.setAttrString(this,t,e)}static attr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return I._preElem(t,"attr").getAttribute(I.getAttrName(e))}attr(t){return I.attr(this,t)}static setAttr(t,e,r=null){const n=I._preElems(t,"setAttr");if("object"==typeof e&&null!==e)return Object.entries(e).forEach(([t,e])=>n.forEach(r=>{null===e?r.removeAttribute(I.getAttrName(t)):r.setAttribute(I.getAttrName(t),String(e))})),t;if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return n.forEach(t=>{null===r?t.removeAttribute(I.getAttrName(e)):t.setAttribute(I.getAttrName(e),String(r))}),t}setAttr(t,e){return I.setAttr(this,t,e)}static removeAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return I._preElems(t,"removeAttr").forEach(t=>t.removeAttribute(I.getAttrName(e))),t}removeAttr(t){return I.removeAttr(this,t)}static hasAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return I._preElem(t,"hasAttr").hasAttribute(I.getAttrName(e))}hasAttr(t){return I.hasAttr(this,t)}static hasProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return!!I._preElem(t,"hasProp")[I.getPropName(e)]}hasProp(t){return I.hasProp(this,t)}static addProp(t,...e){return I._preElems(t,"addProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[I.getPropName(e)]=!0})}),t}addProp(...t){return I.addProp(this,...t)}static removeProp(t,...e){return I._preElems(t,"removeProp").forEach(t=>{e.forEach(e=>{if("string"!=typeof e)throw new TypeError('Each "name" must be a string.');t[I.getPropName(e)]=!1})}),t}removeProp(...t){return I.removeProp(this,...t)}static toggleProp(t,e,r){const n=I._preElems(t,"toggleProp");if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');return(Array.isArray(e)?e:[e]).forEach(t=>{if("string"!=typeof t)throw new TypeError("Each property name must be a string.");n.forEach(e=>{(void 0===r?!e[I.getPropName(t)]:r)?I.addProp(e,t):I.removeProp(e,t)})}),t}toggleProp(t,e){return I.toggleProp(this,t,e)}static prop(t,e){if("string"!=typeof e)throw new TypeError('Invalid arguments passed to prop(). Expected string for "name".');return I._preElem(t,"prop")[e]}prop(t){return I.prop(this,t)}static setProp(t,e,r){if("string"!=typeof e||""===e.trim())throw new Error("Property name must be a non-empty string.");return I._preElems(t,"setProp").forEach(t=>{t[e]=r}),t}setProp(t,e){return I.setProp(this,t,e)}static remove(t){return I._preElems(t,"remove").forEach(t=>t.remove()),t}remove(){return I.remove(this)}static index(t,e=null){const r=I._preElem(t,"index");if(!r)return-1;if(!e)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(e){const t="string"==typeof e?document.querySelectorAll(e):I._preElems(e,"index");return Array.prototype.indexOf.call(t,r)}return-1}index(t){return I.index(this,t)}static _getCustomRect(t,e){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const e in t)"number"==typeof t[e]&&(r[e]=t[e]);if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("extraRect must be a non-null object.");const{height:n=0,width:o=0,top:i=0,bottom:s=0,left:a=0,right:l=0}=e;if("number"!=typeof n)throw new Error("extraRect.height must be a number.");if("number"!=typeof o)throw new Error("extraRect.width must be a number.");if("number"!=typeof i)throw new Error("extraRect.top must be a number.");if("number"!=typeof s)throw new Error("extraRect.bottom must be a number.");if("number"!=typeof a)throw new Error("extraRect.left must be a number.");if("number"!=typeof l)throw new Error("extraRect.right must be a number.");return r.height+=n,r.width+=o,r.top+=i,r.bottom+=s,r.left+=a,r.right+=l,r}static isCollWith(t,e,r={}){const n=I._getCustomRect(I._preElem(t,"isCollWith").getBoundingClientRect(),r),o=I._preElem(e,"isCollWith").getBoundingClientRect();return x(n,o)}isCollWith(t,e){return I.isCollWith(this,t,e)}static isCollPerfWith(t,e,r={}){const n=I._getCustomRect(I._preElem(t,"isCollPerfWith").getBoundingClientRect(),r),o=I._preElem(e,"isCollPerfWith").getBoundingClientRect();return C(n,o)}isCollPerfWith(t,e){return I.isCollPerfWith(this,t,e)}static _isCollWithLock(t,e,r,n,o){const i=H[o];if(t)return i.has(n)||i.set(n,!0),!0;if(i.has(n)){let t=!1;switch(o){case"top":t=L(e,r);break;case"bottom":t=N(e,r);break;case"left":t=D(e,r);break;case"right":t=B(e,r)}return t&&i.delete(n),i.has(n)}return!1}static isCollWithLock(t,e,r,n={}){const o=I._preElem(t,"isCollWithLock"),i=I._preElem(e,"isCollWithLock"),s=I._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=x(s,a);return I._isCollWithLock(l,s,a,o,r)}isCollWithLock(t,e,r){return I.isCollWithLock(this,t,e,r)}static isCollPerfWithLock(t,e,r,n={}){const o=I._preElem(t,"isCollPerfWithLock"),i=I._preElem(e,"isCollPerfWithLock"),s=I._getCustomRect(o.getBoundingClientRect(),n),a=i.getBoundingClientRect(),l=C(s,a);return I._isCollWithLock(l,s,a,o,r)}isCollPerfWithLock(t,e,r){return I.isCollPerfWithLock(this,t,e,r)}static resetCollLock(t){const e=I._preElem(t,"resetCollLock");let r=!1;for(const t of["top","bottom","left","right"])H[t].has(e)&&(H[t].delete(e),r=!0);return r}resetCollLock(){return I.resetCollLock(this)}static resetCollLockDir(t,e){const r=I._preElem(t,"resetCollLockDir"),n=H[e];return!!n.has(r)&&(n.delete(r),!0)}resetCollLockDir(t){return I.resetCollLockDir(this,t)}static isInViewport(t){const e=I._preElem(t,"isInViewport");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=I.offset(e).top,n=r+I.outerHeight(e),o=I.scrollTop(window),i=o+I.height(window);return n>o&&r<i}isInViewport(){return I.isInViewport(this)}static isScrolledIntoView(t){const e=I._preElem(t,"isScrolledIntoView");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=I.scrollTop(window),n=r+I.height(window),o=I.offset(e).top;return o+I.height(e)<=n&&o>=r}isScrolledIntoView(){return I.isScrolledIntoView(this)}static isInContainer(t,e){const r=I._preElem(t,"isInContainer"),n=I._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=o.bottom>i.top&&o.top<i.bottom,a=o.right>i.left&&o.left<i.right;return s&&a}isInContainer(t){return I.isInContainer(this,t)}static isFullyInContainer(t,e){const r=I._preElem(t,"isScrolledIntoView"),n=I._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();return o.top>=i.top&&o.bottom<=i.bottom&&o.left>=i.left&&o.right<=i.right}isFullyInContainer(t){return I.isFullyInContainer(this,t)}static hasScroll(t){const e=I._preElem(t,"hasScroll");return{v:e.scrollHeight>e.clientHeight,h:e.scrollWidth>e.clientWidth}}hasScroll(){return I.hasScroll(this)}}const F=I,M=S("TinySmartScroller"),R=r().EventEmitter;class j extends R{static Utils={...o,TinyHtml:F};#v=new WeakMap;#S=new WeakMap;#A=new WeakMap;#_=new WeakMap;#x=new WeakMap;#C=new WeakMap;#L=null;#N=null;#D=new Set(["IMG","IFRAME","VIDEO"]);#B=null;#P=!1;#W=!1;#k=!1;#O=!1;#H=!1;#I=!1;#F=!1;#M=!1;#R="";#j=!1;#t=!1;#V=!1;#z=!1;#$=!1;#U=!1;#q=0;#J=0;#Y=0;#X=0;#K=0;#G;#Q;#Z;#tt=new Set;constructor(t,{extraScrollBoundary:e=0,autoScrollBottom:r=!0,observeMutations:n=!0,preserveScrollOnLayoutShift:o=!0,debounceTime:i=100,querySelector:s=null,attributeFilter:a=["class","style","src","data-*","height","width"]}={}){if(super(),!(t instanceof Element||t===window))throw new TypeError("TinySmartScroller: 'target' must be a DOM Element or 'window', but got "+typeof t);if("number"!=typeof e||Number.isNaN(e))throw new TypeError(`TinySmartScroller: 'extraScrollBoundary' must be a valid number, received ${e}`);if("boolean"!=typeof r)throw new TypeError("TinySmartScroller: 'autoScrollBottom' must be a boolean, received "+typeof r);if("boolean"!=typeof n)throw new TypeError("TinySmartScroller: 'observeMutations' must be a boolean, received "+typeof n);if("boolean"!=typeof o)throw new TypeError("TinySmartScroller: 'preserveScrollOnLayoutShift' must be a boolean, received "+typeof o);if("number"!=typeof i||i<0||Number.isNaN(i))throw new TypeError(`TinySmartScroller: 'debounceTime' must be a non-negative number, received ${i}`);if(null!==s&&"string"!=typeof s)throw new TypeError("TinySmartScroller: 'querySelector' must be a string or null, received "+typeof s);if(!(null===a||Array.isArray(a)||a instanceof Set))throw new TypeError("TinySmartScroller: 'attributeFilter' must be an array, Set, or null. Got "+typeof a);let l;this.#Z=t,this.#Q=t instanceof Window?document.documentElement:t,this.#j=t instanceof Window,this.#z=r,this.#$=n,this.#U=o,this.#q=i,this.#K=e,this.#R=s||"",this.#G=new Set(a||void 0),this.#B=()=>{this._scrollDataUpdater(),clearTimeout(l),l=setTimeout(()=>this._onScroll(),this.#q)},(this.#j?window:this.#Q).addEventListener("scroll",this.#B,{passive:!0}),this.#$&&(this._observeMutations(),this._observeResizes(this.#Q.children)),this._scrollDataUpdater()}getSimpleOnHeight(t=[]){if(M(this.#t),!Array.isArray(t))throw new TypeError("getSimpleOnHeight(filter): filter must be an array of tag names");return(e,r,n)=>{if(t.length>0&&!t.includes(e.tagName)||n.now!==n.old)return;const o=r.old;return{height:r.now.height-o.height,width:0}}}addSimpleOnHeight(t){if(M(this.#t),!Array.isArray(t))throw new TypeError("addSimpleOnHeight(filter): filter must be an array of tag names");const e=this.getSimpleOnHeight(t);return this.onSize(e),e}getLoadTags(){return M(this.#t),Array.from(this.#D)}addLoadTag(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("addLoadTag(tag): tag must be a string");this.#D.add(t.toUpperCase())}removeLoadTag(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("removeLoadTag(tag): tag must be a string");this.#D.delete(t.toUpperCase())}hasLoadTag(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("hasLoadTag(tag): tag must be a string");return this.#D.has(t.toUpperCase())}resetLoadTags(t=!1){if(M(this.#t),"boolean"!=typeof t)throw new TypeError("resetLoadTags(addDefault): addDefault must be a boolean");this.#D.clear(),t&&(this.#D.add("IMG"),this.#D.add("IFRAME"),this.#D.add("VIDEO"))}getAttributeFilters(){return M(this.#t),Array.from(this.#G)}addAttributeFilter(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("addAttributeFilter(attr): attr must be a string");this.#G.add(t)}removeAttributeFilter(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("removeAttributeFilter(attr): attr must be a string");this.#G.delete(t)}hasAttributeFilter(t){if(M(this.#t),"string"!=typeof t)throw new TypeError("hasAttributeFilter(attr): attr must be a string");return this.#G.has(t)}resetAttributeFilters(t=!1){if(M(this.#t),"boolean"!=typeof t)throw new TypeError("resetAttributeFilters(addDefault): addDefault must be a boolean");this.#G.clear(),t&&["class","style","src","data-*","height","width"].forEach(t=>this.#G.add(t))}onSize(t){if(M(this.#t),"function"!=typeof t)throw new TypeError("onSize(handler): handler must be a function");this.#tt.add(t)}offSize(t){if(M(this.#t),"function"!=typeof t)throw new TypeError("offSize(handler): handler must be a function");this.#tt.delete(t)}_scrollDataUpdater(){const t=new Map;return this.#Q.querySelectorAll(this.#R||"*").forEach(e=>{const r=this.#A.get(e)??!1;this.#_.set(e,r);const n=F.isInContainer(this.#Q,e);this.#A.set(e,n),t.set(e,{oldIsVisible:r,isVisible:n})}),t}_onScroll(){if(this.#t)return;const t=this._scrollDataUpdater(),e=this.#Q,r=e.scrollTop,n=e.scrollHeight,o=e.clientHeight,i={scrollTop:r,scrollHeight:n,clientHeight:o};let s=null,a=null;const l=0===r,c=r+o>=n-1,u=r<=0+this.#K,p=r+o>=n-1-this.#K;l&&c?s="all":l?s="top":c&&(s="bottom"),u&&p?a="all":u?a="top":p&&(a="bottom"),this.#W=this.#I??!1,this.#P=this.#H??!1,this.#k=this.#F??!1,this.#O=this.#M??!1,this.#I=l,this.#H=c,this.#F=u,this.#M=p,this.#V=!(this.#z&&this.#H),this.#X=n-r-o,this.emit("onScrollBoundary",{status:s,...i,scrollCache:t}),this.emit("onExtraScrollBoundary",{status:a,...i,scrollCache:t}),this.#V?this.emit("onScrollPause",{...i,scrollCache:t}):this.emit("onAutoScroll",{...i,scrollCache:t})}_fixScroll(t=[]){if(this.#t)return;if(!Array.isArray(t))throw new TypeError("_fixScroll: targets must be an array of Elements");const e=this.#Q.scrollHeight,r=this.#Q.scrollTop,n=this.#Q.scrollHeight-this.#Q.scrollTop-this.#Q.clientHeight,o=this.#Q.scrollHeight-e,i=()=>{const e={height:0,width:0};for(const r of t){const t=this.#v.get(r)||{height:0,width:0},n=this.#S.get(r)||{height:0,width:0};this.#tt.forEach(o=>{const i=o(r,{old:t,now:n},{old:this.#Y,now:this.#J});if(this.#A.get(r)||this.#x.get(r)){if(void 0!==i&&"object"!=typeof i)throw new Error("_fixScroll: size filter must return an object or undefined");if(void 0===i)return;e.height=i.height,e.width=i.width}})}if("number"!=typeof e.height&&e.height<0)throw new Error("_fixScroll: invalid scrollSize.height value");if("number"!=typeof e.width&&e.width<0)throw new Error("_fixScroll: invalid scrollSize.width value");if(0!==e.height||0!==e.width)for(const e of t)this.#x.set(e,this.#A.get(e)??!1),this.#C.set(e,this.#_.get(e)??!1);return e};if(this.#Y>0&&F.hasScroll(this.#Q).v&&this.#z&&this.#U&&!this.#H&&!this.#I){const t=i();this.#Q.scrollTop=r+o+t.height,t.width>0&&(this.#Q.scrollLeft=this.#Q.scrollLeft+t.width)}else!this.#V&&this.#z?(i(),this.scrollToBottom()):this.#z||this.#H||(i(),this.#Q.scrollTop=this.#Q.scrollHeight-this.#Q.clientHeight-n)}_observeMutations(){this.#N=new MutationObserver(t=>{this.#t||(this._scrollDataUpdater(),this.#Y=this.#J,this.#J=this.#Q.childElementCount,t.forEach(t=>{t.addedNodes.forEach(t=>{if(t instanceof Element&&1===t.nodeType&&(this._observeResizes([t]),this._listenLoadEvents(t),this.#R)){const e=t.querySelectorAll(this.#R);this._observeResizes(e),this._listenLoadEvents(e)}})}),this._fixScroll())}),this.#N.observe(this.#Q,{childList:!0,subtree:!0,attributes:!0,attributeFilter:this.#G.size>0?Array.from(this.#G):void 0})}_observeResizes(t){this.#L||(this.#L=new ResizeObserver(t=>{if(this.#t)return;this._scrollDataUpdater();const e=[];for(const r of t){const t=r.target,n=this.#S.get(t);n&&this.#v.set(t,n);const{width:o,height:i}=r.contentRect;this.#S.set(t,{width:o,height:i}),e.push(t)}this._fixScroll(e)})),Array.from(t).forEach(t=>{if(!this.#L)throw new Error("_observeResizes: ResizeObserver instance is not initialized");this.#L.observe(t)})}_listenLoadEvents(t){this.#t||(t instanceof NodeList?Array.from(t):[t]).forEach(t=>{this.#D.has(t.tagName)&&(t.complete||t.addEventListener("load",()=>{this._scrollDataUpdater(),!this.#V&&this.#z&&this.scrollToBottom()}))})}get target(){return this.#Z}get targetElement(){return this.#Q}getOldSize(t){return M(this.#t),this.#v.get(t)??null}getNewSize(t){return M(this.#t),this.#S.get(t)??null}wasVisible(t){return M(this.#t),this.#_.get(t)??!1}isVisible(t){return M(this.#t),this.#A.get(t)??!1}wasTimedVisible(t){return M(this.#t),this.#C.get(t)??!1}isTimedVisible(t){return M(this.#t),this.#x.get(t)??!1}setExtraScrollBoundary(t){if(M(this.#t),"number"!=typeof t||Number.isNaN(t))throw new TypeError("setExtraScrollBoundary(value): value must be a valid number");this.#K=t}getExtraScrollBoundary(){return M(this.#t),this.#K}getLastKnownScrollBottomOffset(){return M(this.#t),this.#X}scrollToBottom(){M(this.#t),this.#Q.scrollTop=this.#Q.scrollHeight}scrollToTop(){M(this.#t),this.#Q.scrollTop=0}isAtCustomBottom(){return M(this.#t),this.#M}isAtCustomTop(){return M(this.#t),this.#F}isAtBottom(){return M(this.#t),this.#H}isAtTop(){return M(this.#t),this.#I}isPastAtBottom(){return M(this.#t),this.#P}isPastAtTop(){return M(this.#t),this.#W}isPastAtCustomTop(){return M(this.#t),this.#k}isPastAtCustomBottom(){return M(this.#t),this.#O}isScrollPaused(){return M(this.#t),this.#V}isWindow(){return M(this.#t),this.#j}isDestroyed(){return this.#t}getAutoScrollBottom(){return M(this.#t),this.#z}getObserveMutations(){return M(this.#t),this.#$}getPreserveScrollOnLayoutShift(){return M(this.#t),this.#U}getDebounceTime(){return M(this.#t),this.#q}getElemAmount(){return M(this.#t),this.#J}getPrevElemAmount(){return M(this.#t),this.#Y}getQuerySelector(){return M(this.#t),this.#R}destroy(){if(this.#t)return;this.#N&&(this.#N.disconnect(),this.#N=null),this.#L&&(this.#L.disconnect(),this.#L=null);const t=this.#j?window:this.#Q;this.#B&&t.removeEventListener("scroll",this.#B),this.#v=new WeakMap,this.#S=new WeakMap,this.#A=new WeakMap,this.#_=new WeakMap,this.#x=new WeakMap,this.#C=new WeakMap,this.removeAllListeners(),this.#tt.clear(),this.#D.clear(),this.#t=!0}}const V=j;window.TinySmartScroller=e.TinySmartScroller})();
|
|
@@ -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,{TinyStorageBucketFileSystem:()=>E});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})),n=Object.freeze(["utf8","utf-8","base64","hex"]),a=(t,e,i,r="")=>{const n=r.length>0?`, ${r}`:"",a=new Error(`${t}: ${e} '${i}'${n}`);return a.code=t,a.errno=t,a.syscall=e,a.path=i,a},s=(t,e,i,r="ENOTDIR")=>{if("undefined"!=typeof DOMException&&t instanceof DOMException)switch(t.name){case"NotFoundError":return a("ENOENT",e,i);case"TypeMismatchError":return a(r,e,i);case"InvalidModificationError":return a("ENOTEMPTY",e,i);case"NoModificationAllowedError":return a("EBUSY",e,i);case"NotAllowedError":return a("EACCES",e,i);default:return a("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 a("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||!n.includes(t))throw new TypeError(`The "encoding" option must be one of ${n.join(", ")}. Received ${String(t)} in ${e}()`);return t},u=(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 d{#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;#n;#a;#s;constructor(t,e,i){this.#r=t,this.#n=e,this.#a=i,this.#s=!1}get path(){return this.#n}get flags(){return this.#a}get closed(){return this.#s}async readFile(t){return this.#o(),this.#r.readFile(this.#n,t)}async writeFile(t,e){return this.#o(),this.#r.writeFile(this.#n,t,e)}async appendFile(t,e){return this.#o(),this.#r.appendFile(this.#n,t,e)}async stat(){return this.#o(),this.#r.stat(this.#n)}async truncate(t){return this.#o(),this.#r.truncate(this.#n,t)}async close(){this.#s=!0}#o(){if(this.#s)throw a("EBADF","read",this.#n,"file handle is closed")}}const p=t=>{const e=[];for(const i of t.split("/"))0!==i.length&&"."!==i&&(".."!==i?e.push(i):e.pop());return e},w=class{#c=new Map;#h;#u;#d;constructor(t={}){const{cwd:e="/",umask:i=18,identity:r}=c(t,"constructor");this.#h="string"==typeof e?e:"/",this.#u="number"==typeof i?i:18,this.#d={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.#u}get identity(){return this.#d}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"),n=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),n)}async writeFile(t,e,i={}){const r=o(t,"path"),{encoding:n,append:a,mode:s}=c(i,"writeFile"),u=((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(n,"writeFile")),d=await this.exists(r);if(await this._writeFile(r,u,{append:!0===a,mode:"number"==typeof s?s:void 0}),!d){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.#u,uid:this.#d.uid,gid:this.#d.gid,birthtimeMs:Date.now(),mtimeMs:Date.now(),atimeMs:Date.now()})}}async appendFile(t,e,i={}){const r=o(t,"path"),n=c(i,"appendFile");return this.writeFile(r,e,{...n,append:!0})}async readdir(t,e={}){const i=o(t,"path"),{withFileTypes:r,recursive:n}=c(e,"readdir"),a=await this._readdir(i),s=[];for(const t of a)if(s.push(!0===r?new l(t.name,t.kind):t.name),!0===n&&"directory"===t.kind){const n=`${i.replace(/\/$/,"")}/${t.name}`,a=await this.readdir(n,e);for(const e of a){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:n}=c(e,"mkdir");await this._mkdir(i,{recursive:!0===r});const a="number"==typeof n?n:511;return await this._writeMetadata(i,{mode:null,uid:null,gid:null,atimeMs:null,mtimeMs:null,birthtimeMs:null,mode:a&~this.#u,uid:this.#d.uid,gid:this.#d.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:n}=c(e,"rm");await this._rm(i,{recursive:!0===r,force:!0===n}),this.#c.delete(i)}async unlink(t){const e=o(t,"path"),i=await this.__stat(e);if(i?.isDirectory())throw a("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 n=await this._readMetadata(i);await this._writeMetadata(r,n),this.#c.delete(i)}async copyFile(t,e,i=0){const r=o(t,"sourcePath"),n=o(e,"destinationPath"),a="number"==typeof i?i:0;await this._copyFile(r,n,a);const s=await this._readMetadata(r);await this._writeMetadata(n,s)}async __stat(t,e={}){const i=o(t,"path"),{throwIfNoEntry:r}=c(e,"stat"),n=await this._stat(i);if(void 0===n){if(!1===r)return;throw a("ENOENT","stat",i)}const s=await this._readMetadata(i),h="directory"===n.kind?511:438;return new d({path:i,name:n.name,kind:n.kind,size:n.size,mode:s.mode??h,uid:s.uid??0,gid:s.gid??0,atimeMs:s.atimeMs??n.mtimeMs,mtimeMs:s.mtimeMs??n.mtimeMs,birthtimeMs:s.birthtimeMs??n.mtimeMs,ino:0})}async stat(t,e={}){const i=o(t,"path"),r=await this.__stat(i,e);if(void 0===r)throw a("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 n=await this.__stat(r);if(e===i.F_OK)return;if(!n)throw a("ENOENT","access",r);const s=this.#m(n.uid,n.gid),c=n.mode>>s&7;if(e&i.R_OK&&!(4&c))throw a("EACCES","access",r);if(e&i.W_OK&&!(2&c))throw a("EACCES","access",r);if(e&i.X_OK&&!(1&c))throw a("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"),n=await this._readMetadata(i);await this._writeMetadata(i,{...n,mode:r})}async chown(t,e,i){const r=o(t,"path"),n=u(e,"uid"),a=void 0===i?n:u(i,"gid"),s=await this._readMetadata(r);await this._writeMetadata(r,{...s,uid:n,gid:a})}async utimes(t,e,i){const r=o(t,"path"),n=u(e,"atimeMs"),a=void 0===i?n:u(i,"mtimeMs"),s=await this._readMetadata(r);await this._writeMetadata(r,{...s,atimeMs:n,mtimeMs:a})}async truncate(t,e=0){const i=o(t,"path"),r=u(e,"length"),n=await this.readFile(i),a=new Uint8Array(r);a.set(n.subarray(0,r)),await this.writeFile(i,a)}async realpath(t){const e=o(t,"path");return await this.__stat(e),`/${p(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 a("ENOSYS",t,e,`${t}() is not implemented by ${this.constructor.name}`)}#m(t,e){return t===this.#d.uid?6:e===this.#d.gid||this.#d.groups.includes(e)?3:0}},y=class extends w{#p;constructor(t={}){super(t),this.#p=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.#p)return this.#p;if("undefined"==typeof navigator||"function"!=typeof navigator.storage?.getDirectory)throw a("ENOSYS","getDirectory","/","OPFS is not available in this environment");return this.#p=await navigator.storage.getDirectory(),this.#p}async#w(t,e,i,r){let n=await this._resolveRoot();for(const a of t)try{n=await n.getDirectoryHandle(a,{create:e})}catch(t){throw s(t,i,r)}return n}async#y(t,e){const i=p(t),r=i.pop();if(void 0===r)throw a("EINVAL",e,t,"the root has no parent");return{parent:await this.#w(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,n=await t.getFile(),a=await e.getFileHandle(i,{create:!0}),s=await a.createWritable();await s.write(await n.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:n}=await this.#y(t,"writeFile"),a=e;try{const t=await r.getFileHandle(n,{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:a})}else await e.write(a);await e.close()}catch(e){throw s(e,"writeFile",t)}}async _readdir(t){const e=await this.#w(p(t),!1,"readdir",t);return this.#f(e,t)}async _mkdir(t,e){const i=p(t);if(0===i.length){if(!0===e.recursive)return;throw a("EEXIST","mkdir",t)}if(!0===e.recursive)return void await this.#w(i,!0,"mkdir",t);const{parent:r,name:n}=await this.#y(t,"mkdir");if((await this.#f(r,t)).some(t=>t.name===n))throw a("EEXIST","mkdir",t);try{await r.getDirectoryHandle(n,{create:!0})}catch(e){throw s(e,"mkdir",t)}}async _rm(t,e){const{parent:i,name:r}=await this.#y(t,"rm"),n=(await this.#f(i,t)).find(t=>t.name===r);if(void 0===n){if(!0===e.force)return;throw a("ENOENT","rm",t)}if("directory"===n.kind&&!0!==e.recursive){const e=await i.getDirectoryHandle(r);if((await this.#f(e,t)).length>0)throw a("ENOTEMPTY","rm",t)}try{await i.removeEntry(r,{recursive:!0===e.recursive})}catch(e){throw s(e,"rm",t)}}async _stat(t){const e=p(t);if(0===e.length)return{name:"/",kind:"directory",size:0,mtimeMs:Date.now()};const i=e.pop(),r=await this.#w(e,!1,"stat",t),n=(await this.#f(r,t)).find(t=>t.name===i);if(void 0===n)return;if("directory"===n.kind)return{name:i,kind:"directory",size:0,mtimeMs:Date.now()};const a=await r.getFileHandle(i),s=await a.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 a("ENOENT","rename",t);if("directory"===i.kind){const i=await this.#w(p(t),!1,"rename",t),r=await this.#w(p(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})}},f="tiny-fs";class g extends y{#E;#b;#k=null;constructor(t={}){super(t);const e=(t=>{if(void 0===t)return{name:f,options:{}};if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError('The "bucket" option must be of type object');const{name:e,durability:i,persisted:r,quota:n,expires:a}=t;if(void 0!==e&&("string"!=typeof e||0===e.length))throw new TypeError('The "bucket.name" option must be a non-empty string');if(void 0!==i&&"strict"!==i&&"relaxed"!==i)throw new TypeError('The "bucket.durability" option must be "strict" or "relaxed"');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "bucket.persisted" option must be of type boolean');if(void 0!==n){if(!Number.isInteger(n))throw new TypeError('The "bucket.quota" option must be an integer');if(n<0)throw new RangeError('The "bucket.quota" option must not be negative')}if(void 0!==a){if(!Number.isInteger(a))throw new TypeError('The "bucket.expires" option must be an integer');if(a<0)throw new RangeError('The "bucket.expires" option must not be negative')}return{name:e??f,options:{durability:i,persisted:r,quota:n,expires:a}}})(t.bucket);this.#E=e.name,this.#b=e.options}static get isSupported(){return"undefined"!=typeof navigator&&"object"==typeof navigator.storageBuckets&&null!==navigator.storageBuckets}static async listBuckets(){return g.#_("keys"),navigator.storageBuckets.keys()}static async deleteBucket(t){if("string"!=typeof t||0===t.length)throw new TypeError('The "name" argument must be a non-empty string');return g.#_("delete"),navigator.storageBuckets.delete(t)}get bucketName(){return this.#E}async _resolveRoot(){if(null!==this.#k)return this.#k;g.#_("open");const t=await navigator.storageBuckets.open(this.#E,this.#b);return this.#k=await t.getDirectory(),this.#k}static#_(t){if(!g.isSupported)throw a("ENOSYS",t,"/","the Storage Buckets API is not available in this environment")}}const E=g;window.TinyStorageBucketFileSystem=e.TinyStorageBucketFileSystem})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";const
|
|
1
|
+
(()=>{"use strict";const t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};let e={};t.d(e,{TinyTextDiffer:()=>s});const r=t=>{if(t)throw new Error("This TinyTextDiffer instance has been destroyed and can no longer be used.")};const s=class{#t=[];#e=!1;get destroyed(){return this.#e}get history(){return r(this.#e),[...this.#t]}set history(t){if(r(this.#e),!Array.isArray(t))throw new TypeError("History data must be provided as an array.");if(!t.every(t=>"string"==typeof t))throw new TypeError("All items in the history array must be strings.");this.#t=[...t]}get size(){return r(this.#e),this.#t.length}constructor(t=[]){this.history=t}#r(t){if("number"!=typeof t)throw new TypeError("The provided index must be a valid number.")}#s(t){if("string"!=typeof t)throw new TypeError("The provided text must be a valid string.")}get(t){if(r(this.#e),this.#r(t),void 0===this.#t[t])throw new Error(`No text version found at index ${t}.`);return this.#t[t]}has(t){return r(this.#e),this.#r(t),void 0!==this.#t[t]}add(t){r(this.#e),this.#s(t),this.#t.push(t)}remove(){return r(this.#e),this.#t.pop()}addAt(t,e){r(this.#e),this.#r(t),this.#s(e),this.#t.splice(t,0,e)}removeAt(t){r(this.#e),this.#r(t);const e=this.#t.length;return this.#t.splice(t,1),e!==this.#t.length}clear(){r(this.#e),this.#t=[]}compare(...t){r(this.#e);const e=t.length;if(0===e||e%2!=0)throw new Error("The compare method requires an even number of indices to form comparison pairs.");const s=[];for(let r=0;r<e;r+=2){const i=r+1;if(i>e-1)continue;this.#r(t[r]),this.#r(t[i]);const o=this.#t[t[r]],h=this.#t[t[i]];s.push(this._computeDiff(o,h))}return s}_computeDiff(t,e){const r=t.length,s=e.length,i=Array(r+1).fill(null).map(()=>Array(s+1).fill(0));let o=1,h=1;for(o=1;o<=r;o++)for(h=1;h<=s;h++)t[o-1]===e[h-1]?i[o][h]=i[o-1][h-1]+1:i[o][h]=Math.max(i[o-1][h],i[o][h-1]);o=r,h=s;const n=[];for(;o>0||h>0;)o>0&&h>0&&t[o-1]===e[h-1]?(n.unshift({value:t[o-1],type:"normal"}),o--,h--):h>0&&(0===o||i[o][h-1]>=i[o-1][h])?(n.unshift({value:e[h-1],type:"added"}),h--):o>0&&(0===h||i[o][h-1]<i[o-1][h])&&(n.unshift({value:t[o-1],type:"deleted"}),o--);return n.reduce((t,e)=>{const r=t.length-1;return t.length>0&&t[r].type===e.type?t[r].value+=e.value:t.push(e),t},[])}destroy(){this.#e||(this.#t=[],this.#e=!0)}};window.TinyTextDiffer=e.TinyTextDiffer})();
|