@internetarchive/bookreader 5.0.0-24-sortingstate-1 → 5.0.0-24-sortingstate-2
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/BookReader/BookReader.js +1 -4
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/bookreader-component-bundle.js +16 -22
- package/BookReader/bookreader-component-bundle.js.map +1 -1
- package/BookReader/icons/1up.svg +1 -12
- package/BookReader/icons/2up.svg +1 -15
- package/BookReader/icons/advance.svg +3 -26
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +1 -17
- package/BookReader/icons/fullscreen_exit.svg +1 -17
- package/BookReader/icons/hamburger.svg +1 -15
- package/BookReader/icons/left-arrow.svg +1 -12
- package/BookReader/icons/magnify-minus.svg +1 -16
- package/BookReader/icons/magnify-plus.svg +1 -17
- package/BookReader/icons/magnify.svg +1 -15
- package/BookReader/icons/pause.svg +1 -23
- package/BookReader/icons/play.svg +1 -22
- package/BookReader/icons/playback-speed.svg +1 -34
- package/BookReader/icons/read-aloud.svg +1 -22
- package/BookReader/icons/review.svg +3 -22
- package/BookReader/icons/thumbnails.svg +1 -17
- package/BookReader/icons/voice.svg +1 -1
- package/BookReader/icons/volume-full.svg +1 -22
- package/BookReader/images/BRicons.svg +5 -94
- package/BookReader/images/books_graphic.svg +1 -177
- package/BookReader/images/icon_book.svg +1 -12
- package/BookReader/images/icon_bookmark.svg +1 -12
- package/BookReader/images/icon_gear.svg +1 -14
- package/BookReader/images/icon_hamburger.svg +1 -20
- package/BookReader/images/icon_home.svg +1 -21
- package/BookReader/images/icon_info.svg +1 -11
- package/BookReader/images/icon_one_page.svg +1 -8
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_playback-rate.svg +1 -15
- package/BookReader/images/icon_search_button.svg +1 -8
- package/BookReader/images/icon_share.svg +1 -9
- package/BookReader/images/icon_skip-ahead.svg +1 -6
- package/BookReader/images/icon_skip-back.svg +2 -13
- package/BookReader/images/icon_speaker.svg +1 -18
- package/BookReader/images/icon_speaker_open.svg +1 -10
- package/BookReader/images/icon_thumbnails.svg +1 -12
- package/BookReader/images/icon_toc.svg +1 -5
- package/BookReader/images/icon_two_pages.svg +1 -9
- package/BookReader/images/marker_chap-off.svg +1 -11
- package/BookReader/images/marker_chap-on.svg +1 -11
- package/BookReader/images/marker_srch-on.svg +1 -11
- package/BookReader/jquery-1.10.1.js +2 -108
- package/BookReader/plugins/plugin.archive_analytics.js +1 -170
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -163
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +1 -333
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js +1 -72
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js +1 -332
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +1 -241
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1 -1263
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +1 -839
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +2 -9114
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +46 -33
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -326
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +2 -411
- package/BookReader/webcomponents-bundle.js.map +1 -1
- package/package.json +1 -1
- package/src/BookNavigator/volumes/volumes-provider.js +1 -1
- package/src/BookReader.js +0 -4
- package/src/plugins/plugin.url.js +22 -16
- package/tests/jest/plugins/plugin.url.test.js +4 -4
- package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +6 -6
@@ -1,327 +1,2 @@
|
|
1
|
-
(self["
|
2
|
-
|
3
|
-
/***/ "./src/plugins/plugin.vendor-fullscreen.js":
|
4
|
-
/*!*************************************************!*\
|
5
|
-
!*** ./src/plugins/plugin.vendor-fullscreen.js ***!
|
6
|
-
\*************************************************/
|
7
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
8
|
-
|
9
|
-
"use strict";
|
10
|
-
__webpack_require__.r(__webpack_exports__);
|
11
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
12
|
-
/* harmony export */ "getFullscreenElement": function() { return /* binding */ getFullscreenElement; },
|
13
|
-
/* harmony export */ "isFullscreenActive": function() { return /* binding */ isFullscreenActive; },
|
14
|
-
/* harmony export */ "exitFullscreen": function() { return /* binding */ exitFullscreen; },
|
15
|
-
/* harmony export */ "requestFullscreen": function() { return /* binding */ requestFullscreen; },
|
16
|
-
/* harmony export */ "fullscreenAllowed": function() { return /* binding */ fullscreenAllowed; },
|
17
|
-
/* harmony export */ "bindFullscreenChangeListener": function() { return /* binding */ bindFullscreenChangeListener; },
|
18
|
-
/* harmony export */ "isMobile": function() { return /* binding */ isMobile; }
|
19
|
-
/* harmony export */ });
|
20
|
-
/* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.string.trim.js */ "./node_modules/core-js/modules/es.string.trim.js");
|
21
|
-
/* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_0__);
|
22
|
-
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");
|
23
|
-
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_1__);
|
24
|
-
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery");
|
25
|
-
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery");
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
/* global BookReader */
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Toggles browser's native fullscreen mode if available device is not mobile
|
33
|
-
*/
|
34
|
-
if (!isMobile()) {
|
35
|
-
var EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';
|
36
|
-
jQuery.extend(BookReader.defaultOptions, {
|
37
|
-
/** @type {boolean} */
|
38
|
-
enableVendorFullscreenPlugin: true
|
39
|
-
});
|
40
|
-
/** @override */
|
41
|
-
|
42
|
-
BookReader.prototype.setup = function (super_) {
|
43
|
-
return function (options) {
|
44
|
-
super_.call(this, options);
|
45
|
-
this.isVendorFullscreenActive = false;
|
46
|
-
};
|
47
|
-
}(BookReader.prototype.setup);
|
48
|
-
/** @override */
|
49
|
-
|
50
|
-
|
51
|
-
BookReader.prototype.getInitialMode = function (super_) {
|
52
|
-
return function (params) {
|
53
|
-
var nextMode = super_.call(this, params);
|
54
|
-
|
55
|
-
if (this.isVendorFullscreenActive) {
|
56
|
-
nextMode = this.constMode1up;
|
57
|
-
}
|
58
|
-
|
59
|
-
return nextMode;
|
60
|
-
};
|
61
|
-
}(BookReader.prototype.getInitialMode);
|
62
|
-
/** @override */
|
63
|
-
|
64
|
-
|
65
|
-
BookReader.prototype.init = function (super_) {
|
66
|
-
return function () {
|
67
|
-
super_.call(this);
|
68
|
-
|
69
|
-
if (!fullscreenAllowed()) {
|
70
|
-
return;
|
71
|
-
} // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.
|
72
|
-
|
73
|
-
|
74
|
-
bindFullscreenChangeListener(this, function (e) {
|
75
|
-
e.data.resize();
|
76
|
-
e.data.updateBrClasses();
|
77
|
-
var cboxOverlay = $('#cboxOverlay');
|
78
|
-
var cbox = $('#colorbox');
|
79
|
-
|
80
|
-
if (isFullscreenActive()) {
|
81
|
-
// In full screen mode, the colorbox and overlay need
|
82
|
-
// to be children of the fullscreen element to display properly.
|
83
|
-
var $fullscreen = $(getFullscreenElement());
|
84
|
-
$fullscreen.append(cboxOverlay).append(cbox);
|
85
|
-
} else {
|
86
|
-
// In non-fullscreen mode, the colorbox and overlay need
|
87
|
-
// to be children of the main document body.
|
88
|
-
$(document.body).append(cboxOverlay).append(cbox);
|
89
|
-
}
|
90
|
-
});
|
91
|
-
};
|
92
|
-
}(BookReader.prototype.init);
|
93
|
-
/**
|
94
|
-
* Start fullscreen mode
|
95
|
-
*/
|
96
|
-
|
97
|
-
|
98
|
-
BookReader.prototype.enterFullWindow = function () {
|
99
|
-
var _this = this;
|
100
|
-
|
101
|
-
this.refs.$brContainer.css('opacity', 0);
|
102
|
-
var windowWidth = $(window).width();
|
103
|
-
|
104
|
-
if (windowWidth <= this.onePageMinBreakpoint) {
|
105
|
-
this.switchMode(this.constMode1up);
|
106
|
-
}
|
107
|
-
|
108
|
-
this.isVendorFullscreenActive = true;
|
109
|
-
this.updateBrClasses();
|
110
|
-
this.resize();
|
111
|
-
this.jumpToIndex(this.currentIndex());
|
112
|
-
this.refs.$brContainer.animate({
|
113
|
-
opacity: 1
|
114
|
-
}, 400, 'linear');
|
115
|
-
$(document).on("keyup.".concat(EVENT_NAMESPACE), function (e) {
|
116
|
-
if (e.keyCode === 27) _this.exitFullScreen();
|
117
|
-
});
|
118
|
-
};
|
119
|
-
/**
|
120
|
-
* Exit from fullscreen mode
|
121
|
-
*/
|
122
|
-
|
123
|
-
|
124
|
-
BookReader.prototype.exitFullWindow = function () {
|
125
|
-
this.refs.$brContainer.css('opacity', 0);
|
126
|
-
$(document).off('keyup' + EVENT_NAMESPACE);
|
127
|
-
this.isFullscreenActive = false;
|
128
|
-
this.updateBrClasses();
|
129
|
-
this.resize();
|
130
|
-
this.refs.$brContainer.animate({
|
131
|
-
opacity: 1
|
132
|
-
}, 400, 'linear');
|
133
|
-
};
|
134
|
-
/**
|
135
|
-
* Returns true if fullscreen mode is enabled
|
136
|
-
*
|
137
|
-
* @returns {boolean}
|
138
|
-
*/
|
139
|
-
|
140
|
-
|
141
|
-
BookReader.prototype.isFullscreen = function () {
|
142
|
-
return isFullscreenActive() || this.isVendorFullscreenActive;
|
143
|
-
};
|
144
|
-
/**
|
145
|
-
* Toggle screen
|
146
|
-
*/
|
147
|
-
|
148
|
-
|
149
|
-
BookReader.prototype.toggleFullscreen = function () {
|
150
|
-
if (this.isFullscreen()) {
|
151
|
-
if (fullscreenAllowed()) {
|
152
|
-
exitFullscreen();
|
153
|
-
} else {
|
154
|
-
this.exitFullWindow();
|
155
|
-
}
|
156
|
-
} else {
|
157
|
-
if (fullscreenAllowed()) {
|
158
|
-
requestFullscreen(this.refs.$br[0]);
|
159
|
-
} else {
|
160
|
-
this.enterFullWindow();
|
161
|
-
}
|
162
|
-
}
|
163
|
-
};
|
164
|
-
/** @deprecated */
|
165
|
-
|
166
|
-
|
167
|
-
BookReader.util.isMobile = isMobile;
|
168
|
-
/** @deprecated */
|
169
|
-
|
170
|
-
BookReader.util.getFullscreenElement = getFullscreenElement;
|
171
|
-
/** @deprecated */
|
172
|
-
|
173
|
-
BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;
|
174
|
-
/** @deprecated */
|
175
|
-
|
176
|
-
BookReader.util.fullscreenAllowed = fullscreenAllowed;
|
177
|
-
/** @deprecated */
|
178
|
-
|
179
|
-
BookReader.util.requestFullscreen = requestFullscreen;
|
180
|
-
/** @deprecated */
|
181
|
-
|
182
|
-
BookReader.util.exitFullscreen = exitFullscreen;
|
183
|
-
/** @deprecated */
|
184
|
-
|
185
|
-
BookReader.util.isFullscreenActive = isFullscreenActive;
|
186
|
-
}
|
187
|
-
/**
|
188
|
-
* Returns the DOM element being used for fullscreen.
|
189
|
-
*
|
190
|
-
* @returns {HTMLElement}
|
191
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement
|
192
|
-
*/
|
193
|
-
|
194
|
-
|
195
|
-
function getFullscreenElement() {
|
196
|
-
return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;
|
197
|
-
}
|
198
|
-
/**
|
199
|
-
* Returns true if the document is in fullscreen mode.
|
200
|
-
*
|
201
|
-
* @returns {boolean}
|
202
|
-
*/
|
203
|
-
|
204
|
-
function isFullscreenActive() {
|
205
|
-
var fullscreenElement = getFullscreenElement();
|
206
|
-
return fullscreenElement !== null && fullscreenElement !== undefined;
|
207
|
-
}
|
208
|
-
/**
|
209
|
-
* Exits fullscreen mode.
|
210
|
-
*
|
211
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen
|
212
|
-
*/
|
213
|
-
|
214
|
-
function exitFullscreen() {
|
215
|
-
if (document.exitFullscreen) {
|
216
|
-
document.exitFullscreen();
|
217
|
-
} else if (document.webkitExitFullscreen) {
|
218
|
-
document.webkitExitFullscreen();
|
219
|
-
} else if (document.mozCancelFullScreen) {
|
220
|
-
document.mozCancelFullScreen();
|
221
|
-
} else if (document.msExitFullscreen) {
|
222
|
-
document.msExitFullscreen();
|
223
|
-
}
|
224
|
-
}
|
225
|
-
/**
|
226
|
-
* Requests fullscreen mode for the given element
|
227
|
-
*
|
228
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen
|
229
|
-
*/
|
230
|
-
|
231
|
-
function requestFullscreen(element) {
|
232
|
-
if (element.requestFullscreen) {
|
233
|
-
element.requestFullscreen();
|
234
|
-
} else if (element.webkitRequestFullscreen) {
|
235
|
-
element.webkitRequestFullscreen();
|
236
|
-
} else if (element.mozRequestFullScreen) {
|
237
|
-
element.mozRequestFullScreen();
|
238
|
-
} else if (element.msRequestFullscreen) {
|
239
|
-
element.msRequestFullscreen();
|
240
|
-
}
|
241
|
-
}
|
242
|
-
/**
|
243
|
-
* Returns true if fullscreen mode is allowed on this device and document.
|
244
|
-
*
|
245
|
-
* @returns {boolean}
|
246
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled
|
247
|
-
*/
|
248
|
-
|
249
|
-
function fullscreenAllowed() {
|
250
|
-
return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullScreenEnabled;
|
251
|
-
}
|
252
|
-
/**
|
253
|
-
* jQuery-style binding to a fullscreenchange event.
|
254
|
-
*
|
255
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event
|
256
|
-
*/
|
257
|
-
|
258
|
-
function bindFullscreenChangeListener(data, fullscreenchangeListener) {
|
259
|
-
var event = 'fullscreenchange ';
|
260
|
-
var vendor_prefixes = ['webkit', 'moz', 'ms'];
|
261
|
-
var all_events = (event + vendor_prefixes.join(event) + event).trim();
|
262
|
-
$(document).on(all_events, data, fullscreenchangeListener);
|
263
|
-
}
|
264
|
-
/**
|
265
|
-
* Returns true if current device is mobile
|
266
|
-
*
|
267
|
-
* @returns {boolean}
|
268
|
-
*/
|
269
|
-
|
270
|
-
function isMobile() {
|
271
|
-
return typeof window.orientation !== 'undefined' || navigator.userAgent.indexOf('IEMobile') !== -1;
|
272
|
-
}
|
273
|
-
|
274
|
-
/***/ }),
|
275
|
-
|
276
|
-
/***/ "./node_modules/core-js/internals/string-trim-forced.js":
|
277
|
-
/*!**************************************************************!*\
|
278
|
-
!*** ./node_modules/core-js/internals/string-trim-forced.js ***!
|
279
|
-
\**************************************************************/
|
280
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
281
|
-
|
282
|
-
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
|
283
|
-
var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js");
|
284
|
-
|
285
|
-
var non = '\u200B\u0085\u180E';
|
286
|
-
|
287
|
-
// check that a method works with the correct list
|
288
|
-
// of whitespaces and has a correct name
|
289
|
-
module.exports = function (METHOD_NAME) {
|
290
|
-
return fails(function () {
|
291
|
-
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
292
|
-
});
|
293
|
-
};
|
294
|
-
|
295
|
-
|
296
|
-
/***/ }),
|
297
|
-
|
298
|
-
/***/ "./node_modules/core-js/modules/es.string.trim.js":
|
299
|
-
/*!********************************************************!*\
|
300
|
-
!*** ./node_modules/core-js/modules/es.string.trim.js ***!
|
301
|
-
\********************************************************/
|
302
|
-
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
303
|
-
|
304
|
-
"use strict";
|
305
|
-
|
306
|
-
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
|
307
|
-
var $trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim;
|
308
|
-
var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "./node_modules/core-js/internals/string-trim-forced.js");
|
309
|
-
|
310
|
-
// `String.prototype.trim` method
|
311
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
312
|
-
$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
313
|
-
trim: function trim() {
|
314
|
-
return $trim(this);
|
315
|
-
}
|
316
|
-
});
|
317
|
-
|
318
|
-
|
319
|
-
/***/ })
|
320
|
-
|
321
|
-
},
|
322
|
-
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
323
|
-
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
324
|
-
/******/ var __webpack_exports__ = (__webpack_exec__("./src/plugins/plugin.vendor-fullscreen.js"));
|
325
|
-
/******/ }
|
326
|
-
]);
|
1
|
+
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[46],{8688:function(e,t,n){"use strict";n(3210),n(9600);var o,r=n(3609),i=n(3609);if(!m()){var u=".bookreader_vendor-fullscreen";r.extend(BookReader.defaultOptions,{enableVendorFullscreenPlugin:!0}),BookReader.prototype.setup=(o=BookReader.prototype.setup,function(e){o.call(this,e),this.isVendorFullscreenActive=!1}),BookReader.prototype.getInitialMode=function(e){return function(t){var n=e.call(this,t);return this.isVendorFullscreenActive&&(n=this.constMode1up),n}}(BookReader.prototype.getInitialMode),BookReader.prototype.init=function(e){return function(){e.call(this),d()&&p(this,(function(e){e.data.resize(),e.data.updateBrClasses();var t=i("#cboxOverlay"),n=i("#colorbox");s()?i(l()).append(t).append(n):i(document.body).append(t).append(n)}))}}(BookReader.prototype.init),BookReader.prototype.enterFullWindow=function(){var e=this;this.refs.$brContainer.css("opacity",0),i(window).width()<=this.onePageMinBreakpoint&&this.switchMode(this.constMode1up),this.isVendorFullscreenActive=!0,this.updateBrClasses(),this.resize(),this.jumpToIndex(this.currentIndex()),this.refs.$brContainer.animate({opacity:1},400,"linear"),i(document).on("keyup.".concat(u),(function(t){27===t.keyCode&&e.exitFullScreen()}))},BookReader.prototype.exitFullWindow=function(){this.refs.$brContainer.css("opacity",0),i(document).off("keyup"+u),this.isFullscreenActive=!1,this.updateBrClasses(),this.resize(),this.refs.$brContainer.animate({opacity:1},400,"linear")},BookReader.prototype.isFullscreen=function(){return s()||this.isVendorFullscreenActive},BookReader.prototype.toggleFullscreen=function(){this.isFullscreen()?d()?c():this.exitFullWindow():d()?a(this.refs.$br[0]):this.enterFullWindow()},BookReader.util.isMobile=m,BookReader.util.getFullscreenElement=l,BookReader.util.bindFullscreenChangeListener=p,BookReader.util.fullscreenAllowed=d,BookReader.util.requestFullscreen=a,BookReader.util.exitFullscreen=c,BookReader.util.isFullscreenActive=s}function l(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function s(){return null!=l()}function c(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}function a(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function d(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullScreenEnabled}function p(e,t){var n="fullscreenchange ",o=(n+["webkit","moz","ms"].join(n)+n).trim();i(document).on(o,e,t)}function m(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")}},6091:function(e,t,n){var o=n(7293),r=n(1361);e.exports=function(e){return o((function(){return!!r[e]()||"
"!="
"[e]()||r[e].name!==e}))}},3210:function(e,t,n){"use strict";var o=n(2109),r=n(3111).trim;o({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return r(this)}})}},function(e){e(e.s=8688)}]);
|
327
2
|
//# sourceMappingURL=plugin.vendor-fullscreen.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.vendor-fullscreen.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;AACA;AACA;AACA,IAAI,CAACA,QAAQ,EAAb,EAAiB;AACf,MAAMC,eAAe,GAAG,+BAAxB;AAEAC,EAAAA,MAAM,CAACC,MAAP,CAAcC,UAAU,CAACC,cAAzB,EAAyC;AACvC;AACAC,IAAAA,4BAA4B,EAAE;AAFS,GAAzC;AAKA;;AACAF,EAAAA,UAAU,CAACG,SAAX,CAAqBC,KAArB,GAA8B,UAASC,MAAT,EAAiB;AAC7C,WAAO,UAASC,OAAT,EAAkB;AACvBD,MAAAA,MAAM,CAACE,IAAP,CAAY,IAAZ,EAA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AAT,IACNtC,QAAQ,CAACuC,uBADH,IAENvC,QAAQ,CAACwC,oBAFH,IAGNxC,QAAQ,CAACyC,mBAHX;AAID;AAED;AACA;AACA;AACA;AACA;;AACO,SAASrD,4BAAT,CACLE,IADK,EACCoD,wBADD,EAEL;AACA,MAAMC,KAAK,GAAG,mBAAd;AACA,MAAMC,eAAe,GAAG,CACtB,QADsB,EAEtB,KAFsB,EAGtB,IAHsB,CAAxB;AAKA,MAAMC,UAAU,GAAG,CAACF,KAAK,GAAGC,eAAe,CAACE,IAAhB,CAAqBH,KAArB,CAAR,GAAsCA,KAAvC,EAA8CI,IAA9C,EAAnB;AACArD,EAAAA,CAAC,CAACM,QAAD,CAAD,CAAYe,EAAZ,CAAe8B,UAAf,EAA2BvD,IAA3B,EAAiCoD,wBAAjC;AACD;AAED;AACA;AACA;AACA;AACA;;AACO,SAASzE,QAAT,GAAoB;AACzB,SAAQ,OAAOsC,MAAM,CAACyC,WAAd,KAA8B,WAA/B,IAAgDC,SAAS,CAACC,SAAV,CAAoBC,OAApB,CAA4B,UAA5B,MAA4C,CAAC,CAApG;AACD;;;;;;;;;;ACtPD,YAAY,mBAAO,CAAC,qEAAoB;AACxC,kBAAkB,mBAAO,CAAC,iFAA0B;;AAEpD;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACXa;AACb,QAAQ,mBAAO,CAAC,uEAAqB;AACrC,YAAY,2GAAwC;AACpD,6BAA6B,mBAAO,CAAC,+FAAiC;;AAEtE;AACA;AACA,IAAI,uEAAuE;AAC3E;AACA;AACA;AACA,CAAC","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.vendor-fullscreen.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["/* global BookReader */\n\n/**\n * Toggles browser's native fullscreen mode if available device is not mobile\n */\nif (!isMobile()) {\n const EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';\n\n jQuery.extend(BookReader.defaultOptions, {\n /** @type {boolean} */\n enableVendorFullscreenPlugin: true\n });\n\n /** @override */\n BookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.isVendorFullscreenActive = false;\n };\n })(BookReader.prototype.setup);\n\n /** @override */\n BookReader.prototype.getInitialMode = (function(super_) {\n return function(params) {\n let nextMode = super_.call(this, params);\n if (this.isVendorFullscreenActive) {\n nextMode = this.constMode1up;\n }\n return nextMode;\n };\n })(BookReader.prototype.getInitialMode);\n\n /** @override */\n BookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!fullscreenAllowed()) {\n return;\n }\n // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.\n bindFullscreenChangeListener(this, (e) => {\n e.data.resize();\n e.data.updateBrClasses();\n const cboxOverlay = $('#cboxOverlay');\n const cbox = $('#colorbox');\n if (isFullscreenActive()) {\n // In full screen mode, the colorbox and overlay need\n // to be children of the fullscreen element to display properly.\n const $fullscreen = $(getFullscreenElement());\n $fullscreen.append(cboxOverlay).append(cbox);\n } else {\n // In non-fullscreen mode, the colorbox and overlay need\n // to be children of the main document body.\n $(document.body).append(cboxOverlay).append(cbox);\n }\n });\n };\n })(BookReader.prototype.init);\n\n /**\n * Start fullscreen mode\n */\n BookReader.prototype.enterFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n const windowWidth = $(window).width();\n if (windowWidth <= this.onePageMinBreakpoint) {\n this.switchMode(this.constMode1up);\n }\n\n this.isVendorFullscreenActive = true;\n this.updateBrClasses();\n\n this.resize();\n this.jumpToIndex(this.currentIndex());\n\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n\n $(document).on(`keyup.${EVENT_NAMESPACE}`, e => {\n if (e.keyCode === 27) this.exitFullScreen();\n });\n };\n\n /**\n * Exit from fullscreen mode\n */\n BookReader.prototype.exitFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n $(document).off('keyup' + EVENT_NAMESPACE);\n\n this.isFullscreenActive = false;\n this.updateBrClasses();\n\n this.resize();\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n };\n\n /**\n * Returns true if fullscreen mode is enabled\n *\n * @returns {boolean}\n */\n BookReader.prototype.isFullscreen = function() {\n return isFullscreenActive() || this.isVendorFullscreenActive;\n };\n\n /**\n * Toggle screen\n */\n BookReader.prototype.toggleFullscreen = function() {\n if (this.isFullscreen()) {\n if (fullscreenAllowed()) {\n exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n } else {\n if (fullscreenAllowed()) {\n requestFullscreen(this.refs.$br[0]);\n } else {\n this.enterFullWindow();\n }\n }\n };\n\n /** @deprecated */\n BookReader.util.isMobile = isMobile;\n\n /** @deprecated */\n BookReader.util.getFullscreenElement = getFullscreenElement;\n\n /** @deprecated */\n BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;\n\n /** @deprecated */\n BookReader.util.fullscreenAllowed = fullscreenAllowed;\n\n /** @deprecated */\n BookReader.util.requestFullscreen = requestFullscreen;\n\n /** @deprecated */\n BookReader.util.exitFullscreen = exitFullscreen;\n\n /** @deprecated */\n BookReader.util.isFullscreenActive = isFullscreenActive;\n}\n\n\n/**\n * Returns the DOM element being used for fullscreen.\n *\n * @returns {HTMLElement}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement\n */\nexport function getFullscreenElement() {\n return document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement;\n}\n\n/**\n * Returns true if the document is in fullscreen mode.\n *\n * @returns {boolean}\n */\nexport function isFullscreenActive() {\n const fullscreenElement = getFullscreenElement();\n return fullscreenElement !== null && fullscreenElement !== undefined;\n}\n\n/**\n * Exits fullscreen mode.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen\n */\nexport function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n}\n\n/**\n * Requests fullscreen mode for the given element\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen\n */\nexport function requestFullscreen(element) {\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n}\n\n/**\n * Returns true if fullscreen mode is allowed on this device and document.\n *\n * @returns {boolean}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled\n */\nexport function fullscreenAllowed() {\n return (document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullScreenEnabled);\n}\n\n/**\n * jQuery-style binding to a fullscreenchange event.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event\n */\nexport function bindFullscreenChangeListener(\n data, fullscreenchangeListener\n) {\n const event = 'fullscreenchange ';\n const vendor_prefixes = [\n 'webkit',\n 'moz',\n 'ms'\n ];\n const all_events = (event + vendor_prefixes.join(event) + event).trim();\n $(document).on(all_events, data, fullscreenchangeListener);\n}\n\n/**\n * Returns true if current device is mobile\n *\n * @returns {boolean}\n */\nexport function isMobile() {\n return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);\n}\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["isMobile","EVENT_NAMESPACE","jQuery","extend","BookReader","defaultOptions","enableVendorFullscreenPlugin","prototype","setup","super_","options","call","isVendorFullscreenActive","getInitialMode","params","nextMode","constMode1up","init","fullscreenAllowed","bindFullscreenChangeListener","e","data","resize","updateBrClasses","cboxOverlay","$","cbox","isFullscreenActive","$fullscreen","getFullscreenElement","append","document","body","enterFullWindow","refs","$brContainer","css","windowWidth","window","width","onePageMinBreakpoint","switchMode","jumpToIndex","currentIndex","animate","opacity","on","keyCode","exitFullScreen","exitFullWindow","off","isFullscreen","toggleFullscreen","exitFullscreen","requestFullscreen","$br","util","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","undefined","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","element","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullScreenEnabled","fullscreenchangeListener","event","vendor_prefixes","all_events","join","trim","orientation","navigator","userAgent","indexOf"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"plugins/plugin.vendor-fullscreen.js","mappings":"kKAcyCA,E,oBATzC,IAAKC,IAAY,CACf,IAAMC,EAAkB,gCAExBC,EAAOC,OAAOC,WAAWC,eAAgB,CAEvCC,8BAA8B,IAIhCF,WAAWG,UAAUC,OAAkBT,EAMpCK,WAAWG,UAAUC,MALf,SAASC,GACdV,EAAOW,KAAKC,KAAMF,GAElBE,KAAKC,0BAA2B,IAKpCR,WAAWG,UAAUM,eAAkB,SAASd,GAC9C,OAAO,SAASe,GACd,IAAIC,EAAWhB,EAAOW,KAAKC,KAAMG,GA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6D,OAAQ,SAAUC,OAAO,EAAMC,OAJN,EAAQ,KAIMC,CAAuB,SAAW,CAC3Ef,KAAM,WACJ,OAAOW,EAAM1E,W","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.vendor-fullscreen.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/string-trim-forced.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.trim.js"],"sourcesContent":["/* global BookReader */\n\n/**\n * Toggles browser's native fullscreen mode if available device is not mobile\n */\nif (!isMobile()) {\n const EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';\n\n jQuery.extend(BookReader.defaultOptions, {\n /** @type {boolean} */\n enableVendorFullscreenPlugin: true\n });\n\n /** @override */\n BookReader.prototype.setup = (function(super_) {\n return function(options) {\n super_.call(this, options);\n\n this.isVendorFullscreenActive = false;\n };\n })(BookReader.prototype.setup);\n\n /** @override */\n BookReader.prototype.getInitialMode = (function(super_) {\n return function(params) {\n let nextMode = super_.call(this, params);\n if (this.isVendorFullscreenActive) {\n nextMode = this.constMode1up;\n }\n return nextMode;\n };\n })(BookReader.prototype.getInitialMode);\n\n /** @override */\n BookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!fullscreenAllowed()) {\n return;\n }\n // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.\n bindFullscreenChangeListener(this, (e) => {\n e.data.resize();\n e.data.updateBrClasses();\n const cboxOverlay = $('#cboxOverlay');\n const cbox = $('#colorbox');\n if (isFullscreenActive()) {\n // In full screen mode, the colorbox and overlay need\n // to be children of the fullscreen element to display properly.\n const $fullscreen = $(getFullscreenElement());\n $fullscreen.append(cboxOverlay).append(cbox);\n } else {\n // In non-fullscreen mode, the colorbox and overlay need\n // to be children of the main document body.\n $(document.body).append(cboxOverlay).append(cbox);\n }\n });\n };\n })(BookReader.prototype.init);\n\n /**\n * Start fullscreen mode\n */\n BookReader.prototype.enterFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n const windowWidth = $(window).width();\n if (windowWidth <= this.onePageMinBreakpoint) {\n this.switchMode(this.constMode1up);\n }\n\n this.isVendorFullscreenActive = true;\n this.updateBrClasses();\n\n this.resize();\n this.jumpToIndex(this.currentIndex());\n\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n\n $(document).on(`keyup.${EVENT_NAMESPACE}`, e => {\n if (e.keyCode === 27) this.exitFullScreen();\n });\n };\n\n /**\n * Exit from fullscreen mode\n */\n BookReader.prototype.exitFullWindow = function() {\n this.refs.$brContainer.css('opacity', 0);\n\n $(document).off('keyup' + EVENT_NAMESPACE);\n\n this.isFullscreenActive = false;\n this.updateBrClasses();\n\n this.resize();\n this.refs.$brContainer.animate({ opacity: 1 }, 400, 'linear');\n };\n\n /**\n * Returns true if fullscreen mode is enabled\n *\n * @returns {boolean}\n */\n BookReader.prototype.isFullscreen = function() {\n return isFullscreenActive() || this.isVendorFullscreenActive;\n };\n\n /**\n * Toggle screen\n */\n BookReader.prototype.toggleFullscreen = function() {\n if (this.isFullscreen()) {\n if (fullscreenAllowed()) {\n exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n } else {\n if (fullscreenAllowed()) {\n requestFullscreen(this.refs.$br[0]);\n } else {\n this.enterFullWindow();\n }\n }\n };\n\n /** @deprecated */\n BookReader.util.isMobile = isMobile;\n\n /** @deprecated */\n BookReader.util.getFullscreenElement = getFullscreenElement;\n\n /** @deprecated */\n BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;\n\n /** @deprecated */\n BookReader.util.fullscreenAllowed = fullscreenAllowed;\n\n /** @deprecated */\n BookReader.util.requestFullscreen = requestFullscreen;\n\n /** @deprecated */\n BookReader.util.exitFullscreen = exitFullscreen;\n\n /** @deprecated */\n BookReader.util.isFullscreenActive = isFullscreenActive;\n}\n\n\n/**\n * Returns the DOM element being used for fullscreen.\n *\n * @returns {HTMLElement}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement\n */\nexport function getFullscreenElement() {\n return document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement ||\n document.msFullscreenElement;\n}\n\n/**\n * Returns true if the document is in fullscreen mode.\n *\n * @returns {boolean}\n */\nexport function isFullscreenActive() {\n const fullscreenElement = getFullscreenElement();\n return fullscreenElement !== null && fullscreenElement !== undefined;\n}\n\n/**\n * Exits fullscreen mode.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen\n */\nexport function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n}\n\n/**\n * Requests fullscreen mode for the given element\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen\n */\nexport function requestFullscreen(element) {\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n }\n}\n\n/**\n * Returns true if fullscreen mode is allowed on this device and document.\n *\n * @returns {boolean}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled\n */\nexport function fullscreenAllowed() {\n return (document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullScreenEnabled);\n}\n\n/**\n * jQuery-style binding to a fullscreenchange event.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event\n */\nexport function bindFullscreenChangeListener(\n data, fullscreenchangeListener\n) {\n const event = 'fullscreenchange ';\n const vendor_prefixes = [\n 'webkit',\n 'moz',\n 'ms'\n ];\n const all_events = (event + vendor_prefixes.join(event) + event).trim();\n $(document).on(all_events, data, fullscreenchangeListener);\n}\n\n/**\n * Returns true if current device is mobile\n *\n * @returns {boolean}\n */\nexport function isMobile() {\n return (typeof window.orientation !== 'undefined') || (navigator.userAgent.indexOf('IEMobile') !== -1);\n}\n","var fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n"],"names":["super_","isMobile","EVENT_NAMESPACE","jQuery","extend","BookReader","defaultOptions","enableVendorFullscreenPlugin","prototype","setup","options","call","this","isVendorFullscreenActive","getInitialMode","params","nextMode","constMode1up","init","fullscreenAllowed","bindFullscreenChangeListener","e","data","resize","updateBrClasses","cboxOverlay","$","cbox","isFullscreenActive","getFullscreenElement","append","document","body","enterFullWindow","refs","$brContainer","css","window","width","onePageMinBreakpoint","switchMode","jumpToIndex","currentIndex","animate","opacity","on","keyCode","exitFullScreen","exitFullWindow","off","isFullscreen","toggleFullscreen","exitFullscreen","requestFullscreen","$br","util","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","element","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullScreenEnabled","fullscreenchangeListener","event","all_events","join","trim","orientation","navigator","userAgent","indexOf","fails","whitespaces","module","exports","METHOD_NAME","name","$trim","target","proto","forced","forcedStringTrimMethod"],"sourceRoot":""}
|