@bigbinary/neeto-molecules 1.0.7 → 1.0.9

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 (39) hide show
  1. package/dist/BrowserSupport.cjs.js +2 -1462
  2. package/dist/BrowserSupport.js +2 -1456
  3. package/dist/Columns.cjs.js +1 -183
  4. package/dist/Columns.js +1 -177
  5. package/dist/CustomDomain.cjs.js +2 -753
  6. package/dist/CustomDomain.js +2 -727
  7. package/dist/DateFormat.cjs.js +1 -46
  8. package/dist/DateFormat.js +1 -40
  9. package/dist/DateRangeFilter.cjs.js +1 -233
  10. package/dist/DateRangeFilter.js +1 -226
  11. package/dist/DynamicVariables.cjs.js +1 -112
  12. package/dist/DynamicVariables.js +1 -106
  13. package/dist/EmailPreview.cjs.js +1 -89
  14. package/dist/EmailPreview.js +1 -83
  15. package/dist/ErrorPage.cjs.js +1 -189
  16. package/dist/ErrorPage.js +1 -165
  17. package/dist/IpRestriction.cjs.js +1 -3578
  18. package/dist/IpRestriction.js +1 -3552
  19. package/dist/KeyboardShortcuts.cjs.js +6 -2193
  20. package/dist/KeyboardShortcuts.js +6 -2186
  21. package/dist/LoginPage.cjs.js +1 -598
  22. package/dist/LoginPage.js +1 -573
  23. package/dist/NeetoWidget.cjs.js +3 -86957
  24. package/dist/NeetoWidget.js +3 -86931
  25. package/dist/PublishBlock.cjs.js +2 -184
  26. package/dist/PublishBlock.js +2 -178
  27. package/dist/Schedule.cjs.js +1 -950
  28. package/dist/Schedule.js +1 -919
  29. package/dist/ShareViaEmail.cjs.js +2 -2832
  30. package/dist/ShareViaEmail.js +2 -2805
  31. package/dist/ShareViaLink.cjs.js +2 -1243
  32. package/dist/ShareViaLink.js +2 -1237
  33. package/dist/Sidebar.cjs.js +1 -222
  34. package/dist/Sidebar.js +1 -195
  35. package/dist/TimeFormat.cjs.js +1 -11
  36. package/dist/TimeFormat.js +1 -5
  37. package/package.json +2 -1
  38. package/src/translations/en.json +0 -1
  39. package/types/ShareViaEmail.d.ts +9 -2
@@ -1,78 +1,4 @@
1
- import React, { useDebugValue } from 'react';
2
- import { useHotKeys } from '@bigbinary/neeto-commons-frontend/react-utils';
3
- import { Close } from '@bigbinary/neeto-icons';
4
- import { Typography, Kbd, Button } from '@bigbinary/neetoui';
5
- import { manager } from '@bigbinary/neetoui/managers';
6
- import { useTranslation } from 'react-i18next';
7
- import i18next from 'i18next';
8
- import { toPairs } from 'ramda';
9
-
10
- const createStoreImpl = (createState) => {
11
- let state;
12
- const listeners = /* @__PURE__ */ new Set();
13
- const setState = (partial, replace) => {
14
- const nextState = typeof partial === "function" ? partial(state) : partial;
15
- if (!Object.is(nextState, state)) {
16
- const previousState = state;
17
- state = (replace != null ? replace : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState);
18
- listeners.forEach((listener) => listener(state, previousState));
19
- }
20
- };
21
- const getState = () => state;
22
- const subscribe = (listener) => {
23
- listeners.add(listener);
24
- return () => listeners.delete(listener);
25
- };
26
- const destroy = () => {
27
- if ((import.meta.env && import.meta.env.MODE) !== "production") {
28
- console.warn(
29
- "[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected."
30
- );
31
- }
32
- listeners.clear();
33
- };
34
- const api = { setState, getState, subscribe, destroy };
35
- state = createState(setState, getState, api);
36
- return api;
37
- };
38
- const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
39
-
40
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
41
-
42
- function getDefaultExportFromCjs (x) {
43
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
44
- }
45
-
46
- var withSelector = {exports: {}};
47
-
48
- var withSelector_production_min = {};
49
-
50
- var shim = {exports: {}};
51
-
52
- var useSyncExternalStoreShim_production_min = {};
53
-
54
- /**
55
- * @license React
56
- * use-sync-external-store-shim.production.min.js
57
- *
58
- * Copyright (c) Facebook, Inc. and its affiliates.
59
- *
60
- * This source code is licensed under the MIT license found in the
61
- * LICENSE file in the root directory of this source tree.
62
- */
63
-
64
- var hasRequiredUseSyncExternalStoreShim_production_min;
65
-
66
- function requireUseSyncExternalStoreShim_production_min () {
67
- if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
68
- hasRequiredUseSyncExternalStoreShim_production_min = 1;
69
- var e=React;function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
70
- function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;
71
- return useSyncExternalStoreShim_production_min;
72
- }
73
-
74
- var useSyncExternalStoreShim_development = {};
75
-
1
+ import e,{useDebugValue as t}from"react";import{useHotKeys as n}from"@bigbinary/neeto-commons-frontend/react-utils";import{Close as r}from"@bigbinary/neeto-icons";import{Typography as o,Kbd as i,Button as a}from"@bigbinary/neetoui";import{manager as l}from"@bigbinary/neetoui/managers";import{useTranslation as s}from"react-i18next";import u from"i18next";import{toPairs as c}from"ramda";const f=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env&&import.meta.env.MODE)&&console.warn("[DEPRECATED] The destroy method will be unsupported in the future version. You should use unsubscribe function returned by subscribe. Everything will be garbage collected if store is garbage collected."),n.clear()}};return t=e(r,o,i),i};var b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,m={exports:{}},S={},y={exports:{}},h={};var g,v,O,x={};
76
2
  /**
77
3
  * @license React
78
4
  * use-sync-external-store-shim.development.js
@@ -81,258 +7,7 @@ var useSyncExternalStoreShim_development = {};
81
7
  *
82
8
  * This source code is licensed under the MIT license found in the
83
9
  * LICENSE file in the root directory of this source tree.
84
- */
85
-
86
- var hasRequiredUseSyncExternalStoreShim_development;
87
-
88
- function requireUseSyncExternalStoreShim_development () {
89
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
90
- hasRequiredUseSyncExternalStoreShim_development = 1;
91
-
92
- if (process.env.NODE_ENV !== "production") {
93
- (function() {
94
-
95
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
96
- if (
97
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
98
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
99
- 'function'
100
- ) {
101
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
102
- }
103
- var React$1 = React;
104
-
105
- var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
106
-
107
- function error(format) {
108
- {
109
- {
110
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
111
- args[_key2 - 1] = arguments[_key2];
112
- }
113
-
114
- printWarning('error', format, args);
115
- }
116
- }
117
- }
118
-
119
- function printWarning(level, format, args) {
120
- // When changing this logic, you might want to also
121
- // update consoleWithStackDev.www.js as well.
122
- {
123
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
124
- var stack = ReactDebugCurrentFrame.getStackAddendum();
125
-
126
- if (stack !== '') {
127
- format += '%s';
128
- args = args.concat([stack]);
129
- } // eslint-disable-next-line react-internal/safe-string-coercion
130
-
131
-
132
- var argsWithFormat = args.map(function (item) {
133
- return String(item);
134
- }); // Careful: RN currently depends on this prefix
135
-
136
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
137
- // breaks IE9: https://github.com/facebook/react/issues/13610
138
- // eslint-disable-next-line react-internal/no-production-logging
139
-
140
- Function.prototype.apply.call(console[level], console, argsWithFormat);
141
- }
142
- }
143
-
144
- /**
145
- * inlined Object.is polyfill to avoid requiring consumers ship their own
146
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
147
- */
148
- function is(x, y) {
149
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
150
- ;
151
- }
152
-
153
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
154
-
155
- // dispatch for CommonJS interop named imports.
156
-
157
- var useState = React$1.useState,
158
- useEffect = React$1.useEffect,
159
- useLayoutEffect = React$1.useLayoutEffect,
160
- useDebugValue = React$1.useDebugValue;
161
- var didWarnOld18Alpha = false;
162
- var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
163
- // because of a very particular set of implementation details and assumptions
164
- // -- change any one of them and it will break. The most important assumption
165
- // is that updates are always synchronous, because concurrent rendering is
166
- // only available in versions of React that also have a built-in
167
- // useSyncExternalStore API. And we only use this shim when the built-in API
168
- // does not exist.
169
- //
170
- // Do not assume that the clever hacks used by this hook also work in general.
171
- // The point of this shim is to replace the need for hacks by other libraries.
172
-
173
- function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
174
- // React do not expose a way to check if we're hydrating. So users of the shim
175
- // will need to track that themselves and return the correct value
176
- // from `getSnapshot`.
177
- getServerSnapshot) {
178
- {
179
- if (!didWarnOld18Alpha) {
180
- if (React$1.startTransition !== undefined) {
181
- didWarnOld18Alpha = true;
182
-
183
- error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
184
- }
185
- }
186
- } // Read the current snapshot from the store on every render. Again, this
187
- // breaks the rules of React, and only works here because of specific
188
- // implementation details, most importantly that updates are
189
- // always synchronous.
190
-
191
-
192
- var value = getSnapshot();
193
-
194
- {
195
- if (!didWarnUncachedGetSnapshot) {
196
- var cachedValue = getSnapshot();
197
-
198
- if (!objectIs(value, cachedValue)) {
199
- error('The result of getSnapshot should be cached to avoid an infinite loop');
200
-
201
- didWarnUncachedGetSnapshot = true;
202
- }
203
- }
204
- } // Because updates are synchronous, we don't queue them. Instead we force a
205
- // re-render whenever the subscribed state changes by updating an some
206
- // arbitrary useState hook. Then, during render, we call getSnapshot to read
207
- // the current value.
208
- //
209
- // Because we don't actually use the state returned by the useState hook, we
210
- // can save a bit of memory by storing other stuff in that slot.
211
- //
212
- // To implement the early bailout, we need to track some things on a mutable
213
- // object. Usually, we would put that in a useRef hook, but we can stash it in
214
- // our useState hook instead.
215
- //
216
- // To force a re-render, we call forceUpdate({inst}). That works because the
217
- // new object always fails an equality check.
218
-
219
-
220
- var _useState = useState({
221
- inst: {
222
- value: value,
223
- getSnapshot: getSnapshot
224
- }
225
- }),
226
- inst = _useState[0].inst,
227
- forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
228
- // in the layout phase so we can access it during the tearing check that
229
- // happens on subscribe.
230
-
231
-
232
- useLayoutEffect(function () {
233
- inst.value = value;
234
- inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
235
- // commit phase if there was an interleaved mutation. In concurrent mode
236
- // this can happen all the time, but even in synchronous mode, an earlier
237
- // effect may have mutated the store.
238
-
239
- if (checkIfSnapshotChanged(inst)) {
240
- // Force a re-render.
241
- forceUpdate({
242
- inst: inst
243
- });
244
- }
245
- }, [subscribe, value, getSnapshot]);
246
- useEffect(function () {
247
- // Check for changes right before subscribing. Subsequent changes will be
248
- // detected in the subscription handler.
249
- if (checkIfSnapshotChanged(inst)) {
250
- // Force a re-render.
251
- forceUpdate({
252
- inst: inst
253
- });
254
- }
255
-
256
- var handleStoreChange = function () {
257
- // TODO: Because there is no cross-renderer API for batching updates, it's
258
- // up to the consumer of this library to wrap their subscription event
259
- // with unstable_batchedUpdates. Should we try to detect when this isn't
260
- // the case and print a warning in development?
261
- // The store changed. Check if the snapshot changed since the last time we
262
- // read from the store.
263
- if (checkIfSnapshotChanged(inst)) {
264
- // Force a re-render.
265
- forceUpdate({
266
- inst: inst
267
- });
268
- }
269
- }; // Subscribe to the store and return a clean-up function.
270
-
271
-
272
- return subscribe(handleStoreChange);
273
- }, [subscribe]);
274
- useDebugValue(value);
275
- return value;
276
- }
277
-
278
- function checkIfSnapshotChanged(inst) {
279
- var latestGetSnapshot = inst.getSnapshot;
280
- var prevValue = inst.value;
281
-
282
- try {
283
- var nextValue = latestGetSnapshot();
284
- return !objectIs(prevValue, nextValue);
285
- } catch (error) {
286
- return true;
287
- }
288
- }
289
-
290
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
291
- // Note: The shim does not use getServerSnapshot, because pre-18 versions of
292
- // React do not expose a way to check if we're hydrating. So users of the shim
293
- // will need to track that themselves and return the correct value
294
- // from `getSnapshot`.
295
- return getSnapshot();
296
- }
297
-
298
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
299
-
300
- var isServerEnvironment = !canUseDOM;
301
-
302
- var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
303
- var useSyncExternalStore$2 = React$1.useSyncExternalStore !== undefined ? React$1.useSyncExternalStore : shim;
304
-
305
- useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
306
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
307
- if (
308
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
309
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
310
- 'function'
311
- ) {
312
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
313
- }
314
-
315
- })();
316
- }
317
- return useSyncExternalStoreShim_development;
318
- }
319
-
320
- var hasRequiredShim;
321
-
322
- function requireShim () {
323
- if (hasRequiredShim) return shim.exports;
324
- hasRequiredShim = 1;
325
- (function (module) {
326
-
327
- if (process.env.NODE_ENV === 'production') {
328
- module.exports = requireUseSyncExternalStoreShim_production_min();
329
- } else {
330
- module.exports = requireUseSyncExternalStoreShim_development();
331
- }
332
- } (shim));
333
- return shim.exports;
334
- }
335
-
10
+ */function E(){return g||(g=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=e,n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];!function(e,t,r){var o=n.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",r=r.concat([o]));var i=r.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,r)}var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=t.useState,a=t.useEffect,l=t.useLayoutEffect,s=t.useDebugValue,u=!1,c=!1;function f(e){var t=e.getSnapshot,n=e.value;try{var r=t();return!o(n,r)}catch(e){return!0}}var b=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,n){return t()}:function(e,n,b){u||void 0!==t.startTransition&&(u=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=n();if(!c){var d=n();o(p,d)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=i({inst:{value:p,getSnapshot:n}}),S=m[0].inst,y=m[1];return l((function(){S.value=p,S.getSnapshot=n,f(S)&&y({inst:S})}),[e,p,n]),a((function(){f(S)&&y({inst:S});return e((function(){f(S)&&y({inst:S})}))}),[e]),s(p),p},p=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:b;x.useSyncExternalStore=p,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),x}function w(){return v||(v=1,t=y,"production"===process.env.NODE_ENV?t.exports=function(){if(d)return h;d=1;var t=e,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,a=t.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),u=s[0].inst,c=s[1];return i((function(){u.value=n,u.getSnapshot=t,l(u)&&c({inst:u})}),[e,n,t]),o((function(){return l(u)&&c({inst:u}),e((function(){l(u)&&c({inst:u})}))}),[e]),a(n),n};return h.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:s,h}():t.exports=E()),y.exports;var t}
336
11
  /**
337
12
  * @license React
338
13
  * use-sync-external-store-shim/with-selector.production.min.js
@@ -341,21 +16,7 @@ function requireShim () {
341
16
  *
342
17
  * This source code is licensed under the MIT license found in the
343
18
  * LICENSE file in the root directory of this source tree.
344
- */
345
-
346
- var hasRequiredWithSelector_production_min;
347
-
348
- function requireWithSelector_production_min () {
349
- if (hasRequiredWithSelector_production_min) return withSelector_production_min;
350
- hasRequiredWithSelector_production_min = 1;
351
- var h=React,n=requireShim();function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q="function"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;
352
- withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);
353
- u(function(){f.hasValue=!0;f.value=d;},[d]);w(d);return d};
354
- return withSelector_production_min;
355
- }
356
-
357
- var withSelector_development = {};
358
-
19
+ */var _,M,A={};
359
20
  /**
360
21
  * @license React
361
22
  * use-sync-external-store-shim/with-selector.development.js
@@ -364,1856 +25,15 @@ var withSelector_development = {};
364
25
  *
365
26
  * This source code is licensed under the MIT license found in the
366
27
  * LICENSE file in the root directory of this source tree.
367
- */
368
-
369
- var hasRequiredWithSelector_development;
370
-
371
- function requireWithSelector_development () {
372
- if (hasRequiredWithSelector_development) return withSelector_development;
373
- hasRequiredWithSelector_development = 1;
374
-
375
- if (process.env.NODE_ENV !== "production") {
376
- (function() {
377
-
378
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
379
- if (
380
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
381
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
382
- 'function'
383
- ) {
384
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
385
- }
386
- var React$1 = React;
387
- var shim = requireShim();
388
-
389
- /**
390
- * inlined Object.is polyfill to avoid requiring consumers ship their own
391
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
392
- */
393
- function is(x, y) {
394
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
395
- ;
396
- }
397
-
398
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
399
-
400
- var useSyncExternalStore = shim.useSyncExternalStore;
401
-
402
- // for CommonJS interop.
403
-
404
- var useRef = React$1.useRef,
405
- useEffect = React$1.useEffect,
406
- useMemo = React$1.useMemo,
407
- useDebugValue = React$1.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.
408
-
409
- function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
410
- // Use this to track the rendered snapshot.
411
- var instRef = useRef(null);
412
- var inst;
413
-
414
- if (instRef.current === null) {
415
- inst = {
416
- hasValue: false,
417
- value: null
418
- };
419
- instRef.current = inst;
420
- } else {
421
- inst = instRef.current;
422
- }
423
-
424
- var _useMemo = useMemo(function () {
425
- // Track the memoized state using closure variables that are local to this
426
- // memoized instance of a getSnapshot function. Intentionally not using a
427
- // useRef hook, because that state would be shared across all concurrent
428
- // copies of the hook/component.
429
- var hasMemo = false;
430
- var memoizedSnapshot;
431
- var memoizedSelection;
432
-
433
- var memoizedSelector = function (nextSnapshot) {
434
- if (!hasMemo) {
435
- // The first time the hook is called, there is no memoized result.
436
- hasMemo = true;
437
- memoizedSnapshot = nextSnapshot;
438
-
439
- var _nextSelection = selector(nextSnapshot);
440
-
441
- if (isEqual !== undefined) {
442
- // Even if the selector has changed, the currently rendered selection
443
- // may be equal to the new selection. We should attempt to reuse the
444
- // current value if possible, to preserve downstream memoizations.
445
- if (inst.hasValue) {
446
- var currentSelection = inst.value;
447
-
448
- if (isEqual(currentSelection, _nextSelection)) {
449
- memoizedSelection = currentSelection;
450
- return currentSelection;
451
- }
452
- }
453
- }
454
-
455
- memoizedSelection = _nextSelection;
456
- return _nextSelection;
457
- } // We may be able to reuse the previous invocation's result.
458
-
459
-
460
- // We may be able to reuse the previous invocation's result.
461
- var prevSnapshot = memoizedSnapshot;
462
- var prevSelection = memoizedSelection;
463
-
464
- if (objectIs(prevSnapshot, nextSnapshot)) {
465
- // The snapshot is the same as last time. Reuse the previous selection.
466
- return prevSelection;
467
- } // The snapshot has changed, so we need to compute a new selection.
468
-
469
-
470
- // The snapshot has changed, so we need to compute a new selection.
471
- var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data
472
- // has changed. If it hasn't, return the previous selection. That signals
473
- // to React that the selections are conceptually equal, and we can bail
474
- // out of rendering.
475
-
476
- // If a custom isEqual function is provided, use that to check if the data
477
- // has changed. If it hasn't, return the previous selection. That signals
478
- // to React that the selections are conceptually equal, and we can bail
479
- // out of rendering.
480
- if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
481
- return prevSelection;
482
- }
483
-
484
- memoizedSnapshot = nextSnapshot;
485
- memoizedSelection = nextSelection;
486
- return nextSelection;
487
- }; // Assigning this to a constant so that Flow knows it can't change.
488
-
489
-
490
- // Assigning this to a constant so that Flow knows it can't change.
491
- var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;
492
-
493
- var getSnapshotWithSelector = function () {
494
- return memoizedSelector(getSnapshot());
495
- };
496
-
497
- var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {
498
- return memoizedSelector(maybeGetServerSnapshot());
499
- };
500
- return [getSnapshotWithSelector, getServerSnapshotWithSelector];
501
- }, [getSnapshot, getServerSnapshot, selector, isEqual]),
502
- getSelection = _useMemo[0],
503
- getServerSelection = _useMemo[1];
504
-
505
- var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
506
- useEffect(function () {
507
- inst.hasValue = true;
508
- inst.value = value;
509
- }, [value]);
510
- useDebugValue(value);
511
- return value;
512
- }
513
-
514
- withSelector_development.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
515
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
516
- if (
517
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
518
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
519
- 'function'
520
- ) {
521
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
522
- }
523
-
524
- })();
525
- }
526
- return withSelector_development;
527
- }
528
-
529
- (function (module) {
530
-
531
- if (process.env.NODE_ENV === 'production') {
532
- module.exports = requireWithSelector_production_min();
533
- } else {
534
- module.exports = requireWithSelector_development();
535
- }
536
- } (withSelector));
537
-
538
- var useSyncExternalStoreExports = /*@__PURE__*/getDefaultExportFromCjs(withSelector.exports);
539
-
540
- const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
541
- function useStore(api, selector = api.getState, equalityFn) {
542
- const slice = useSyncExternalStoreWithSelector(
543
- api.subscribe,
544
- api.getState,
545
- api.getServerState || api.getState,
546
- selector,
547
- equalityFn
548
- );
549
- useDebugValue(slice);
550
- return slice;
551
- }
552
- const createImpl = (createState) => {
553
- if ((import.meta.env && import.meta.env.MODE) !== "production" && typeof createState !== "function") {
554
- console.warn(
555
- '[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.'
556
- );
557
- }
558
- const api = typeof createState === "function" ? createStore(createState) : createState;
559
- const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
560
- Object.assign(useBoundStore, api);
561
- return useBoundStore;
562
- };
563
- const create = (createState) => createState ? createImpl(createState) : createImpl;
564
-
565
- function shallow(objA, objB) {
566
- if (Object.is(objA, objB)) {
567
- return true;
568
- }
569
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
570
- return false;
571
- }
572
- if (objA instanceof Map && objB instanceof Map) {
573
- if (objA.size !== objB.size)
574
- return false;
575
- for (const [key, value] of objA) {
576
- if (!Object.is(value, objB.get(key))) {
577
- return false;
578
- }
579
- }
580
- return true;
581
- }
582
- if (objA instanceof Set && objB instanceof Set) {
583
- if (objA.size !== objB.size)
584
- return false;
585
- for (const value of objA) {
586
- if (!objB.has(value)) {
587
- return false;
588
- }
589
- }
590
- return true;
591
- }
592
- const keysA = Object.keys(objA);
593
- if (keysA.length !== Object.keys(objB).length) {
594
- return false;
595
- }
596
- for (let i = 0; i < keysA.length; i++) {
597
- if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
598
- return false;
599
- }
600
- }
601
- return true;
602
- }
603
-
604
- var useKeyboardShortcutsStore = create(function (set) {
605
- return {
606
- isOpen: false,
607
- setIsOpen: function setIsOpen(arg) {
608
- if (typeof arg === "function") {
609
- set(function (state) {
610
- return {
611
- isOpen: arg(state.isOpen)
612
- };
613
- });
614
- } else {
615
- set({
616
- isOpen: arg
617
- });
618
- }
619
- }
620
- };
621
- });
622
- var useKeyboardShortcutsPaneState = function useKeyboardShortcutsPaneState() {
623
- return useKeyboardShortcutsStore(function (_ref) {
624
- var isOpen = _ref.isOpen,
625
- setIsOpen = _ref.setIsOpen;
626
- return [isOpen, setIsOpen];
627
- }, shallow);
628
- };
629
-
630
- function _arrayWithHoles(arr) {
631
- if (Array.isArray(arr)) return arr;
632
- }
633
-
634
- function _iterableToArrayLimit(arr, i) {
635
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
636
- if (null != _i) {
637
- var _s,
638
- _e,
639
- _x,
640
- _r,
641
- _arr = [],
642
- _n = !0,
643
- _d = !1;
644
- try {
645
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
646
- if (Object(_i) !== _i) return;
647
- _n = !1;
648
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
649
- } catch (err) {
650
- _d = !0, _e = err;
651
- } finally {
652
- try {
653
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
654
- } finally {
655
- if (_d) throw _e;
656
- }
657
- }
658
- return _arr;
659
- }
660
- }
661
-
662
- function _arrayLikeToArray(arr, len) {
663
- if (len == null || len > arr.length) len = arr.length;
664
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
665
- return arr2;
666
- }
667
-
668
- function _unsupportedIterableToArray(o, minLen) {
669
- if (!o) return;
670
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
671
- var n = Object.prototype.toString.call(o).slice(8, -1);
672
- if (n === "Object" && o.constructor) n = o.constructor.name;
673
- if (n === "Map" || n === "Set") return Array.from(o);
674
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
675
- }
676
-
677
- function _nonIterableRest() {
678
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
679
- }
680
-
681
- function _slicedToArray(arr, i) {
682
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
683
- }
684
-
685
- var classnames$1 = {exports: {}};
686
-
28
+ */M=m,"production"===process.env.NODE_ENV?M.exports=function(){if(O)return S;O=1;var t=e,n=w(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,l=t.useMemo,s=t.useDebugValue;return S.useSyncExternalStoreWithSelector=function(e,t,n,u,c){var f=i(null);if(null===f.current){var b={hasValue:!1,value:null};f.current=b}else b=f.current;f=l((function(){function e(e){if(!a){if(a=!0,o=e,e=u(e),void 0!==c&&b.hasValue){var t=b.value;if(c(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=u(e);return void 0!==c&&c(t,n)?t:(o=e,i=n)}var o,i,a=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,u,c]);var p=o(e,f[0],f[1]);return a((function(){b.hasValue=!0,b.value=p}),[p]),s(p),p},S}():M.exports=(_||(_=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=e,n=w(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,l=t.useMemo,s=t.useDebugValue;A.useSyncExternalStoreWithSelector=function(e,t,n,u,c){var f,b=i(null);null===b.current?(f={hasValue:!1,value:null},b.current=f):f=b.current;var p=l((function(){var e,o,i=!1,a=function(t){if(!i){i=!0,e=t;var n=u(t);if(void 0!==c&&f.hasValue){var a=f.value;if(c(a,n))return o=a,a}return o=n,n}var l=o;if(r(e,t))return l;var s=u(t);return void 0!==c&&c(l,s)?l:(e=t,o=s,s)},l=void 0===n?null:n;return[function(){return a(t())},null===l?void 0:function(){return a(l())}]}),[t,n,u,c]),d=p[0],m=p[1],S=o(e,d,m);return a((function(){f.hasValue=!0,f.value=S}),[S]),s(S),S},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),A);var T=p(m.exports);const{useSyncExternalStoreWithSelector:k}=T;const C=e=>{"production"!==(import.meta.env&&import.meta.env.MODE)&&"function"!=typeof e&&console.warn('[DEPRECATED] Passing a vanilla store will be unsupported in the future version. Please use `import { useStore } from "zustand"` to use the vanilla store in React.');const n="function"==typeof e?(e=>e?f(e):f)(e):e,r=(e,r)=>function(e,n=e.getState,r){const o=k(e.subscribe,e.getState,e.getServerState||e.getState,n,r);return t(o),o}(n,e,r);return Object.assign(r,n),r};function P(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var R,B=(R=function(e){return{isOpen:!1,setIsOpen:function(t){e("function"==typeof t?function(e){return{isOpen:t(e.isOpen)}}:{isOpen:t})}}})?C(R):C,j=function(){return B((function(e){return[e.isOpen,e.setIsOpen]}),P)};function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var W={exports:{}};
687
29
  /*!
688
30
  Copyright (c) 2018 Jed Watson.
689
31
  Licensed under the MIT License (MIT), see
690
32
  http://jedwatson.github.io/classnames
691
- */
692
-
693
- (function (module) {
694
- /* global define */
695
-
696
- (function () {
697
-
698
- var hasOwn = {}.hasOwnProperty;
699
-
700
- function classNames() {
701
- var classes = [];
702
-
703
- for (var i = 0; i < arguments.length; i++) {
704
- var arg = arguments[i];
705
- if (!arg) continue;
706
-
707
- var argType = typeof arg;
708
-
709
- if (argType === 'string' || argType === 'number') {
710
- classes.push(arg);
711
- } else if (Array.isArray(arg)) {
712
- if (arg.length) {
713
- var inner = classNames.apply(null, arg);
714
- if (inner) {
715
- classes.push(inner);
716
- }
717
- }
718
- } else if (argType === 'object') {
719
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
720
- classes.push(arg.toString());
721
- continue;
722
- }
723
-
724
- for (var key in arg) {
725
- if (hasOwn.call(arg, key) && arg[key]) {
726
- classes.push(key);
727
- }
728
- }
729
- }
730
- }
731
-
732
- return classes.join(' ');
733
- }
734
-
735
- if (module.exports) {
736
- classNames.default = classNames;
737
- module.exports = classNames;
738
- } else {
739
- window.classNames = classNames;
740
- }
741
- }());
742
- } (classnames$1));
743
-
744
- var classnames = classnames$1.exports;
745
-
746
- var KEY_SHORTFORM_MAP = {
747
- command: "cmd",
748
- escape: "esc",
749
- control: "ctrl",
750
- option: "opt"
751
- };
752
- var MAC_TO_WINDOWS_KEYS_MAP = {
753
- option: "alt",
754
- command: "ctrl",
755
- "return": "enter",
756
- "delete": "backspace"
757
- };
758
- var OS = {
759
- mac: "OS X",
760
- windows: "Windows"
761
- };
762
- var FULL_SHORTCUTS_LINK_PROP_NAME = "fullShortcutsLink";
763
-
764
- function _typeof(obj) {
765
- "@babel/helpers - typeof";
766
-
767
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
768
- return typeof obj;
769
- } : function (obj) {
770
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
771
- }, _typeof(obj);
772
- }
773
-
774
- function _toPrimitive(input, hint) {
775
- if (_typeof(input) !== "object" || input === null) return input;
776
- var prim = input[Symbol.toPrimitive];
777
- if (prim !== undefined) {
778
- var res = prim.call(input, hint || "default");
779
- if (_typeof(res) !== "object") return res;
780
- throw new TypeError("@@toPrimitive must return a primitive value.");
781
- }
782
- return (hint === "string" ? String : Number)(input);
783
- }
784
-
785
- function _toPropertyKey(arg) {
786
- var key = _toPrimitive(arg, "string");
787
- return _typeof(key) === "symbol" ? key : String(key);
788
- }
789
-
790
- function _defineProperty(obj, key, value) {
791
- key = _toPropertyKey(key);
792
- if (key in obj) {
793
- Object.defineProperty(obj, key, {
794
- value: value,
795
- enumerable: true,
796
- configurable: true,
797
- writable: true
798
- });
799
- } else {
800
- obj[key] = value;
801
- }
802
- return obj;
803
- }
804
-
805
- var platform$1 = {exports: {}};
806
-
33
+ */!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var l in o)t.call(o,l)&&o[l]&&e.push(l)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(W);var N=W.exports,G={command:"cmd",escape:"esc",control:"ctrl",option:"opt"},F={option:"alt",command:"ctrl",return:"enter",delete:"backspace"},V="OS X";function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function K(e){var t=function(e,t){if("object"!==D(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===D(t)?t:String(t)}var $={exports:{}};
807
34
  /*!
808
35
  * Platform.js v1.3.6
809
36
  * Copyright 2014-2020 Benjamin Tan
810
37
  * Copyright 2011-2013 John-David Dalton
811
38
  * Available under MIT license
812
- */
813
-
814
- (function (module, exports) {
815
- (function() {
816
-
817
- /** Used to determine if values are of the language type `Object`. */
818
- var objectTypes = {
819
- 'function': true,
820
- 'object': true
821
- };
822
-
823
- /** Used as a reference to the global object. */
824
- var root = (objectTypes[typeof window] && window) || this;
825
-
826
- /** Detect free variable `exports`. */
827
- var freeExports = exports;
828
-
829
- /** Detect free variable `module`. */
830
- var freeModule = module && !module.nodeType && module;
831
-
832
- /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
833
- var freeGlobal = freeExports && freeModule && typeof commonjsGlobal == 'object' && commonjsGlobal;
834
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
835
- root = freeGlobal;
836
- }
837
-
838
- /**
839
- * Used as the maximum length of an array-like object.
840
- * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
841
- * for more details.
842
- */
843
- var maxSafeInteger = Math.pow(2, 53) - 1;
844
-
845
- /** Regular expression to detect Opera. */
846
- var reOpera = /\bOpera/;
847
-
848
- /** Used for native method references. */
849
- var objectProto = Object.prototype;
850
-
851
- /** Used to check for own properties of an object. */
852
- var hasOwnProperty = objectProto.hasOwnProperty;
853
-
854
- /** Used to resolve the internal `[[Class]]` of values. */
855
- var toString = objectProto.toString;
856
-
857
- /*--------------------------------------------------------------------------*/
858
-
859
- /**
860
- * Capitalizes a string value.
861
- *
862
- * @private
863
- * @param {string} string The string to capitalize.
864
- * @returns {string} The capitalized string.
865
- */
866
- function capitalize(string) {
867
- string = String(string);
868
- return string.charAt(0).toUpperCase() + string.slice(1);
869
- }
870
-
871
- /**
872
- * A utility function to clean up the OS name.
873
- *
874
- * @private
875
- * @param {string} os The OS name to clean up.
876
- * @param {string} [pattern] A `RegExp` pattern matching the OS name.
877
- * @param {string} [label] A label for the OS.
878
- */
879
- function cleanupOS(os, pattern, label) {
880
- // Platform tokens are defined at:
881
- // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
882
- // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
883
- var data = {
884
- '10.0': '10',
885
- '6.4': '10 Technical Preview',
886
- '6.3': '8.1',
887
- '6.2': '8',
888
- '6.1': 'Server 2008 R2 / 7',
889
- '6.0': 'Server 2008 / Vista',
890
- '5.2': 'Server 2003 / XP 64-bit',
891
- '5.1': 'XP',
892
- '5.01': '2000 SP1',
893
- '5.0': '2000',
894
- '4.0': 'NT',
895
- '4.90': 'ME'
896
- };
897
- // Detect Windows version from platform tokens.
898
- if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) &&
899
- (data = data[/[\d.]+$/.exec(os)])) {
900
- os = 'Windows ' + data;
901
- }
902
- // Correct character case and cleanup string.
903
- os = String(os);
904
-
905
- if (pattern && label) {
906
- os = os.replace(RegExp(pattern, 'i'), label);
907
- }
908
-
909
- os = format(
910
- os.replace(/ ce$/i, ' CE')
911
- .replace(/\bhpw/i, 'web')
912
- .replace(/\bMacintosh\b/, 'Mac OS')
913
- .replace(/_PowerPC\b/i, ' OS')
914
- .replace(/\b(OS X) [^ \d]+/i, '$1')
915
- .replace(/\bMac (OS X)\b/, '$1')
916
- .replace(/\/(\d)/, ' $1')
917
- .replace(/_/g, '.')
918
- .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
919
- .replace(/\bx86\.64\b/gi, 'x86_64')
920
- .replace(/\b(Windows Phone) OS\b/, '$1')
921
- .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1')
922
- .split(' on ')[0]
923
- );
924
-
925
- return os;
926
- }
927
-
928
- /**
929
- * An iteration utility for arrays and objects.
930
- *
931
- * @private
932
- * @param {Array|Object} object The object to iterate over.
933
- * @param {Function} callback The function called per iteration.
934
- */
935
- function each(object, callback) {
936
- var index = -1,
937
- length = object ? object.length : 0;
938
-
939
- if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
940
- while (++index < length) {
941
- callback(object[index], index, object);
942
- }
943
- } else {
944
- forOwn(object, callback);
945
- }
946
- }
947
-
948
- /**
949
- * Trim and conditionally capitalize string values.
950
- *
951
- * @private
952
- * @param {string} string The string to format.
953
- * @returns {string} The formatted string.
954
- */
955
- function format(string) {
956
- string = trim(string);
957
- return /^(?:webOS|i(?:OS|P))/.test(string)
958
- ? string
959
- : capitalize(string);
960
- }
961
-
962
- /**
963
- * Iterates over an object's own properties, executing the `callback` for each.
964
- *
965
- * @private
966
- * @param {Object} object The object to iterate over.
967
- * @param {Function} callback The function executed per own property.
968
- */
969
- function forOwn(object, callback) {
970
- for (var key in object) {
971
- if (hasOwnProperty.call(object, key)) {
972
- callback(object[key], key, object);
973
- }
974
- }
975
- }
976
-
977
- /**
978
- * Gets the internal `[[Class]]` of a value.
979
- *
980
- * @private
981
- * @param {*} value The value.
982
- * @returns {string} The `[[Class]]`.
983
- */
984
- function getClassOf(value) {
985
- return value == null
986
- ? capitalize(value)
987
- : toString.call(value).slice(8, -1);
988
- }
989
-
990
- /**
991
- * Host objects can return type values that are different from their actual
992
- * data type. The objects we are concerned with usually return non-primitive
993
- * types of "object", "function", or "unknown".
994
- *
995
- * @private
996
- * @param {*} object The owner of the property.
997
- * @param {string} property The property to check.
998
- * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
999
- */
1000
- function isHostType(object, property) {
1001
- var type = object != null ? typeof object[property] : 'number';
1002
- return !/^(?:boolean|number|string|undefined)$/.test(type) &&
1003
- (type == 'object' ? !!object[property] : true);
1004
- }
1005
-
1006
- /**
1007
- * Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
1008
- *
1009
- * @private
1010
- * @param {string} string The string to qualify.
1011
- * @returns {string} The qualified string.
1012
- */
1013
- function qualify(string) {
1014
- return String(string).replace(/([ -])(?!$)/g, '$1?');
1015
- }
1016
-
1017
- /**
1018
- * A bare-bones `Array#reduce` like utility function.
1019
- *
1020
- * @private
1021
- * @param {Array} array The array to iterate over.
1022
- * @param {Function} callback The function called per iteration.
1023
- * @returns {*} The accumulated result.
1024
- */
1025
- function reduce(array, callback) {
1026
- var accumulator = null;
1027
- each(array, function(value, index) {
1028
- accumulator = callback(accumulator, value, index, array);
1029
- });
1030
- return accumulator;
1031
- }
1032
-
1033
- /**
1034
- * Removes leading and trailing whitespace from a string.
1035
- *
1036
- * @private
1037
- * @param {string} string The string to trim.
1038
- * @returns {string} The trimmed string.
1039
- */
1040
- function trim(string) {
1041
- return String(string).replace(/^ +| +$/g, '');
1042
- }
1043
-
1044
- /*--------------------------------------------------------------------------*/
1045
-
1046
- /**
1047
- * Creates a new platform object.
1048
- *
1049
- * @memberOf platform
1050
- * @param {Object|string} [ua=navigator.userAgent] The user agent string or
1051
- * context object.
1052
- * @returns {Object} A platform object.
1053
- */
1054
- function parse(ua) {
1055
-
1056
- /** The environment context object. */
1057
- var context = root;
1058
-
1059
- /** Used to flag when a custom context is provided. */
1060
- var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String';
1061
-
1062
- // Juggle arguments.
1063
- if (isCustomContext) {
1064
- context = ua;
1065
- ua = null;
1066
- }
1067
-
1068
- /** Browser navigator object. */
1069
- var nav = context.navigator || {};
1070
-
1071
- /** Browser user agent string. */
1072
- var userAgent = nav.userAgent || '';
1073
-
1074
- ua || (ua = userAgent);
1075
-
1076
- /** Used to detect if browser is like Chrome. */
1077
- var likeChrome = isCustomContext
1078
- ? !!nav.likeChrome
1079
- : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
1080
-
1081
- /** Internal `[[Class]]` value shortcuts. */
1082
- var objectClass = 'Object',
1083
- airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
1084
- enviroClass = isCustomContext ? objectClass : 'Environment',
1085
- javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java),
1086
- phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
1087
-
1088
- /** Detect Java environments. */
1089
- var java = /\bJava/.test(javaClass) && context.java;
1090
-
1091
- /** Detect Rhino. */
1092
- var rhino = java && getClassOf(context.environment) == enviroClass;
1093
-
1094
- /** A character to represent alpha. */
1095
- var alpha = java ? 'a' : '\u03b1';
1096
-
1097
- /** A character to represent beta. */
1098
- var beta = java ? 'b' : '\u03b2';
1099
-
1100
- /** Browser document object. */
1101
- var doc = context.document || {};
1102
-
1103
- /**
1104
- * Detect Opera browser (Presto-based).
1105
- * http://www.howtocreate.co.uk/operaStuff/operaObject.html
1106
- * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
1107
- */
1108
- var opera = context.operamini || context.opera;
1109
-
1110
- /** Opera `[[Class]]`. */
1111
- var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
1112
- ? operaClass
1113
- : (opera = null);
1114
-
1115
- /*------------------------------------------------------------------------*/
1116
-
1117
- /** Temporary variable used over the script's lifetime. */
1118
- var data;
1119
-
1120
- /** The CPU architecture. */
1121
- var arch = ua;
1122
-
1123
- /** Platform description array. */
1124
- var description = [];
1125
-
1126
- /** Platform alpha/beta indicator. */
1127
- var prerelease = null;
1128
-
1129
- /** A flag to indicate that environment features should be used to resolve the platform. */
1130
- var useFeatures = ua == userAgent;
1131
-
1132
- /** The browser/environment version. */
1133
- var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
1134
-
1135
- /** A flag to indicate if the OS ends with "/ Version" */
1136
- var isSpecialCasedOS;
1137
-
1138
- /* Detectable layout engines (order is important). */
1139
- var layout = getLayout([
1140
- { 'label': 'EdgeHTML', 'pattern': 'Edge' },
1141
- 'Trident',
1142
- { 'label': 'WebKit', 'pattern': 'AppleWebKit' },
1143
- 'iCab',
1144
- 'Presto',
1145
- 'NetFront',
1146
- 'Tasman',
1147
- 'KHTML',
1148
- 'Gecko'
1149
- ]);
1150
-
1151
- /* Detectable browser names (order is important). */
1152
- var name = getName([
1153
- 'Adobe AIR',
1154
- 'Arora',
1155
- 'Avant Browser',
1156
- 'Breach',
1157
- 'Camino',
1158
- 'Electron',
1159
- 'Epiphany',
1160
- 'Fennec',
1161
- 'Flock',
1162
- 'Galeon',
1163
- 'GreenBrowser',
1164
- 'iCab',
1165
- 'Iceweasel',
1166
- 'K-Meleon',
1167
- 'Konqueror',
1168
- 'Lunascape',
1169
- 'Maxthon',
1170
- { 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' },
1171
- 'Midori',
1172
- 'Nook Browser',
1173
- 'PaleMoon',
1174
- 'PhantomJS',
1175
- 'Raven',
1176
- 'Rekonq',
1177
- 'RockMelt',
1178
- { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' },
1179
- 'SeaMonkey',
1180
- { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
1181
- 'Sleipnir',
1182
- 'SlimBrowser',
1183
- { 'label': 'SRWare Iron', 'pattern': 'Iron' },
1184
- 'Sunrise',
1185
- 'Swiftfox',
1186
- 'Vivaldi',
1187
- 'Waterfox',
1188
- 'WebPositive',
1189
- { 'label': 'Yandex Browser', 'pattern': 'YaBrowser' },
1190
- { 'label': 'UC Browser', 'pattern': 'UCBrowser' },
1191
- 'Opera Mini',
1192
- { 'label': 'Opera Mini', 'pattern': 'OPiOS' },
1193
- 'Opera',
1194
- { 'label': 'Opera', 'pattern': 'OPR' },
1195
- 'Chromium',
1196
- 'Chrome',
1197
- { 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' },
1198
- { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' },
1199
- { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' },
1200
- { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' },
1201
- { 'label': 'IE', 'pattern': 'IEMobile' },
1202
- { 'label': 'IE', 'pattern': 'MSIE' },
1203
- 'Safari'
1204
- ]);
1205
-
1206
- /* Detectable products (order is important). */
1207
- var product = getProduct([
1208
- { 'label': 'BlackBerry', 'pattern': 'BB10' },
1209
- 'BlackBerry',
1210
- { 'label': 'Galaxy S', 'pattern': 'GT-I9000' },
1211
- { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' },
1212
- { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' },
1213
- { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' },
1214
- { 'label': 'Galaxy S5', 'pattern': 'SM-G900' },
1215
- { 'label': 'Galaxy S6', 'pattern': 'SM-G920' },
1216
- { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' },
1217
- { 'label': 'Galaxy S7', 'pattern': 'SM-G930' },
1218
- { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' },
1219
- 'Google TV',
1220
- 'Lumia',
1221
- 'iPad',
1222
- 'iPod',
1223
- 'iPhone',
1224
- 'Kindle',
1225
- { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
1226
- 'Nexus',
1227
- 'Nook',
1228
- 'PlayBook',
1229
- 'PlayStation Vita',
1230
- 'PlayStation',
1231
- 'TouchPad',
1232
- 'Transformer',
1233
- { 'label': 'Wii U', 'pattern': 'WiiU' },
1234
- 'Wii',
1235
- 'Xbox One',
1236
- { 'label': 'Xbox 360', 'pattern': 'Xbox' },
1237
- 'Xoom'
1238
- ]);
1239
-
1240
- /* Detectable manufacturers. */
1241
- var manufacturer = getManufacturer({
1242
- 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
1243
- 'Alcatel': {},
1244
- 'Archos': {},
1245
- 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
1246
- 'Asus': { 'Transformer': 1 },
1247
- 'Barnes & Noble': { 'Nook': 1 },
1248
- 'BlackBerry': { 'PlayBook': 1 },
1249
- 'Google': { 'Google TV': 1, 'Nexus': 1 },
1250
- 'HP': { 'TouchPad': 1 },
1251
- 'HTC': {},
1252
- 'Huawei': {},
1253
- 'Lenovo': {},
1254
- 'LG': {},
1255
- 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
1256
- 'Motorola': { 'Xoom': 1 },
1257
- 'Nintendo': { 'Wii U': 1, 'Wii': 1 },
1258
- 'Nokia': { 'Lumia': 1 },
1259
- 'Oppo': {},
1260
- 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
1261
- 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 },
1262
- 'Xiaomi': { 'Mi': 1, 'Redmi': 1 }
1263
- });
1264
-
1265
- /* Detectable operating systems (order is important). */
1266
- var os = getOS([
1267
- 'Windows Phone',
1268
- 'KaiOS',
1269
- 'Android',
1270
- 'CentOS',
1271
- { 'label': 'Chrome OS', 'pattern': 'CrOS' },
1272
- 'Debian',
1273
- { 'label': 'DragonFly BSD', 'pattern': 'DragonFly' },
1274
- 'Fedora',
1275
- 'FreeBSD',
1276
- 'Gentoo',
1277
- 'Haiku',
1278
- 'Kubuntu',
1279
- 'Linux Mint',
1280
- 'OpenBSD',
1281
- 'Red Hat',
1282
- 'SuSE',
1283
- 'Ubuntu',
1284
- 'Xubuntu',
1285
- 'Cygwin',
1286
- 'Symbian OS',
1287
- 'hpwOS',
1288
- 'webOS ',
1289
- 'webOS',
1290
- 'Tablet OS',
1291
- 'Tizen',
1292
- 'Linux',
1293
- 'Mac OS X',
1294
- 'Macintosh',
1295
- 'Mac',
1296
- 'Windows 98;',
1297
- 'Windows '
1298
- ]);
1299
-
1300
- /*------------------------------------------------------------------------*/
1301
-
1302
- /**
1303
- * Picks the layout engine from an array of guesses.
1304
- *
1305
- * @private
1306
- * @param {Array} guesses An array of guesses.
1307
- * @returns {null|string} The detected layout engine.
1308
- */
1309
- function getLayout(guesses) {
1310
- return reduce(guesses, function(result, guess) {
1311
- return result || RegExp('\\b' + (
1312
- guess.pattern || qualify(guess)
1313
- ) + '\\b', 'i').exec(ua) && (guess.label || guess);
1314
- });
1315
- }
1316
-
1317
- /**
1318
- * Picks the manufacturer from an array of guesses.
1319
- *
1320
- * @private
1321
- * @param {Array} guesses An object of guesses.
1322
- * @returns {null|string} The detected manufacturer.
1323
- */
1324
- function getManufacturer(guesses) {
1325
- return reduce(guesses, function(result, value, key) {
1326
- // Lookup the manufacturer by product or scan the UA for the manufacturer.
1327
- return result || (
1328
- value[product] ||
1329
- value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] ||
1330
- RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)
1331
- ) && key;
1332
- });
1333
- }
1334
-
1335
- /**
1336
- * Picks the browser name from an array of guesses.
1337
- *
1338
- * @private
1339
- * @param {Array} guesses An array of guesses.
1340
- * @returns {null|string} The detected browser name.
1341
- */
1342
- function getName(guesses) {
1343
- return reduce(guesses, function(result, guess) {
1344
- return result || RegExp('\\b' + (
1345
- guess.pattern || qualify(guess)
1346
- ) + '\\b', 'i').exec(ua) && (guess.label || guess);
1347
- });
1348
- }
1349
-
1350
- /**
1351
- * Picks the OS name from an array of guesses.
1352
- *
1353
- * @private
1354
- * @param {Array} guesses An array of guesses.
1355
- * @returns {null|string} The detected OS name.
1356
- */
1357
- function getOS(guesses) {
1358
- return reduce(guesses, function(result, guess) {
1359
- var pattern = guess.pattern || qualify(guess);
1360
- if (!result && (result =
1361
- RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
1362
- )) {
1363
- result = cleanupOS(result, pattern, guess.label || guess);
1364
- }
1365
- return result;
1366
- });
1367
- }
1368
-
1369
- /**
1370
- * Picks the product name from an array of guesses.
1371
- *
1372
- * @private
1373
- * @param {Array} guesses An array of guesses.
1374
- * @returns {null|string} The detected product name.
1375
- */
1376
- function getProduct(guesses) {
1377
- return reduce(guesses, function(result, guess) {
1378
- var pattern = guess.pattern || qualify(guess);
1379
- if (!result && (result =
1380
- RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) ||
1381
- RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) ||
1382
- RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua)
1383
- )) {
1384
- // Split by forward slash and append product version if needed.
1385
- if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
1386
- result[0] += ' ' + result[1];
1387
- }
1388
- // Correct character case and cleanup string.
1389
- guess = guess.label || guess;
1390
- result = format(result[0]
1391
- .replace(RegExp(pattern, 'i'), guess)
1392
- .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ')
1393
- .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
1394
- }
1395
- return result;
1396
- });
1397
- }
1398
-
1399
- /**
1400
- * Resolves the version using an array of UA patterns.
1401
- *
1402
- * @private
1403
- * @param {Array} patterns An array of UA patterns.
1404
- * @returns {null|string} The detected version.
1405
- */
1406
- function getVersion(patterns) {
1407
- return reduce(patterns, function(result, pattern) {
1408
- return result || (RegExp(pattern +
1409
- '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
1410
- });
1411
- }
1412
-
1413
- /**
1414
- * Returns `platform.description` when the platform object is coerced to a string.
1415
- *
1416
- * @name toString
1417
- * @memberOf platform
1418
- * @returns {string} Returns `platform.description` if available, else an empty string.
1419
- */
1420
- function toStringPlatform() {
1421
- return this.description || '';
1422
- }
1423
-
1424
- /*------------------------------------------------------------------------*/
1425
-
1426
- // Convert layout to an array so we can add extra details.
1427
- layout && (layout = [layout]);
1428
-
1429
- // Detect Android products.
1430
- // Browsers on Android devices typically provide their product IDS after "Android;"
1431
- // up to "Build" or ") AppleWebKit".
1432
- // Example:
1433
- // "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
1434
- // (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
1435
- if (/\bAndroid\b/.test(os) && !product &&
1436
- (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
1437
- product = trim(data[1])
1438
- // Replace any language codes (eg. "en-US").
1439
- .replace(/^[a-z]{2}-[a-z]{2};\s*/i, '')
1440
- || null;
1441
- }
1442
- // Detect product names that contain their manufacturer's name.
1443
- if (manufacturer && !product) {
1444
- product = getProduct([manufacturer]);
1445
- } else if (manufacturer && product) {
1446
- product = product
1447
- .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ')
1448
- .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
1449
- }
1450
- // Clean up Google TV.
1451
- if ((data = /\bGoogle TV\b/.exec(product))) {
1452
- product = data[0];
1453
- }
1454
- // Detect simulators.
1455
- if (/\bSimulator\b/i.test(ua)) {
1456
- product = (product ? product + ' ' : '') + 'Simulator';
1457
- }
1458
- // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
1459
- if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
1460
- description.push('running in Turbo/Uncompressed mode');
1461
- }
1462
- // Detect IE Mobile 11.
1463
- if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
1464
- data = parse(ua.replace(/like iPhone OS/, ''));
1465
- manufacturer = data.manufacturer;
1466
- product = data.product;
1467
- }
1468
- // Detect iOS.
1469
- else if (/^iP/.test(product)) {
1470
- name || (name = 'Safari');
1471
- os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua))
1472
- ? ' ' + data[1].replace(/_/g, '.')
1473
- : '');
1474
- }
1475
- // Detect Kubuntu.
1476
- else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
1477
- os = 'Kubuntu';
1478
- }
1479
- // Detect Android browsers.
1480
- else if ((manufacturer && manufacturer != 'Google' &&
1481
- ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) ||
1482
- (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) {
1483
- name = 'Android Browser';
1484
- os = /\bAndroid\b/.test(os) ? os : 'Android';
1485
- }
1486
- // Detect Silk desktop/accelerated modes.
1487
- else if (name == 'Silk') {
1488
- if (!/\bMobi/i.test(ua)) {
1489
- os = 'Android';
1490
- description.unshift('desktop mode');
1491
- }
1492
- if (/Accelerated *= *true/i.test(ua)) {
1493
- description.unshift('accelerated');
1494
- }
1495
- }
1496
- // Detect UC Browser speed mode.
1497
- else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
1498
- description.push('speed mode');
1499
- }
1500
- // Detect PaleMoon identifying as Firefox.
1501
- else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
1502
- description.push('identifying as Firefox ' + data[1]);
1503
- }
1504
- // Detect Firefox OS and products running Firefox.
1505
- else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
1506
- os || (os = 'Firefox OS');
1507
- product || (product = data[1]);
1508
- }
1509
- // Detect false positives for Firefox/Safari.
1510
- else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
1511
- // Escape the `/` for Firefox 1.
1512
- if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
1513
- // Clear name of false positives.
1514
- name = null;
1515
- }
1516
- // Reassign a generic name.
1517
- if ((data = product || manufacturer || os) &&
1518
- (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
1519
- name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
1520
- }
1521
- }
1522
- // Add Chrome version to description for Electron.
1523
- else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
1524
- description.push('Chromium ' + data);
1525
- }
1526
- // Detect non-Opera (Presto-based) versions (order is important).
1527
- if (!version) {
1528
- version = getVersion([
1529
- '(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)',
1530
- 'Version',
1531
- qualify(name),
1532
- '(?:Firefox|Minefield|NetFront)'
1533
- ]);
1534
- }
1535
- // Detect stubborn layout engines.
1536
- if ((data =
1537
- layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' ||
1538
- /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') ||
1539
- /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' ||
1540
- !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') ||
1541
- layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront'
1542
- )) {
1543
- layout = [data];
1544
- }
1545
- // Detect Windows Phone 7 desktop mode.
1546
- if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
1547
- name += ' Mobile';
1548
- os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
1549
- description.unshift('desktop mode');
1550
- }
1551
- // Detect Windows Phone 8.x desktop mode.
1552
- else if (/\bWPDesktop\b/i.test(ua)) {
1553
- name = 'IE Mobile';
1554
- os = 'Windows Phone 8.x';
1555
- description.unshift('desktop mode');
1556
- version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
1557
- }
1558
- // Detect IE 11 identifying as other browsers.
1559
- else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
1560
- if (name) {
1561
- description.push('identifying as ' + name + (version ? ' ' + version : ''));
1562
- }
1563
- name = 'IE';
1564
- version = data[1];
1565
- }
1566
- // Leverage environment features.
1567
- if (useFeatures) {
1568
- // Detect server-side environments.
1569
- // Rhino has a global function while others have a global object.
1570
- if (isHostType(context, 'global')) {
1571
- if (java) {
1572
- data = java.lang.System;
1573
- arch = data.getProperty('os.arch');
1574
- os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
1575
- }
1576
- if (rhino) {
1577
- try {
1578
- version = context.require('ringo/engine').version.join('.');
1579
- name = 'RingoJS';
1580
- } catch(e) {
1581
- if ((data = context.system) && data.global.system == context.system) {
1582
- name = 'Narwhal';
1583
- os || (os = data[0].os || null);
1584
- }
1585
- }
1586
- if (!name) {
1587
- name = 'Rhino';
1588
- }
1589
- }
1590
- else if (
1591
- typeof context.process == 'object' && !context.process.browser &&
1592
- (data = context.process)
1593
- ) {
1594
- if (typeof data.versions == 'object') {
1595
- if (typeof data.versions.electron == 'string') {
1596
- description.push('Node ' + data.versions.node);
1597
- name = 'Electron';
1598
- version = data.versions.electron;
1599
- } else if (typeof data.versions.nw == 'string') {
1600
- description.push('Chromium ' + version, 'Node ' + data.versions.node);
1601
- name = 'NW.js';
1602
- version = data.versions.nw;
1603
- }
1604
- }
1605
- if (!name) {
1606
- name = 'Node.js';
1607
- arch = data.arch;
1608
- os = data.platform;
1609
- version = /[\d.]+/.exec(data.version);
1610
- version = version ? version[0] : null;
1611
- }
1612
- }
1613
- }
1614
- // Detect Adobe AIR.
1615
- else if (getClassOf((data = context.runtime)) == airRuntimeClass) {
1616
- name = 'Adobe AIR';
1617
- os = data.flash.system.Capabilities.os;
1618
- }
1619
- // Detect PhantomJS.
1620
- else if (getClassOf((data = context.phantom)) == phantomClass) {
1621
- name = 'PhantomJS';
1622
- version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
1623
- }
1624
- // Detect IE compatibility modes.
1625
- else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
1626
- // We're in compatibility mode when the Trident version + 4 doesn't
1627
- // equal the document mode.
1628
- version = [version, doc.documentMode];
1629
- if ((data = +data[1] + 4) != version[1]) {
1630
- description.push('IE ' + version[1] + ' mode');
1631
- layout && (layout[1] = '');
1632
- version[1] = data;
1633
- }
1634
- version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
1635
- }
1636
- // Detect IE 11 masking as other browsers.
1637
- else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
1638
- description.push('masking as ' + name + ' ' + version);
1639
- name = 'IE';
1640
- version = '11.0';
1641
- layout = ['Trident'];
1642
- os = 'Windows';
1643
- }
1644
- os = os && format(os);
1645
- }
1646
- // Detect prerelease phases.
1647
- if (version && (data =
1648
- /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
1649
- /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
1650
- /\bMinefield\b/i.test(ua) && 'a'
1651
- )) {
1652
- prerelease = /b/i.test(data) ? 'beta' : 'alpha';
1653
- version = version.replace(RegExp(data + '\\+?$'), '') +
1654
- (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
1655
- }
1656
- // Detect Firefox Mobile.
1657
- if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
1658
- name = 'Firefox Mobile';
1659
- }
1660
- // Obscure Maxthon's unreliable version.
1661
- else if (name == 'Maxthon' && version) {
1662
- version = version.replace(/\.[\d.]+/, '.x');
1663
- }
1664
- // Detect Xbox 360 and Xbox One.
1665
- else if (/\bXbox\b/i.test(product)) {
1666
- if (product == 'Xbox 360') {
1667
- os = null;
1668
- }
1669
- if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
1670
- description.unshift('mobile mode');
1671
- }
1672
- }
1673
- // Add mobile postfix.
1674
- else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) &&
1675
- (os == 'Windows CE' || /Mobi/i.test(ua))) {
1676
- name += ' Mobile';
1677
- }
1678
- // Detect IE platform preview.
1679
- else if (name == 'IE' && useFeatures) {
1680
- try {
1681
- if (context.external === null) {
1682
- description.unshift('platform preview');
1683
- }
1684
- } catch(e) {
1685
- description.unshift('embedded');
1686
- }
1687
- }
1688
- // Detect BlackBerry OS version.
1689
- // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
1690
- else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data =
1691
- (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
1692
- version
1693
- )) {
1694
- data = [data, /BB10/.test(ua)];
1695
- os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
1696
- version = null;
1697
- }
1698
- // Detect Opera identifying/masking itself as another browser.
1699
- // http://www.opera.com/support/kb/view/843/
1700
- else if (this != forOwn && product != 'Wii' && (
1701
- (useFeatures && opera) ||
1702
- (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) ||
1703
- (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) ||
1704
- (name == 'IE' && (
1705
- (os && !/^Win/.test(os) && version > 5.5) ||
1706
- /\bWindows XP\b/.test(os) && version > 8 ||
1707
- version == 8 && !/\bTrident\b/.test(ua)
1708
- ))
1709
- ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
1710
- // When "identifying", the UA contains both Opera and the other browser's name.
1711
- data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
1712
- if (reOpera.test(name)) {
1713
- if (/\bIE\b/.test(data) && os == 'Mac OS') {
1714
- os = null;
1715
- }
1716
- data = 'identify' + data;
1717
- }
1718
- // When "masking", the UA contains only the other browser's name.
1719
- else {
1720
- data = 'mask' + data;
1721
- if (operaClass) {
1722
- name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
1723
- } else {
1724
- name = 'Opera';
1725
- }
1726
- if (/\bIE\b/.test(data)) {
1727
- os = null;
1728
- }
1729
- if (!useFeatures) {
1730
- version = null;
1731
- }
1732
- }
1733
- layout = ['Presto'];
1734
- description.push(data);
1735
- }
1736
- // Detect WebKit Nightly and approximate Chrome/Safari versions.
1737
- if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
1738
- // Correct build number for numeric comparison.
1739
- // (e.g. "532.5" becomes "532.05")
1740
- data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
1741
- // Nightly builds are postfixed with a "+".
1742
- if (name == 'Safari' && data[1].slice(-1) == '+') {
1743
- name = 'WebKit Nightly';
1744
- prerelease = 'alpha';
1745
- version = data[1].slice(0, -1);
1746
- }
1747
- // Clear incorrect browser versions.
1748
- else if (version == data[1] ||
1749
- version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
1750
- version = null;
1751
- }
1752
- // Use the full Chrome version when available.
1753
- data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
1754
- // Detect Blink layout engine.
1755
- if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
1756
- layout = ['Blink'];
1757
- }
1758
- // Detect JavaScriptCore.
1759
- // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
1760
- if (!useFeatures || (!likeChrome && !data[1])) {
1761
- layout && (layout[1] = 'like Safari');
1762
- data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12');
1763
- } else {
1764
- layout && (layout[1] = 'like Chrome');
1765
- data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
1766
- }
1767
- // Add the postfix of ".x" or "+" for approximate versions.
1768
- layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
1769
- // Obscure version for some Safari 1-2 releases.
1770
- if (name == 'Safari' && (!version || parseInt(version) > 45)) {
1771
- version = data;
1772
- } else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
1773
- description.unshift('headless');
1774
- }
1775
- }
1776
- // Detect Opera desktop modes.
1777
- if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
1778
- name += ' ';
1779
- description.unshift('desktop mode');
1780
- if (data == 'zvav') {
1781
- name += 'Mini';
1782
- version = null;
1783
- } else {
1784
- name += 'Mobile';
1785
- }
1786
- os = os.replace(RegExp(' *' + data + '$'), '');
1787
- }
1788
- // Detect Chrome desktop mode.
1789
- else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
1790
- description.unshift('desktop mode');
1791
- name = 'Chrome Mobile';
1792
- version = null;
1793
-
1794
- if (/\bOS X\b/.test(os)) {
1795
- manufacturer = 'Apple';
1796
- os = 'iOS 4.3+';
1797
- } else {
1798
- os = null;
1799
- }
1800
- }
1801
- // Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
1802
- else if (/\bSRWare Iron\b/.test(name) && !version) {
1803
- version = getVersion('Chrome');
1804
- }
1805
- // Strip incorrect OS versions.
1806
- if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
1807
- ua.indexOf('/' + data + '-') > -1) {
1808
- os = trim(os.replace(data, ''));
1809
- }
1810
- // Ensure OS does not include the browser name.
1811
- if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
1812
- os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
1813
- }
1814
- // Add layout engine.
1815
- if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (
1816
- /Browser|Lunascape|Maxthon/.test(name) ||
1817
- name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) ||
1818
- /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
1819
- // Don't add layout details to description if they are falsey.
1820
- (data = layout[layout.length - 1]) && description.push(data);
1821
- }
1822
- // Combine contextual information.
1823
- if (description.length) {
1824
- description = ['(' + description.join('; ') + ')'];
1825
- }
1826
- // Append manufacturer to description.
1827
- if (manufacturer && product && product.indexOf(manufacturer) < 0) {
1828
- description.push('on ' + manufacturer);
1829
- }
1830
- // Append product to description.
1831
- if (product) {
1832
- description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
1833
- }
1834
- // Parse the OS into an object.
1835
- if (os) {
1836
- data = / ([\d.+]+)$/.exec(os);
1837
- isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
1838
- os = {
1839
- 'architecture': 32,
1840
- 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
1841
- 'version': data ? data[1] : null,
1842
- 'toString': function() {
1843
- var version = this.version;
1844
- return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
1845
- }
1846
- };
1847
- }
1848
- // Add browser/OS architecture.
1849
- if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
1850
- if (os) {
1851
- os.architecture = 64;
1852
- os.family = os.family.replace(RegExp(' *' + data), '');
1853
- }
1854
- if (
1855
- name && (/\bWOW64\b/i.test(ua) ||
1856
- (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua)))
1857
- ) {
1858
- description.unshift('32-bit');
1859
- }
1860
- }
1861
- // Chrome 39 and above on OS X is always 64-bit.
1862
- else if (
1863
- os && /^OS X/.test(os.family) &&
1864
- name == 'Chrome' && parseFloat(version) >= 39
1865
- ) {
1866
- os.architecture = 64;
1867
- }
1868
-
1869
- ua || (ua = null);
1870
-
1871
- /*------------------------------------------------------------------------*/
1872
-
1873
- /**
1874
- * The platform object.
1875
- *
1876
- * @name platform
1877
- * @type Object
1878
- */
1879
- var platform = {};
1880
-
1881
- /**
1882
- * The platform description.
1883
- *
1884
- * @memberOf platform
1885
- * @type string|null
1886
- */
1887
- platform.description = ua;
1888
-
1889
- /**
1890
- * The name of the browser's layout engine.
1891
- *
1892
- * The list of common layout engines include:
1893
- * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
1894
- *
1895
- * @memberOf platform
1896
- * @type string|null
1897
- */
1898
- platform.layout = layout && layout[0];
1899
-
1900
- /**
1901
- * The name of the product's manufacturer.
1902
- *
1903
- * The list of manufacturers include:
1904
- * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
1905
- * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
1906
- * "Nokia", "Samsung" and "Sony"
1907
- *
1908
- * @memberOf platform
1909
- * @type string|null
1910
- */
1911
- platform.manufacturer = manufacturer;
1912
-
1913
- /**
1914
- * The name of the browser/environment.
1915
- *
1916
- * The list of common browser names include:
1917
- * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
1918
- * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
1919
- * "Opera Mini" and "Opera"
1920
- *
1921
- * Mobile versions of some browsers have "Mobile" appended to their name:
1922
- * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
1923
- *
1924
- * @memberOf platform
1925
- * @type string|null
1926
- */
1927
- platform.name = name;
1928
-
1929
- /**
1930
- * The alpha/beta release indicator.
1931
- *
1932
- * @memberOf platform
1933
- * @type string|null
1934
- */
1935
- platform.prerelease = prerelease;
1936
-
1937
- /**
1938
- * The name of the product hosting the browser.
1939
- *
1940
- * The list of common products include:
1941
- *
1942
- * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
1943
- * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
1944
- *
1945
- * @memberOf platform
1946
- * @type string|null
1947
- */
1948
- platform.product = product;
1949
-
1950
- /**
1951
- * The browser's user agent string.
1952
- *
1953
- * @memberOf platform
1954
- * @type string|null
1955
- */
1956
- platform.ua = ua;
1957
-
1958
- /**
1959
- * The browser/environment version.
1960
- *
1961
- * @memberOf platform
1962
- * @type string|null
1963
- */
1964
- platform.version = name && version;
1965
-
1966
- /**
1967
- * The name of the operating system.
1968
- *
1969
- * @memberOf platform
1970
- * @type Object
1971
- */
1972
- platform.os = os || {
1973
-
1974
- /**
1975
- * The CPU architecture the OS is built for.
1976
- *
1977
- * @memberOf platform.os
1978
- * @type number|null
1979
- */
1980
- 'architecture': null,
1981
-
1982
- /**
1983
- * The family of the OS.
1984
- *
1985
- * Common values include:
1986
- * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
1987
- * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
1988
- * "SuSE", "Android", "iOS" and "Windows Phone"
1989
- *
1990
- * @memberOf platform.os
1991
- * @type string|null
1992
- */
1993
- 'family': null,
1994
-
1995
- /**
1996
- * The version of the OS.
1997
- *
1998
- * @memberOf platform.os
1999
- * @type string|null
2000
- */
2001
- 'version': null,
2002
-
2003
- /**
2004
- * Returns the OS string.
2005
- *
2006
- * @memberOf platform.os
2007
- * @returns {string} The OS string.
2008
- */
2009
- 'toString': function() { return 'null'; }
2010
- };
2011
-
2012
- platform.parse = parse;
2013
- platform.toString = toStringPlatform;
2014
-
2015
- if (platform.version) {
2016
- description.unshift(version);
2017
- }
2018
- if (platform.name) {
2019
- description.unshift(name);
2020
- }
2021
- if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
2022
- description.push(product ? '(' + os + ')' : 'on ' + os);
2023
- }
2024
- if (description.length) {
2025
- platform.description = description.join(' ');
2026
- }
2027
- return platform;
2028
- }
2029
-
2030
- /*--------------------------------------------------------------------------*/
2031
-
2032
- // Export platform.
2033
- var platform = parse();
2034
-
2035
- // Some AMD build optimizers, like r.js, check for condition patterns like the following:
2036
- if (freeExports && freeModule) {
2037
- // Export for CommonJS support.
2038
- forOwn(platform, function(value, key) {
2039
- freeExports[key] = value;
2040
- });
2041
- }
2042
- else {
2043
- // Export to the global object.
2044
- root.platform = platform;
2045
- }
2046
- }.call(commonjsGlobal));
2047
- } (platform$1, platform$1.exports));
2048
-
2049
- var platform = platform$1.exports;
2050
-
2051
- var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
2052
- toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
2053
- var _ref2 = _slicedToArray(_ref, 2),
2054
- macKey = _ref2[0],
2055
- windowsKey = _ref2[1];
2056
- hotkey = hotkey.replaceAll(macKey, windowsKey);
2057
- });
2058
- return hotkey;
2059
- };
2060
- var replaceDeleteKeyWithBackspace = function replaceDeleteKeyWithBackspace(hotkey) {
2061
- return hotkey.replaceAll("delete", "backspace");
2062
- };
2063
- var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
2064
- var _platformInfo$os, _platformInfo$os$fami;
2065
- var platformInfo = platform.parse(navigator.userAgent);
2066
- var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
2067
- if (isOSX) return replaceDeleteKeyWithBackspace(hotkey);
2068
- return convertHotKeyToWindows(hotkey);
2069
- };
2070
- var shortenHotKey = function shortenHotKey(hotkey) {
2071
- var result = hotkey;
2072
- Object.entries(KEY_SHORTFORM_MAP).forEach(function (_ref3) {
2073
- var _ref4 = _slicedToArray(_ref3, 2),
2074
- longform = _ref4[0],
2075
- shortform = _ref4[1];
2076
- result = result.replaceAll(longform, shortform);
2077
- });
2078
- return result;
2079
- };
2080
- var getGlobalShortcuts = function getGlobalShortcuts() {
2081
- return _defineProperty({}, i18next.t("neetoMolecules.keyboardShortcuts.global.categoryName"), {
2082
- openKeyboardShortcutsPane: {
2083
- sequence: "shift+/",
2084
- description: i18next.t("neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane")
2085
- },
2086
- close: {
2087
- sequence: "esc",
2088
- description: i18next.t("neetoMolecules.keyboardShortcuts.global.close")
2089
- }
2090
- });
2091
- };
2092
-
2093
- var HotKey = function HotKey(_ref) {
2094
- var description = _ref.description,
2095
- sequence = _ref.sequence;
2096
- var hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));
2097
- var isSequentialHotkey = hotkey.includes(" ");
2098
- var isSimultaneousHotkey = hotkey.includes("+");
2099
- var isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;
2100
- var sequences = [];
2101
- if (isSingleKeyHotkey) {
2102
- sequences = [hotkey];
2103
- } else if (isSequentialHotkey) {
2104
- sequences = hotkey.split(" ");
2105
- } else if (isSimultaneousHotkey) {
2106
- sequences = hotkey.split("+");
2107
- }
2108
- return /*#__PURE__*/React.createElement("div", {
2109
- className: "my-3 px-4"
2110
- }, /*#__PURE__*/React.createElement("div", {
2111
- className: "flex items-center justify-between gap-3",
2112
- "data-testid": "hotkey-item"
2113
- }, /*#__PURE__*/React.createElement(Typography, {
2114
- className: "neeto-ui-text-gray-800",
2115
- lineHeight: "normal",
2116
- style: "body2"
2117
- }, description), /*#__PURE__*/React.createElement("div", {
2118
- className: "flex items-center gap-1"
2119
- }, sequences.map(function (keyName, idx) {
2120
- return /*#__PURE__*/React.createElement(React.Fragment, {
2121
- key: idx
2122
- }, /*#__PURE__*/React.createElement(Kbd, {
2123
- keyName: keyName
2124
- }), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React.createElement(Kbd, {
2125
- keyName: "then"
2126
- }));
2127
- }))));
2128
- };
2129
-
2130
- var HotKeyList = function HotKeyList(_ref) {
2131
- var hotkeys = _ref.hotkeys;
2132
- var _useTranslation = useTranslation(),
2133
- t = _useTranslation.t;
2134
- return Object.keys(hotkeys).map(function (categoryName) {
2135
- var categoryValues = hotkeys[categoryName];
2136
- var fullShortcutsLink = categoryValues[FULL_SHORTCUTS_LINK_PROP_NAME];
2137
- return /*#__PURE__*/React.createElement(React.Fragment, {
2138
- key: categoryName
2139
- }, /*#__PURE__*/React.createElement(Typography, {
2140
- className: "neeto-ui-text-gray-800 mt-4 px-4 text-xs font-bold",
2141
- lineHeight: "normal",
2142
- style: "body2"
2143
- }, categoryName), Object.entries(categoryValues).map(function (_ref2) {
2144
- var _ref3 = _slicedToArray(_ref2, 2),
2145
- _ref3$ = _ref3[1],
2146
- sequence = _ref3$.sequence,
2147
- description = _ref3$.description;
2148
- return sequence && /*#__PURE__*/React.createElement(HotKey, {
2149
- description: description,
2150
- key: sequence,
2151
- sequence: sequence
2152
- });
2153
- }), fullShortcutsLink && /*#__PURE__*/React.createElement(Button, {
2154
- className: "pl-4 mb-3",
2155
- href: fullShortcutsLink,
2156
- style: "link",
2157
- target: "_blank",
2158
- label: t("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")
2159
- }));
2160
- });
2161
- };
2162
-
2163
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
2164
-
2165
- var css = ".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
2166
- n(css,{});
2167
-
2168
- var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
2169
- var _ref$productShortcuts = _ref.productShortcuts,
2170
- productShortcuts = _ref$productShortcuts === void 0 ? {} : _ref$productShortcuts;
2171
- var _useKeyboardShortcuts = useKeyboardShortcutsPaneState(),
2172
- _useKeyboardShortcuts2 = _slicedToArray(_useKeyboardShortcuts, 2),
2173
- isOpen = _useKeyboardShortcuts2[0],
2174
- setIsOpen = _useKeyboardShortcuts2[1];
2175
- var hasOverlays = manager.hasOverlays();
2176
- var GLOBAL_SHORTCUTS = getGlobalShortcuts();
2177
- var _useTranslation = useTranslation(),
2178
- t = _useTranslation.t;
2179
- var shortcuts = GLOBAL_SHORTCUTS[t("neetoMolecules.keyboardShortcuts.global.categoryName")];
2180
- useHotKeys(shortcuts.openKeyboardShortcutsPane.sequence, function () {
2181
- return setIsOpen(function (prevIsOpen) {
2182
- return !prevIsOpen;
2183
- });
2184
- });
2185
- useHotKeys(shortcuts.close.sequence, function () {
2186
- return setIsOpen(false);
2187
- });
2188
- return /*#__PURE__*/React.createElement("div", {
2189
- className: classnames("neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
2190
- "w-80": isOpen,
2191
- "w-0": !isOpen,
2192
- absolute: hasOverlays,
2193
- "right-0": hasOverlays
2194
- })
2195
- }, /*#__PURE__*/React.createElement("div", {
2196
- className: "h-screen border border-b-0"
2197
- }, /*#__PURE__*/React.createElement("div", {
2198
- className: "neeto-ui-border-gray-300 my-2 flex items-center justify-between border-b px-4 pb-2"
2199
- }, /*#__PURE__*/React.createElement(Typography, {
2200
- style: "h4"
2201
- }, t("neetoMolecules.keyboardShortcuts.title")), /*#__PURE__*/React.createElement(Button, {
2202
- icon: Close,
2203
- style: "text",
2204
- onClick: function onClick() {
2205
- return setIsOpen(false);
2206
- }
2207
- })), /*#__PURE__*/React.createElement(HotKeyList, {
2208
- hotkeys: GLOBAL_SHORTCUTS
2209
- }), /*#__PURE__*/React.createElement(HotKeyList, {
2210
- hotkeys: productShortcuts
2211
- })));
2212
- };
2213
-
2214
- var KeyboardShortcuts = {
2215
- Pane: KeyboardShortcutsPane,
2216
- usePaneState: useKeyboardShortcutsPaneState
2217
- };
2218
-
2219
- export { KeyboardShortcuts as default };
39
+ */!function(e,t){(function(){var n={function:!0,object:!0}[typeof window]&&window||this,r=t,o=e&&!e.nodeType&&e,i=r&&o&&"object"==typeof b&&b;!i||i.global!==i&&i.window!==i&&i.self!==i||(n=i);var a=Math.pow(2,53)-1,l=/\bOpera/,s=Object.prototype,u=s.hasOwnProperty,c=s.toString;function f(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function p(e){return e=h(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:f(e)}function d(e,t){for(var n in e)u.call(e,n)&&t(e[n],n,e)}function m(e){return null==e?f(e):c.call(e).slice(8,-1)}function S(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function y(e,t){var n=null;return function(e,t){var n=-1,r=e?e.length:0;if("number"==typeof r&&r>-1&&r<=a)for(;++n<r;)t(e[n],n,e);else d(e,t)}(e,(function(r,o){n=t(n,r,o,e)})),n}function h(e){return String(e).replace(/^ +| +$/g,"")}var g=function e(t){var r=n,o=t&&"object"==typeof t&&"String"!=m(t);o&&(r=t,t=null);var i=r.navigator||{},a=i.userAgent||"";t||(t=a);var s,u,f,b,g,v=o?!!i.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(c.toString()),O="Object",x=o?O:"ScriptBridgingProxyObject",E=o?O:"Environment",w=o&&r.java?"JavaPackage":m(r.java),_=o?O:"RuntimeObject",M=/\bJava/.test(w)&&r.java,A=M&&m(r.environment)==E,T=M?"a":"α",k=M?"b":"β",C=r.document||{},P=r.operamini||r.opera,R=l.test(R=o&&P?P["[[Class]]"]:m(P))?R:P=null,B=t,j=[],L=null,I=t==a,W=I&&P&&"function"==typeof P.version&&P.version(),N=y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(e,n){return e||RegExp("\\b"+(n.pattern||S(n))+"\\b","i").exec(t)&&(n.label||n)})),G=function(e){return y(e,(function(e,n){return e||RegExp("\\b"+(n.pattern||S(n))+"\\b","i").exec(t)&&(n.label||n)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),F=K([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),V=function(e){return y(e,(function(e,n,r){return e||(n[F]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(F)]||RegExp("\\b"+S(r)+"(?:\\b|\\w*\\d)","i").exec(t))&&r}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),D=function(e){return y(e,(function(e,n){var r=n.pattern||S(n);return!e&&(e=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&n&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(r=r[/[\d.]+$/.exec(e)])&&(e="Windows "+r),e=String(e),t&&n&&(e=e.replace(RegExp(t,"i"),n)),p(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,r,n.label||n)),e}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function K(e){return y(e,(function(e,n){var r=n.pattern||S(n);return!e&&(e=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+r+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),n=n.label||n,e=p(e[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),e}))}function $(e){return y(e,(function(e,n){return e||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(N&&(N=[N]),/\bAndroid\b/.test(D)&&!F&&(s=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(F=h(s[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),V&&!F?F=K([V]):V&&F&&(F=F.replace(RegExp("^("+S(V)+")[-_.\\s]","i"),V+" ").replace(RegExp("^("+S(V)+")[-_.]?(\\w)","i"),V+" $2")),(s=/\bGoogle TV\b/.exec(F))&&(F=s[0]),/\bSimulator\b/i.test(t)&&(F=(F?F+" ":"")+"Simulator"),"Opera Mini"==G&&/\bOPiOS\b/.test(t)&&j.push("running in Turbo/Uncompressed mode"),"IE"==G&&/\blike iPhone OS\b/.test(t)?(V=(s=e(t.replace(/like iPhone OS/,""))).manufacturer,F=s.product):/^iP/.test(F)?(G||(G="Safari"),D="iOS"+((s=/ OS ([\d_]+)/i.exec(t))?" "+s[1].replace(/_/g,"."):"")):"Konqueror"==G&&/^Linux\b/i.test(D)?D="Kubuntu":V&&"Google"!=V&&(/Chrome/.test(G)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(F))||/\bAndroid\b/.test(D)&&/^Chrome/.test(G)&&/\bVersion\//i.test(t)?(G="Android Browser",D=/\bAndroid\b/.test(D)?D:"Android"):"Silk"==G?(/\bMobi/i.test(t)||(D="Android",j.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&j.unshift("accelerated")):"UC Browser"==G&&/\bUCWEB\b/.test(t)?j.push("speed mode"):"PaleMoon"==G&&(s=/\bFirefox\/([\d.]+)\b/.exec(t))?j.push("identifying as Firefox "+s[1]):"Firefox"==G&&(s=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(D||(D="Firefox OS"),F||(F=s[1])):!G||(s=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(G))?(G&&!F&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(s+"/")+8))&&(G=null),(s=F||V||D)&&(F||V||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(D))&&(G=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(D)?D:s)+" Browser")):"Electron"==G&&(s=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&j.push("Chromium "+s),W||(W=$(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",S(G),"(?:Firefox|Minefield|NetFront)"])),(s=("iCab"==N&&parseFloat(W)>3?"WebKit":/\bOpera\b/.test(G)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(N)&&"WebKit"||!N&&/\bMSIE\b/i.test(t)&&("Mac OS"==D?"Tasman":"Trident")||"WebKit"==N&&/\bPlayStation\b(?! Vita\b)/i.test(G)&&"NetFront")&&(N=[s]),"IE"==G&&(s=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(G+=" Mobile",D="Windows Phone "+(/\+$/.test(s)?s:s+".x"),j.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(G="IE Mobile",D="Windows Phone 8.x",j.unshift("desktop mode"),W||(W=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=G&&"Trident"==N&&(s=/\brv:([\d.]+)/.exec(t))&&(G&&j.push("identifying as "+G+(W?" "+W:"")),G="IE",W=s[1]),I){if(b="global",g=null!=(f=r)?typeof f[b]:"number",/^(?:boolean|number|string|undefined)$/.test(g)||"object"==g&&!f[b])m(s=r.runtime)==x?(G="Adobe AIR",D=s.flash.system.Capabilities.os):m(s=r.phantom)==_?(G="PhantomJS",W=(s=s.version||null)&&s.major+"."+s.minor+"."+s.patch):"number"==typeof C.documentMode&&(s=/\bTrident\/(\d+)/i.exec(t))?(W=[W,C.documentMode],(s=+s[1]+4)!=W[1]&&(j.push("IE "+W[1]+" mode"),N&&(N[1]=""),W[1]=s),W="IE"==G?String(W[1].toFixed(1)):W[0]):"number"==typeof C.documentMode&&/^(?:Chrome|Firefox)\b/.test(G)&&(j.push("masking as "+G+" "+W),G="IE",W="11.0",N=["Trident"],D="Windows");else if(M&&(B=(s=M.lang.System).getProperty("os.arch"),D=D||s.getProperty("os.name")+" "+s.getProperty("os.version")),A){try{W=r.require("ringo/engine").version.join("."),G="RingoJS"}catch(e){(s=r.system)&&s.global.system==r.system&&(G="Narwhal",D||(D=s[0].os||null))}G||(G="Rhino")}else"object"==typeof r.process&&!r.process.browser&&(s=r.process)&&("object"==typeof s.versions&&("string"==typeof s.versions.electron?(j.push("Node "+s.versions.node),G="Electron",W=s.versions.electron):"string"==typeof s.versions.nw&&(j.push("Chromium "+W,"Node "+s.versions.node),G="NW.js",W=s.versions.nw)),G||(G="Node.js",B=s.arch,D=s.platform,W=(W=/[\d.]+/.exec(s.version))?W[0]:null));D=D&&p(D)}if(W&&(s=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(W)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(I&&i.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(L=/b/i.test(s)?"beta":"alpha",W=W.replace(RegExp(s+"\\+?$"),"")+("beta"==L?k:T)+(/\d+\+?/.exec(s)||"")),"Fennec"==G||"Firefox"==G&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(D))G="Firefox Mobile";else if("Maxthon"==G&&W)W=W.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(F))"Xbox 360"==F&&(D=null),"Xbox 360"==F&&/\bIEMobile\b/.test(t)&&j.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(G)&&(!G||F||/Browser|Mobi/.test(G))||"Windows CE"!=D&&!/Mobi/i.test(t))if("IE"==G&&I)try{null===r.external&&j.unshift("platform preview")}catch(e){j.unshift("embedded")}else(/\bBlackBerry\b/.test(F)||/\bBB10\b/.test(t))&&(s=(RegExp(F.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||W)?(D=((s=[s,/BB10/.test(t)])[1]?(F=null,V="BlackBerry"):"Device Software")+" "+s[0],W=null):this!=d&&"Wii"!=F&&(I&&P||/Opera/.test(G)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==G&&/\bOS X (?:\d+\.){2,}/.test(D)||"IE"==G&&(D&&!/^Win/.test(D)&&W>5.5||/\bWindows XP\b/.test(D)&&W>8||8==W&&!/\bTrident\b/.test(t)))&&!l.test(s=e.call(d,t.replace(l,"")+";"))&&s.name&&(s="ing as "+s.name+((s=s.version)?" "+s:""),l.test(G)?(/\bIE\b/.test(s)&&"Mac OS"==D&&(D=null),s="identify"+s):(s="mask"+s,G=R?p(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(s)&&(D=null),I||(W=null)),N=["Presto"],j.push(s));else G+=" Mobile";(s=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(s=[parseFloat(s.replace(/\.(\d)$/,".0$1")),s],"Safari"==G&&"+"==s[1].slice(-1)?(G="WebKit Nightly",L="alpha",W=s[1].slice(0,-1)):W!=s[1]&&W!=(s[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(W=null),s[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==s[0]&&537.36==s[2]&&parseFloat(s[1])>=28&&"WebKit"==N&&(N=["Blink"]),I&&(v||s[1])?(N&&(N[1]="like Chrome"),s=s[1]||((s=s[0])<530?1:s<532?2:s<532.05?3:s<533?4:s<534.03?5:s<534.07?6:s<534.1?7:s<534.13?8:s<534.16?9:s<534.24?10:s<534.3?11:s<535.01?12:s<535.02?"13+":s<535.07?15:s<535.11?16:s<535.19?17:s<536.05?18:s<536.1?19:s<537.01?20:s<537.11?"21+":s<537.13?23:s<537.18?24:s<537.24?25:s<537.36?26:"Blink"!=N?"27":"28")):(N&&(N[1]="like Safari"),s=(s=s[0])<400?1:s<500?2:s<526?3:s<533?4:s<534?"4+":s<535?5:s<537?6:s<538?7:s<601?8:s<602?9:s<604?10:s<606?11:s<608?12:"12"),N&&(N[1]+=" "+(s+="number"==typeof s?".x":/[.+]/.test(s)?"":"+")),"Safari"==G&&(!W||parseInt(W)>45)?W=s:"Chrome"==G&&/\bHeadlessChrome/i.test(t)&&j.unshift("headless")),"Opera"==G&&(s=/\bzbov|zvav$/.exec(D))?(G+=" ",j.unshift("desktop mode"),"zvav"==s?(G+="Mini",W=null):G+="Mobile",D=D.replace(RegExp(" *"+s+"$"),"")):"Safari"==G&&/\bChrome\b/.exec(N&&N[1])?(j.unshift("desktop mode"),G="Chrome Mobile",W=null,/\bOS X\b/.test(D)?(V="Apple",D="iOS 4.3+"):D=null):/\bSRWare Iron\b/.test(G)&&!W&&(W=$("Chrome")),W&&0==W.indexOf(s=/[\d.]+$/.exec(D))&&t.indexOf("/"+s+"-")>-1&&(D=h(D.replace(s,""))),D&&-1!=D.indexOf(G)&&!RegExp(G+" OS").test(D)&&(D=D.replace(RegExp(" *"+S(G)+" *"),"")),N&&!/\b(?:Avant|Nook)\b/.test(G)&&(/Browser|Lunascape|Maxthon/.test(G)||"Safari"!=G&&/^iOS/.test(D)&&/\bSafari\b/.test(N[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(G)&&N[1])&&(s=N[N.length-1])&&j.push(s),j.length&&(j=["("+j.join("; ")+")"]),V&&F&&F.indexOf(V)<0&&j.push("on "+V),F&&j.push((/^on /.test(j[j.length-1])?"":"on ")+F),D&&(s=/ ([\d.+]+)$/.exec(D),u=s&&"/"==D.charAt(D.length-s[0].length-1),D={architecture:32,family:s&&!u?D.replace(s[0],""):D,version:s?s[1]:null,toString:function(){var e=this.version;return this.family+(e&&!u?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(s=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(B))&&!/\bi686\b/i.test(B)?(D&&(D.architecture=64,D.family=D.family.replace(RegExp(" *"+s),"")),G&&(/\bWOW64\b/i.test(t)||I&&/\w(?:86|32)$/.test(i.cpuClass||i.platform)&&!/\bWin64; x64\b/i.test(t))&&j.unshift("32-bit")):D&&/^OS X/.test(D.family)&&"Chrome"==G&&parseFloat(W)>=39&&(D.architecture=64),t||(t=null);var H={};return H.description=t,H.layout=N&&N[0],H.manufacturer=V,H.name=G,H.prerelease=L,H.product=F,H.ua=t,H.version=G&&W,H.os=D||{architecture:null,family:null,version:null,toString:function(){return"null"}},H.parse=e,H.toString=function(){return this.description||""},H.version&&j.unshift(W),H.name&&j.unshift(G),D&&G&&(D!=String(D).split(" ")[0]||D!=G.split(" ")[0]&&!F)&&j.push(F?"("+D+")":"on "+D),j.length&&(H.description=j.join(" ")),H}();r&&o?d(g,(function(e,t){r[t]=e})):n.platform=g}).call(b)}($,$.exports);var H=$.exports,X=function(e){var t,n;return(null===(t=H.parse(navigator.userAgent).os)||void 0===t||null===(n=t.family)||void 0===n?void 0:n.includes(V))?function(e){return e.replaceAll("delete","backspace")}(e):function(e){return c(F).forEach((function(t){var n=I(t,2),r=n[0],o=n[1];e=e.replaceAll(r,o)})),e}(e)},z=function(){return e={},t=u.t("neetoMolecules.keyboardShortcuts.global.categoryName"),n={openKeyboardShortcutsPane:{sequence:"shift+/",description:u.t("neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane")},close:{sequence:"esc",description:u.t("neetoMolecules.keyboardShortcuts.global.close")}},(t=K(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n},U=function(t){var n=t.description,r=t.sequence,a=function(e){var t=e;return Object.entries(G).forEach((function(e){var n=I(e,2),r=n[0],o=n[1];t=t.replaceAll(r,o)})),t}(X(r)),l=a.includes(" "),s=a.includes("+"),u=[];return!l&&!s?u=[a]:l?u=a.split(" "):s&&(u=a.split("+")),e.createElement("div",{className:"my-3 px-4"},e.createElement("div",{className:"flex items-center justify-between gap-3","data-testid":"hotkey-item"},e.createElement(o,{className:"neeto-ui-text-gray-800",lineHeight:"normal",style:"body2"},n),e.createElement("div",{className:"flex items-center gap-1"},u.map((function(t,n){return e.createElement(e.Fragment,{key:n},e.createElement(i,{keyName:t}),l&&n+1!==u.length&&e.createElement(i,{keyName:"then"}))})))))},q=function(t){var n=t.hotkeys,r=s().t;return Object.keys(n).map((function(t){var i=n[t],l=i.fullShortcutsLink;return e.createElement(e.Fragment,{key:t},e.createElement(o,{className:"neeto-ui-text-gray-800 mt-4 px-4 text-xs font-bold",lineHeight:"normal",style:"body2"},t),Object.entries(i).map((function(t){var n=I(t,2)[1],r=n.sequence,o=n.description;return r&&e.createElement(U,{description:o,key:r,sequence:r})})),l&&e.createElement(a,{className:"pl-4 mb-3",href:l,style:"link",target:"_blank",label:r("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")}))}))},Y=[],J=[];!function(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=Y.indexOf(i);-1===a&&(a=Y.push(i)-1,J[a]={}),n=J[a]&&J[a][r]?J[a][r]:J[a][r]=l()}else n=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function l(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var a="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}(".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}",{});var Z={Pane:function(t){var i=t.productShortcuts,u=void 0===i?{}:i,c=I(j(),2),f=c[0],b=c[1],p=l.hasOverlays(),d=z(),m=s().t,S=d[m("neetoMolecules.keyboardShortcuts.global.categoryName")];return n(S.openKeyboardShortcutsPane.sequence,(function(){return b((function(e){return!e}))})),n(S.close.sequence,(function(){return b(!1)})),e.createElement("div",{className:N("neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll",{"w-80":f,"w-0":!f,absolute:p,"right-0":p})},e.createElement("div",{className:"h-screen border border-b-0"},e.createElement("div",{className:"neeto-ui-border-gray-300 my-2 flex items-center justify-between border-b px-4 pb-2"},e.createElement(o,{style:"h4"},m("neetoMolecules.keyboardShortcuts.title")),e.createElement(a,{icon:r,style:"text",onClick:function(){return b(!1)}})),e.createElement(q,{hotkeys:d}),e.createElement(q,{hotkeys:u})))},usePaneState:j};export{Z as default};