native-fn 1.0.63 → 1.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +2 -2
  2. package/dist/native.cjs +16 -14
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +16 -14
  6. package/dist/native.umd.js +16 -14
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +27 -20
  9. package/dist/plugin/app/index.d.ts +5 -0
  10. package/dist/plugin/app/index.min.cjs +1 -1
  11. package/dist/plugin/app/index.min.mjs +1 -1
  12. package/dist/plugin/app/index.mjs +27 -20
  13. package/dist/plugin/app/index.umd.js +27 -20
  14. package/dist/plugin/app/index.umd.min.js +1 -1
  15. package/dist/plugin/app/src/plugin/app/constants/index.d.ts +12 -0
  16. package/dist/plugin/app/src/plugin/app/cores/index.d.ts +3 -0
  17. package/dist/plugin/app/src/plugin/app/index.d.ts +1 -1
  18. package/dist/plugin/app/src/plugin/app/types/app.d.ts +6 -1
  19. package/dist/plugin/app/src/plugin/app/types/index.d.ts +2 -2
  20. package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +11 -0
  21. package/dist/plugin/app/src/plugin/appearance/cores/index.d.ts +3 -0
  22. package/dist/plugin/app/src/plugin/appearance/index.d.ts +8 -0
  23. package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +6 -0
  24. package/dist/plugin/app/src/plugin/appearance/types/index.d.ts +13 -0
  25. package/dist/plugin/app/src/plugin/camera/constants/inedx.d.ts +4 -0
  26. package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +3 -0
  27. package/dist/plugin/app/src/plugin/camera/index.d.ts +1 -1
  28. package/dist/plugin/app/src/plugin/camera/types/camera.d.ts +1 -1
  29. package/dist/plugin/app/src/plugin/camera/types/index.d.ts +1 -1
  30. package/dist/plugin/app/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  31. package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +3 -0
  32. package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +35 -0
  33. package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  34. package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +14 -0
  35. package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +3 -0
  36. package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -1
  37. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
  38. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +1 -1
  39. package/dist/plugin/appearance/index.cjs +766 -0
  40. package/dist/plugin/appearance/index.d.ts +100 -0
  41. package/dist/plugin/appearance/index.min.cjs +1 -0
  42. package/dist/plugin/appearance/index.min.mjs +1 -0
  43. package/dist/plugin/appearance/index.mjs +764 -0
  44. package/dist/plugin/appearance/index.umd.js +772 -0
  45. package/dist/plugin/appearance/index.umd.min.js +1 -0
  46. package/dist/plugin/appearance/src/constants/platform.d.ts +67 -0
  47. package/dist/plugin/appearance/src/errors/plugin-not-extended-error.d.ts +2 -0
  48. package/dist/plugin/appearance/src/plugin/app/constants/index.d.ts +12 -0
  49. package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +3 -0
  50. package/dist/plugin/appearance/src/plugin/app/errors/url-open-error.d.ts +2 -0
  51. package/dist/plugin/appearance/src/plugin/app/index.d.ts +12 -0
  52. package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +54 -0
  53. package/dist/plugin/appearance/src/plugin/app/types/index.d.ts +16 -0
  54. package/dist/plugin/appearance/src/plugin/app/utils/try-open-url.d.ts +16 -0
  55. package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +11 -0
  56. package/dist/plugin/appearance/src/plugin/appearance/cores/index.d.ts +3 -0
  57. package/dist/plugin/appearance/src/plugin/appearance/index.d.ts +8 -0
  58. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +6 -0
  59. package/dist/plugin/appearance/src/plugin/appearance/types/index.d.ts +13 -0
  60. package/dist/plugin/appearance/src/plugin/camera/constants/inedx.d.ts +4 -0
  61. package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +3 -0
  62. package/dist/plugin/appearance/src/plugin/camera/index.d.ts +8 -0
  63. package/dist/plugin/appearance/src/plugin/camera/types/camera.d.ts +4 -0
  64. package/dist/plugin/appearance/src/plugin/camera/types/index.d.ts +13 -0
  65. package/dist/plugin/appearance/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
  66. package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +3 -0
  67. package/dist/plugin/appearance/src/plugin/clipboard/index.d.ts +5 -0
  68. package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +4 -0
  69. package/dist/plugin/appearance/src/plugin/clipboard/types/index.d.ts +11 -0
  70. package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +35 -0
  71. package/dist/plugin/appearance/src/plugin/fullscreen/index.d.ts +5 -0
  72. package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +17 -0
  73. package/dist/plugin/appearance/src/plugin/fullscreen/types/index.d.ts +11 -0
  74. package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +14 -0
  75. package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +3 -0
  76. package/dist/plugin/appearance/src/plugin/theme/errors/easing-error.d.ts +6 -0
  77. package/dist/plugin/appearance/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
  78. package/dist/plugin/appearance/src/plugin/theme/index.d.ts +17 -0
  79. package/dist/plugin/appearance/src/plugin/theme/types/color.d.ts +17 -0
  80. package/dist/plugin/appearance/src/plugin/theme/types/easing-syntax.d.ts +16 -0
  81. package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +23 -0
  82. package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +24 -0
  83. package/dist/plugin/appearance/src/plugin/theme/utils/parse-color.d.ts +2 -0
  84. package/dist/plugin/appearance/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
  85. package/dist/plugin/appearance/src/types/event-listener-util.d.ts +11 -0
  86. package/dist/plugin/appearance/src/types/index.d.ts +1 -0
  87. package/dist/plugin/appearance/src/types/native.d.ts +27 -0
  88. package/dist/plugin/appearance/src/types/platform.d.ts +16 -0
  89. package/dist/plugin/appearance/src/utils/assign.d.ts +1 -0
  90. package/dist/plugin/appearance/src/utils/compare-version.d.ts +1 -0
  91. package/dist/plugin/appearance/src/utils/create-custom-error.d.ts +6 -0
  92. package/dist/plugin/appearance/src/utils/create-hidden-element.d.ts +1 -0
  93. package/dist/plugin/appearance/src/utils/dispatch-click-event.d.ts +1 -0
  94. package/dist/plugin/appearance/src/utils/event-listener-utils.d.ts +3 -0
  95. package/dist/plugin/appearance/src/utils/get-topmost-window.d.ts +1 -0
  96. package/dist/plugin/appearance/src/utils/is-secure-context.d.ts +1 -0
  97. package/dist/plugin/camera/index.cjs +17 -15
  98. package/dist/plugin/camera/index.min.cjs +1 -1
  99. package/dist/plugin/camera/index.min.mjs +1 -1
  100. package/dist/plugin/camera/index.mjs +17 -15
  101. package/dist/plugin/camera/index.umd.js +17 -15
  102. package/dist/plugin/camera/index.umd.min.js +1 -1
  103. package/dist/plugin/camera/src/plugin/app/constants/index.d.ts +12 -0
  104. package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +3 -0
  105. package/dist/plugin/camera/src/plugin/app/index.d.ts +1 -1
  106. package/dist/plugin/camera/src/plugin/app/types/app.d.ts +6 -1
  107. package/dist/plugin/camera/src/plugin/app/types/index.d.ts +2 -2
  108. package/dist/plugin/camera/src/plugin/appearance/constants/index.d.ts +11 -0
  109. package/dist/plugin/camera/src/plugin/appearance/cores/index.d.ts +3 -0
  110. package/dist/plugin/camera/src/plugin/appearance/index.d.ts +8 -0
  111. package/dist/plugin/camera/src/plugin/appearance/types/appearance.d.ts +6 -0
  112. package/dist/plugin/camera/src/plugin/appearance/types/index.d.ts +13 -0
  113. package/dist/plugin/camera/src/plugin/camera/constants/inedx.d.ts +4 -0
  114. package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +3 -0
  115. package/dist/plugin/camera/src/plugin/camera/index.d.ts +1 -1
  116. package/dist/plugin/camera/src/plugin/camera/types/camera.d.ts +1 -1
  117. package/dist/plugin/camera/src/plugin/camera/types/index.d.ts +1 -1
  118. package/dist/plugin/camera/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  119. package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +3 -0
  120. package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +35 -0
  121. package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  122. package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +14 -0
  123. package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +3 -0
  124. package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -1
  125. package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +1 -1
  126. package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +1 -1
  127. package/dist/plugin/clipboard/index.cjs +17 -15
  128. package/dist/plugin/clipboard/index.min.cjs +1 -1
  129. package/dist/plugin/clipboard/index.min.mjs +1 -1
  130. package/dist/plugin/clipboard/index.mjs +17 -15
  131. package/dist/plugin/clipboard/index.umd.js +17 -15
  132. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  133. package/dist/plugin/clipboard/src/plugin/app/constants/index.d.ts +12 -0
  134. package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +3 -0
  135. package/dist/plugin/clipboard/src/plugin/app/index.d.ts +1 -1
  136. package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +6 -1
  137. package/dist/plugin/clipboard/src/plugin/app/types/index.d.ts +2 -2
  138. package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +11 -0
  139. package/dist/plugin/clipboard/src/plugin/appearance/cores/index.d.ts +3 -0
  140. package/dist/plugin/clipboard/src/plugin/appearance/index.d.ts +8 -0
  141. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +6 -0
  142. package/dist/plugin/clipboard/src/plugin/appearance/types/index.d.ts +13 -0
  143. package/dist/plugin/clipboard/src/plugin/camera/constants/inedx.d.ts +4 -0
  144. package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +3 -0
  145. package/dist/plugin/clipboard/src/plugin/camera/index.d.ts +1 -1
  146. package/dist/plugin/clipboard/src/plugin/camera/types/camera.d.ts +1 -1
  147. package/dist/plugin/clipboard/src/plugin/camera/types/index.d.ts +1 -1
  148. package/dist/plugin/clipboard/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  149. package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +3 -0
  150. package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +35 -0
  151. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  152. package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +14 -0
  153. package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +3 -0
  154. package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -1
  155. package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +1 -1
  156. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +1 -1
  157. package/dist/plugin/fullscreen/index.cjs +336 -339
  158. package/dist/plugin/fullscreen/index.d.ts +10 -11
  159. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  160. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  161. package/dist/plugin/fullscreen/index.mjs +336 -339
  162. package/dist/plugin/fullscreen/index.umd.js +336 -339
  163. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  164. package/dist/plugin/fullscreen/src/plugin/app/constants/index.d.ts +12 -0
  165. package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +3 -0
  166. package/dist/plugin/fullscreen/src/plugin/app/index.d.ts +1 -1
  167. package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +6 -1
  168. package/dist/plugin/fullscreen/src/plugin/app/types/index.d.ts +2 -2
  169. package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +11 -0
  170. package/dist/plugin/fullscreen/src/plugin/appearance/cores/index.d.ts +3 -0
  171. package/dist/plugin/fullscreen/src/plugin/appearance/index.d.ts +8 -0
  172. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +6 -0
  173. package/dist/plugin/fullscreen/src/plugin/appearance/types/index.d.ts +13 -0
  174. package/dist/plugin/fullscreen/src/plugin/camera/constants/inedx.d.ts +4 -0
  175. package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +3 -0
  176. package/dist/plugin/fullscreen/src/plugin/camera/index.d.ts +1 -1
  177. package/dist/plugin/fullscreen/src/plugin/camera/types/camera.d.ts +1 -1
  178. package/dist/plugin/fullscreen/src/plugin/camera/types/index.d.ts +1 -1
  179. package/dist/plugin/fullscreen/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  180. package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +3 -0
  181. package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +35 -0
  182. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  183. package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +14 -0
  184. package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +3 -0
  185. package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -1
  186. package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +1 -1
  187. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +1 -1
  188. package/dist/plugin/theme/index.cjs +17 -15
  189. package/dist/plugin/theme/index.min.cjs +1 -1
  190. package/dist/plugin/theme/index.min.mjs +1 -1
  191. package/dist/plugin/theme/index.mjs +17 -15
  192. package/dist/plugin/theme/index.umd.js +17 -15
  193. package/dist/plugin/theme/index.umd.min.js +1 -1
  194. package/dist/plugin/theme/src/plugin/app/constants/index.d.ts +12 -0
  195. package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +3 -0
  196. package/dist/plugin/theme/src/plugin/app/index.d.ts +1 -1
  197. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +6 -1
  198. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +2 -2
  199. package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +11 -0
  200. package/dist/plugin/theme/src/plugin/appearance/cores/index.d.ts +3 -0
  201. package/dist/plugin/theme/src/plugin/appearance/index.d.ts +8 -0
  202. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +6 -0
  203. package/dist/plugin/theme/src/plugin/appearance/types/index.d.ts +13 -0
  204. package/dist/plugin/theme/src/plugin/camera/constants/inedx.d.ts +4 -0
  205. package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +3 -0
  206. package/dist/plugin/theme/src/plugin/camera/index.d.ts +1 -1
  207. package/dist/plugin/theme/src/plugin/camera/types/camera.d.ts +1 -1
  208. package/dist/plugin/theme/src/plugin/camera/types/index.d.ts +1 -1
  209. package/dist/plugin/theme/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  210. package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +3 -0
  211. package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +35 -0
  212. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  213. package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +14 -0
  214. package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +3 -0
  215. package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -1
  216. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
  217. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +1 -1
  218. package/dist/src/plugin/app/constants/index.d.ts +12 -0
  219. package/dist/src/plugin/app/cores/index.d.ts +3 -0
  220. package/dist/src/plugin/app/index.d.ts +1 -1
  221. package/dist/src/plugin/app/types/app.d.ts +6 -1
  222. package/dist/src/plugin/app/types/index.d.ts +2 -2
  223. package/dist/src/plugin/appearance/constants/index.d.ts +11 -0
  224. package/dist/src/plugin/appearance/cores/index.d.ts +3 -0
  225. package/dist/src/plugin/appearance/index.d.ts +8 -0
  226. package/dist/src/plugin/appearance/types/appearance.d.ts +6 -0
  227. package/dist/src/plugin/appearance/types/index.d.ts +13 -0
  228. package/dist/src/plugin/camera/constants/inedx.d.ts +4 -0
  229. package/dist/src/plugin/camera/cores/index.d.ts +3 -0
  230. package/dist/src/plugin/camera/index.d.ts +1 -1
  231. package/dist/src/plugin/camera/types/camera.d.ts +1 -1
  232. package/dist/src/plugin/camera/types/index.d.ts +1 -1
  233. package/dist/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
  234. package/dist/src/plugin/clipboard/cores/index.d.ts +3 -0
  235. package/dist/src/plugin/fullscreen/cores/index.d.ts +35 -0
  236. package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
  237. package/dist/src/plugin/theme/constants/index.d.ts +14 -0
  238. package/dist/src/plugin/theme/cores/index.d.ts +3 -0
  239. package/dist/src/plugin/theme/index.d.ts +1 -1
  240. package/dist/src/plugin/theme/types/index.d.ts +1 -1
  241. package/dist/src/plugin/theme/types/theme.d.ts +1 -1
  242. package/package.json +1 -1
@@ -256,7 +256,7 @@ function resolveSemanticAndroidVersion(version, defaultValue) {
256
256
  if (version.major === 21)
257
257
  return '5.0';
258
258
  if (version.major === 20)
259
- return '4.4W';
259
+ return '4.4';
260
260
  if (version.major === 19)
261
261
  return '4.4';
262
262
  if (version.major === 18)
@@ -448,19 +448,21 @@ if (IS_NODE_JS) {
448
448
  catch (_) {
449
449
  }
450
450
  }
451
- document.addEventListener("deviceready", function () {
452
- if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
453
- switch (globalThis.device.platform) {
454
- case 'Android':
455
- Platform.os = OS.Android;
456
- break;
457
- case 'iOS':
458
- Platform.os = OS.iOS;
459
- break;
451
+ if (typeof globalThis.document !== 'undefined') {
452
+ globalThis.document.addEventListener("deviceready", function () {
453
+ if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
454
+ switch (globalThis.device.platform) {
455
+ case 'Android':
456
+ Platform.os = OS.Android;
457
+ break;
458
+ case 'iOS':
459
+ Platform.os = OS.iOS;
460
+ break;
461
+ }
462
+ Platform.osVersion = globalThis.device.version;
460
463
  }
461
- Platform.osVersion = globalThis.device.version;
462
- }
463
- }, false);
464
+ }, false);
465
+ }
464
466
  if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
465
467
  navigator
466
468
  .userAgentData
@@ -490,6 +492,27 @@ Platform.isMobile = Platform.device === Devices.Mobile;
490
492
  Platform.isDesktop = Platform.device === Devices.Desktop;
491
493
  Platform.isStandalone = getIsStandalone(Platform.os);
492
494
 
495
+ var Index = {
496
+ get enabled() {
497
+ return getEnabled();
498
+ },
499
+ get element() {
500
+ return getElement();
501
+ },
502
+ get isFullscreen() {
503
+ return getIsFullscreen();
504
+ },
505
+ request: request,
506
+ exit: exit,
507
+ toggle: toggle,
508
+ onchange: onchange,
509
+ onerror: onerror,
510
+ };
511
+ var lastIOSVideo = null;
512
+ var lastElectronBrowserWindow = null;
513
+ var lastElectronBrowserWindowOptions = null;
514
+ var eventsBridged = false;
515
+ var api = detectApi();
493
516
  var API_VARIANTS = {
494
517
  standard: {
495
518
  enabled: 'fullscreenEnabled',
@@ -530,15 +553,15 @@ function detectApi() {
530
553
  var keys = ['webkit', 'moz', 'ms'];
531
554
  for (var i = 0; i < keys.length; i++) {
532
555
  var key = keys[i];
533
- var api = API_VARIANTS[key];
534
- if (api.enabled in globalThis.document || api.element in globalThis.document || api.exit in globalThis.document) {
556
+ var api_1 = API_VARIANTS[key];
557
+ if (api_1.enabled in globalThis.document || api_1.element in globalThis.document || api_1.exit in globalThis.document) {
535
558
  if (key === 'webkit' && 'webkitRequestFullScreen' in element)
536
- api.request = 'webkitRequestFullScreen';
537
- return api;
559
+ api_1.request = 'webkitRequestFullScreen';
560
+ return api_1;
538
561
  }
539
562
  }
540
563
  if ('webkitCurrentFullScreenElement' in globalThis.document) {
541
- var api = {
564
+ var api_2 = {
542
565
  enabled: 'webkitFullscreenEnabled',
543
566
  element: 'webkitCurrentFullScreenElement',
544
567
  request: 'webkitRequestFullscreen',
@@ -546,71 +569,79 @@ function detectApi() {
546
569
  events: API_VARIANTS.webkit.events,
547
570
  };
548
571
  if ('webkitRequestFullScreen' in element)
549
- api.request = 'webkitRequestFullScreen';
550
- return api;
572
+ api_2.request = 'webkitRequestFullScreen';
573
+ return api_2;
551
574
  }
552
575
  return null;
553
576
  }
554
- function createFullscreenUtils() {
555
- var api = detectApi();
556
- var lastIOSVideo = null;
557
- var lastElectronBrowserWindow = null;
558
- var lastElectronBrowserWindowOptions = null;
559
- var eventsBridged = false;
560
- function getDefaultTarget() {
561
- if (IS_ELECTRON) {
562
- var electron = require('electron');
563
- var focusedWindow = electron.BrowserWindow.getFocusedWindow();
564
- if (focusedWindow !== null)
565
- return focusedWindow;
566
- var allWindows = electron.BrowserWindow.getAllWindows();
567
- if (allWindows.length === 0)
568
- throw new Error();
569
- return allWindows[0];
570
- }
571
- if (OS.iOS === Platform.os) {
572
- var video = globalThis.document.querySelector('video');
573
- if (video === null)
574
- throw new Error();
575
- return video;
576
- }
577
- return globalThis.document.documentElement;
577
+ function getDefaultTarget() {
578
+ if (IS_ELECTRON) {
579
+ var electron = require('electron');
580
+ var focusedWindow = electron.BrowserWindow.getFocusedWindow();
581
+ if (focusedWindow !== null)
582
+ return focusedWindow;
583
+ var allWindows = electron.BrowserWindow.getAllWindows();
584
+ if (allWindows.length === 0)
585
+ throw new Error();
586
+ return allWindows[0];
578
587
  }
579
- function restoreElectronBrowserWindowOptions() {
580
- if (lastElectronBrowserWindowOptions !== null) {
581
- lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
582
- lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
583
- lastElectronBrowserWindowOptions = null;
584
- }
585
- lastElectronBrowserWindow = null;
588
+ if (OS.iOS === Platform.os) {
589
+ var video = globalThis.document.querySelector('video');
590
+ if (video === null)
591
+ throw new Error();
592
+ return video;
586
593
  }
587
- function bridgeEvents() {
588
- if (eventsBridged)
594
+ return globalThis.document.documentElement;
595
+ }
596
+ function restoreElectronBrowserWindowOptions() {
597
+ if (lastElectronBrowserWindowOptions !== null) {
598
+ lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
599
+ lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
600
+ lastElectronBrowserWindowOptions = null;
601
+ }
602
+ lastElectronBrowserWindow = null;
603
+ }
604
+ function bridgeEvents() {
605
+ if (eventsBridged)
606
+ return;
607
+ eventsBridged = true;
608
+ var dispatching = false;
609
+ function emit(type) {
610
+ if (dispatching)
589
611
  return;
590
- eventsBridged = true;
591
- var dispatching = false;
592
- function emit(type) {
593
- if (dispatching)
594
- return;
595
- dispatching = true;
596
- if (typeof globalThis.document !== 'undefined')
597
- globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
598
- Promise.resolve().then(function () {
599
- dispatching = false;
600
- });
601
- }
602
- function emitChange() {
603
- emit('fullscreenchange');
604
- }
605
- function emitError() {
606
- emit('fullscreenerror');
607
- }
608
- if (IS_ELECTRON) {
609
- try {
610
- var electron = require('electron');
611
- var allWindows = electron.BrowserWindow.getAllWindows();
612
- var _loop_1 = function (i) {
613
- var currentWindow = allWindows[i];
612
+ dispatching = true;
613
+ if (typeof globalThis.document !== 'undefined')
614
+ globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
615
+ Promise.resolve().then(function () {
616
+ dispatching = false;
617
+ });
618
+ }
619
+ function emitChange() {
620
+ emit('fullscreenchange');
621
+ }
622
+ function emitError() {
623
+ emit('fullscreenerror');
624
+ }
625
+ if (IS_ELECTRON) {
626
+ try {
627
+ var electron = require('electron');
628
+ var allWindows = electron.BrowserWindow.getAllWindows();
629
+ var _loop_1 = function (i) {
630
+ var currentWindow = allWindows[i];
631
+ currentWindow.on('enter-full-screen', function () {
632
+ lastElectronBrowserWindow = currentWindow;
633
+ emitChange();
634
+ });
635
+ currentWindow.on('leave-full-screen', function () {
636
+ restoreElectronBrowserWindowOptions();
637
+ emitChange();
638
+ });
639
+ };
640
+ for (var i = 0; i < allWindows.length; i++) {
641
+ _loop_1(i);
642
+ }
643
+ if (typeof electron.BrowserWindow.on === 'function') {
644
+ electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
614
645
  currentWindow.on('enter-full-screen', function () {
615
646
  lastElectronBrowserWindow = currentWindow;
616
647
  emitChange();
@@ -619,223 +650,145 @@ function createFullscreenUtils() {
619
650
  restoreElectronBrowserWindowOptions();
620
651
  emitChange();
621
652
  });
622
- };
623
- for (var i = 0; i < allWindows.length; i++) {
624
- _loop_1(i);
625
- }
626
- if (typeof electron.BrowserWindow.on === 'function') {
627
- electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
628
- currentWindow.on('enter-full-screen', function () {
629
- lastElectronBrowserWindow = currentWindow;
630
- emitChange();
631
- });
632
- currentWindow.on('leave-full-screen', function () {
633
- restoreElectronBrowserWindowOptions();
634
- emitChange();
635
- });
636
- });
637
- }
638
- }
639
- catch (_) {
640
- }
641
- }
642
- var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
643
- var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
644
- for (var i = 0; i < changeEvents.length; i++) {
645
- if (typeof globalThis.document !== 'undefined')
646
- globalThis.document.addEventListener(changeEvents[i], emitChange, false);
647
- }
648
- for (var i = 0; i < errorEvents.length; i++) {
649
- if (typeof globalThis.document !== 'undefined')
650
- globalThis.document.addEventListener(errorEvents[i], emitError, false);
651
- }
652
- if (OS.iOS === Platform.os) {
653
- bridgeIOSVideoEvents();
654
- if (typeof globalThis.MutationObserver !== 'undefined') {
655
- var observer = new MutationObserver(function () {
656
- bridgeIOSVideoEvents();
657
653
  });
658
- observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
659
654
  }
660
655
  }
656
+ catch (_) {
657
+ }
661
658
  }
662
- function bridgeIOSVideoEvents() {
663
- if (typeof globalThis.document !== 'undefined') {
664
- var videos = globalThis.document.querySelectorAll('video');
665
- videos.forEach(function (video) {
666
- if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
667
- return;
668
- function emitChange() {
669
- globalThis.document.dispatchEvent(new Event('fullscreenchange'));
670
- }
671
- video.addEventListener('webkitbeginfullscreen', emitChange, false);
672
- video.addEventListener('webkitendfullscreen', emitChange, false);
673
- video.__fsBridged__ = true;
659
+ var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
660
+ var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
661
+ for (var i = 0; i < changeEvents.length; i++) {
662
+ if (typeof globalThis.document !== 'undefined')
663
+ globalThis.document.addEventListener(changeEvents[i], emitChange, false);
664
+ }
665
+ for (var i = 0; i < errorEvents.length; i++) {
666
+ if (typeof globalThis.document !== 'undefined')
667
+ globalThis.document.addEventListener(errorEvents[i], emitError, false);
668
+ }
669
+ if (OS.iOS === Platform.os) {
670
+ bridgeIOSVideoEvents();
671
+ if (typeof globalThis.MutationObserver !== 'undefined') {
672
+ var observer = new MutationObserver(function () {
673
+ bridgeIOSVideoEvents();
674
674
  });
675
+ observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
675
676
  }
676
677
  }
677
- function getEnabled() {
678
- if (IS_ELECTRON) {
679
- try {
680
- var electron = require('electron');
681
- return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
682
- }
683
- catch (_) {
684
- return false;
678
+ }
679
+ function bridgeIOSVideoEvents() {
680
+ if (typeof globalThis.document !== 'undefined') {
681
+ var videos = globalThis.document.querySelectorAll('video');
682
+ videos.forEach(function (video) {
683
+ if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
684
+ return;
685
+ function emitChange() {
686
+ globalThis.document.dispatchEvent(new Event('fullscreenchange'));
685
687
  }
688
+ video.addEventListener('webkitbeginfullscreen', emitChange, false);
689
+ video.addEventListener('webkitendfullscreen', emitChange, false);
690
+ video.__fsBridged__ = true;
691
+ });
692
+ }
693
+ }
694
+ function getEnabled() {
695
+ if (IS_ELECTRON) {
696
+ try {
697
+ var electron = require('electron');
698
+ return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
686
699
  }
687
- if (api === null) {
688
- if (OS.iOS !== Platform.os)
689
- return false;
690
- var videos = globalThis.document.querySelectorAll('video');
691
- for (var i = 0; i < videos.length; i++) {
692
- var video = videos[i];
693
- if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
694
- return true;
695
- }
700
+ catch (_) {
696
701
  return false;
697
702
  }
698
- var enabledValue = globalThis.document[api.enabled];
699
- if (typeof enabledValue === 'boolean')
700
- return enabledValue;
701
- return typeof globalThis.document[api.element] !== 'undefined';
702
- }
703
- function getElement() {
704
- if (IS_ELECTRON) {
705
- if (lastElectronBrowserWindow !== null)
706
- return lastElectronBrowserWindow;
707
- try {
708
- var electron = require('electron');
709
- var allWindows = electron.BrowserWindow.getAllWindows();
710
- for (var i = 0; i < allWindows.length; i++) {
711
- var currentWindow = allWindows[i];
712
- if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
713
- return currentWindow;
714
- }
715
- return null;
716
- }
717
- catch (_) {
718
- return null;
703
+ }
704
+ if (api === null) {
705
+ if (OS.iOS !== Platform.os)
706
+ return false;
707
+ var videos = globalThis.document.querySelectorAll('video');
708
+ for (var i = 0; i < videos.length; i++) {
709
+ var video = videos[i];
710
+ if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
711
+ return true;
712
+ }
713
+ return false;
714
+ }
715
+ var enabledValue = globalThis.document[api.enabled];
716
+ if (typeof enabledValue === 'boolean')
717
+ return enabledValue;
718
+ return typeof globalThis.document[api.element] !== 'undefined';
719
+ }
720
+ function getElement() {
721
+ if (IS_ELECTRON) {
722
+ if (lastElectronBrowserWindow !== null)
723
+ return lastElectronBrowserWindow;
724
+ try {
725
+ var electron = require('electron');
726
+ var allWindows = electron.BrowserWindow.getAllWindows();
727
+ for (var i = 0; i < allWindows.length; i++) {
728
+ var currentWindow = allWindows[i];
729
+ if (currentWindow.isFullScreen() || (Platform.os === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
730
+ return currentWindow;
719
731
  }
732
+ return null;
720
733
  }
721
- if (api === null) {
722
- if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
723
- return lastIOSVideo;
734
+ catch (_) {
724
735
  return null;
725
736
  }
726
- var currentElement = globalThis.document[api.element];
727
- if (currentElement !== null && currentElement !== undefined)
728
- return currentElement;
729
- return null;
730
737
  }
731
- function getIsFullscreen() {
732
- return getElement() !== null;
738
+ if (api === null) {
739
+ if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
740
+ return lastIOSVideo;
741
+ return null;
733
742
  }
734
- function request(target, options) {
735
- if (target === void 0) { target = getDefaultTarget(); }
736
- if (IS_ELECTRON) {
737
- var browserWindow_1 = target;
738
- return new Promise(function (resolve, reject) {
739
- try {
740
- if (lastElectronBrowserWindow === null) {
741
- lastElectronBrowserWindowOptions = {
742
- fullScreenable: browserWindow_1.fullScreenable,
743
- autoHideMenuBar: browserWindow_1.autoHideMenuBar,
744
- };
745
- browserWindow_1.fullScreenable = true;
746
- browserWindow_1.autoHideMenuBar = true;
747
- }
748
- browserWindow_1.setFullScreen(true);
749
- lastElectronBrowserWindow = browserWindow_1;
750
- resolve();
751
- return;
752
- }
753
- catch (_) {
754
- reject();
755
- }
756
- });
757
- }
743
+ var currentElement = globalThis.document[api.element];
744
+ if (currentElement !== null && currentElement !== undefined)
745
+ return currentElement;
746
+ return null;
747
+ }
748
+ function getIsFullscreen() {
749
+ return getElement() !== null;
750
+ }
751
+ function request(target, options) {
752
+ if (target === void 0) { target = getDefaultTarget(); }
753
+ if (IS_ELECTRON) {
754
+ var browserWindow_1 = target;
758
755
  return new Promise(function (resolve, reject) {
759
- if (api !== null) {
760
- var method = target[api.request];
761
- if (typeof method === 'function') {
762
- try {
763
- var result = method.call(target, options);
764
- if (result !== undefined && typeof result.then === 'function') {
765
- result
766
- .then(function () {
767
- resolve();
768
- })
769
- .catch(function () {
770
- if (OS.iOS !== Platform.os) {
771
- reject();
772
- return;
773
- }
774
- fallbackToIOSVideo();
775
- });
776
- return;
777
- }
778
- else {
779
- resolve();
780
- return;
781
- }
782
- }
783
- catch (error) {
784
- if (OS.iOS !== Platform.os) {
785
- reject();
786
- return;
787
- }
788
- }
756
+ try {
757
+ if (lastElectronBrowserWindow === null) {
758
+ lastElectronBrowserWindowOptions = {
759
+ fullScreenable: browserWindow_1.fullScreenable,
760
+ autoHideMenuBar: browserWindow_1.autoHideMenuBar,
761
+ };
762
+ browserWindow_1.fullScreenable = true;
763
+ browserWindow_1.autoHideMenuBar = true;
789
764
  }
765
+ browserWindow_1.setFullScreen(true);
766
+ lastElectronBrowserWindow = browserWindow_1;
767
+ resolve();
768
+ return;
790
769
  }
791
- function fallbackToIOSVideo() {
792
- if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
793
- var video = target;
794
- if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
795
- lastIOSVideo = video;
796
- bridgeIOSVideoEvents();
797
- video.webkitEnterFullscreen();
798
- resolve();
799
- return;
800
- }
801
- }
770
+ catch (_) {
802
771
  reject();
803
772
  }
804
- fallbackToIOSVideo();
805
773
  });
806
774
  }
807
- function exit() {
808
- if (IS_ELECTRON) {
809
- return new Promise(function (resolve, reject) {
775
+ return new Promise(function (resolve, reject) {
776
+ if (api !== null) {
777
+ var method = target[api.request];
778
+ if (typeof method === 'function') {
810
779
  try {
811
- if (lastElectronBrowserWindow !== null) {
812
- lastElectronBrowserWindow.setFullScreen(false);
813
- restoreElectronBrowserWindowOptions();
814
- }
815
- else {
816
- var browserWindow = getElement();
817
- if (browserWindow !== null)
818
- browserWindow.setFullScreen(false);
819
- }
820
- resolve();
821
- }
822
- catch (_) {
823
- reject();
824
- }
825
- });
826
- }
827
- return new Promise(function (resolve, reject) {
828
- if (api !== null) {
829
- var method = globalThis.document[api.exit];
830
- if (typeof method === 'function') {
831
- var result = method.call(globalThis.document);
780
+ var result = method.call(target, options);
832
781
  if (result !== undefined && typeof result.then === 'function') {
833
782
  result
834
783
  .then(function () {
835
784
  resolve();
836
785
  })
837
786
  .catch(function () {
838
- reject();
787
+ if (OS.iOS !== Platform.os) {
788
+ reject();
789
+ return;
790
+ }
791
+ fallbackToIOSVideo();
839
792
  });
840
793
  return;
841
794
  }
@@ -844,103 +797,147 @@ function createFullscreenUtils() {
844
797
  return;
845
798
  }
846
799
  }
800
+ catch (error) {
801
+ if (OS.iOS !== Platform.os) {
802
+ reject();
803
+ return;
804
+ }
805
+ }
847
806
  }
848
- if (OS.iOS === Platform.os && lastIOSVideo !== null) {
849
- if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
850
- lastIOSVideo.webkitExitFullscreen();
851
- lastIOSVideo = null;
807
+ }
808
+ function fallbackToIOSVideo() {
809
+ if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
810
+ var video = target;
811
+ if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
812
+ lastIOSVideo = video;
813
+ bridgeIOSVideoEvents();
814
+ video.webkitEnterFullscreen();
852
815
  resolve();
853
816
  return;
854
817
  }
855
- var videos = globalThis.document.querySelectorAll('video');
856
- for (var i = 0; i < videos.length; i++) {
857
- var video = videos[i];
858
- if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
859
- video.webkitExitFullscreen();
860
- resolve();
861
- return;
862
- }
863
- }
864
818
  }
865
- if (!getElement()) {
819
+ reject();
820
+ }
821
+ fallbackToIOSVideo();
822
+ });
823
+ }
824
+ function exit() {
825
+ if (IS_ELECTRON) {
826
+ return new Promise(function (resolve, reject) {
827
+ try {
828
+ if (lastElectronBrowserWindow !== null) {
829
+ lastElectronBrowserWindow.setFullScreen(false);
830
+ restoreElectronBrowserWindowOptions();
831
+ }
832
+ else {
833
+ var browserWindow = getElement();
834
+ if (browserWindow !== null)
835
+ browserWindow.setFullScreen(false);
836
+ }
866
837
  resolve();
867
- return;
868
838
  }
869
- reject();
839
+ catch (_) {
840
+ reject();
841
+ }
870
842
  });
871
843
  }
872
- function toggle(target, options) {
873
- if (getIsFullscreen())
874
- return exit();
875
- else
876
- return request(target, options);
877
- }
878
- function onChange(handler) {
879
- var listeners = [];
880
- function listen(eventType) {
881
- function wrapper(event) {
882
- handler(event);
844
+ return new Promise(function (resolve, reject) {
845
+ if (api !== null) {
846
+ var method = globalThis.document[api.exit];
847
+ if (typeof method === 'function') {
848
+ var result = method.call(globalThis.document);
849
+ if (result !== undefined && typeof result.then === 'function') {
850
+ result
851
+ .then(function () {
852
+ resolve();
853
+ })
854
+ .catch(function () {
855
+ reject();
856
+ });
857
+ return;
858
+ }
859
+ else {
860
+ resolve();
861
+ return;
862
+ }
883
863
  }
884
- if (typeof globalThis.document === 'undefined')
864
+ }
865
+ if (OS.iOS === Platform.os && lastIOSVideo !== null) {
866
+ if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
867
+ lastIOSVideo.webkitExitFullscreen();
868
+ lastIOSVideo = null;
869
+ resolve();
885
870
  return;
886
- globalThis.document.addEventListener(eventType, wrapper, false);
887
- listeners.push(function () {
888
- globalThis.document.removeEventListener(eventType, wrapper, false);
889
- });
871
+ }
872
+ var videos = globalThis.document.querySelectorAll('video');
873
+ for (var i = 0; i < videos.length; i++) {
874
+ var video = videos[i];
875
+ if (typeof video.webkitExitFullscreen === 'function' && video.webkitDisplayingFullscreen === true) {
876
+ video.webkitExitFullscreen();
877
+ resolve();
878
+ return;
879
+ }
880
+ }
890
881
  }
891
- listen('fullscreenchange');
892
- return function () {
893
- listeners.forEach(function (cleanup) {
894
- cleanup();
895
- });
896
- };
882
+ if (!getElement()) {
883
+ resolve();
884
+ return;
885
+ }
886
+ reject();
887
+ });
888
+ }
889
+ function toggle(target, options) {
890
+ if (getIsFullscreen())
891
+ return exit();
892
+ else
893
+ return request(target, options);
894
+ }
895
+ function onchange(handler) {
896
+ var listeners = [];
897
+ function listen(eventType) {
898
+ function wrapper(event) {
899
+ handler(event);
900
+ }
901
+ if (typeof globalThis.document === 'undefined')
902
+ return;
903
+ globalThis.document.addEventListener(eventType, wrapper, false);
904
+ listeners.push(function () {
905
+ globalThis.document.removeEventListener(eventType, wrapper, false);
906
+ });
897
907
  }
898
- function onError(handler) {
899
- var listeners = [];
900
- function listen(eventType) {
901
- function wrapper(event) {
902
- handler(event);
903
- }
904
- if (typeof globalThis.document === 'undefined')
905
- return;
906
- globalThis.document.addEventListener(eventType, wrapper, false);
907
- listeners.push(function () {
908
- globalThis.document.removeEventListener(eventType, wrapper, false);
909
- });
908
+ listen('fullscreenchange');
909
+ return function () {
910
+ for (var i = 0; i < listeners.length; i++) {
911
+ listeners[i]();
910
912
  }
911
- listen('fullscreenerror');
912
- return function () {
913
- listeners.forEach(function (cleanup) {
914
- cleanup();
915
- });
916
- };
913
+ };
914
+ }
915
+ function onerror(handler) {
916
+ var listeners = [];
917
+ function listen(eventType) {
918
+ function wrapper(event) {
919
+ handler(event);
920
+ }
921
+ if (typeof globalThis.document === 'undefined')
922
+ return;
923
+ globalThis.document.addEventListener(eventType, wrapper, false);
924
+ listeners.push(function () {
925
+ globalThis.document.removeEventListener(eventType, wrapper, false);
926
+ });
917
927
  }
918
- bridgeEvents();
919
- return {
920
- get enabled() {
921
- return getEnabled();
922
- },
923
- get element() {
924
- return getElement();
925
- },
926
- get isFullscreen() {
927
- return getIsFullscreen();
928
- },
929
- request: request,
930
- exit: exit,
931
- toggle: toggle,
932
- onChange: onChange,
933
- onError: onError,
928
+ listen('fullscreenerror');
929
+ return function () {
930
+ for (var i = 0; i < listeners.length; i++) {
931
+ listeners[i]();
932
+ }
934
933
  };
935
934
  }
936
- var FullscreenUtils = createFullscreenUtils();
937
-
938
- var Fullscreen = FullscreenUtils;
935
+ bridgeEvents();
939
936
 
940
937
  var NativeFullscreenPlugin = {
941
938
  installed: false,
942
939
  name: 'Fullscreen',
943
- module: Fullscreen,
940
+ module: Index,
944
941
  Constants: {},
945
942
  Errors: {}
946
943
  };