@bigbinary/neetoui 6.0.0 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/formik.cjs.js +2326 -602
- package/formik.cjs.js.map +1 -1
- package/formik.js +2327 -603
- package/formik.js.map +1 -1
- package/index.cjs.js +2328 -604
- package/index.cjs.js.map +1 -1
- package/index.css +1 -1
- package/index.js +2329 -605
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -49,22 +49,22 @@ var _Table__default = /*#__PURE__*/_interopDefaultLegacy(_Table);
|
|
|
49
49
|
var _Tree__default = /*#__PURE__*/_interopDefaultLegacy(_Tree);
|
|
50
50
|
var _TreeSelect__default = /*#__PURE__*/_interopDefaultLegacy(_TreeSelect);
|
|
51
51
|
|
|
52
|
-
function _typeof$
|
|
52
|
+
function _typeof$7(obj) {
|
|
53
53
|
"@babel/helpers - typeof";
|
|
54
54
|
|
|
55
|
-
return _typeof$
|
|
55
|
+
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
56
56
|
return typeof obj;
|
|
57
57
|
} : function (obj) {
|
|
58
58
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
59
|
-
}, _typeof$
|
|
59
|
+
}, _typeof$7(obj);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function _toPrimitive$1(input, hint) {
|
|
63
|
-
if (_typeof$
|
|
63
|
+
if (_typeof$7(input) !== "object" || input === null) return input;
|
|
64
64
|
var prim = input[Symbol.toPrimitive];
|
|
65
65
|
if (prim !== undefined) {
|
|
66
66
|
var res = prim.call(input, hint || "default");
|
|
67
|
-
if (_typeof$
|
|
67
|
+
if (_typeof$7(res) !== "object") return res;
|
|
68
68
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
69
69
|
}
|
|
70
70
|
return (hint === "string" ? String : Number)(input);
|
|
@@ -72,7 +72,7 @@ function _toPrimitive$1(input, hint) {
|
|
|
72
72
|
|
|
73
73
|
function _toPropertyKey(arg) {
|
|
74
74
|
var key = _toPrimitive$1(arg, "string");
|
|
75
|
-
return _typeof$
|
|
75
|
+
return _typeof$7(key) === "symbol" ? key : String(key);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function _defineProperty$7(obj, key, value) {
|
|
@@ -90,11 +90,11 @@ function _defineProperty$7(obj, key, value) {
|
|
|
90
90
|
return obj;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function _arrayWithHoles$
|
|
93
|
+
function _arrayWithHoles$3(arr) {
|
|
94
94
|
if (Array.isArray(arr)) return arr;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function _iterableToArrayLimit$
|
|
97
|
+
function _iterableToArrayLimit$3(arr, i) {
|
|
98
98
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
99
99
|
if (null != _i) {
|
|
100
100
|
var _s,
|
|
@@ -122,32 +122,32 @@ function _iterableToArrayLimit$2(arr, i) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function _arrayLikeToArray$
|
|
125
|
+
function _arrayLikeToArray$3(arr, len) {
|
|
126
126
|
if (len == null || len > arr.length) len = arr.length;
|
|
127
127
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
128
128
|
return arr2;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
function _unsupportedIterableToArray$
|
|
131
|
+
function _unsupportedIterableToArray$3(o, minLen) {
|
|
132
132
|
if (!o) return;
|
|
133
|
-
if (typeof o === "string") return _arrayLikeToArray$
|
|
133
|
+
if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
|
134
134
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
135
135
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
136
136
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
137
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$
|
|
137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function _nonIterableRest$
|
|
140
|
+
function _nonIterableRest$3() {
|
|
141
141
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function _slicedToArray$
|
|
145
|
-
return _arrayWithHoles$
|
|
144
|
+
function _slicedToArray$3(arr, i) {
|
|
145
|
+
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$3();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
148
|
+
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
149
149
|
|
|
150
|
-
function getDefaultExportFromCjs (x) {
|
|
150
|
+
function getDefaultExportFromCjs$1 (x) {
|
|
151
151
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -3736,7 +3736,7 @@ function applyDefaultFilter(v) {
|
|
|
3736
3736
|
return name + "(" + defaultValue + unit + ")";
|
|
3737
3737
|
}
|
|
3738
3738
|
const functionRegex = /([a-z-]*)\(.*?\)/g;
|
|
3739
|
-
const filter
|
|
3739
|
+
const filter = {
|
|
3740
3740
|
...complex,
|
|
3741
3741
|
getAnimatableNone: (v) => {
|
|
3742
3742
|
const functions = v.match(functionRegex);
|
|
@@ -3761,8 +3761,8 @@ const defaultValueTypes = {
|
|
|
3761
3761
|
borderRightColor: color,
|
|
3762
3762
|
borderBottomColor: color,
|
|
3763
3763
|
borderLeftColor: color,
|
|
3764
|
-
filter
|
|
3765
|
-
WebkitFilter: filter
|
|
3764
|
+
filter,
|
|
3765
|
+
WebkitFilter: filter,
|
|
3766
3766
|
};
|
|
3767
3767
|
/**
|
|
3768
3768
|
* Gets the default ValueType for the provided value key
|
|
@@ -3771,7 +3771,7 @@ const getDefaultValueType = (key) => defaultValueTypes[key];
|
|
|
3771
3771
|
|
|
3772
3772
|
function getAnimatableNone(key, value) {
|
|
3773
3773
|
let defaultValueType = getDefaultValueType(key);
|
|
3774
|
-
if (defaultValueType !== filter
|
|
3774
|
+
if (defaultValueType !== filter)
|
|
3775
3775
|
defaultValueType = complex;
|
|
3776
3776
|
// If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
|
|
3777
3777
|
return defaultValueType.getAnimatableNone
|
|
@@ -9526,7 +9526,7 @@ var Accordion = function Accordion(_ref) {
|
|
|
9526
9526
|
_ref$className = _ref.className,
|
|
9527
9527
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
9528
9528
|
var _useState = React$3.useState(defaultActiveKey),
|
|
9529
|
-
_useState2 = _slicedToArray$
|
|
9529
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
9530
9530
|
openTab = _useState2[0],
|
|
9531
9531
|
setOpenTab = _useState2[1];
|
|
9532
9532
|
React$3.useEffect(function () {
|
|
@@ -9582,7 +9582,7 @@ function _createClass$2(Constructor, protoProps, staticProps) {
|
|
|
9582
9582
|
var dayjs_min = {exports: {}};
|
|
9583
9583
|
|
|
9584
9584
|
(function (module, exports) {
|
|
9585
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
9585
|
+
!function(t,e){module.exports=e();}(commonjsGlobal$1,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
9586
9586
|
} (dayjs_min));
|
|
9587
9587
|
|
|
9588
9588
|
var dayjs = dayjs_min.exports;
|
|
@@ -9590,7 +9590,7 @@ var dayjs = dayjs_min.exports;
|
|
|
9590
9590
|
var localeData$1 = {exports: {}};
|
|
9591
9591
|
|
|
9592
9592
|
(function (module, exports) {
|
|
9593
|
-
!function(n,e){module.exports=e();}(commonjsGlobal,(function(){return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
9593
|
+
!function(n,e){module.exports=e();}(commonjsGlobal$1,(function(){return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
9594
9594
|
} (localeData$1));
|
|
9595
9595
|
|
|
9596
9596
|
var localeData = localeData$1.exports;
|
|
@@ -9598,7 +9598,7 @@ var localeData = localeData$1.exports;
|
|
|
9598
9598
|
var utc$1 = {exports: {}};
|
|
9599
9599
|
|
|
9600
9600
|
(function (module, exports) {
|
|
9601
|
-
!function(t,i){module.exports=i();}(commonjsGlobal,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
|
|
9601
|
+
!function(t,i){module.exports=i();}(commonjsGlobal$1,(function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i)},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i)},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},u.isUTC=function(){return !!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var l=u.toDate;u.toDate=function(t){return "s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e)};}}));
|
|
9602
9602
|
} (utc$1));
|
|
9603
9603
|
|
|
9604
9604
|
var utc = utc$1.exports;
|
|
@@ -9606,7 +9606,7 @@ var utc = utc$1.exports;
|
|
|
9606
9606
|
var weekday$1 = {exports: {}};
|
|
9607
9607
|
|
|
9608
9608
|
(function (module, exports) {
|
|
9609
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")};}}));
|
|
9609
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")};}}));
|
|
9610
9610
|
} (weekday$1));
|
|
9611
9611
|
|
|
9612
9612
|
var weekday = weekday$1.exports;
|
|
@@ -9614,7 +9614,7 @@ var weekday = weekday$1.exports;
|
|
|
9614
9614
|
var weekOfYear$1 = {exports: {}};
|
|
9615
9615
|
|
|
9616
9616
|
(function (module, exports) {
|
|
9617
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
|
|
9617
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
|
|
9618
9618
|
} (weekOfYear$1));
|
|
9619
9619
|
|
|
9620
9620
|
var weekOfYear = weekOfYear$1.exports;
|
|
@@ -11751,7 +11751,7 @@ var ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES = {
|
|
|
11751
11751
|
var buildUrl = function buildUrl(route, params) {
|
|
11752
11752
|
var placeHolders = [];
|
|
11753
11753
|
ramda.toPairs(params).forEach(function (_ref) {
|
|
11754
|
-
var _ref2 = _slicedToArray$
|
|
11754
|
+
var _ref2 = _slicedToArray$3(_ref, 2),
|
|
11755
11755
|
key = _ref2[0],
|
|
11756
11756
|
value = _ref2[1];
|
|
11757
11757
|
if (!route.includes(":".concat(key))) return;
|
|
@@ -15737,7 +15737,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15737
15737
|
hideOnTargetExit = _ref$hideOnTargetExit === void 0 ? false : _ref$hideOnTargetExit,
|
|
15738
15738
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$H);
|
|
15739
15739
|
var _useState = React$3.useState(null),
|
|
15740
|
-
_useState2 = _slicedToArray$
|
|
15740
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
15741
15741
|
instance = _useState2[0],
|
|
15742
15742
|
setInstance = _useState2[1];
|
|
15743
15743
|
var localProps = {};
|
|
@@ -16119,11 +16119,11 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16119
16119
|
onClick = _ref2.onClick,
|
|
16120
16120
|
otherProps = _objectWithoutProperties$1(_ref2, _excluded2$5);
|
|
16121
16121
|
var _useState = React$3.useState(null),
|
|
16122
|
-
_useState2 = _slicedToArray$
|
|
16122
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
16123
16123
|
instance = _useState2[0],
|
|
16124
16124
|
setInstance = _useState2[1];
|
|
16125
16125
|
var _useState3 = React$3.useState(false),
|
|
16126
|
-
_useState4 = _slicedToArray$
|
|
16126
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
16127
16127
|
mounted = _useState4[0],
|
|
16128
16128
|
setMounted = _useState4[1];
|
|
16129
16129
|
var isControlled = !ramda.isNil(isOpen);
|
|
@@ -17790,647 +17790,2381 @@ var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handle
|
|
|
17790
17790
|
}, [insideRef, outsideRef, handler]);
|
|
17791
17791
|
};
|
|
17792
17792
|
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17793
|
+
var MODES = {
|
|
17794
|
+
"default": "default",
|
|
17795
|
+
global: "global",
|
|
17796
|
+
scoped: "scoped"
|
|
17797
|
+
};
|
|
17798
|
+
var DEFAULT_CONFIG = {
|
|
17799
|
+
mode: MODES["default"],
|
|
17800
|
+
unbindOnUnmount: true,
|
|
17801
|
+
enabled: true
|
|
17802
|
+
};
|
|
17803
|
+
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
17804
|
+
option: "alt",
|
|
17805
|
+
command: "ctrl",
|
|
17806
|
+
"return": "enter",
|
|
17807
|
+
"delete": "backspace"
|
|
17808
|
+
};
|
|
17809
|
+
var OS = {
|
|
17810
|
+
mac: "OS X",
|
|
17811
|
+
windows: "Windows"
|
|
17812
|
+
};
|
|
17813
|
+
var KEY_NAMES = {
|
|
17814
|
+
"delete": "delete",
|
|
17815
|
+
backspace: "backspace"
|
|
17816
|
+
};
|
|
17802
17817
|
|
|
17803
|
-
|
|
17818
|
+
function _arrayWithHoles$2(arr) {
|
|
17819
|
+
if (Array.isArray(arr)) return arr;
|
|
17820
|
+
}
|
|
17804
17821
|
|
|
17805
|
-
function
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17822
|
+
function _iterableToArrayLimit$2(r, l) {
|
|
17823
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17824
|
+
if (null != t) {
|
|
17825
|
+
var e,
|
|
17826
|
+
n,
|
|
17827
|
+
i,
|
|
17828
|
+
u,
|
|
17829
|
+
a = [],
|
|
17830
|
+
f = !0,
|
|
17831
|
+
o = !1;
|
|
17832
|
+
try {
|
|
17833
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
17834
|
+
if (Object(t) !== t) return;
|
|
17835
|
+
f = !1;
|
|
17836
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
17837
|
+
} catch (r) {
|
|
17838
|
+
o = !0, n = r;
|
|
17839
|
+
} finally {
|
|
17840
|
+
try {
|
|
17841
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
17842
|
+
} finally {
|
|
17843
|
+
if (o) throw n;
|
|
17844
|
+
}
|
|
17845
|
+
}
|
|
17846
|
+
return a;
|
|
17812
17847
|
}
|
|
17813
|
-
}
|
|
17848
|
+
}
|
|
17814
17849
|
|
|
17850
|
+
function _arrayLikeToArray$2(arr, len) {
|
|
17851
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
17852
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
17853
|
+
return arr2;
|
|
17854
|
+
}
|
|
17815
17855
|
|
|
17816
|
-
function
|
|
17817
|
-
|
|
17856
|
+
function _unsupportedIterableToArray$2(o, minLen) {
|
|
17857
|
+
if (!o) return;
|
|
17858
|
+
if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
|
|
17859
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
17860
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
17861
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
17862
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
|
|
17863
|
+
}
|
|
17818
17864
|
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17865
|
+
function _nonIterableRest$2() {
|
|
17866
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17867
|
+
}
|
|
17822
17868
|
|
|
17823
|
-
|
|
17824
|
-
|
|
17869
|
+
function _slicedToArray$2(arr, i) {
|
|
17870
|
+
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
|
|
17871
|
+
}
|
|
17825
17872
|
|
|
17873
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17826
17874
|
|
|
17827
|
-
function
|
|
17828
|
-
|
|
17829
|
-
|
|
17875
|
+
function getDefaultExportFromCjs (x) {
|
|
17876
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
17877
|
+
}
|
|
17830
17878
|
|
|
17831
|
-
|
|
17879
|
+
var mousetrap = {exports: {}};
|
|
17832
17880
|
|
|
17833
|
-
|
|
17881
|
+
/*global define:false */
|
|
17882
|
+
mousetrap.exports;
|
|
17883
|
+
(function (module) {
|
|
17884
|
+
/**
|
|
17885
|
+
* Copyright 2012-2017 Craig Campbell
|
|
17886
|
+
*
|
|
17887
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
17888
|
+
* you may not use this file except in compliance with the License.
|
|
17889
|
+
* You may obtain a copy of the License at
|
|
17890
|
+
*
|
|
17891
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17892
|
+
*
|
|
17893
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17894
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17895
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17896
|
+
* See the License for the specific language governing permissions and
|
|
17897
|
+
* limitations under the License.
|
|
17898
|
+
*
|
|
17899
|
+
* Mousetrap is a simple keyboard shortcut library for Javascript with
|
|
17900
|
+
* no external dependencies
|
|
17901
|
+
*
|
|
17902
|
+
* @version 1.6.5
|
|
17903
|
+
* @url craig.is/killing/mice
|
|
17904
|
+
*/
|
|
17905
|
+
(function (window, document, undefined$1) {
|
|
17906
|
+
// Check if mousetrap is used inside browser, if not, return
|
|
17907
|
+
if (!window) {
|
|
17908
|
+
return;
|
|
17909
|
+
}
|
|
17834
17910
|
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
17838
|
-
|
|
17839
|
-
|
|
17911
|
+
/**
|
|
17912
|
+
* mapping of special keycodes to their corresponding keys
|
|
17913
|
+
*
|
|
17914
|
+
* everything in this dictionary cannot use keypress events
|
|
17915
|
+
* so it has to be here to map to the correct keycodes for
|
|
17916
|
+
* keyup/keydown events
|
|
17917
|
+
*
|
|
17918
|
+
* @type {Object}
|
|
17919
|
+
*/
|
|
17920
|
+
var _MAP = {
|
|
17921
|
+
8: 'backspace',
|
|
17922
|
+
9: 'tab',
|
|
17923
|
+
13: 'enter',
|
|
17924
|
+
16: 'shift',
|
|
17925
|
+
17: 'ctrl',
|
|
17926
|
+
18: 'alt',
|
|
17927
|
+
20: 'capslock',
|
|
17928
|
+
27: 'esc',
|
|
17929
|
+
32: 'space',
|
|
17930
|
+
33: 'pageup',
|
|
17931
|
+
34: 'pagedown',
|
|
17932
|
+
35: 'end',
|
|
17933
|
+
36: 'home',
|
|
17934
|
+
37: 'left',
|
|
17935
|
+
38: 'up',
|
|
17936
|
+
39: 'right',
|
|
17937
|
+
40: 'down',
|
|
17938
|
+
45: 'ins',
|
|
17939
|
+
46: 'del',
|
|
17940
|
+
91: 'meta',
|
|
17941
|
+
93: 'meta',
|
|
17942
|
+
224: 'meta'
|
|
17943
|
+
};
|
|
17840
17944
|
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
|
|
17852
|
-
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
up: 38,
|
|
17868
|
-
right: 39,
|
|
17869
|
-
down: 40,
|
|
17870
|
-
del: 46,
|
|
17871
|
-
delete: 46,
|
|
17872
|
-
ins: 45,
|
|
17873
|
-
insert: 45,
|
|
17874
|
-
home: 36,
|
|
17875
|
-
end: 35,
|
|
17876
|
-
pageup: 33,
|
|
17877
|
-
pagedown: 34,
|
|
17878
|
-
capslock: 20,
|
|
17879
|
-
num_0: 96,
|
|
17880
|
-
num_1: 97,
|
|
17881
|
-
num_2: 98,
|
|
17882
|
-
num_3: 99,
|
|
17883
|
-
num_4: 100,
|
|
17884
|
-
num_5: 101,
|
|
17885
|
-
num_6: 102,
|
|
17886
|
-
num_7: 103,
|
|
17887
|
-
num_8: 104,
|
|
17888
|
-
num_9: 105,
|
|
17889
|
-
num_multiply: 106,
|
|
17890
|
-
num_add: 107,
|
|
17891
|
-
num_enter: 108,
|
|
17892
|
-
num_subtract: 109,
|
|
17893
|
-
num_decimal: 110,
|
|
17894
|
-
num_divide: 111,
|
|
17895
|
-
'⇪': 20,
|
|
17896
|
-
',': 188,
|
|
17897
|
-
'.': 190,
|
|
17898
|
-
'/': 191,
|
|
17899
|
-
'`': 192,
|
|
17900
|
-
'-': isff ? 173 : 189,
|
|
17901
|
-
'=': isff ? 61 : 187,
|
|
17902
|
-
';': isff ? 59 : 186,
|
|
17903
|
-
'\'': 222,
|
|
17904
|
-
'[': 219,
|
|
17905
|
-
']': 221,
|
|
17906
|
-
'\\': 220
|
|
17907
|
-
}; // Modifier Keys
|
|
17908
|
-
|
|
17909
|
-
var _modifier = {
|
|
17910
|
-
// shiftKey
|
|
17911
|
-
'⇧': 16,
|
|
17912
|
-
shift: 16,
|
|
17913
|
-
// altKey
|
|
17914
|
-
'⌥': 18,
|
|
17915
|
-
alt: 18,
|
|
17916
|
-
option: 18,
|
|
17917
|
-
// ctrlKey
|
|
17918
|
-
'⌃': 17,
|
|
17919
|
-
ctrl: 17,
|
|
17920
|
-
control: 17,
|
|
17921
|
-
// metaKey
|
|
17922
|
-
'⌘': 91,
|
|
17923
|
-
cmd: 91,
|
|
17924
|
-
command: 91
|
|
17925
|
-
};
|
|
17926
|
-
var modifierMap = {
|
|
17927
|
-
16: 'shiftKey',
|
|
17928
|
-
18: 'altKey',
|
|
17929
|
-
17: 'ctrlKey',
|
|
17930
|
-
91: 'metaKey',
|
|
17931
|
-
shiftKey: 16,
|
|
17932
|
-
ctrlKey: 17,
|
|
17933
|
-
altKey: 18,
|
|
17934
|
-
metaKey: 91
|
|
17935
|
-
};
|
|
17936
|
-
var _mods = {
|
|
17937
|
-
16: false,
|
|
17938
|
-
18: false,
|
|
17939
|
-
17: false,
|
|
17940
|
-
91: false
|
|
17941
|
-
};
|
|
17942
|
-
var _handlers = {}; // F1~F12 special key
|
|
17945
|
+
/**
|
|
17946
|
+
* mapping for special characters so they can support
|
|
17947
|
+
*
|
|
17948
|
+
* this dictionary is only used incase you want to bind a
|
|
17949
|
+
* keyup or keydown event to one of these keys
|
|
17950
|
+
*
|
|
17951
|
+
* @type {Object}
|
|
17952
|
+
*/
|
|
17953
|
+
var _KEYCODE_MAP = {
|
|
17954
|
+
106: '*',
|
|
17955
|
+
107: '+',
|
|
17956
|
+
109: '-',
|
|
17957
|
+
110: '.',
|
|
17958
|
+
111: '/',
|
|
17959
|
+
186: ';',
|
|
17960
|
+
187: '=',
|
|
17961
|
+
188: ',',
|
|
17962
|
+
189: '-',
|
|
17963
|
+
190: '.',
|
|
17964
|
+
191: '/',
|
|
17965
|
+
192: '`',
|
|
17966
|
+
219: '[',
|
|
17967
|
+
220: '\\',
|
|
17968
|
+
221: ']',
|
|
17969
|
+
222: '\''
|
|
17970
|
+
};
|
|
17943
17971
|
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17972
|
+
/**
|
|
17973
|
+
* this is a mapping of keys that require shift on a US keypad
|
|
17974
|
+
* back to the non shift equivelents
|
|
17975
|
+
*
|
|
17976
|
+
* this is so you can use keyup events with these keys
|
|
17977
|
+
*
|
|
17978
|
+
* note that this will only work reliably on US keyboards
|
|
17979
|
+
*
|
|
17980
|
+
* @type {Object}
|
|
17981
|
+
*/
|
|
17982
|
+
var _SHIFT_MAP = {
|
|
17983
|
+
'~': '`',
|
|
17984
|
+
'!': '1',
|
|
17985
|
+
'@': '2',
|
|
17986
|
+
'#': '3',
|
|
17987
|
+
'$': '4',
|
|
17988
|
+
'%': '5',
|
|
17989
|
+
'^': '6',
|
|
17990
|
+
'&': '7',
|
|
17991
|
+
'*': '8',
|
|
17992
|
+
'(': '9',
|
|
17993
|
+
')': '0',
|
|
17994
|
+
'_': '-',
|
|
17995
|
+
'+': '=',
|
|
17996
|
+
':': ';',
|
|
17997
|
+
'\"': '\'',
|
|
17998
|
+
'<': ',',
|
|
17999
|
+
'>': '.',
|
|
18000
|
+
'?': '/',
|
|
18001
|
+
'|': '\\'
|
|
18002
|
+
};
|
|
17947
18003
|
|
|
17948
|
-
|
|
18004
|
+
/**
|
|
18005
|
+
* this is a list of special strings you can use to map
|
|
18006
|
+
* to modifier keys when you specify your keyboard shortcuts
|
|
18007
|
+
*
|
|
18008
|
+
* @type {Object}
|
|
18009
|
+
*/
|
|
18010
|
+
var _SPECIAL_ALIASES = {
|
|
18011
|
+
'option': 'alt',
|
|
18012
|
+
'command': 'meta',
|
|
18013
|
+
'return': 'enter',
|
|
18014
|
+
'escape': 'esc',
|
|
18015
|
+
'plus': '+',
|
|
18016
|
+
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
|
|
18017
|
+
};
|
|
17949
18018
|
|
|
17950
|
-
|
|
18019
|
+
/**
|
|
18020
|
+
* variable to store the flipped version of _MAP from above
|
|
18021
|
+
* needed to check if we should use keypress or not when no action
|
|
18022
|
+
* is specified
|
|
18023
|
+
*
|
|
18024
|
+
* @type {Object|undefined}
|
|
18025
|
+
*/
|
|
18026
|
+
var _REVERSE_MAP;
|
|
17951
18027
|
|
|
17952
|
-
|
|
17953
|
-
|
|
18028
|
+
/**
|
|
18029
|
+
* loop through the f keys, f1 to f19 and add them to the map
|
|
18030
|
+
* programatically
|
|
18031
|
+
*/
|
|
18032
|
+
for (var i = 1; i < 20; ++i) {
|
|
18033
|
+
_MAP[111 + i] = 'f' + i;
|
|
18034
|
+
}
|
|
17954
18035
|
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
18036
|
+
/**
|
|
18037
|
+
* loop through to map numbers on the numeric keypad
|
|
18038
|
+
*/
|
|
18039
|
+
for (i = 0; i <= 9; ++i) {
|
|
18040
|
+
// This needs to use a string cause otherwise since 0 is falsey
|
|
18041
|
+
// mousetrap will never fire for numpad 0 pressed as part of a keydown
|
|
18042
|
+
// event.
|
|
18043
|
+
//
|
|
18044
|
+
// @see https://github.com/ccampbell/mousetrap/pull/258
|
|
18045
|
+
_MAP[i + 96] = i.toString();
|
|
18046
|
+
}
|
|
17958
18047
|
|
|
18048
|
+
/**
|
|
18049
|
+
* cross browser add event method
|
|
18050
|
+
*
|
|
18051
|
+
* @param {Element|HTMLDocument} object
|
|
18052
|
+
* @param {string} type
|
|
18053
|
+
* @param {Function} callback
|
|
18054
|
+
* @returns void
|
|
18055
|
+
*/
|
|
18056
|
+
function _addEvent(object, type, callback) {
|
|
18057
|
+
if (object.addEventListener) {
|
|
18058
|
+
object.addEventListener(type, callback, false);
|
|
18059
|
+
return;
|
|
18060
|
+
}
|
|
18061
|
+
object.attachEvent('on' + type, callback);
|
|
18062
|
+
}
|
|
17959
18063
|
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
18064
|
+
/**
|
|
18065
|
+
* takes the event and returns the key character
|
|
18066
|
+
*
|
|
18067
|
+
* @param {Event} e
|
|
18068
|
+
* @return {string}
|
|
18069
|
+
*/
|
|
18070
|
+
function _characterFromEvent(e) {
|
|
18071
|
+
// for keypress events we should return the character as is
|
|
18072
|
+
if (e.type == 'keypress') {
|
|
18073
|
+
var character = String.fromCharCode(e.which);
|
|
18074
|
+
|
|
18075
|
+
// if the shift key is not pressed then it is safe to assume
|
|
18076
|
+
// that we want the character to be lowercase. this means if
|
|
18077
|
+
// you accidentally have caps lock on then your key bindings
|
|
18078
|
+
// will continue to work
|
|
18079
|
+
//
|
|
18080
|
+
// the only side effect that might not be desired is if you
|
|
18081
|
+
// bind something like 'A' cause you want to trigger an
|
|
18082
|
+
// event when capital A is pressed caps lock will no longer
|
|
18083
|
+
// trigger the event. shift+a will though.
|
|
18084
|
+
if (!e.shiftKey) {
|
|
18085
|
+
character = character.toLowerCase();
|
|
18086
|
+
}
|
|
18087
|
+
return character;
|
|
18088
|
+
}
|
|
17963
18089
|
|
|
18090
|
+
// for non keypress events the special maps are needed
|
|
18091
|
+
if (_MAP[e.which]) {
|
|
18092
|
+
return _MAP[e.which];
|
|
18093
|
+
}
|
|
18094
|
+
if (_KEYCODE_MAP[e.which]) {
|
|
18095
|
+
return _KEYCODE_MAP[e.which];
|
|
18096
|
+
}
|
|
17964
18097
|
|
|
17965
|
-
|
|
17966
|
-
return _scope || 'all';
|
|
17967
|
-
} // 获取摁下绑定键的键值
|
|
18098
|
+
// if it is not in the special map
|
|
17968
18099
|
|
|
18100
|
+
// with keydown and keyup events the character seems to always
|
|
18101
|
+
// come in as an uppercase character whether you are pressing shift
|
|
18102
|
+
// or not. we should make sure it is always lowercase for comparisons
|
|
18103
|
+
return String.fromCharCode(e.which).toLowerCase();
|
|
18104
|
+
}
|
|
17969
18105
|
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
|
|
18106
|
+
/**
|
|
18107
|
+
* checks if two arrays are equal
|
|
18108
|
+
*
|
|
18109
|
+
* @param {Array} modifiers1
|
|
18110
|
+
* @param {Array} modifiers2
|
|
18111
|
+
* @returns {boolean}
|
|
18112
|
+
*/
|
|
18113
|
+
function _modifiersMatch(modifiers1, modifiers2) {
|
|
18114
|
+
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
|
|
18115
|
+
}
|
|
17974
18116
|
|
|
18117
|
+
/**
|
|
18118
|
+
* takes a key event and figures out what the modifiers are
|
|
18119
|
+
*
|
|
18120
|
+
* @param {Event} e
|
|
18121
|
+
* @returns {Array}
|
|
18122
|
+
*/
|
|
18123
|
+
function _eventModifiers(e) {
|
|
18124
|
+
var modifiers = [];
|
|
18125
|
+
if (e.shiftKey) {
|
|
18126
|
+
modifiers.push('shift');
|
|
18127
|
+
}
|
|
18128
|
+
if (e.altKey) {
|
|
18129
|
+
modifiers.push('alt');
|
|
18130
|
+
}
|
|
18131
|
+
if (e.ctrlKey) {
|
|
18132
|
+
modifiers.push('ctrl');
|
|
18133
|
+
}
|
|
18134
|
+
if (e.metaKey) {
|
|
18135
|
+
modifiers.push('meta');
|
|
18136
|
+
}
|
|
18137
|
+
return modifiers;
|
|
18138
|
+
}
|
|
18139
|
+
|
|
18140
|
+
/**
|
|
18141
|
+
* prevents default for this event
|
|
18142
|
+
*
|
|
18143
|
+
* @param {Event} e
|
|
18144
|
+
* @returns void
|
|
18145
|
+
*/
|
|
18146
|
+
function _preventDefault(e) {
|
|
18147
|
+
if (e.preventDefault) {
|
|
18148
|
+
e.preventDefault();
|
|
18149
|
+
return;
|
|
18150
|
+
}
|
|
18151
|
+
e.returnValue = false;
|
|
18152
|
+
}
|
|
17975
18153
|
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
18154
|
+
/**
|
|
18155
|
+
* stops propogation for this event
|
|
18156
|
+
*
|
|
18157
|
+
* @param {Event} e
|
|
18158
|
+
* @returns void
|
|
18159
|
+
*/
|
|
18160
|
+
function _stopPropagation(e) {
|
|
18161
|
+
if (e.stopPropagation) {
|
|
18162
|
+
e.stopPropagation();
|
|
18163
|
+
return;
|
|
18164
|
+
}
|
|
18165
|
+
e.cancelBubble = true;
|
|
18166
|
+
}
|
|
17980
18167
|
|
|
17981
|
-
|
|
17982
|
-
|
|
17983
|
-
|
|
18168
|
+
/**
|
|
18169
|
+
* determines if the keycode specified is a modifier key or not
|
|
18170
|
+
*
|
|
18171
|
+
* @param {string} key
|
|
18172
|
+
* @returns {boolean}
|
|
18173
|
+
*/
|
|
18174
|
+
function _isModifier(key) {
|
|
18175
|
+
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
|
|
18176
|
+
}
|
|
17984
18177
|
|
|
17985
|
-
|
|
17986
|
-
|
|
18178
|
+
/**
|
|
18179
|
+
* reverses the map lookup so that we can look for specific keys
|
|
18180
|
+
* to see what can and can't use keypress
|
|
18181
|
+
*
|
|
18182
|
+
* @return {Object}
|
|
18183
|
+
*/
|
|
18184
|
+
function _getReverseMap() {
|
|
18185
|
+
if (!_REVERSE_MAP) {
|
|
18186
|
+
_REVERSE_MAP = {};
|
|
18187
|
+
for (var key in _MAP) {
|
|
18188
|
+
// pull out the numeric keypad from here cause keypress should
|
|
18189
|
+
// be able to detect the keys from the character
|
|
18190
|
+
if (key > 95 && key < 112) {
|
|
18191
|
+
continue;
|
|
18192
|
+
}
|
|
18193
|
+
if (_MAP.hasOwnProperty(key)) {
|
|
18194
|
+
_REVERSE_MAP[_MAP[key]] = key;
|
|
18195
|
+
}
|
|
18196
|
+
}
|
|
18197
|
+
}
|
|
18198
|
+
return _REVERSE_MAP;
|
|
18199
|
+
}
|
|
17987
18200
|
|
|
18201
|
+
/**
|
|
18202
|
+
* picks the best action based on the key combination
|
|
18203
|
+
*
|
|
18204
|
+
* @param {string} key - character for key
|
|
18205
|
+
* @param {Array} modifiers
|
|
18206
|
+
* @param {string=} action passed in
|
|
18207
|
+
*/
|
|
18208
|
+
function _pickBestAction(key, modifiers, action) {
|
|
18209
|
+
// if no action was picked in we should try to pick the one
|
|
18210
|
+
// that we think would work best for this key
|
|
18211
|
+
if (!action) {
|
|
18212
|
+
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
|
|
18213
|
+
}
|
|
17988
18214
|
|
|
17989
|
-
|
|
17990
|
-
|
|
17991
|
-
|
|
17992
|
-
|
|
18215
|
+
// modifier keys don't work as expected with keypress,
|
|
18216
|
+
// switch to keydown
|
|
18217
|
+
if (action == 'keypress' && modifiers.length) {
|
|
18218
|
+
action = 'keydown';
|
|
18219
|
+
}
|
|
18220
|
+
return action;
|
|
18221
|
+
}
|
|
17993
18222
|
|
|
17994
|
-
|
|
17995
|
-
|
|
18223
|
+
/**
|
|
18224
|
+
* Converts from a string key combination to an array
|
|
18225
|
+
*
|
|
18226
|
+
* @param {string} combination like "command+shift+l"
|
|
18227
|
+
* @return {Array}
|
|
18228
|
+
*/
|
|
18229
|
+
function _keysFromString(combination) {
|
|
18230
|
+
if (combination === '+') {
|
|
18231
|
+
return ['+'];
|
|
18232
|
+
}
|
|
18233
|
+
combination = combination.replace(/\+{2}/g, '+plus');
|
|
18234
|
+
return combination.split('+');
|
|
18235
|
+
}
|
|
17996
18236
|
|
|
18237
|
+
/**
|
|
18238
|
+
* Gets info for a specific key combination
|
|
18239
|
+
*
|
|
18240
|
+
* @param {string} combination key combination ("command+s" or "a" or "*")
|
|
18241
|
+
* @param {string=} action
|
|
18242
|
+
* @returns {Object}
|
|
18243
|
+
*/
|
|
18244
|
+
function _getKeyInfo(combination, action) {
|
|
18245
|
+
var keys;
|
|
18246
|
+
var key;
|
|
18247
|
+
var i;
|
|
18248
|
+
var modifiers = [];
|
|
17997
18249
|
|
|
17998
|
-
|
|
17999
|
-
|
|
18000
|
-
|
|
18250
|
+
// take the keys from this pattern and figure out what the actual
|
|
18251
|
+
// pattern is all about
|
|
18252
|
+
keys = _keysFromString(combination);
|
|
18253
|
+
for (i = 0; i < keys.length; ++i) {
|
|
18254
|
+
key = keys[i];
|
|
18001
18255
|
|
|
18002
|
-
|
|
18256
|
+
// normalize key names
|
|
18257
|
+
if (_SPECIAL_ALIASES[key]) {
|
|
18258
|
+
key = _SPECIAL_ALIASES[key];
|
|
18259
|
+
}
|
|
18003
18260
|
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18261
|
+
// if this is not a keypress event then we should
|
|
18262
|
+
// be smart about using shift keys
|
|
18263
|
+
// this will only work for US keyboards however
|
|
18264
|
+
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
|
|
18265
|
+
key = _SHIFT_MAP[key];
|
|
18266
|
+
modifiers.push('shift');
|
|
18267
|
+
}
|
|
18007
18268
|
|
|
18008
|
-
|
|
18009
|
-
if (
|
|
18269
|
+
// if this key is a modifier then add it to the list of modifiers
|
|
18270
|
+
if (_isModifier(key)) {
|
|
18271
|
+
modifiers.push(key);
|
|
18272
|
+
}
|
|
18010
18273
|
}
|
|
18274
|
+
|
|
18275
|
+
// depending on what the key combination is
|
|
18276
|
+
// we will try to pick the best event for it
|
|
18277
|
+
action = _pickBestAction(key, modifiers, action);
|
|
18278
|
+
return {
|
|
18279
|
+
key: key,
|
|
18280
|
+
modifiers: modifiers,
|
|
18281
|
+
action: action
|
|
18282
|
+
};
|
|
18011
18283
|
}
|
|
18012
|
-
|
|
18284
|
+
function _belongsTo(element, ancestor) {
|
|
18285
|
+
if (element === null || element === document) {
|
|
18286
|
+
return false;
|
|
18287
|
+
}
|
|
18288
|
+
if (element === ancestor) {
|
|
18289
|
+
return true;
|
|
18290
|
+
}
|
|
18291
|
+
return _belongsTo(element.parentNode, ancestor);
|
|
18292
|
+
}
|
|
18293
|
+
function Mousetrap(targetElement) {
|
|
18294
|
+
var self = this;
|
|
18295
|
+
targetElement = targetElement || document;
|
|
18296
|
+
if (!(self instanceof Mousetrap)) {
|
|
18297
|
+
return new Mousetrap(targetElement);
|
|
18298
|
+
}
|
|
18013
18299
|
|
|
18300
|
+
/**
|
|
18301
|
+
* element to attach key events to
|
|
18302
|
+
*
|
|
18303
|
+
* @type {Element}
|
|
18304
|
+
*/
|
|
18305
|
+
self.target = targetElement;
|
|
18014
18306
|
|
|
18015
|
-
|
|
18016
|
-
|
|
18307
|
+
/**
|
|
18308
|
+
* a list of all the callbacks setup via Mousetrap.bind()
|
|
18309
|
+
*
|
|
18310
|
+
* @type {Object}
|
|
18311
|
+
*/
|
|
18312
|
+
self._callbacks = {};
|
|
18017
18313
|
|
|
18314
|
+
/**
|
|
18315
|
+
* direct map of string combinations to callbacks used for trigger()
|
|
18316
|
+
*
|
|
18317
|
+
* @type {Object}
|
|
18318
|
+
*/
|
|
18319
|
+
self._directMap = {};
|
|
18018
18320
|
|
|
18019
|
-
|
|
18020
|
-
|
|
18321
|
+
/**
|
|
18322
|
+
* keeps track of what level each sequence is at since multiple
|
|
18323
|
+
* sequences can start out with the same sequence
|
|
18324
|
+
*
|
|
18325
|
+
* @type {Object}
|
|
18326
|
+
*/
|
|
18327
|
+
var _sequenceLevels = {};
|
|
18021
18328
|
|
|
18022
|
-
|
|
18329
|
+
/**
|
|
18330
|
+
* variable to store the setTimeout call
|
|
18331
|
+
*
|
|
18332
|
+
* @type {null|number}
|
|
18333
|
+
*/
|
|
18334
|
+
var _resetTimer;
|
|
18023
18335
|
|
|
18336
|
+
/**
|
|
18337
|
+
* temporary state where we will ignore the next keyup
|
|
18338
|
+
*
|
|
18339
|
+
* @type {boolean|string}
|
|
18340
|
+
*/
|
|
18341
|
+
var _ignoreNextKeyup = false;
|
|
18024
18342
|
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18343
|
+
/**
|
|
18344
|
+
* temporary state where we will ignore the next keypress
|
|
18345
|
+
*
|
|
18346
|
+
* @type {boolean}
|
|
18347
|
+
*/
|
|
18348
|
+
var _ignoreNextKeypress = false;
|
|
18028
18349
|
|
|
18350
|
+
/**
|
|
18351
|
+
* are we currently inside of a sequence?
|
|
18352
|
+
* type of action ("keyup" or "keydown" or "keypress") or false
|
|
18353
|
+
*
|
|
18354
|
+
* @type {boolean|string}
|
|
18355
|
+
*/
|
|
18356
|
+
var _nextExpectedAction = false;
|
|
18029
18357
|
|
|
18030
|
-
|
|
18031
|
-
|
|
18032
|
-
|
|
18358
|
+
/**
|
|
18359
|
+
* resets all sequence counters except for the ones passed in
|
|
18360
|
+
*
|
|
18361
|
+
* @param {Object} doNotReset
|
|
18362
|
+
* @returns void
|
|
18363
|
+
*/
|
|
18364
|
+
function _resetSequences(doNotReset) {
|
|
18365
|
+
doNotReset = doNotReset || {};
|
|
18366
|
+
var activeSequences = false,
|
|
18367
|
+
key;
|
|
18368
|
+
for (key in _sequenceLevels) {
|
|
18369
|
+
if (doNotReset[key]) {
|
|
18370
|
+
activeSequences = true;
|
|
18371
|
+
continue;
|
|
18372
|
+
}
|
|
18373
|
+
_sequenceLevels[key] = 0;
|
|
18374
|
+
}
|
|
18375
|
+
if (!activeSequences) {
|
|
18376
|
+
_nextExpectedAction = false;
|
|
18377
|
+
}
|
|
18378
|
+
}
|
|
18033
18379
|
|
|
18380
|
+
/**
|
|
18381
|
+
* finds all callbacks that match based on the keycode, modifiers,
|
|
18382
|
+
* and action
|
|
18383
|
+
*
|
|
18384
|
+
* @param {string} character
|
|
18385
|
+
* @param {Array} modifiers
|
|
18386
|
+
* @param {Event|Object} e
|
|
18387
|
+
* @param {string=} sequenceName - name of the sequence we are looking for
|
|
18388
|
+
* @param {string=} combination
|
|
18389
|
+
* @param {number=} level
|
|
18390
|
+
* @returns {Array}
|
|
18391
|
+
*/
|
|
18392
|
+
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
|
|
18393
|
+
var i;
|
|
18394
|
+
var callback;
|
|
18395
|
+
var matches = [];
|
|
18396
|
+
var action = e.type;
|
|
18034
18397
|
|
|
18035
|
-
|
|
18398
|
+
// if there are no events related to this keycode
|
|
18399
|
+
if (!self._callbacks[character]) {
|
|
18400
|
+
return [];
|
|
18401
|
+
}
|
|
18036
18402
|
|
|
18037
|
-
|
|
18038
|
-
|
|
18403
|
+
// if a modifier key is coming up on its own we should allow it
|
|
18404
|
+
if (action == 'keyup' && _isModifier(character)) {
|
|
18405
|
+
modifiers = [character];
|
|
18406
|
+
}
|
|
18039
18407
|
|
|
18040
|
-
|
|
18041
|
-
|
|
18042
|
-
|
|
18043
|
-
|
|
18044
|
-
}
|
|
18408
|
+
// loop through all callbacks for the key that was pressed
|
|
18409
|
+
// and see if any of them match
|
|
18410
|
+
for (i = 0; i < self._callbacks[character].length; ++i) {
|
|
18411
|
+
callback = self._callbacks[character][i];
|
|
18045
18412
|
|
|
18046
|
-
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
});
|
|
18052
|
-
} else if (Array.isArray(keysInfo)) {
|
|
18053
|
-
// support like : unbind([{key: 'ctrl+a', scope: 's1'}, {key: 'ctrl-a', scope: 's2', splitKey: '-'}])
|
|
18054
|
-
keysInfo.forEach(function (info) {
|
|
18055
|
-
if (info.key) eachUnbind(info);
|
|
18056
|
-
});
|
|
18057
|
-
} else if (typeof keysInfo === 'object') {
|
|
18058
|
-
// support like unbind({key: 'ctrl+a, ctrl+b', scope:'abc'})
|
|
18059
|
-
if (keysInfo.key) eachUnbind(keysInfo);
|
|
18060
|
-
} else if (typeof keysInfo === 'string') {
|
|
18061
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
18062
|
-
args[_key - 1] = arguments[_key];
|
|
18063
|
-
}
|
|
18413
|
+
// if a sequence name is not specified, but this is a sequence at
|
|
18414
|
+
// the wrong level then move onto the next match
|
|
18415
|
+
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
|
|
18416
|
+
continue;
|
|
18417
|
+
}
|
|
18064
18418
|
|
|
18065
|
-
|
|
18066
|
-
|
|
18067
|
-
|
|
18068
|
-
|
|
18419
|
+
// if the action we are looking for doesn't match the action we got
|
|
18420
|
+
// then we should keep going
|
|
18421
|
+
if (action != callback.action) {
|
|
18422
|
+
continue;
|
|
18423
|
+
}
|
|
18069
18424
|
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18425
|
+
// if this is a keypress event and the meta key and control key
|
|
18426
|
+
// are not pressed that means that we need to only look at the
|
|
18427
|
+
// character, otherwise check the modifiers as well
|
|
18428
|
+
//
|
|
18429
|
+
// chrome will not fire a keypress if meta or control is down
|
|
18430
|
+
// safari will fire a keypress if meta or meta+shift is down
|
|
18431
|
+
// firefox will fire a keypress if meta or control is down
|
|
18432
|
+
if (action == 'keypress' && !e.metaKey && !e.ctrlKey || _modifiersMatch(modifiers, callback.modifiers)) {
|
|
18433
|
+
// when you bind a combination or sequence a second time it
|
|
18434
|
+
// should overwrite the first one. if a sequenceName or
|
|
18435
|
+
// combination is specified in this call it does just that
|
|
18436
|
+
//
|
|
18437
|
+
// @todo make deleting its own method?
|
|
18438
|
+
var deleteCombo = !sequenceName && callback.combo == combination;
|
|
18439
|
+
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
|
|
18440
|
+
if (deleteCombo || deleteSequence) {
|
|
18441
|
+
self._callbacks[character].splice(i, 1);
|
|
18442
|
+
}
|
|
18443
|
+
matches.push(callback);
|
|
18444
|
+
}
|
|
18445
|
+
}
|
|
18446
|
+
return matches;
|
|
18447
|
+
}
|
|
18074
18448
|
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18082
|
-
}
|
|
18083
|
-
|
|
18084
|
-
|
|
18085
|
-
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
var len = unbindKeys.length;
|
|
18095
|
-
var lastKey = unbindKeys[len - 1];
|
|
18096
|
-
var keyCode = lastKey === '*' ? '*' : code(lastKey);
|
|
18097
|
-
if (!_handlers[keyCode]) return; // 判断是否传入范围,没有就获取范围
|
|
18098
|
-
|
|
18099
|
-
if (!scope) scope = getScope();
|
|
18100
|
-
var mods = len > 1 ? getMods(_modifier, unbindKeys) : [];
|
|
18101
|
-
_handlers[keyCode] = _handlers[keyCode].map(function (record) {
|
|
18102
|
-
// 通过函数判断,是否解除绑定,函数相等直接返回
|
|
18103
|
-
var isMatchingMethod = method ? record.method === method : true;
|
|
18104
|
-
|
|
18105
|
-
if (isMatchingMethod && record.scope === scope && compareArray(record.mods, mods)) {
|
|
18106
|
-
return {};
|
|
18449
|
+
/**
|
|
18450
|
+
* actually calls the callback function
|
|
18451
|
+
*
|
|
18452
|
+
* if your callback function returns false this will use the jquery
|
|
18453
|
+
* convention - prevent default and stop propogation on the event
|
|
18454
|
+
*
|
|
18455
|
+
* @param {Function} callback
|
|
18456
|
+
* @param {Event} e
|
|
18457
|
+
* @returns void
|
|
18458
|
+
*/
|
|
18459
|
+
function _fireCallback(callback, e, combo, sequence) {
|
|
18460
|
+
// if this event should not happen stop here
|
|
18461
|
+
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
|
|
18462
|
+
return;
|
|
18463
|
+
}
|
|
18464
|
+
if (callback(e, combo) === false) {
|
|
18465
|
+
_preventDefault(e);
|
|
18466
|
+
_stopPropagation(e);
|
|
18467
|
+
}
|
|
18107
18468
|
}
|
|
18108
18469
|
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
}
|
|
18470
|
+
/**
|
|
18471
|
+
* handles a character key event
|
|
18472
|
+
*
|
|
18473
|
+
* @param {string} character
|
|
18474
|
+
* @param {Array} modifiers
|
|
18475
|
+
* @param {Event} e
|
|
18476
|
+
* @returns void
|
|
18477
|
+
*/
|
|
18478
|
+
self._handleKey = function (character, modifiers, e) {
|
|
18479
|
+
var callbacks = _getMatches(character, modifiers, e);
|
|
18480
|
+
var i;
|
|
18481
|
+
var doNotReset = {};
|
|
18482
|
+
var maxLevel = 0;
|
|
18483
|
+
var processedSequenceCallback = false;
|
|
18484
|
+
|
|
18485
|
+
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
|
|
18486
|
+
for (i = 0; i < callbacks.length; ++i) {
|
|
18487
|
+
if (callbacks[i].seq) {
|
|
18488
|
+
maxLevel = Math.max(maxLevel, callbacks[i].level);
|
|
18489
|
+
}
|
|
18490
|
+
}
|
|
18113
18491
|
|
|
18492
|
+
// loop through matching callbacks for this key event
|
|
18493
|
+
for (i = 0; i < callbacks.length; ++i) {
|
|
18494
|
+
// fire for all sequence callbacks
|
|
18495
|
+
// this is because if for example you have multiple sequences
|
|
18496
|
+
// bound such as "g i" and "g t" they both need to fire the
|
|
18497
|
+
// callback for matching g cause otherwise you can only ever
|
|
18498
|
+
// match the first one
|
|
18499
|
+
if (callbacks[i].seq) {
|
|
18500
|
+
// only fire callbacks for the maxLevel to prevent
|
|
18501
|
+
// subsequences from also firing
|
|
18502
|
+
//
|
|
18503
|
+
// for example 'a option b' should not cause 'option b' to fire
|
|
18504
|
+
// even though 'option b' is part of the other sequence
|
|
18505
|
+
//
|
|
18506
|
+
// any sequences that do not match here will be discarded
|
|
18507
|
+
// below by the _resetSequences call
|
|
18508
|
+
if (callbacks[i].level != maxLevel) {
|
|
18509
|
+
continue;
|
|
18510
|
+
}
|
|
18511
|
+
processedSequenceCallback = true;
|
|
18114
18512
|
|
|
18115
|
-
|
|
18116
|
-
|
|
18513
|
+
// keep a list of which sequences were matches for later
|
|
18514
|
+
doNotReset[callbacks[i].seq] = 1;
|
|
18515
|
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
|
|
18516
|
+
continue;
|
|
18517
|
+
}
|
|
18117
18518
|
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
|
|
18519
|
+
// if there were no sequence matches but we are still here
|
|
18520
|
+
// that means this is a regular match so we should fire that
|
|
18521
|
+
if (!processedSequenceCallback) {
|
|
18522
|
+
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
|
|
18523
|
+
}
|
|
18524
|
+
}
|
|
18121
18525
|
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
|
|
18125
|
-
|
|
18526
|
+
// if the key you pressed matches the type of sequence without
|
|
18527
|
+
// being a modifier (ie "keyup" or "keypress") then we should
|
|
18528
|
+
// reset all sequences that were not matched by this event
|
|
18529
|
+
//
|
|
18530
|
+
// this is so, for example, if you have the sequence "h a t" and you
|
|
18531
|
+
// type "h e a r t" it does not match. in this case the "e" will
|
|
18532
|
+
// cause the sequence to reset
|
|
18533
|
+
//
|
|
18534
|
+
// modifier keys are ignored because you can have a sequence
|
|
18535
|
+
// that contains modifiers such as "enter ctrl+space" and in most
|
|
18536
|
+
// cases the modifier key will be pressed before the next key
|
|
18537
|
+
//
|
|
18538
|
+
// also if you have a sequence such as "ctrl+b a" then pressing the
|
|
18539
|
+
// "b" key will trigger a "keypress" and a "keydown"
|
|
18540
|
+
//
|
|
18541
|
+
// the "keydown" is expected when there is a modifier, but the
|
|
18542
|
+
// "keypress" ends up matching the _nextExpectedAction since it occurs
|
|
18543
|
+
// after and that causes the sequence to reset
|
|
18544
|
+
//
|
|
18545
|
+
// we ignore keypresses in a sequence that directly follow a keydown
|
|
18546
|
+
// for the same character
|
|
18547
|
+
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
|
|
18548
|
+
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
|
|
18549
|
+
_resetSequences(doNotReset);
|
|
18550
|
+
}
|
|
18551
|
+
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
|
|
18552
|
+
};
|
|
18553
|
+
|
|
18554
|
+
/**
|
|
18555
|
+
* handles a keydown event
|
|
18556
|
+
*
|
|
18557
|
+
* @param {Event} e
|
|
18558
|
+
* @returns void
|
|
18559
|
+
*/
|
|
18560
|
+
function _handleKeyEvent(e) {
|
|
18561
|
+
// normalize e.which for key events
|
|
18562
|
+
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
|
|
18563
|
+
if (typeof e.which !== 'number') {
|
|
18564
|
+
e.which = e.keyCode;
|
|
18126
18565
|
}
|
|
18127
|
-
|
|
18128
|
-
} // 调用处理程序,如果是修饰键不做处理
|
|
18566
|
+
var character = _characterFromEvent(e);
|
|
18129
18567
|
|
|
18568
|
+
// no character found then stop
|
|
18569
|
+
if (!character) {
|
|
18570
|
+
return;
|
|
18571
|
+
}
|
|
18130
18572
|
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18573
|
+
// need to use === for the character check because the character can be 0
|
|
18574
|
+
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
|
|
18575
|
+
_ignoreNextKeyup = false;
|
|
18576
|
+
return;
|
|
18577
|
+
}
|
|
18578
|
+
self.handleKey(character, _eventModifiers(e), e);
|
|
18136
18579
|
}
|
|
18137
|
-
}
|
|
18138
|
-
}
|
|
18139
|
-
} // 处理keydown事件
|
|
18140
18580
|
|
|
18581
|
+
/**
|
|
18582
|
+
* called to set a 1 second timeout on the specified sequence
|
|
18583
|
+
*
|
|
18584
|
+
* this is so after each key press in the sequence you have 1 second
|
|
18585
|
+
* to press the next key before you have to start over
|
|
18586
|
+
*
|
|
18587
|
+
* @returns void
|
|
18588
|
+
*/
|
|
18589
|
+
function _resetSequenceTimer() {
|
|
18590
|
+
clearTimeout(_resetTimer);
|
|
18591
|
+
_resetTimer = setTimeout(_resetSequences, 1000);
|
|
18592
|
+
}
|
|
18141
18593
|
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18594
|
+
/**
|
|
18595
|
+
* binds a key sequence to an event
|
|
18596
|
+
*
|
|
18597
|
+
* @param {string} combo - combo specified in bind call
|
|
18598
|
+
* @param {Array} keys
|
|
18599
|
+
* @param {Function} callback
|
|
18600
|
+
* @param {string=} action
|
|
18601
|
+
* @returns void
|
|
18602
|
+
*/
|
|
18603
|
+
function _bindSequence(combo, keys, callback, action) {
|
|
18604
|
+
// start off by adding a sequence level record for this combination
|
|
18605
|
+
// and setting the level to 0
|
|
18606
|
+
_sequenceLevels[combo] = 0;
|
|
18148
18607
|
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18608
|
+
/**
|
|
18609
|
+
* callback to increase the sequence level for this sequence and reset
|
|
18610
|
+
* all other sequences that were active
|
|
18611
|
+
*
|
|
18612
|
+
* @param {string} nextAction
|
|
18613
|
+
* @returns {Function}
|
|
18614
|
+
*/
|
|
18615
|
+
function _increaseSequence(nextAction) {
|
|
18616
|
+
return function () {
|
|
18617
|
+
_nextExpectedAction = nextAction;
|
|
18618
|
+
++_sequenceLevels[combo];
|
|
18619
|
+
_resetSequenceTimer();
|
|
18620
|
+
};
|
|
18621
|
+
}
|
|
18156
18622
|
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18623
|
+
/**
|
|
18624
|
+
* wraps the specified callback inside of another function in order
|
|
18625
|
+
* to reset all sequence counters as soon as this sequence is done
|
|
18626
|
+
*
|
|
18627
|
+
* @param {Event} e
|
|
18628
|
+
* @returns void
|
|
18629
|
+
*/
|
|
18630
|
+
function _callbackAndReset(e) {
|
|
18631
|
+
_fireCallback(callback, e, combo);
|
|
18632
|
+
|
|
18633
|
+
// we should ignore the next key up if the action is key down
|
|
18634
|
+
// or keypress. this is so if you finish a sequence and
|
|
18635
|
+
// release the key the final key will not trigger a keyup
|
|
18636
|
+
if (action !== 'keyup') {
|
|
18637
|
+
_ignoreNextKeyup = _characterFromEvent(e);
|
|
18638
|
+
}
|
|
18162
18639
|
|
|
18163
|
-
|
|
18164
|
-
|
|
18640
|
+
// weird race condition if a sequence ends with the key
|
|
18641
|
+
// another sequence begins with
|
|
18642
|
+
setTimeout(_resetSequences, 10);
|
|
18643
|
+
}
|
|
18644
|
+
|
|
18645
|
+
// loop through keys one at a time and bind the appropriate callback
|
|
18646
|
+
// function. for any key leading up to the final one it should
|
|
18647
|
+
// increase the sequence. after the final, it should reset all sequences
|
|
18648
|
+
//
|
|
18649
|
+
// if an action is specified in the original bind call then that will
|
|
18650
|
+
// be used throughout. otherwise we will pass the action that the
|
|
18651
|
+
// next key in the sequence should match. this allows a sequence
|
|
18652
|
+
// to mix and match keypress and keydown events depending on which
|
|
18653
|
+
// ones are better suited to the key provided
|
|
18654
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
18655
|
+
var isFinal = i + 1 === keys.length;
|
|
18656
|
+
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
|
|
18657
|
+
_bindSingle(keys[i], wrappedCallback, action, combo, i);
|
|
18658
|
+
}
|
|
18659
|
+
}
|
|
18165
18660
|
|
|
18166
|
-
if (event[keyName] && _downKeys.indexOf(keyNum) === -1) {
|
|
18167
|
-
_downKeys.push(keyNum);
|
|
18168
|
-
} else if (!event[keyName] && _downKeys.indexOf(keyNum) > -1) {
|
|
18169
|
-
_downKeys.splice(_downKeys.indexOf(keyNum), 1);
|
|
18170
|
-
} else if (keyName === 'metaKey' && event[keyName] && _downKeys.length === 3) {
|
|
18171
18661
|
/**
|
|
18172
|
-
*
|
|
18173
|
-
*
|
|
18662
|
+
* binds a single keyboard combination
|
|
18663
|
+
*
|
|
18664
|
+
* @param {string} combination
|
|
18665
|
+
* @param {Function} callback
|
|
18666
|
+
* @param {string=} action
|
|
18667
|
+
* @param {string=} sequenceName - name of sequence if part of sequence
|
|
18668
|
+
* @param {number=} level - what part of the sequence the command is
|
|
18669
|
+
* @returns void
|
|
18174
18670
|
*/
|
|
18175
|
-
|
|
18176
|
-
|
|
18671
|
+
function _bindSingle(combination, callback, action, sequenceName, level) {
|
|
18672
|
+
// store a direct mapped reference for use with Mousetrap.trigger
|
|
18673
|
+
self._directMap[combination + ':' + action] = callback;
|
|
18674
|
+
|
|
18675
|
+
// make sure multiple spaces in a row become a single space
|
|
18676
|
+
combination = combination.replace(/\s+/g, ' ');
|
|
18677
|
+
var sequence = combination.split(' ');
|
|
18678
|
+
var info;
|
|
18679
|
+
|
|
18680
|
+
// if this pattern is a sequence of keys then run through this method
|
|
18681
|
+
// to reprocess each pattern one key at a time
|
|
18682
|
+
if (sequence.length > 1) {
|
|
18683
|
+
_bindSequence(combination, sequence, callback, action);
|
|
18684
|
+
return;
|
|
18685
|
+
}
|
|
18686
|
+
info = _getKeyInfo(combination, action);
|
|
18687
|
+
|
|
18688
|
+
// make sure to initialize array if this is the first time
|
|
18689
|
+
// a callback is added for this key
|
|
18690
|
+
self._callbacks[info.key] = self._callbacks[info.key] || [];
|
|
18691
|
+
|
|
18692
|
+
// remove an existing match if there is one
|
|
18693
|
+
_getMatches(info.key, info.modifiers, {
|
|
18694
|
+
type: info.action
|
|
18695
|
+
}, sequenceName, combination, level);
|
|
18696
|
+
|
|
18697
|
+
// add this call back to the array
|
|
18698
|
+
// if it is a sequence put it at the beginning
|
|
18699
|
+
// if not put it at the end
|
|
18700
|
+
//
|
|
18701
|
+
// this is important because the way these are processed expects
|
|
18702
|
+
// the sequence ones to come first
|
|
18703
|
+
self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
|
|
18704
|
+
callback: callback,
|
|
18705
|
+
modifiers: info.modifiers,
|
|
18706
|
+
action: info.action,
|
|
18707
|
+
seq: sequenceName,
|
|
18708
|
+
level: level,
|
|
18709
|
+
combo: combination
|
|
18710
|
+
});
|
|
18177
18711
|
}
|
|
18178
|
-
}
|
|
18179
|
-
});
|
|
18180
|
-
/**
|
|
18181
|
-
* -------------------------------
|
|
18182
|
-
*/
|
|
18183
18712
|
|
|
18184
|
-
|
|
18185
|
-
|
|
18713
|
+
/**
|
|
18714
|
+
* binds multiple combinations to the same callback
|
|
18715
|
+
*
|
|
18716
|
+
* @param {Array} combinations
|
|
18717
|
+
* @param {Function} callback
|
|
18718
|
+
* @param {string|undefined} action
|
|
18719
|
+
* @returns void
|
|
18720
|
+
*/
|
|
18721
|
+
self._bindMultiple = function (combinations, callback, action) {
|
|
18722
|
+
for (var i = 0; i < combinations.length; ++i) {
|
|
18723
|
+
_bindSingle(combinations[i], callback, action);
|
|
18724
|
+
}
|
|
18725
|
+
};
|
|
18186
18726
|
|
|
18187
|
-
|
|
18188
|
-
|
|
18727
|
+
// start!
|
|
18728
|
+
_addEvent(targetElement, 'keypress', _handleKeyEvent);
|
|
18729
|
+
_addEvent(targetElement, 'keydown', _handleKeyEvent);
|
|
18730
|
+
_addEvent(targetElement, 'keyup', _handleKeyEvent);
|
|
18189
18731
|
}
|
|
18190
18732
|
|
|
18191
|
-
|
|
18192
|
-
|
|
18733
|
+
/**
|
|
18734
|
+
* binds an event to mousetrap
|
|
18735
|
+
*
|
|
18736
|
+
* can be a single key, a combination of keys separated with +,
|
|
18737
|
+
* an array of keys, or a sequence of keys separated by spaces
|
|
18738
|
+
*
|
|
18739
|
+
* be sure to list the modifier keys first to make sure that the
|
|
18740
|
+
* correct key ends up getting bound (the last key in the pattern)
|
|
18741
|
+
*
|
|
18742
|
+
* @param {string|Array} keys
|
|
18743
|
+
* @param {Function} callback
|
|
18744
|
+
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
|
|
18745
|
+
* @returns void
|
|
18746
|
+
*/
|
|
18747
|
+
Mousetrap.prototype.bind = function (keys, callback, action) {
|
|
18748
|
+
var self = this;
|
|
18749
|
+
keys = keys instanceof Array ? keys : [keys];
|
|
18750
|
+
self._bindMultiple.call(self, keys, callback, action);
|
|
18751
|
+
return self;
|
|
18752
|
+
};
|
|
18193
18753
|
|
|
18754
|
+
/**
|
|
18755
|
+
* unbinds an event to mousetrap
|
|
18756
|
+
*
|
|
18757
|
+
* the unbinding sets the callback function of the specified key combo
|
|
18758
|
+
* to an empty function and deletes the corresponding key in the
|
|
18759
|
+
* _directMap dict.
|
|
18760
|
+
*
|
|
18761
|
+
* TODO: actually remove this from the _callbacks dictionary instead
|
|
18762
|
+
* of binding an empty function
|
|
18763
|
+
*
|
|
18764
|
+
* the keycombo+action has to be exactly the same as
|
|
18765
|
+
* it was defined in the bind method
|
|
18766
|
+
*
|
|
18767
|
+
* @param {string|Array} keys
|
|
18768
|
+
* @param {string} action
|
|
18769
|
+
* @returns void
|
|
18770
|
+
*/
|
|
18771
|
+
Mousetrap.prototype.unbind = function (keys, action) {
|
|
18772
|
+
var self = this;
|
|
18773
|
+
return self.bind.call(self, keys, function () {}, action);
|
|
18774
|
+
};
|
|
18194
18775
|
|
|
18195
|
-
|
|
18196
|
-
|
|
18197
|
-
|
|
18198
|
-
|
|
18199
|
-
|
|
18200
|
-
|
|
18201
|
-
|
|
18202
|
-
|
|
18203
|
-
|
|
18204
|
-
|
|
18205
|
-
|
|
18776
|
+
/**
|
|
18777
|
+
* triggers an event that has already been bound
|
|
18778
|
+
*
|
|
18779
|
+
* @param {string} keys
|
|
18780
|
+
* @param {string=} action
|
|
18781
|
+
* @returns void
|
|
18782
|
+
*/
|
|
18783
|
+
Mousetrap.prototype.trigger = function (keys, action) {
|
|
18784
|
+
var self = this;
|
|
18785
|
+
if (self._directMap[keys + ':' + action]) {
|
|
18786
|
+
self._directMap[keys + ':' + action]({}, keys);
|
|
18787
|
+
}
|
|
18788
|
+
return self;
|
|
18789
|
+
};
|
|
18790
|
+
|
|
18791
|
+
/**
|
|
18792
|
+
* resets the library back to its initial state. this is useful
|
|
18793
|
+
* if you want to clear out the current keyboard shortcuts and bind
|
|
18794
|
+
* new ones - for example if you switch to another page
|
|
18795
|
+
*
|
|
18796
|
+
* @returns void
|
|
18797
|
+
*/
|
|
18798
|
+
Mousetrap.prototype.reset = function () {
|
|
18799
|
+
var self = this;
|
|
18800
|
+
self._callbacks = {};
|
|
18801
|
+
self._directMap = {};
|
|
18802
|
+
return self;
|
|
18803
|
+
};
|
|
18804
|
+
|
|
18805
|
+
/**
|
|
18806
|
+
* should we stop this event before firing off callbacks
|
|
18807
|
+
*
|
|
18808
|
+
* @param {Event} e
|
|
18809
|
+
* @param {Element} element
|
|
18810
|
+
* @return {boolean}
|
|
18811
|
+
*/
|
|
18812
|
+
Mousetrap.prototype.stopCallback = function (e, element) {
|
|
18813
|
+
var self = this;
|
|
18814
|
+
|
|
18815
|
+
// if the element has the class "mousetrap" then no need to stop
|
|
18816
|
+
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
|
|
18817
|
+
return false;
|
|
18818
|
+
}
|
|
18819
|
+
if (_belongsTo(element, self.target)) {
|
|
18820
|
+
return false;
|
|
18821
|
+
}
|
|
18822
|
+
|
|
18823
|
+
// Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
|
|
18824
|
+
// not the initial event target in the shadow tree. Note that not all events cross the
|
|
18825
|
+
// shadow boundary.
|
|
18826
|
+
// For shadow trees with `mode: 'open'`, the initial event target is the first element in
|
|
18827
|
+
// the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
|
|
18828
|
+
// target cannot be obtained.
|
|
18829
|
+
if ('composedPath' in e && typeof e.composedPath === 'function') {
|
|
18830
|
+
// For open shadow trees, update `element` so that the following check works.
|
|
18831
|
+
var initialEventTarget = e.composedPath()[0];
|
|
18832
|
+
if (initialEventTarget !== e.target) {
|
|
18833
|
+
element = initialEventTarget;
|
|
18834
|
+
}
|
|
18835
|
+
}
|
|
18836
|
+
|
|
18837
|
+
// stop for input, select, and textarea
|
|
18838
|
+
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
|
|
18839
|
+
};
|
|
18840
|
+
|
|
18841
|
+
/**
|
|
18842
|
+
* exposes _handleKey publicly so it can be overwritten by extensions
|
|
18843
|
+
*/
|
|
18844
|
+
Mousetrap.prototype.handleKey = function () {
|
|
18845
|
+
var self = this;
|
|
18846
|
+
return self._handleKey.apply(self, arguments);
|
|
18847
|
+
};
|
|
18848
|
+
|
|
18849
|
+
/**
|
|
18850
|
+
* allow custom key mappings
|
|
18851
|
+
*/
|
|
18852
|
+
Mousetrap.addKeycodes = function (object) {
|
|
18853
|
+
for (var key in object) {
|
|
18854
|
+
if (object.hasOwnProperty(key)) {
|
|
18855
|
+
_MAP[key] = object[key];
|
|
18856
|
+
}
|
|
18857
|
+
}
|
|
18858
|
+
_REVERSE_MAP = null;
|
|
18859
|
+
};
|
|
18860
|
+
|
|
18861
|
+
/**
|
|
18862
|
+
* Init the global mousetrap functions
|
|
18863
|
+
*
|
|
18864
|
+
* This method is needed to allow the global mousetrap functions to work
|
|
18865
|
+
* now that mousetrap is a constructor function.
|
|
18866
|
+
*/
|
|
18867
|
+
Mousetrap.init = function () {
|
|
18868
|
+
var documentMousetrap = Mousetrap(document);
|
|
18869
|
+
for (var method in documentMousetrap) {
|
|
18870
|
+
if (method.charAt(0) !== '_') {
|
|
18871
|
+
Mousetrap[method] = function (method) {
|
|
18872
|
+
return function () {
|
|
18873
|
+
return documentMousetrap[method].apply(documentMousetrap, arguments);
|
|
18874
|
+
};
|
|
18875
|
+
}(method);
|
|
18876
|
+
}
|
|
18877
|
+
}
|
|
18878
|
+
};
|
|
18879
|
+
Mousetrap.init();
|
|
18206
18880
|
|
|
18881
|
+
// expose mousetrap to the global object
|
|
18882
|
+
window.Mousetrap = Mousetrap;
|
|
18207
18883
|
|
|
18208
|
-
|
|
18209
|
-
if (
|
|
18210
|
-
|
|
18884
|
+
// expose as a common js module
|
|
18885
|
+
if (module.exports) {
|
|
18886
|
+
module.exports = Mousetrap;
|
|
18211
18887
|
}
|
|
18212
18888
|
|
|
18213
|
-
|
|
18214
|
-
|
|
18889
|
+
// expose mousetrap as an AMD module
|
|
18890
|
+
if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
|
18891
|
+
undefined$1(function () {
|
|
18892
|
+
return Mousetrap;
|
|
18893
|
+
});
|
|
18894
|
+
}
|
|
18895
|
+
})(typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
|
|
18896
|
+
})(mousetrap);
|
|
18897
|
+
var mousetrapExports = mousetrap.exports;
|
|
18898
|
+
var Mousetrap$1 = /*@__PURE__*/getDefaultExportFromCjs(mousetrapExports);
|
|
18899
|
+
|
|
18900
|
+
/**
|
|
18901
|
+
* adds a bindGlobal method to Mousetrap that allows you to
|
|
18902
|
+
* bind specific keyboard shortcuts that will still work
|
|
18903
|
+
* inside a text input field
|
|
18904
|
+
*
|
|
18905
|
+
* usage:
|
|
18906
|
+
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
|
|
18907
|
+
*/
|
|
18908
|
+
/* global Mousetrap:true */
|
|
18909
|
+
(function (Mousetrap) {
|
|
18910
|
+
var _globalCallbacks = {};
|
|
18911
|
+
var _originalStopCallback = Mousetrap.prototype.stopCallback;
|
|
18912
|
+
Mousetrap.prototype.stopCallback = function (e, element, combo, sequence) {
|
|
18913
|
+
var self = this;
|
|
18914
|
+
if (self.paused) {
|
|
18915
|
+
return true;
|
|
18916
|
+
}
|
|
18917
|
+
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
|
|
18918
|
+
return false;
|
|
18919
|
+
}
|
|
18920
|
+
return _originalStopCallback.call(self, e, element, combo);
|
|
18921
|
+
};
|
|
18922
|
+
Mousetrap.prototype.bindGlobal = function (keys, callback, action) {
|
|
18923
|
+
var self = this;
|
|
18924
|
+
self.bind(keys, callback, action);
|
|
18925
|
+
if (keys instanceof Array) {
|
|
18926
|
+
for (var i = 0; i < keys.length; i++) {
|
|
18927
|
+
_globalCallbacks[keys[i]] = true;
|
|
18928
|
+
}
|
|
18929
|
+
return;
|
|
18930
|
+
}
|
|
18931
|
+
_globalCallbacks[keys] = true;
|
|
18932
|
+
};
|
|
18933
|
+
Mousetrap.prototype.unbindGlobal = function (keys, action) {
|
|
18934
|
+
var self = this;
|
|
18935
|
+
self.unbind(keys, action);
|
|
18936
|
+
if (keys instanceof Array) {
|
|
18937
|
+
for (var i = 0; i < keys.length; i++) {
|
|
18938
|
+
_globalCallbacks[keys[i]] = false;
|
|
18939
|
+
}
|
|
18940
|
+
return;
|
|
18215
18941
|
}
|
|
18942
|
+
_globalCallbacks[keys] = false;
|
|
18943
|
+
};
|
|
18944
|
+
Mousetrap.init();
|
|
18945
|
+
})(Mousetrap);
|
|
18216
18946
|
|
|
18217
|
-
|
|
18218
|
-
|
|
18219
|
-
} // 获取范围 默认为 `all`
|
|
18947
|
+
function _typeof$6(o) {
|
|
18948
|
+
"@babel/helpers - typeof";
|
|
18220
18949
|
|
|
18950
|
+
return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
18951
|
+
return typeof o;
|
|
18952
|
+
} : function (o) {
|
|
18953
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18954
|
+
}, _typeof$6(o);
|
|
18955
|
+
}
|
|
18221
18956
|
|
|
18222
|
-
|
|
18957
|
+
var platform$1 = {exports: {}};
|
|
18223
18958
|
|
|
18224
|
-
|
|
18225
|
-
|
|
18226
|
-
|
|
18227
|
-
|
|
18228
|
-
|
|
18959
|
+
platform$1.exports;
|
|
18960
|
+
(function (module, exports) {
|
|
18961
|
+
(function () {
|
|
18962
|
+
|
|
18963
|
+
/** Used to determine if values are of the language type `Object`. */
|
|
18964
|
+
var objectTypes = {
|
|
18965
|
+
'function': true,
|
|
18966
|
+
'object': true
|
|
18967
|
+
};
|
|
18968
|
+
|
|
18969
|
+
/** Used as a reference to the global object. */
|
|
18970
|
+
var root = objectTypes[typeof window === "undefined" ? "undefined" : _typeof$6(window)] && window || this;
|
|
18971
|
+
|
|
18972
|
+
/** Detect free variable `exports`. */
|
|
18973
|
+
var freeExports = exports;
|
|
18974
|
+
|
|
18975
|
+
/** Detect free variable `module`. */
|
|
18976
|
+
var freeModule = module && !module.nodeType && module;
|
|
18977
|
+
|
|
18978
|
+
/** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
|
|
18979
|
+
var freeGlobal = freeExports && freeModule && _typeof$6(commonjsGlobal) == 'object' && commonjsGlobal;
|
|
18980
|
+
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
|
|
18981
|
+
root = freeGlobal;
|
|
18229
18982
|
}
|
|
18230
|
-
} // key 不在 _handlers 中返回
|
|
18231
18983
|
|
|
18984
|
+
/**
|
|
18985
|
+
* Used as the maximum length of an array-like object.
|
|
18986
|
+
* See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
|
18987
|
+
* for more details.
|
|
18988
|
+
*/
|
|
18989
|
+
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
18990
|
+
|
|
18991
|
+
/** Regular expression to detect Opera. */
|
|
18992
|
+
var reOpera = /\bOpera/;
|
|
18232
18993
|
|
|
18233
|
-
|
|
18994
|
+
/** Used for native method references. */
|
|
18995
|
+
var objectProto = Object.prototype;
|
|
18234
18996
|
|
|
18235
|
-
|
|
18236
|
-
|
|
18237
|
-
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
18997
|
+
/** Used to check for own properties of an object. */
|
|
18998
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
18999
|
+
|
|
19000
|
+
/** Used to resolve the internal `[[Class]]` of values. */
|
|
19001
|
+
var toString = objectProto.toString;
|
|
19002
|
+
|
|
19003
|
+
/*--------------------------------------------------------------------------*/
|
|
19004
|
+
|
|
19005
|
+
/**
|
|
19006
|
+
* Capitalizes a string value.
|
|
19007
|
+
*
|
|
19008
|
+
* @private
|
|
19009
|
+
* @param {string} string The string to capitalize.
|
|
19010
|
+
* @returns {string} The capitalized string.
|
|
19011
|
+
*/
|
|
19012
|
+
function capitalize(string) {
|
|
19013
|
+
string = String(string);
|
|
19014
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
19015
|
+
}
|
|
19016
|
+
|
|
19017
|
+
/**
|
|
19018
|
+
* A utility function to clean up the OS name.
|
|
19019
|
+
*
|
|
19020
|
+
* @private
|
|
19021
|
+
* @param {string} os The OS name to clean up.
|
|
19022
|
+
* @param {string} [pattern] A `RegExp` pattern matching the OS name.
|
|
19023
|
+
* @param {string} [label] A label for the OS.
|
|
19024
|
+
*/
|
|
19025
|
+
function cleanupOS(os, pattern, label) {
|
|
19026
|
+
// Platform tokens are defined at:
|
|
19027
|
+
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
19028
|
+
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
19029
|
+
var data = {
|
|
19030
|
+
'10.0': '10',
|
|
19031
|
+
'6.4': '10 Technical Preview',
|
|
19032
|
+
'6.3': '8.1',
|
|
19033
|
+
'6.2': '8',
|
|
19034
|
+
'6.1': 'Server 2008 R2 / 7',
|
|
19035
|
+
'6.0': 'Server 2008 / Vista',
|
|
19036
|
+
'5.2': 'Server 2003 / XP 64-bit',
|
|
19037
|
+
'5.1': 'XP',
|
|
19038
|
+
'5.01': '2000 SP1',
|
|
19039
|
+
'5.0': '2000',
|
|
19040
|
+
'4.0': 'NT',
|
|
19041
|
+
'4.90': 'ME'
|
|
19042
|
+
};
|
|
19043
|
+
// Detect Windows version from platform tokens.
|
|
19044
|
+
if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && (data = data[/[\d.]+$/.exec(os)])) {
|
|
19045
|
+
os = 'Windows ' + data;
|
|
19046
|
+
}
|
|
19047
|
+
// Correct character case and cleanup string.
|
|
19048
|
+
os = String(os);
|
|
19049
|
+
if (pattern && label) {
|
|
19050
|
+
os = os.replace(RegExp(pattern, 'i'), label);
|
|
19051
|
+
}
|
|
19052
|
+
os = format(os.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]);
|
|
19053
|
+
return os;
|
|
19054
|
+
}
|
|
18242
19055
|
|
|
18243
|
-
|
|
18244
|
-
|
|
19056
|
+
/**
|
|
19057
|
+
* An iteration utility for arrays and objects.
|
|
19058
|
+
*
|
|
19059
|
+
* @private
|
|
19060
|
+
* @param {Array|Object} object The object to iterate over.
|
|
19061
|
+
* @param {Function} callback The function called per iteration.
|
|
19062
|
+
*/
|
|
19063
|
+
function each(object, callback) {
|
|
19064
|
+
var index = -1,
|
|
19065
|
+
length = object ? object.length : 0;
|
|
19066
|
+
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
|
|
19067
|
+
while (++index < length) {
|
|
19068
|
+
callback(object[index], index, object);
|
|
18245
19069
|
}
|
|
19070
|
+
} else {
|
|
19071
|
+
forOwn(object, callback);
|
|
19072
|
+
}
|
|
19073
|
+
}
|
|
19074
|
+
|
|
19075
|
+
/**
|
|
19076
|
+
* Trim and conditionally capitalize string values.
|
|
19077
|
+
*
|
|
19078
|
+
* @private
|
|
19079
|
+
* @param {string} string The string to format.
|
|
19080
|
+
* @returns {string} The formatted string.
|
|
19081
|
+
*/
|
|
19082
|
+
function format(string) {
|
|
19083
|
+
string = trim(string);
|
|
19084
|
+
return /^(?:webOS|i(?:OS|P))/.test(string) ? string : capitalize(string);
|
|
19085
|
+
}
|
|
18246
19086
|
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
|
|
19087
|
+
/**
|
|
19088
|
+
* Iterates over an object's own properties, executing the `callback` for each.
|
|
19089
|
+
*
|
|
19090
|
+
* @private
|
|
19091
|
+
* @param {Object} object The object to iterate over.
|
|
19092
|
+
* @param {Function} callback The function executed per own property.
|
|
19093
|
+
*/
|
|
19094
|
+
function forOwn(object, callback) {
|
|
19095
|
+
for (var key in object) {
|
|
19096
|
+
if (hasOwnProperty.call(object, key)) {
|
|
19097
|
+
callback(object[key], key, object);
|
|
18250
19098
|
}
|
|
18251
19099
|
}
|
|
18252
19100
|
}
|
|
18253
|
-
}
|
|
18254
|
-
} // 判断 element 是否已经绑定事件
|
|
18255
19101
|
|
|
19102
|
+
/**
|
|
19103
|
+
* Gets the internal `[[Class]]` of a value.
|
|
19104
|
+
*
|
|
19105
|
+
* @private
|
|
19106
|
+
* @param {*} value The value.
|
|
19107
|
+
* @returns {string} The `[[Class]]`.
|
|
19108
|
+
*/
|
|
19109
|
+
function getClassOf(value) {
|
|
19110
|
+
return value == null ? capitalize(value) : toString.call(value).slice(8, -1);
|
|
19111
|
+
}
|
|
18256
19112
|
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
|
|
19113
|
+
/**
|
|
19114
|
+
* Host objects can return type values that are different from their actual
|
|
19115
|
+
* data type. The objects we are concerned with usually return non-primitive
|
|
19116
|
+
* types of "object", "function", or "unknown".
|
|
19117
|
+
*
|
|
19118
|
+
* @private
|
|
19119
|
+
* @param {*} object The owner of the property.
|
|
19120
|
+
* @param {string} property The property to check.
|
|
19121
|
+
* @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
|
|
19122
|
+
*/
|
|
19123
|
+
function isHostType(object, property) {
|
|
19124
|
+
var type = object != null ? _typeof$6(object[property]) : 'number';
|
|
19125
|
+
return !/^(?:boolean|number|string|undefined)$/.test(type) && (type == 'object' ? !!object[property] : true);
|
|
19126
|
+
}
|
|
18260
19127
|
|
|
18261
|
-
|
|
18262
|
-
|
|
18263
|
-
|
|
19128
|
+
/**
|
|
19129
|
+
* Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
|
|
19130
|
+
*
|
|
19131
|
+
* @private
|
|
19132
|
+
* @param {string} string The string to qualify.
|
|
19133
|
+
* @returns {string} The qualified string.
|
|
19134
|
+
*/
|
|
19135
|
+
function qualify(string) {
|
|
19136
|
+
return String(string).replace(/([ -])(?!$)/g, '$1?');
|
|
19137
|
+
}
|
|
18264
19138
|
|
|
18265
|
-
|
|
18266
|
-
|
|
19139
|
+
/**
|
|
19140
|
+
* A bare-bones `Array#reduce` like utility function.
|
|
19141
|
+
*
|
|
19142
|
+
* @private
|
|
19143
|
+
* @param {Array} array The array to iterate over.
|
|
19144
|
+
* @param {Function} callback The function called per iteration.
|
|
19145
|
+
* @returns {*} The accumulated result.
|
|
19146
|
+
*/
|
|
19147
|
+
function reduce(array, callback) {
|
|
19148
|
+
var accumulator = null;
|
|
19149
|
+
each(array, function (value, index) {
|
|
19150
|
+
accumulator = callback(accumulator, value, index, array);
|
|
19151
|
+
});
|
|
19152
|
+
return accumulator;
|
|
19153
|
+
}
|
|
18267
19154
|
|
|
18268
|
-
|
|
19155
|
+
/**
|
|
19156
|
+
* Removes leading and trailing whitespace from a string.
|
|
19157
|
+
*
|
|
19158
|
+
* @private
|
|
19159
|
+
* @param {string} string The string to trim.
|
|
19160
|
+
* @returns {string} The trimmed string.
|
|
19161
|
+
*/
|
|
19162
|
+
function trim(string) {
|
|
19163
|
+
return String(string).replace(/^ +| +$/g, '');
|
|
19164
|
+
}
|
|
18269
19165
|
|
|
18270
|
-
|
|
18271
|
-
var keyup = false;
|
|
18272
|
-
var keydown = true;
|
|
18273
|
-
var splitKey = '+'; // 对为设定范围的判断
|
|
19166
|
+
/*--------------------------------------------------------------------------*/
|
|
18274
19167
|
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
19168
|
+
/**
|
|
19169
|
+
* Creates a new platform object.
|
|
19170
|
+
*
|
|
19171
|
+
* @memberOf platform
|
|
19172
|
+
* @param {Object|string} [ua=navigator.userAgent] The user agent string or
|
|
19173
|
+
* context object.
|
|
19174
|
+
* @returns {Object} A platform object.
|
|
19175
|
+
*/
|
|
19176
|
+
function parse(ua) {
|
|
19177
|
+
/** The environment context object. */
|
|
19178
|
+
var context = root;
|
|
18278
19179
|
|
|
18279
|
-
|
|
18280
|
-
|
|
19180
|
+
/** Used to flag when a custom context is provided. */
|
|
19181
|
+
var isCustomContext = ua && _typeof$6(ua) == 'object' && getClassOf(ua) != 'String';
|
|
18281
19182
|
|
|
18282
|
-
|
|
19183
|
+
// Juggle arguments.
|
|
19184
|
+
if (isCustomContext) {
|
|
19185
|
+
context = ua;
|
|
19186
|
+
ua = null;
|
|
19187
|
+
}
|
|
18283
19188
|
|
|
18284
|
-
|
|
19189
|
+
/** Browser navigator object. */
|
|
19190
|
+
var nav = context.navigator || {};
|
|
18285
19191
|
|
|
18286
|
-
|
|
19192
|
+
/** Browser user agent string. */
|
|
19193
|
+
var userAgent = nav.userAgent || '';
|
|
19194
|
+
ua || (ua = userAgent);
|
|
18287
19195
|
|
|
18288
|
-
|
|
18289
|
-
|
|
19196
|
+
/** Used to detect if browser is like Chrome. */
|
|
19197
|
+
var likeChrome = isCustomContext ? !!nav.likeChrome : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
|
18290
19198
|
|
|
18291
|
-
|
|
19199
|
+
/** Internal `[[Class]]` value shortcuts. */
|
|
19200
|
+
var objectClass = 'Object',
|
|
19201
|
+
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
|
19202
|
+
enviroClass = isCustomContext ? objectClass : 'Environment',
|
|
19203
|
+
javaClass = isCustomContext && context.java ? 'JavaPackage' : getClassOf(context.java),
|
|
19204
|
+
phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
|
|
18292
19205
|
|
|
18293
|
-
|
|
18294
|
-
|
|
19206
|
+
/** Detect Java environments. */
|
|
19207
|
+
var java = /\bJava/.test(javaClass) && context.java;
|
|
18295
19208
|
|
|
18296
|
-
|
|
19209
|
+
/** Detect Rhino. */
|
|
19210
|
+
var rhino = java && getClassOf(context.environment) == enviroClass;
|
|
18297
19211
|
|
|
18298
|
-
|
|
19212
|
+
/** A character to represent alpha. */
|
|
19213
|
+
var alpha = java ? 'a' : "\u03B1";
|
|
18299
19214
|
|
|
18300
|
-
|
|
18301
|
-
|
|
18302
|
-
// 判断key是否在_handlers中,不在就赋一个空数组
|
|
19215
|
+
/** A character to represent beta. */
|
|
19216
|
+
var beta = java ? 'b' : "\u03B2";
|
|
18303
19217
|
|
|
18304
|
-
|
|
19218
|
+
/** Browser document object. */
|
|
19219
|
+
var doc = context.document || {};
|
|
18305
19220
|
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
19221
|
+
/**
|
|
19222
|
+
* Detect Opera browser (Presto-based).
|
|
19223
|
+
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
|
19224
|
+
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
|
19225
|
+
*/
|
|
19226
|
+
var opera = context.operamini || context.opera;
|
|
19227
|
+
|
|
19228
|
+
/** Opera `[[Class]]`. */
|
|
19229
|
+
var operaClass = reOpera.test(operaClass = isCustomContext && opera ? opera['[[Class]]'] : getClassOf(opera)) ? operaClass : opera = null;
|
|
19230
|
+
|
|
19231
|
+
/*------------------------------------------------------------------------*/
|
|
19232
|
+
|
|
19233
|
+
/** Temporary variable used over the script's lifetime. */
|
|
19234
|
+
var data;
|
|
19235
|
+
|
|
19236
|
+
/** The CPU architecture. */
|
|
19237
|
+
var arch = ua;
|
|
19238
|
+
|
|
19239
|
+
/** Platform description array. */
|
|
19240
|
+
var description = [];
|
|
19241
|
+
|
|
19242
|
+
/** Platform alpha/beta indicator. */
|
|
19243
|
+
var prerelease = null;
|
|
19244
|
+
|
|
19245
|
+
/** A flag to indicate that environment features should be used to resolve the platform. */
|
|
19246
|
+
var useFeatures = ua == userAgent;
|
|
19247
|
+
|
|
19248
|
+
/** The browser/environment version. */
|
|
19249
|
+
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
|
19250
|
+
|
|
19251
|
+
/** A flag to indicate if the OS ends with "/ Version" */
|
|
19252
|
+
var isSpecialCasedOS;
|
|
19253
|
+
|
|
19254
|
+
/* Detectable layout engines (order is important). */
|
|
19255
|
+
var layout = getLayout([{
|
|
19256
|
+
'label': 'EdgeHTML',
|
|
19257
|
+
'pattern': 'Edge'
|
|
19258
|
+
}, 'Trident', {
|
|
19259
|
+
'label': 'WebKit',
|
|
19260
|
+
'pattern': 'AppleWebKit'
|
|
19261
|
+
}, 'iCab', 'Presto', 'NetFront', 'Tasman', 'KHTML', 'Gecko']);
|
|
19262
|
+
|
|
19263
|
+
/* Detectable browser names (order is important). */
|
|
19264
|
+
var name = getName(['Adobe AIR', 'Arora', 'Avant Browser', 'Breach', 'Camino', 'Electron', 'Epiphany', 'Fennec', 'Flock', 'Galeon', 'GreenBrowser', 'iCab', 'Iceweasel', 'K-Meleon', 'Konqueror', 'Lunascape', 'Maxthon', {
|
|
19265
|
+
'label': 'Microsoft Edge',
|
|
19266
|
+
'pattern': '(?:Edge|Edg|EdgA|EdgiOS)'
|
|
19267
|
+
}, 'Midori', 'Nook Browser', 'PaleMoon', 'PhantomJS', 'Raven', 'Rekonq', 'RockMelt', {
|
|
19268
|
+
'label': 'Samsung Internet',
|
|
19269
|
+
'pattern': 'SamsungBrowser'
|
|
19270
|
+
}, 'SeaMonkey', {
|
|
19271
|
+
'label': 'Silk',
|
|
19272
|
+
'pattern': '(?:Cloud9|Silk-Accelerated)'
|
|
19273
|
+
}, 'Sleipnir', 'SlimBrowser', {
|
|
19274
|
+
'label': 'SRWare Iron',
|
|
19275
|
+
'pattern': 'Iron'
|
|
19276
|
+
}, 'Sunrise', 'Swiftfox', 'Vivaldi', 'Waterfox', 'WebPositive', {
|
|
19277
|
+
'label': 'Yandex Browser',
|
|
19278
|
+
'pattern': 'YaBrowser'
|
|
19279
|
+
}, {
|
|
19280
|
+
'label': 'UC Browser',
|
|
19281
|
+
'pattern': 'UCBrowser'
|
|
19282
|
+
}, 'Opera Mini', {
|
|
19283
|
+
'label': 'Opera Mini',
|
|
19284
|
+
'pattern': 'OPiOS'
|
|
19285
|
+
}, 'Opera', {
|
|
19286
|
+
'label': 'Opera',
|
|
19287
|
+
'pattern': 'OPR'
|
|
19288
|
+
}, 'Chromium', 'Chrome', {
|
|
19289
|
+
'label': 'Chrome',
|
|
19290
|
+
'pattern': '(?:HeadlessChrome)'
|
|
19291
|
+
}, {
|
|
19292
|
+
'label': 'Chrome Mobile',
|
|
19293
|
+
'pattern': '(?:CriOS|CrMo)'
|
|
19294
|
+
}, {
|
|
19295
|
+
'label': 'Firefox',
|
|
19296
|
+
'pattern': '(?:Firefox|Minefield)'
|
|
19297
|
+
}, {
|
|
19298
|
+
'label': 'Firefox for iOS',
|
|
19299
|
+
'pattern': 'FxiOS'
|
|
19300
|
+
}, {
|
|
19301
|
+
'label': 'IE',
|
|
19302
|
+
'pattern': 'IEMobile'
|
|
19303
|
+
}, {
|
|
19304
|
+
'label': 'IE',
|
|
19305
|
+
'pattern': 'MSIE'
|
|
19306
|
+
}, 'Safari']);
|
|
19307
|
+
|
|
19308
|
+
/* Detectable products (order is important). */
|
|
19309
|
+
var product = getProduct([{
|
|
19310
|
+
'label': 'BlackBerry',
|
|
19311
|
+
'pattern': 'BB10'
|
|
19312
|
+
}, 'BlackBerry', {
|
|
19313
|
+
'label': 'Galaxy S',
|
|
19314
|
+
'pattern': 'GT-I9000'
|
|
19315
|
+
}, {
|
|
19316
|
+
'label': 'Galaxy S2',
|
|
19317
|
+
'pattern': 'GT-I9100'
|
|
19318
|
+
}, {
|
|
19319
|
+
'label': 'Galaxy S3',
|
|
19320
|
+
'pattern': 'GT-I9300'
|
|
19321
|
+
}, {
|
|
19322
|
+
'label': 'Galaxy S4',
|
|
19323
|
+
'pattern': 'GT-I9500'
|
|
19324
|
+
}, {
|
|
19325
|
+
'label': 'Galaxy S5',
|
|
19326
|
+
'pattern': 'SM-G900'
|
|
19327
|
+
}, {
|
|
19328
|
+
'label': 'Galaxy S6',
|
|
19329
|
+
'pattern': 'SM-G920'
|
|
19330
|
+
}, {
|
|
19331
|
+
'label': 'Galaxy S6 Edge',
|
|
19332
|
+
'pattern': 'SM-G925'
|
|
19333
|
+
}, {
|
|
19334
|
+
'label': 'Galaxy S7',
|
|
19335
|
+
'pattern': 'SM-G930'
|
|
19336
|
+
}, {
|
|
19337
|
+
'label': 'Galaxy S7 Edge',
|
|
19338
|
+
'pattern': 'SM-G935'
|
|
19339
|
+
}, 'Google TV', 'Lumia', 'iPad', 'iPod', 'iPhone', 'Kindle', {
|
|
19340
|
+
'label': 'Kindle Fire',
|
|
19341
|
+
'pattern': '(?:Cloud9|Silk-Accelerated)'
|
|
19342
|
+
}, 'Nexus', 'Nook', 'PlayBook', 'PlayStation Vita', 'PlayStation', 'TouchPad', 'Transformer', {
|
|
19343
|
+
'label': 'Wii U',
|
|
19344
|
+
'pattern': 'WiiU'
|
|
19345
|
+
}, 'Wii', 'Xbox One', {
|
|
19346
|
+
'label': 'Xbox 360',
|
|
19347
|
+
'pattern': 'Xbox'
|
|
19348
|
+
}, 'Xoom']);
|
|
19349
|
+
|
|
19350
|
+
/* Detectable manufacturers. */
|
|
19351
|
+
var manufacturer = getManufacturer({
|
|
19352
|
+
'Apple': {
|
|
19353
|
+
'iPad': 1,
|
|
19354
|
+
'iPhone': 1,
|
|
19355
|
+
'iPod': 1
|
|
19356
|
+
},
|
|
19357
|
+
'Alcatel': {},
|
|
19358
|
+
'Archos': {},
|
|
19359
|
+
'Amazon': {
|
|
19360
|
+
'Kindle': 1,
|
|
19361
|
+
'Kindle Fire': 1
|
|
19362
|
+
},
|
|
19363
|
+
'Asus': {
|
|
19364
|
+
'Transformer': 1
|
|
19365
|
+
},
|
|
19366
|
+
'Barnes & Noble': {
|
|
19367
|
+
'Nook': 1
|
|
19368
|
+
},
|
|
19369
|
+
'BlackBerry': {
|
|
19370
|
+
'PlayBook': 1
|
|
19371
|
+
},
|
|
19372
|
+
'Google': {
|
|
19373
|
+
'Google TV': 1,
|
|
19374
|
+
'Nexus': 1
|
|
19375
|
+
},
|
|
19376
|
+
'HP': {
|
|
19377
|
+
'TouchPad': 1
|
|
19378
|
+
},
|
|
19379
|
+
'HTC': {},
|
|
19380
|
+
'Huawei': {},
|
|
19381
|
+
'Lenovo': {},
|
|
19382
|
+
'LG': {},
|
|
19383
|
+
'Microsoft': {
|
|
19384
|
+
'Xbox': 1,
|
|
19385
|
+
'Xbox One': 1
|
|
19386
|
+
},
|
|
19387
|
+
'Motorola': {
|
|
19388
|
+
'Xoom': 1
|
|
19389
|
+
},
|
|
19390
|
+
'Nintendo': {
|
|
19391
|
+
'Wii U': 1,
|
|
19392
|
+
'Wii': 1
|
|
19393
|
+
},
|
|
19394
|
+
'Nokia': {
|
|
19395
|
+
'Lumia': 1
|
|
19396
|
+
},
|
|
19397
|
+
'Oppo': {},
|
|
19398
|
+
'Samsung': {
|
|
19399
|
+
'Galaxy S': 1,
|
|
19400
|
+
'Galaxy S2': 1,
|
|
19401
|
+
'Galaxy S3': 1,
|
|
19402
|
+
'Galaxy S4': 1
|
|
19403
|
+
},
|
|
19404
|
+
'Sony': {
|
|
19405
|
+
'PlayStation': 1,
|
|
19406
|
+
'PlayStation Vita': 1
|
|
19407
|
+
},
|
|
19408
|
+
'Xiaomi': {
|
|
19409
|
+
'Mi': 1,
|
|
19410
|
+
'Redmi': 1
|
|
19411
|
+
}
|
|
19412
|
+
});
|
|
18317
19413
|
|
|
19414
|
+
/* Detectable operating systems (order is important). */
|
|
19415
|
+
var os = getOS(['Windows Phone', 'KaiOS', 'Android', 'CentOS', {
|
|
19416
|
+
'label': 'Chrome OS',
|
|
19417
|
+
'pattern': 'CrOS'
|
|
19418
|
+
}, 'Debian', {
|
|
19419
|
+
'label': 'DragonFly BSD',
|
|
19420
|
+
'pattern': 'DragonFly'
|
|
19421
|
+
}, '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 ']);
|
|
18318
19422
|
|
|
18319
|
-
|
|
18320
|
-
elementHasBindEvent.push(element);
|
|
18321
|
-
addEvent$1(element, 'keydown', function (e) {
|
|
18322
|
-
dispatch(e);
|
|
18323
|
-
});
|
|
18324
|
-
addEvent$1(window, 'focus', function () {
|
|
18325
|
-
_downKeys = [];
|
|
18326
|
-
});
|
|
18327
|
-
addEvent$1(element, 'keyup', function (e) {
|
|
18328
|
-
dispatch(e);
|
|
18329
|
-
clearModifier(e);
|
|
18330
|
-
});
|
|
18331
|
-
}
|
|
18332
|
-
}
|
|
19423
|
+
/*------------------------------------------------------------------------*/
|
|
18333
19424
|
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
19425
|
+
/**
|
|
19426
|
+
* Picks the layout engine from an array of guesses.
|
|
19427
|
+
*
|
|
19428
|
+
* @private
|
|
19429
|
+
* @param {Array} guesses An array of guesses.
|
|
19430
|
+
* @returns {null|string} The detected layout engine.
|
|
19431
|
+
*/
|
|
19432
|
+
function getLayout(guesses) {
|
|
19433
|
+
return reduce(guesses, function (result, guess) {
|
|
19434
|
+
return result || RegExp('\\b' + (guess.pattern || qualify(guess)) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
19435
|
+
});
|
|
19436
|
+
}
|
|
18343
19437
|
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
}
|
|
19438
|
+
/**
|
|
19439
|
+
* Picks the manufacturer from an array of guesses.
|
|
19440
|
+
*
|
|
19441
|
+
* @private
|
|
19442
|
+
* @param {Array} guesses An object of guesses.
|
|
19443
|
+
* @returns {null|string} The detected manufacturer.
|
|
19444
|
+
*/
|
|
19445
|
+
function getManufacturer(guesses) {
|
|
19446
|
+
return reduce(guesses, function (result, value, key) {
|
|
19447
|
+
// Lookup the manufacturer by product or scan the UA for the manufacturer.
|
|
19448
|
+
return result || (value[product] || value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)) && key;
|
|
19449
|
+
});
|
|
19450
|
+
}
|
|
18349
19451
|
|
|
18350
|
-
|
|
18351
|
-
|
|
19452
|
+
/**
|
|
19453
|
+
* Picks the browser name from an array of guesses.
|
|
19454
|
+
*
|
|
19455
|
+
* @private
|
|
19456
|
+
* @param {Array} guesses An array of guesses.
|
|
19457
|
+
* @returns {null|string} The detected browser name.
|
|
19458
|
+
*/
|
|
19459
|
+
function getName(guesses) {
|
|
19460
|
+
return reduce(guesses, function (result, guess) {
|
|
19461
|
+
return result || RegExp('\\b' + (guess.pattern || qualify(guess)) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
19462
|
+
});
|
|
19463
|
+
}
|
|
18352
19464
|
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
19465
|
+
/**
|
|
19466
|
+
* Picks the OS name from an array of guesses.
|
|
19467
|
+
*
|
|
19468
|
+
* @private
|
|
19469
|
+
* @param {Array} guesses An array of guesses.
|
|
19470
|
+
* @returns {null|string} The detected OS name.
|
|
19471
|
+
*/
|
|
19472
|
+
function getOS(guesses) {
|
|
19473
|
+
return reduce(guesses, function (result, guess) {
|
|
19474
|
+
var pattern = guess.pattern || qualify(guess);
|
|
19475
|
+
if (!result && (result = RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua))) {
|
|
19476
|
+
result = cleanupOS(result, pattern, guess.label || guess);
|
|
19477
|
+
}
|
|
19478
|
+
return result;
|
|
19479
|
+
});
|
|
19480
|
+
}
|
|
18357
19481
|
|
|
18358
|
-
|
|
18359
|
-
|
|
19482
|
+
/**
|
|
19483
|
+
* Picks the product name from an array of guesses.
|
|
19484
|
+
*
|
|
19485
|
+
* @private
|
|
19486
|
+
* @param {Array} guesses An array of guesses.
|
|
19487
|
+
* @returns {null|string} The detected product name.
|
|
19488
|
+
*/
|
|
19489
|
+
function getProduct(guesses) {
|
|
19490
|
+
return reduce(guesses, function (result, guess) {
|
|
19491
|
+
var pattern = guess.pattern || qualify(guess);
|
|
19492
|
+
if (!result && (result = RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua))) {
|
|
19493
|
+
// Split by forward slash and append product version if needed.
|
|
19494
|
+
if ((result = String(guess.label && !RegExp(pattern, 'i').test(guess.label) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
|
|
19495
|
+
result[0] += ' ' + result[1];
|
|
19496
|
+
}
|
|
19497
|
+
// Correct character case and cleanup string.
|
|
19498
|
+
guess = guess.label || guess;
|
|
19499
|
+
result = format(result[0].replace(RegExp(pattern, 'i'), guess).replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ').replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
|
|
19500
|
+
}
|
|
19501
|
+
return result;
|
|
19502
|
+
});
|
|
19503
|
+
}
|
|
18360
19504
|
|
|
18361
|
-
|
|
18362
|
-
|
|
19505
|
+
/**
|
|
19506
|
+
* Resolves the version using an array of UA patterns.
|
|
19507
|
+
*
|
|
19508
|
+
* @private
|
|
19509
|
+
* @param {Array} patterns An array of UA patterns.
|
|
19510
|
+
* @returns {null|string} The detected version.
|
|
19511
|
+
*/
|
|
19512
|
+
function getVersion(patterns) {
|
|
19513
|
+
return reduce(patterns, function (result, pattern) {
|
|
19514
|
+
return result || (RegExp(pattern + '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
|
|
19515
|
+
});
|
|
19516
|
+
}
|
|
18363
19517
|
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
19518
|
+
/**
|
|
19519
|
+
* Returns `platform.description` when the platform object is coerced to a string.
|
|
19520
|
+
*
|
|
19521
|
+
* @name toString
|
|
19522
|
+
* @memberOf platform
|
|
19523
|
+
* @returns {string} Returns `platform.description` if available, else an empty string.
|
|
19524
|
+
*/
|
|
19525
|
+
function toStringPlatform() {
|
|
19526
|
+
return this.description || '';
|
|
19527
|
+
}
|
|
18367
19528
|
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
|
|
19529
|
+
/*------------------------------------------------------------------------*/
|
|
19530
|
+
|
|
19531
|
+
// Convert layout to an array so we can add extra details.
|
|
19532
|
+
layout && (layout = [layout]);
|
|
19533
|
+
|
|
19534
|
+
// Detect Android products.
|
|
19535
|
+
// Browsers on Android devices typically provide their product IDS after "Android;"
|
|
19536
|
+
// up to "Build" or ") AppleWebKit".
|
|
19537
|
+
// Example:
|
|
19538
|
+
// "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
|
|
19539
|
+
// (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
|
|
19540
|
+
if (/\bAndroid\b/.test(os) && !product && (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
|
|
19541
|
+
product = trim(data[1])
|
|
19542
|
+
// Replace any language codes (eg. "en-US").
|
|
19543
|
+
.replace(/^[a-z]{2}-[a-z]{2};\s*/i, '') || null;
|
|
19544
|
+
}
|
|
19545
|
+
// Detect product names that contain their manufacturer's name.
|
|
19546
|
+
if (manufacturer && !product) {
|
|
19547
|
+
product = getProduct([manufacturer]);
|
|
19548
|
+
} else if (manufacturer && product) {
|
|
19549
|
+
product = product.replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ').replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
|
|
19550
|
+
}
|
|
19551
|
+
// Clean up Google TV.
|
|
19552
|
+
if (data = /\bGoogle TV\b/.exec(product)) {
|
|
19553
|
+
product = data[0];
|
|
19554
|
+
}
|
|
19555
|
+
// Detect simulators.
|
|
19556
|
+
if (/\bSimulator\b/i.test(ua)) {
|
|
19557
|
+
product = (product ? product + ' ' : '') + 'Simulator';
|
|
19558
|
+
}
|
|
19559
|
+
// Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
|
|
19560
|
+
if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
|
|
19561
|
+
description.push('running in Turbo/Uncompressed mode');
|
|
19562
|
+
}
|
|
19563
|
+
// Detect IE Mobile 11.
|
|
19564
|
+
if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
|
|
19565
|
+
data = parse(ua.replace(/like iPhone OS/, ''));
|
|
19566
|
+
manufacturer = data.manufacturer;
|
|
19567
|
+
product = data.product;
|
|
19568
|
+
}
|
|
19569
|
+
// Detect iOS.
|
|
19570
|
+
else if (/^iP/.test(product)) {
|
|
19571
|
+
name || (name = 'Safari');
|
|
19572
|
+
os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) ? ' ' + data[1].replace(/_/g, '.') : '');
|
|
19573
|
+
}
|
|
19574
|
+
// Detect Kubuntu.
|
|
19575
|
+
else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
|
|
19576
|
+
os = 'Kubuntu';
|
|
19577
|
+
}
|
|
19578
|
+
// Detect Android browsers.
|
|
19579
|
+
else if (manufacturer && manufacturer != 'Google' && (/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua) || /\bVita\b/.test(product)) || /\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua)) {
|
|
19580
|
+
name = 'Android Browser';
|
|
19581
|
+
os = /\bAndroid\b/.test(os) ? os : 'Android';
|
|
19582
|
+
}
|
|
19583
|
+
// Detect Silk desktop/accelerated modes.
|
|
19584
|
+
else if (name == 'Silk') {
|
|
19585
|
+
if (!/\bMobi/i.test(ua)) {
|
|
19586
|
+
os = 'Android';
|
|
19587
|
+
description.unshift('desktop mode');
|
|
19588
|
+
}
|
|
19589
|
+
if (/Accelerated *= *true/i.test(ua)) {
|
|
19590
|
+
description.unshift('accelerated');
|
|
19591
|
+
}
|
|
19592
|
+
}
|
|
19593
|
+
// Detect UC Browser speed mode.
|
|
19594
|
+
else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
|
|
19595
|
+
description.push('speed mode');
|
|
19596
|
+
}
|
|
19597
|
+
// Detect PaleMoon identifying as Firefox.
|
|
19598
|
+
else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
|
|
19599
|
+
description.push('identifying as Firefox ' + data[1]);
|
|
19600
|
+
}
|
|
19601
|
+
// Detect Firefox OS and products running Firefox.
|
|
19602
|
+
else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
|
|
19603
|
+
os || (os = 'Firefox OS');
|
|
19604
|
+
product || (product = data[1]);
|
|
19605
|
+
}
|
|
19606
|
+
// Detect false positives for Firefox/Safari.
|
|
19607
|
+
else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
|
|
19608
|
+
// Escape the `/` for Firefox 1.
|
|
19609
|
+
if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
|
|
19610
|
+
// Clear name of false positives.
|
|
19611
|
+
name = null;
|
|
19612
|
+
}
|
|
19613
|
+
// Reassign a generic name.
|
|
19614
|
+
if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
|
|
19615
|
+
name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
|
|
19616
|
+
}
|
|
19617
|
+
}
|
|
19618
|
+
// Add Chrome version to description for Electron.
|
|
19619
|
+
else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
|
|
19620
|
+
description.push('Chromium ' + data);
|
|
19621
|
+
}
|
|
19622
|
+
// Detect non-Opera (Presto-based) versions (order is important).
|
|
19623
|
+
if (!version) {
|
|
19624
|
+
version = getVersion(['(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)', 'Version', qualify(name), '(?:Firefox|Minefield|NetFront)']);
|
|
19625
|
+
}
|
|
19626
|
+
// Detect stubborn layout engines.
|
|
19627
|
+
if (data = layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' || !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') || layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront') {
|
|
19628
|
+
layout = [data];
|
|
19629
|
+
}
|
|
19630
|
+
// Detect Windows Phone 7 desktop mode.
|
|
19631
|
+
if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
|
|
19632
|
+
name += ' Mobile';
|
|
19633
|
+
os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
|
|
19634
|
+
description.unshift('desktop mode');
|
|
19635
|
+
}
|
|
19636
|
+
// Detect Windows Phone 8.x desktop mode.
|
|
19637
|
+
else if (/\bWPDesktop\b/i.test(ua)) {
|
|
19638
|
+
name = 'IE Mobile';
|
|
19639
|
+
os = 'Windows Phone 8.x';
|
|
19640
|
+
description.unshift('desktop mode');
|
|
19641
|
+
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
|
|
19642
|
+
}
|
|
19643
|
+
// Detect IE 11 identifying as other browsers.
|
|
19644
|
+
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
|
|
19645
|
+
if (name) {
|
|
19646
|
+
description.push('identifying as ' + name + (version ? ' ' + version : ''));
|
|
19647
|
+
}
|
|
19648
|
+
name = 'IE';
|
|
19649
|
+
version = data[1];
|
|
19650
|
+
}
|
|
19651
|
+
// Leverage environment features.
|
|
19652
|
+
if (useFeatures) {
|
|
19653
|
+
// Detect server-side environments.
|
|
19654
|
+
// Rhino has a global function while others have a global object.
|
|
19655
|
+
if (isHostType(context, 'global')) {
|
|
19656
|
+
if (java) {
|
|
19657
|
+
data = java.lang.System;
|
|
19658
|
+
arch = data.getProperty('os.arch');
|
|
19659
|
+
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
|
19660
|
+
}
|
|
19661
|
+
if (rhino) {
|
|
19662
|
+
try {
|
|
19663
|
+
version = context.require('ringo/engine').version.join('.');
|
|
19664
|
+
name = 'RingoJS';
|
|
19665
|
+
} catch (e) {
|
|
19666
|
+
if ((data = context.system) && data.global.system == context.system) {
|
|
19667
|
+
name = 'Narwhal';
|
|
19668
|
+
os || (os = data[0].os || null);
|
|
19669
|
+
}
|
|
19670
|
+
}
|
|
19671
|
+
if (!name) {
|
|
19672
|
+
name = 'Rhino';
|
|
19673
|
+
}
|
|
19674
|
+
} else if (_typeof$6(context.process) == 'object' && !context.process.browser && (data = context.process)) {
|
|
19675
|
+
if (_typeof$6(data.versions) == 'object') {
|
|
19676
|
+
if (typeof data.versions.electron == 'string') {
|
|
19677
|
+
description.push('Node ' + data.versions.node);
|
|
19678
|
+
name = 'Electron';
|
|
19679
|
+
version = data.versions.electron;
|
|
19680
|
+
} else if (typeof data.versions.nw == 'string') {
|
|
19681
|
+
description.push('Chromium ' + version, 'Node ' + data.versions.node);
|
|
19682
|
+
name = 'NW.js';
|
|
19683
|
+
version = data.versions.nw;
|
|
19684
|
+
}
|
|
19685
|
+
}
|
|
19686
|
+
if (!name) {
|
|
19687
|
+
name = 'Node.js';
|
|
19688
|
+
arch = data.arch;
|
|
19689
|
+
os = data.platform;
|
|
19690
|
+
version = /[\d.]+/.exec(data.version);
|
|
19691
|
+
version = version ? version[0] : null;
|
|
19692
|
+
}
|
|
19693
|
+
}
|
|
19694
|
+
}
|
|
19695
|
+
// Detect Adobe AIR.
|
|
19696
|
+
else if (getClassOf(data = context.runtime) == airRuntimeClass) {
|
|
19697
|
+
name = 'Adobe AIR';
|
|
19698
|
+
os = data.flash.system.Capabilities.os;
|
|
19699
|
+
}
|
|
19700
|
+
// Detect PhantomJS.
|
|
19701
|
+
else if (getClassOf(data = context.phantom) == phantomClass) {
|
|
19702
|
+
name = 'PhantomJS';
|
|
19703
|
+
version = (data = data.version || null) && data.major + '.' + data.minor + '.' + data.patch;
|
|
19704
|
+
}
|
|
19705
|
+
// Detect IE compatibility modes.
|
|
19706
|
+
else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
|
|
19707
|
+
// We're in compatibility mode when the Trident version + 4 doesn't
|
|
19708
|
+
// equal the document mode.
|
|
19709
|
+
version = [version, doc.documentMode];
|
|
19710
|
+
if ((data = +data[1] + 4) != version[1]) {
|
|
19711
|
+
description.push('IE ' + version[1] + ' mode');
|
|
19712
|
+
layout && (layout[1] = '');
|
|
19713
|
+
version[1] = data;
|
|
19714
|
+
}
|
|
19715
|
+
version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
|
|
19716
|
+
}
|
|
19717
|
+
// Detect IE 11 masking as other browsers.
|
|
19718
|
+
else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
|
|
19719
|
+
description.push('masking as ' + name + ' ' + version);
|
|
19720
|
+
name = 'IE';
|
|
19721
|
+
version = '11.0';
|
|
19722
|
+
layout = ['Trident'];
|
|
19723
|
+
os = 'Windows';
|
|
19724
|
+
}
|
|
19725
|
+
os = os && format(os);
|
|
19726
|
+
}
|
|
19727
|
+
// Detect prerelease phases.
|
|
19728
|
+
if (version && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && 'a')) {
|
|
19729
|
+
prerelease = /b/i.test(data) ? 'beta' : 'alpha';
|
|
19730
|
+
version = version.replace(RegExp(data + '\\+?$'), '') + (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
|
|
19731
|
+
}
|
|
19732
|
+
// Detect Firefox Mobile.
|
|
19733
|
+
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
|
|
19734
|
+
name = 'Firefox Mobile';
|
|
19735
|
+
}
|
|
19736
|
+
// Obscure Maxthon's unreliable version.
|
|
19737
|
+
else if (name == 'Maxthon' && version) {
|
|
19738
|
+
version = version.replace(/\.[\d.]+/, '.x');
|
|
19739
|
+
}
|
|
19740
|
+
// Detect Xbox 360 and Xbox One.
|
|
19741
|
+
else if (/\bXbox\b/i.test(product)) {
|
|
19742
|
+
if (product == 'Xbox 360') {
|
|
19743
|
+
os = null;
|
|
19744
|
+
}
|
|
19745
|
+
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
|
|
19746
|
+
description.unshift('mobile mode');
|
|
19747
|
+
}
|
|
19748
|
+
}
|
|
19749
|
+
// Add mobile postfix.
|
|
19750
|
+
else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == 'Windows CE' || /Mobi/i.test(ua))) {
|
|
19751
|
+
name += ' Mobile';
|
|
19752
|
+
}
|
|
19753
|
+
// Detect IE platform preview.
|
|
19754
|
+
else if (name == 'IE' && useFeatures) {
|
|
19755
|
+
try {
|
|
19756
|
+
if (context.external === null) {
|
|
19757
|
+
description.unshift('platform preview');
|
|
19758
|
+
}
|
|
19759
|
+
} catch (e) {
|
|
19760
|
+
description.unshift('embedded');
|
|
19761
|
+
}
|
|
19762
|
+
}
|
|
19763
|
+
// Detect BlackBerry OS version.
|
|
19764
|
+
// http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
|
|
19765
|
+
else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || version)) {
|
|
19766
|
+
data = [data, /BB10/.test(ua)];
|
|
19767
|
+
os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
|
|
19768
|
+
version = null;
|
|
19769
|
+
}
|
|
19770
|
+
// Detect Opera identifying/masking itself as another browser.
|
|
19771
|
+
// http://www.opera.com/support/kb/view/843/
|
|
19772
|
+
else if (this != forOwn && product != 'Wii' && (useFeatures && opera || /Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua) || name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os) || name == 'IE' && (os && !/^Win/.test(os) && version > 5.5 || /\bWindows XP\b/.test(os) && version > 8 || version == 8 && !/\bTrident\b/.test(ua))) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, '') + ';')) && data.name) {
|
|
19773
|
+
// When "identifying", the UA contains both Opera and the other browser's name.
|
|
19774
|
+
data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
|
|
19775
|
+
if (reOpera.test(name)) {
|
|
19776
|
+
if (/\bIE\b/.test(data) && os == 'Mac OS') {
|
|
19777
|
+
os = null;
|
|
19778
|
+
}
|
|
19779
|
+
data = 'identify' + data;
|
|
19780
|
+
}
|
|
19781
|
+
// When "masking", the UA contains only the other browser's name.
|
|
19782
|
+
else {
|
|
19783
|
+
data = 'mask' + data;
|
|
19784
|
+
if (operaClass) {
|
|
19785
|
+
name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
|
|
19786
|
+
} else {
|
|
19787
|
+
name = 'Opera';
|
|
19788
|
+
}
|
|
19789
|
+
if (/\bIE\b/.test(data)) {
|
|
19790
|
+
os = null;
|
|
19791
|
+
}
|
|
19792
|
+
if (!useFeatures) {
|
|
19793
|
+
version = null;
|
|
19794
|
+
}
|
|
19795
|
+
}
|
|
19796
|
+
layout = ['Presto'];
|
|
19797
|
+
description.push(data);
|
|
19798
|
+
}
|
|
19799
|
+
// Detect WebKit Nightly and approximate Chrome/Safari versions.
|
|
19800
|
+
if (data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1]) {
|
|
19801
|
+
// Correct build number for numeric comparison.
|
|
19802
|
+
// (e.g. "532.5" becomes "532.05")
|
|
19803
|
+
data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
|
|
19804
|
+
// Nightly builds are postfixed with a "+".
|
|
19805
|
+
if (name == 'Safari' && data[1].slice(-1) == '+') {
|
|
19806
|
+
name = 'WebKit Nightly';
|
|
19807
|
+
prerelease = 'alpha';
|
|
19808
|
+
version = data[1].slice(0, -1);
|
|
19809
|
+
}
|
|
19810
|
+
// Clear incorrect browser versions.
|
|
19811
|
+
else if (version == data[1] || version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
19812
|
+
version = null;
|
|
19813
|
+
}
|
|
19814
|
+
// Use the full Chrome version when available.
|
|
19815
|
+
data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
|
|
19816
|
+
// Detect Blink layout engine.
|
|
19817
|
+
if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
|
|
19818
|
+
layout = ['Blink'];
|
|
19819
|
+
}
|
|
19820
|
+
// Detect JavaScriptCore.
|
|
19821
|
+
// http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
|
|
19822
|
+
if (!useFeatures || !likeChrome && !data[1]) {
|
|
19823
|
+
layout && (layout[1] = 'like Safari');
|
|
19824
|
+
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');
|
|
19825
|
+
} else {
|
|
19826
|
+
layout && (layout[1] = 'like Chrome');
|
|
19827
|
+
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');
|
|
19828
|
+
}
|
|
19829
|
+
// Add the postfix of ".x" or "+" for approximate versions.
|
|
19830
|
+
layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
|
|
19831
|
+
// Obscure version for some Safari 1-2 releases.
|
|
19832
|
+
if (name == 'Safari' && (!version || parseInt(version) > 45)) {
|
|
19833
|
+
version = data;
|
|
19834
|
+
} else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
|
|
19835
|
+
description.unshift('headless');
|
|
19836
|
+
}
|
|
19837
|
+
}
|
|
19838
|
+
// Detect Opera desktop modes.
|
|
19839
|
+
if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
|
|
19840
|
+
name += ' ';
|
|
19841
|
+
description.unshift('desktop mode');
|
|
19842
|
+
if (data == 'zvav') {
|
|
19843
|
+
name += 'Mini';
|
|
19844
|
+
version = null;
|
|
19845
|
+
} else {
|
|
19846
|
+
name += 'Mobile';
|
|
19847
|
+
}
|
|
19848
|
+
os = os.replace(RegExp(' *' + data + '$'), '');
|
|
19849
|
+
}
|
|
19850
|
+
// Detect Chrome desktop mode.
|
|
19851
|
+
else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
|
|
19852
|
+
description.unshift('desktop mode');
|
|
19853
|
+
name = 'Chrome Mobile';
|
|
19854
|
+
version = null;
|
|
19855
|
+
if (/\bOS X\b/.test(os)) {
|
|
19856
|
+
manufacturer = 'Apple';
|
|
19857
|
+
os = 'iOS 4.3+';
|
|
19858
|
+
} else {
|
|
19859
|
+
os = null;
|
|
19860
|
+
}
|
|
19861
|
+
}
|
|
19862
|
+
// Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
|
|
19863
|
+
else if (/\bSRWare Iron\b/.test(name) && !version) {
|
|
19864
|
+
version = getVersion('Chrome');
|
|
19865
|
+
}
|
|
19866
|
+
// Strip incorrect OS versions.
|
|
19867
|
+
if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && ua.indexOf('/' + data + '-') > -1) {
|
|
19868
|
+
os = trim(os.replace(data, ''));
|
|
19869
|
+
}
|
|
19870
|
+
// Ensure OS does not include the browser name.
|
|
19871
|
+
if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
|
|
19872
|
+
os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
|
|
19873
|
+
}
|
|
19874
|
+
// Add layout engine.
|
|
19875
|
+
if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (/Browser|Lunascape|Maxthon/.test(name) || name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
|
|
19876
|
+
// Don't add layout details to description if they are falsey.
|
|
19877
|
+
(data = layout[layout.length - 1]) && description.push(data);
|
|
19878
|
+
}
|
|
19879
|
+
// Combine contextual information.
|
|
19880
|
+
if (description.length) {
|
|
19881
|
+
description = ['(' + description.join('; ') + ')'];
|
|
19882
|
+
}
|
|
19883
|
+
// Append manufacturer to description.
|
|
19884
|
+
if (manufacturer && product && product.indexOf(manufacturer) < 0) {
|
|
19885
|
+
description.push('on ' + manufacturer);
|
|
19886
|
+
}
|
|
19887
|
+
// Append product to description.
|
|
19888
|
+
if (product) {
|
|
19889
|
+
description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
|
|
19890
|
+
}
|
|
19891
|
+
// Parse the OS into an object.
|
|
19892
|
+
if (os) {
|
|
19893
|
+
data = / ([\d.+]+)$/.exec(os);
|
|
19894
|
+
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
|
|
19895
|
+
os = {
|
|
19896
|
+
'architecture': 32,
|
|
19897
|
+
'family': data && !isSpecialCasedOS ? os.replace(data[0], '') : os,
|
|
19898
|
+
'version': data ? data[1] : null,
|
|
19899
|
+
'toString': function toString() {
|
|
19900
|
+
var version = this.version;
|
|
19901
|
+
return this.family + (version && !isSpecialCasedOS ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
|
19902
|
+
}
|
|
19903
|
+
};
|
|
19904
|
+
}
|
|
19905
|
+
// Add browser/OS architecture.
|
|
19906
|
+
if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
|
|
19907
|
+
if (os) {
|
|
19908
|
+
os.architecture = 64;
|
|
19909
|
+
os.family = os.family.replace(RegExp(' *' + data), '');
|
|
19910
|
+
}
|
|
19911
|
+
if (name && (/\bWOW64\b/i.test(ua) || useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) {
|
|
19912
|
+
description.unshift('32-bit');
|
|
19913
|
+
}
|
|
19914
|
+
}
|
|
19915
|
+
// Chrome 39 and above on OS X is always 64-bit.
|
|
19916
|
+
else if (os && /^OS X/.test(os.family) && name == 'Chrome' && parseFloat(version) >= 39) {
|
|
19917
|
+
os.architecture = 64;
|
|
19918
|
+
}
|
|
19919
|
+
ua || (ua = null);
|
|
18373
19920
|
|
|
18374
|
-
|
|
18375
|
-
return tagFilter(ev, ['INPUT', 'TEXTAREA', 'SELECT']);
|
|
18376
|
-
};
|
|
19921
|
+
/*------------------------------------------------------------------------*/
|
|
18377
19922
|
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
|
|
19923
|
+
/**
|
|
19924
|
+
* The platform object.
|
|
19925
|
+
*
|
|
19926
|
+
* @name platform
|
|
19927
|
+
* @type Object
|
|
19928
|
+
*/
|
|
19929
|
+
var platform = {};
|
|
19930
|
+
|
|
19931
|
+
/**
|
|
19932
|
+
* The platform description.
|
|
19933
|
+
*
|
|
19934
|
+
* @memberOf platform
|
|
19935
|
+
* @type string|null
|
|
19936
|
+
*/
|
|
19937
|
+
platform.description = ua;
|
|
18383
19938
|
|
|
18384
|
-
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
19939
|
+
/**
|
|
19940
|
+
* The name of the browser's layout engine.
|
|
19941
|
+
*
|
|
19942
|
+
* The list of common layout engines include:
|
|
19943
|
+
* "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
|
|
19944
|
+
*
|
|
19945
|
+
* @memberOf platform
|
|
19946
|
+
* @type string|null
|
|
19947
|
+
*/
|
|
19948
|
+
platform.layout = layout && layout[0];
|
|
19949
|
+
|
|
19950
|
+
/**
|
|
19951
|
+
* The name of the product's manufacturer.
|
|
19952
|
+
*
|
|
19953
|
+
* The list of manufacturers include:
|
|
19954
|
+
* "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
|
|
19955
|
+
* "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
|
|
19956
|
+
* "Nokia", "Samsung" and "Sony"
|
|
19957
|
+
*
|
|
19958
|
+
* @memberOf platform
|
|
19959
|
+
* @type string|null
|
|
19960
|
+
*/
|
|
19961
|
+
platform.manufacturer = manufacturer;
|
|
18395
19962
|
|
|
18396
|
-
|
|
19963
|
+
/**
|
|
19964
|
+
* The name of the browser/environment.
|
|
19965
|
+
*
|
|
19966
|
+
* The list of common browser names include:
|
|
19967
|
+
* "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
|
|
19968
|
+
* "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
|
|
19969
|
+
* "Opera Mini" and "Opera"
|
|
19970
|
+
*
|
|
19971
|
+
* Mobile versions of some browsers have "Mobile" appended to their name:
|
|
19972
|
+
* eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
|
|
19973
|
+
*
|
|
19974
|
+
* @memberOf platform
|
|
19975
|
+
* @type string|null
|
|
19976
|
+
*/
|
|
19977
|
+
platform.name = name;
|
|
18397
19978
|
|
|
18398
|
-
|
|
18399
|
-
|
|
19979
|
+
/**
|
|
19980
|
+
* The alpha/beta release indicator.
|
|
19981
|
+
*
|
|
19982
|
+
* @memberOf platform
|
|
19983
|
+
* @type string|null
|
|
19984
|
+
*/
|
|
19985
|
+
platform.prerelease = prerelease;
|
|
18400
19986
|
|
|
18401
|
-
|
|
18402
|
-
|
|
18403
|
-
|
|
19987
|
+
/**
|
|
19988
|
+
* The name of the product hosting the browser.
|
|
19989
|
+
*
|
|
19990
|
+
* The list of common products include:
|
|
19991
|
+
*
|
|
19992
|
+
* "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
|
|
19993
|
+
* "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
|
|
19994
|
+
*
|
|
19995
|
+
* @memberOf platform
|
|
19996
|
+
* @type string|null
|
|
19997
|
+
*/
|
|
19998
|
+
platform.product = product;
|
|
18404
19999
|
|
|
20000
|
+
/**
|
|
20001
|
+
* The browser's user agent string.
|
|
20002
|
+
*
|
|
20003
|
+
* @memberOf platform
|
|
20004
|
+
* @type string|null
|
|
20005
|
+
*/
|
|
20006
|
+
platform.ua = ua;
|
|
18405
20007
|
|
|
18406
|
-
|
|
18407
|
-
|
|
18408
|
-
|
|
20008
|
+
/**
|
|
20009
|
+
* The browser/environment version.
|
|
20010
|
+
*
|
|
20011
|
+
* @memberOf platform
|
|
20012
|
+
* @type string|null
|
|
20013
|
+
*/
|
|
20014
|
+
platform.version = name && version;
|
|
18409
20015
|
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
20016
|
+
/**
|
|
20017
|
+
* The name of the operating system.
|
|
20018
|
+
*
|
|
20019
|
+
* @memberOf platform
|
|
20020
|
+
* @type Object
|
|
20021
|
+
*/
|
|
20022
|
+
platform.os = os || {
|
|
20023
|
+
/**
|
|
20024
|
+
* The CPU architecture the OS is built for.
|
|
20025
|
+
*
|
|
20026
|
+
* @memberOf platform.os
|
|
20027
|
+
* @type number|null
|
|
20028
|
+
*/
|
|
20029
|
+
'architecture': null,
|
|
20030
|
+
/**
|
|
20031
|
+
* The family of the OS.
|
|
20032
|
+
*
|
|
20033
|
+
* Common values include:
|
|
20034
|
+
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
|
|
20035
|
+
* "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
|
|
20036
|
+
* "SuSE", "Android", "iOS" and "Windows Phone"
|
|
20037
|
+
*
|
|
20038
|
+
* @memberOf platform.os
|
|
20039
|
+
* @type string|null
|
|
20040
|
+
*/
|
|
20041
|
+
'family': null,
|
|
20042
|
+
/**
|
|
20043
|
+
* The version of the OS.
|
|
20044
|
+
*
|
|
20045
|
+
* @memberOf platform.os
|
|
20046
|
+
* @type string|null
|
|
20047
|
+
*/
|
|
20048
|
+
'version': null,
|
|
20049
|
+
/**
|
|
20050
|
+
* Returns the OS string.
|
|
20051
|
+
*
|
|
20052
|
+
* @memberOf platform.os
|
|
20053
|
+
* @returns {string} The OS string.
|
|
20054
|
+
*/
|
|
20055
|
+
'toString': function toString() {
|
|
20056
|
+
return 'null';
|
|
20057
|
+
}
|
|
20058
|
+
};
|
|
20059
|
+
platform.parse = parse;
|
|
20060
|
+
platform.toString = toStringPlatform;
|
|
20061
|
+
if (platform.version) {
|
|
20062
|
+
description.unshift(version);
|
|
20063
|
+
}
|
|
20064
|
+
if (platform.name) {
|
|
20065
|
+
description.unshift(name);
|
|
20066
|
+
}
|
|
20067
|
+
if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
|
|
20068
|
+
description.push(product ? '(' + os + ')' : 'on ' + os);
|
|
20069
|
+
}
|
|
20070
|
+
if (description.length) {
|
|
20071
|
+
platform.description = description.join(' ');
|
|
20072
|
+
}
|
|
20073
|
+
return platform;
|
|
18413
20074
|
}
|
|
18414
20075
|
|
|
18415
|
-
|
|
18416
|
-
}, deps ? [ref, enableOnTags, filter].concat(deps) : [ref, enableOnTags, filter]);
|
|
18417
|
-
React$3.useEffect(function () {
|
|
18418
|
-
if (!enabled) {
|
|
18419
|
-
return;
|
|
18420
|
-
} // In this case keydown is likely undefined, so we set it to false, since hotkeys needs the `keydown` key to have a value.
|
|
20076
|
+
/*--------------------------------------------------------------------------*/
|
|
18421
20077
|
|
|
20078
|
+
// Export platform.
|
|
20079
|
+
var platform = parse();
|
|
18422
20080
|
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
|
|
20081
|
+
// Some AMD build optimizers, like r.js, check for condition patterns like the following:
|
|
20082
|
+
if (freeExports && freeModule) {
|
|
20083
|
+
// Export for CommonJS support.
|
|
20084
|
+
forOwn(platform, function (value, key) {
|
|
20085
|
+
freeExports[key] = value;
|
|
20086
|
+
});
|
|
20087
|
+
} else {
|
|
20088
|
+
// Export to the global object.
|
|
20089
|
+
root.platform = platform;
|
|
20090
|
+
}
|
|
20091
|
+
}).call(commonjsGlobal);
|
|
20092
|
+
})(platform$1, platform$1.exports);
|
|
20093
|
+
var platformExports = platform$1.exports;
|
|
20094
|
+
var platform = /*@__PURE__*/getDefaultExportFromCjs(platformExports);
|
|
20095
|
+
|
|
20096
|
+
var isMultipleHotkey = Array.isArray;
|
|
20097
|
+
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
20098
|
+
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
20099
|
+
return item.replaceAll(keyName, replaceWith);
|
|
20100
|
+
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
20101
|
+
};
|
|
20102
|
+
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
20103
|
+
ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
20104
|
+
var _ref2 = _slicedToArray$2(_ref, 2),
|
|
20105
|
+
macKey = _ref2[0],
|
|
20106
|
+
windowsKey = _ref2[1];
|
|
20107
|
+
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
20108
|
+
});
|
|
20109
|
+
return hotkey;
|
|
20110
|
+
};
|
|
20111
|
+
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
20112
|
+
var _platformInfo$os;
|
|
20113
|
+
var platformInfo = platform.parse(navigator.userAgent);
|
|
20114
|
+
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 || (_platformInfo$os = _platformInfo$os.family) === null || _platformInfo$os === void 0 ? void 0 : _platformInfo$os.includes(OS.mac);
|
|
20115
|
+
if (isOSX) return replaceKeys(hotkey, KEY_NAMES["delete"], KEY_NAMES.backspace);
|
|
20116
|
+
return convertHotKeyToWindows(hotkey);
|
|
20117
|
+
};
|
|
20118
|
+
var bindHotKey = function bindHotKey(_ref3) {
|
|
20119
|
+
var mode = _ref3.mode,
|
|
20120
|
+
hotkey = _ref3.hotkey,
|
|
20121
|
+
handler = _ref3.handler,
|
|
20122
|
+
ref = _ref3.ref;
|
|
20123
|
+
var mousetrapInstance;
|
|
20124
|
+
switch (mode) {
|
|
20125
|
+
case MODES.global:
|
|
20126
|
+
Mousetrap$1.bindGlobal(hotkey, handler);
|
|
20127
|
+
break;
|
|
20128
|
+
case MODES.scoped:
|
|
20129
|
+
mousetrapInstance = Mousetrap$1(ref.current).bind(hotkey, handler);
|
|
20130
|
+
break;
|
|
20131
|
+
default:
|
|
20132
|
+
mousetrapInstance = Mousetrap$1.bind(hotkey, handler);
|
|
20133
|
+
}
|
|
20134
|
+
return mousetrapInstance;
|
|
20135
|
+
};
|
|
20136
|
+
var unBindHotKey = function unBindHotKey(_ref4) {
|
|
20137
|
+
var mousetrapInstance = _ref4.mousetrapInstance,
|
|
20138
|
+
mode = _ref4.mode,
|
|
20139
|
+
hotkey = _ref4.hotkey;
|
|
20140
|
+
return mode === MODES.global ? Mousetrap$1.unbindGlobal(hotkey) : mousetrapInstance === null || mousetrapInstance === void 0 ? void 0 : mousetrapInstance.unbind(hotkey);
|
|
20141
|
+
};
|
|
18426
20142
|
|
|
18427
|
-
|
|
20143
|
+
var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
|
|
20144
|
+
var ref = React$3.useRef(null);
|
|
20145
|
+
var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
|
|
20146
|
+
var config = ramda.mergeLeft(userConfig, DEFAULT_CONFIG);
|
|
20147
|
+
if (!handler) {
|
|
20148
|
+
throw new Error("You must provide a handler function to useHotKeys");
|
|
20149
|
+
}
|
|
20150
|
+
React$3.useEffect(function () {
|
|
20151
|
+
if (!config.enabled) return undefined;
|
|
20152
|
+
var mousetrapInstance = bindHotKey({
|
|
20153
|
+
mode: config.mode,
|
|
20154
|
+
hotkey: convertedHotkey,
|
|
20155
|
+
handler: handler,
|
|
20156
|
+
ref: ref
|
|
20157
|
+
});
|
|
18428
20158
|
return function () {
|
|
18429
|
-
|
|
20159
|
+
unBindHotKey({
|
|
20160
|
+
mousetrapInstance: mousetrapInstance,
|
|
20161
|
+
mode: config.mode,
|
|
20162
|
+
hotkey: convertedHotkey
|
|
20163
|
+
});
|
|
18430
20164
|
};
|
|
18431
|
-
}, [
|
|
18432
|
-
return ref;
|
|
18433
|
-
}
|
|
20165
|
+
}, [handler, config.mode, convertedHotkey, config]);
|
|
20166
|
+
return config.mode === MODES.scoped ? ref : null;
|
|
20167
|
+
};
|
|
18434
20168
|
|
|
18435
20169
|
var OverlayManager = /*#__PURE__*/function () {
|
|
18436
20170
|
function OverlayManager() {
|
|
@@ -18533,14 +20267,13 @@ var useOverlay = function useOverlay(_ref) {
|
|
|
18533
20267
|
}
|
|
18534
20268
|
};
|
|
18535
20269
|
var focusRequiredElementInOverlay = function focusRequiredElementInOverlay() {
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
}
|
|
20270
|
+
var _initialFocusRef;
|
|
20271
|
+
if (!hasTransitionCompleted) return;
|
|
20272
|
+
if ((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current) {
|
|
20273
|
+
var _initialFocusRef2;
|
|
20274
|
+
(_initialFocusRef2 = initialFocusRef) === null || _initialFocusRef2 === void 0 || (_initialFocusRef2 = _initialFocusRef2.current) === null || _initialFocusRef2 === void 0 || _initialFocusRef2.focus();
|
|
20275
|
+
} else {
|
|
20276
|
+
focusFirstFocusableElement(overlayWrapper);
|
|
18544
20277
|
}
|
|
18545
20278
|
};
|
|
18546
20279
|
var handleOverlayClose = React$3.useCallback(function () {
|
|
@@ -18552,9 +20285,9 @@ var useOverlay = function useOverlay(_ref) {
|
|
|
18552
20285
|
var isTopOverlay = React$3.useSyncExternalStore(manager.subscribe, function () {
|
|
18553
20286
|
return manager.isTopOverlay(overlayWrapper);
|
|
18554
20287
|
});
|
|
18555
|
-
|
|
18556
|
-
closeOnEsc
|
|
18557
|
-
}
|
|
20288
|
+
useHotKeys("escape", handleOverlayClose, {
|
|
20289
|
+
enabled: closeOnEsc
|
|
20290
|
+
});
|
|
18558
20291
|
React$3.useEffect(function () {
|
|
18559
20292
|
var cleanUp = noop$3;
|
|
18560
20293
|
if (isOpen) {
|
|
@@ -18838,7 +20571,7 @@ var Modal = function Modal(_ref) {
|
|
|
18838
20571
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
18839
20572
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$z);
|
|
18840
20573
|
var _useState = React$3.useState(false),
|
|
18841
|
-
_useState2 = _slicedToArray$
|
|
20574
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
18842
20575
|
hasTransitionCompleted = _useState2[0],
|
|
18843
20576
|
setHasTransitionCompleted = _useState2[1];
|
|
18844
20577
|
var modalWrapper = React$3.useRef(null);
|
|
@@ -18994,10 +20727,10 @@ var Alert = function Alert(_ref) {
|
|
|
18994
20727
|
var build = {exports: {}};
|
|
18995
20728
|
|
|
18996
20729
|
(function (module, exports) {
|
|
18997
|
-
!function(e,t){module.exports=t(React__default["default"]);}(commonjsGlobal,(function(e){return function(e){var t={};function r(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,l){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l});},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(l,i,function(t){return e[t]}.bind(null,i));return l},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e;},function(e,t,r){e.exports=r(2);},function(e,t,r){function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l);}return r}function a(e,t){if(null==e)return {};var r,l,i=function(e,t){if(null==e)return {};var r,l,i={},a=Object.keys(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);}return i}r.r(t);var n=r(0),c=r.n(n),h=function(e){for(var t=0,r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t;}return Math.abs(t)},o=function(e,t){return Math.floor(e/Math.pow(10,t)%10)},s=function(e,t){return !(o(e,t)%2)},m=function(e,t,r){var l=e%t;return r&&o(e,r)%2===0?-l:l},f=function(e,t,r){return t[e%r]};var u=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),40-(i+17),1),translateY:m(r*(i+1),40-(i+17),2),rotate:m(r*(i+1),360),isSquare:s(r,2)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__bauhaus",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__bauhaus)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("rect",{x:10,y:30,width:80,height:t[1].isSquare?80:10,fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40)"}),n.createElement("circle",{cx:40,cy:40,fill:t[2].color,r:16,transform:"translate("+t[2].translateX+" "+t[2].translateY+")"}),n.createElement("line",{x1:0,y1:40,x2:80,y2:40,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+" 40 40)"})))};var d=function(e){var t=function(e,t){var r=h(t),l=e&&e.length,i=Array.from({length:5},(function(t,i){return f(r+i,e,l)})),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}(e.colors,e.name);return c.a.createElement("svg",{viewBox:"0 0 90 90",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&c.a.createElement("title",null,e.name),c.a.createElement("mask",{id:"mask__ring",maskUnits:"userSpaceOnUse",x:0,y:0,width:90,height:90},c.a.createElement("rect",{width:90,height:90,rx:e.square?void 0:180,fill:"#FFFFFF"})),c.a.createElement("g",{mask:"url(#mask__ring)"},c.a.createElement("path",{d:"M0 0h90v45H0z",fill:t[0]}),c.a.createElement("path",{d:"M0 45h90v45H0z",fill:t[1]}),c.a.createElement("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:t[2]}),c.a.createElement("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:t[3]}),c.a.createElement("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:t[4]}),c.a.createElement("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:t[5]}),c.a.createElement("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:t[6]}),c.a.createElement("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:t[7]}),c.a.createElement("circle",{cx:45,cy:45,r:23,fill:t[8]})))};var g=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:64},(function(e,i){return f(r%i,t,l)}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__pixel","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__pixel)"},n.createElement("rect",{width:10,height:10,fill:t[0]}),n.createElement("rect",{x:20,width:10,height:10,fill:t[1]}),n.createElement("rect",{x:40,width:10,height:10,fill:t[2]}),n.createElement("rect",{x:60,width:10,height:10,fill:t[3]}),n.createElement("rect",{x:10,width:10,height:10,fill:t[4]}),n.createElement("rect",{x:30,width:10,height:10,fill:t[5]}),n.createElement("rect",{x:50,width:10,height:10,fill:t[6]}),n.createElement("rect",{x:70,width:10,height:10,fill:t[7]}),n.createElement("rect",{y:10,width:10,height:10,fill:t[8]}),n.createElement("rect",{y:20,width:10,height:10,fill:t[9]}),n.createElement("rect",{y:30,width:10,height:10,fill:t[10]}),n.createElement("rect",{y:40,width:10,height:10,fill:t[11]}),n.createElement("rect",{y:50,width:10,height:10,fill:t[12]}),n.createElement("rect",{y:60,width:10,height:10,fill:t[13]}),n.createElement("rect",{y:70,width:10,height:10,fill:t[14]}),n.createElement("rect",{x:20,y:10,width:10,height:10,fill:t[15]}),n.createElement("rect",{x:20,y:20,width:10,height:10,fill:t[16]}),n.createElement("rect",{x:20,y:30,width:10,height:10,fill:t[17]}),n.createElement("rect",{x:20,y:40,width:10,height:10,fill:t[18]}),n.createElement("rect",{x:20,y:50,width:10,height:10,fill:t[19]}),n.createElement("rect",{x:20,y:60,width:10,height:10,fill:t[20]}),n.createElement("rect",{x:20,y:70,width:10,height:10,fill:t[21]}),n.createElement("rect",{x:40,y:10,width:10,height:10,fill:t[22]}),n.createElement("rect",{x:40,y:20,width:10,height:10,fill:t[23]}),n.createElement("rect",{x:40,y:30,width:10,height:10,fill:t[24]}),n.createElement("rect",{x:40,y:40,width:10,height:10,fill:t[25]}),n.createElement("rect",{x:40,y:50,width:10,height:10,fill:t[26]}),n.createElement("rect",{x:40,y:60,width:10,height:10,fill:t[27]}),n.createElement("rect",{x:40,y:70,width:10,height:10,fill:t[28]}),n.createElement("rect",{x:60,y:10,width:10,height:10,fill:t[29]}),n.createElement("rect",{x:60,y:20,width:10,height:10,fill:t[30]}),n.createElement("rect",{x:60,y:30,width:10,height:10,fill:t[31]}),n.createElement("rect",{x:60,y:40,width:10,height:10,fill:t[32]}),n.createElement("rect",{x:60,y:50,width:10,height:10,fill:t[33]}),n.createElement("rect",{x:60,y:60,width:10,height:10,fill:t[34]}),n.createElement("rect",{x:60,y:70,width:10,height:10,fill:t[35]}),n.createElement("rect",{x:10,y:10,width:10,height:10,fill:t[36]}),n.createElement("rect",{x:10,y:20,width:10,height:10,fill:t[37]}),n.createElement("rect",{x:10,y:30,width:10,height:10,fill:t[38]}),n.createElement("rect",{x:10,y:40,width:10,height:10,fill:t[39]}),n.createElement("rect",{x:10,y:50,width:10,height:10,fill:t[40]}),n.createElement("rect",{x:10,y:60,width:10,height:10,fill:t[41]}),n.createElement("rect",{x:10,y:70,width:10,height:10,fill:t[42]}),n.createElement("rect",{x:30,y:10,width:10,height:10,fill:t[43]}),n.createElement("rect",{x:30,y:20,width:10,height:10,fill:t[44]}),n.createElement("rect",{x:30,y:30,width:10,height:10,fill:t[45]}),n.createElement("rect",{x:30,y:40,width:10,height:10,fill:t[46]}),n.createElement("rect",{x:30,y:50,width:10,height:10,fill:t[47]}),n.createElement("rect",{x:30,y:60,width:10,height:10,fill:t[48]}),n.createElement("rect",{x:30,y:70,width:10,height:10,fill:t[49]}),n.createElement("rect",{x:50,y:10,width:10,height:10,fill:t[50]}),n.createElement("rect",{x:50,y:20,width:10,height:10,fill:t[51]}),n.createElement("rect",{x:50,y:30,width:10,height:10,fill:t[52]}),n.createElement("rect",{x:50,y:40,width:10,height:10,fill:t[53]}),n.createElement("rect",{x:50,y:50,width:10,height:10,fill:t[54]}),n.createElement("rect",{x:50,y:60,width:10,height:10,fill:t[55]}),n.createElement("rect",{x:50,y:70,width:10,height:10,fill:t[56]}),n.createElement("rect",{x:70,y:10,width:10,height:10,fill:t[57]}),n.createElement("rect",{x:70,y:20,width:10,height:10,fill:t[58]}),n.createElement("rect",{x:70,y:30,width:10,height:10,fill:t[59]}),n.createElement("rect",{x:70,y:40,width:10,height:10,fill:t[60]}),n.createElement("rect",{x:70,y:50,width:10,height:10,fill:t[61]}),n.createElement("rect",{x:70,y:60,width:10,height:10,fill:t[62]}),n.createElement("rect",{x:70,y:70,width:10,height:10,fill:t[63]})))};var w=function(e){var t=function(e,t){var r,l=h(e),i=t&&t.length,a=f(l,t,i),n=m(l,10,1),c=n<5?n+4:n,o=m(l,10,2),u=o<5?o+4:o;return {wrapperColor:a,faceColor:(r=a,"#"===r.slice(0,1)&&(r=r.slice(1)),(299*parseInt(r.substr(0,2),16)+587*parseInt(r.substr(2,2),16)+114*parseInt(r.substr(4,2),16))/1e3>=128?"#000000":"#FFFFFF"),backgroundColor:f(l+13,t,i),wrapperTranslateX:c,wrapperTranslateY:u,wrapperRotate:m(l,360),wrapperScale:1+m(l,3)/10,isMouthOpen:s(l,2),isCircle:s(l,1),eyeSpread:m(l,5),mouthSpread:m(l,3),faceRotate:m(l,10,3),faceTranslateX:c>6?c/2:m(l,8,1),faceTranslateY:u>6?u/2:m(l,7,2)}}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__beam",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("rect",{width:36,height:36,rx:e.square?void 0:72,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__beam)"},n.createElement("rect",{width:36,height:36,fill:t.backgroundColor}),n.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+" 18 18) scale("+t.wrapperScale+")",fill:t.wrapperColor,rx:t.isCircle?36:6}),n.createElement("g",{transform:"translate("+t.faceTranslateX+" "+t.faceTranslateY+") rotate("+t.faceRotate+" 18 18)"},t.isMouthOpen?n.createElement("path",{d:"M15 "+(19+t.mouthSpread)+"c2 1 4 1 6 0",stroke:t.faceColor,fill:"none",strokeLinecap:"round"}):n.createElement("path",{d:"M13,"+(19+t.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:t.faceColor}),n.createElement("rect",{x:14-t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}),n.createElement("rect",{x:20+t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}))))};var E=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return f(r+i,t,l)}))}(e.name,e.colors),r=e.name.replace(/\s/g,"");return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__sunset",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__sunset)"},n.createElement("path",{fill:"url(#gradient_paint0_linear_"+r+")",d:"M0 0h80v40H0z"}),n.createElement("path",{fill:"url(#gradient_paint1_linear_"+r+")",d:"M0 40h80v40H0z"})),n.createElement("defs",null,n.createElement("linearGradient",{id:"gradient_paint0_linear_"+r,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[0]}),n.createElement("stop",{offset:1,stopColor:t[1]})),n.createElement("linearGradient",{id:"gradient_paint1_linear_"+r,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[2]}),n.createElement("stop",{offset:1,stopColor:t[3]}))))};var p=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:3},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),8,1),translateY:m(r*(i+1),8,2),scale:1.2+m(r*(i+1),4)/10,rotate:m(r*(i+1),360,1)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__marble",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__marble)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40) scale("+t[2].scale+")"}),n.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:t[2].color,transform:"translate("+t[2].translateX+" "+t[2].translateY+") rotate("+t[2].rotate+" 40 40) scale("+t[2].scale+")"})),n.createElement("defs",null,n.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),n.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},y=["pixel","bauhaus","ring","beam","sunset","marble"],x={geometric:"beam",abstract:"bauhaus"},v=function(e){var t=e.variant,r=void 0===t?"marble":t,n=e.colors,h=void 0===n?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:n,o=e.name,s=void 0===o?"Clara Barton":o,m=e.square,f=void 0!==m&&m,v=e.title,b=void 0!==v&&v,_=e.size,F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){l(e,t,r[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t));}));}return e}({colors:h,name:s,title:b,size:void 0===_?40:_,square:f},a(e,["variant","colors","name","square","title","size"]));return {pixel:c.a.createElement(g,F),bauhaus:c.a.createElement(u,F),ring:c.a.createElement(d,F),beam:c.a.createElement(w,F),sunset:c.a.createElement(E,F),marble:c.a.createElement(p,F)}[Object.keys(x).includes(r)?x[r]:y.includes(r)?r:"marble"]};t.default=v;}])}));
|
|
20730
|
+
!function(e,t){module.exports=t(React__default["default"]);}(commonjsGlobal$1,(function(e){return function(e){var t={};function r(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,l){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l});},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(l,i,function(t){return e[t]}.bind(null,i));return l},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(t,r){t.exports=e;},function(e,t,r){e.exports=r(2);},function(e,t,r){function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l);}return r}function a(e,t){if(null==e)return {};var r,l,i=function(e,t){if(null==e)return {};var r,l,i={},a=Object.keys(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);}return i}r.r(t);var n=r(0),c=r.n(n),h=function(e){for(var t=0,r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t;}return Math.abs(t)},o=function(e,t){return Math.floor(e/Math.pow(10,t)%10)},s=function(e,t){return !(o(e,t)%2)},m=function(e,t,r){var l=e%t;return r&&o(e,r)%2===0?-l:l},f=function(e,t,r){return t[e%r]};var u=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),40-(i+17),1),translateY:m(r*(i+1),40-(i+17),2),rotate:m(r*(i+1),360),isSquare:s(r,2)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__bauhaus",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__bauhaus)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("rect",{x:10,y:30,width:80,height:t[1].isSquare?80:10,fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40)"}),n.createElement("circle",{cx:40,cy:40,fill:t[2].color,r:16,transform:"translate("+t[2].translateX+" "+t[2].translateY+")"}),n.createElement("line",{x1:0,y1:40,x2:80,y2:40,strokeWidth:2,stroke:t[3].color,transform:"translate("+t[3].translateX+" "+t[3].translateY+") rotate("+t[3].rotate+" 40 40)"})))};var d=function(e){var t=function(e,t){var r=h(t),l=e&&e.length,i=Array.from({length:5},(function(t,i){return f(r+i,e,l)})),a=[];return a[0]=i[0],a[1]=i[1],a[2]=i[1],a[3]=i[2],a[4]=i[2],a[5]=i[3],a[6]=i[3],a[7]=i[0],a[8]=i[4],a}(e.colors,e.name);return c.a.createElement("svg",{viewBox:"0 0 90 90",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&c.a.createElement("title",null,e.name),c.a.createElement("mask",{id:"mask__ring",maskUnits:"userSpaceOnUse",x:0,y:0,width:90,height:90},c.a.createElement("rect",{width:90,height:90,rx:e.square?void 0:180,fill:"#FFFFFF"})),c.a.createElement("g",{mask:"url(#mask__ring)"},c.a.createElement("path",{d:"M0 0h90v45H0z",fill:t[0]}),c.a.createElement("path",{d:"M0 45h90v45H0z",fill:t[1]}),c.a.createElement("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:t[2]}),c.a.createElement("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:t[3]}),c.a.createElement("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:t[4]}),c.a.createElement("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:t[5]}),c.a.createElement("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:t[6]}),c.a.createElement("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:t[7]}),c.a.createElement("circle",{cx:45,cy:45,r:23,fill:t[8]})))};var g=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:64},(function(e,i){return f(r%i,t,l)}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__pixel","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__pixel)"},n.createElement("rect",{width:10,height:10,fill:t[0]}),n.createElement("rect",{x:20,width:10,height:10,fill:t[1]}),n.createElement("rect",{x:40,width:10,height:10,fill:t[2]}),n.createElement("rect",{x:60,width:10,height:10,fill:t[3]}),n.createElement("rect",{x:10,width:10,height:10,fill:t[4]}),n.createElement("rect",{x:30,width:10,height:10,fill:t[5]}),n.createElement("rect",{x:50,width:10,height:10,fill:t[6]}),n.createElement("rect",{x:70,width:10,height:10,fill:t[7]}),n.createElement("rect",{y:10,width:10,height:10,fill:t[8]}),n.createElement("rect",{y:20,width:10,height:10,fill:t[9]}),n.createElement("rect",{y:30,width:10,height:10,fill:t[10]}),n.createElement("rect",{y:40,width:10,height:10,fill:t[11]}),n.createElement("rect",{y:50,width:10,height:10,fill:t[12]}),n.createElement("rect",{y:60,width:10,height:10,fill:t[13]}),n.createElement("rect",{y:70,width:10,height:10,fill:t[14]}),n.createElement("rect",{x:20,y:10,width:10,height:10,fill:t[15]}),n.createElement("rect",{x:20,y:20,width:10,height:10,fill:t[16]}),n.createElement("rect",{x:20,y:30,width:10,height:10,fill:t[17]}),n.createElement("rect",{x:20,y:40,width:10,height:10,fill:t[18]}),n.createElement("rect",{x:20,y:50,width:10,height:10,fill:t[19]}),n.createElement("rect",{x:20,y:60,width:10,height:10,fill:t[20]}),n.createElement("rect",{x:20,y:70,width:10,height:10,fill:t[21]}),n.createElement("rect",{x:40,y:10,width:10,height:10,fill:t[22]}),n.createElement("rect",{x:40,y:20,width:10,height:10,fill:t[23]}),n.createElement("rect",{x:40,y:30,width:10,height:10,fill:t[24]}),n.createElement("rect",{x:40,y:40,width:10,height:10,fill:t[25]}),n.createElement("rect",{x:40,y:50,width:10,height:10,fill:t[26]}),n.createElement("rect",{x:40,y:60,width:10,height:10,fill:t[27]}),n.createElement("rect",{x:40,y:70,width:10,height:10,fill:t[28]}),n.createElement("rect",{x:60,y:10,width:10,height:10,fill:t[29]}),n.createElement("rect",{x:60,y:20,width:10,height:10,fill:t[30]}),n.createElement("rect",{x:60,y:30,width:10,height:10,fill:t[31]}),n.createElement("rect",{x:60,y:40,width:10,height:10,fill:t[32]}),n.createElement("rect",{x:60,y:50,width:10,height:10,fill:t[33]}),n.createElement("rect",{x:60,y:60,width:10,height:10,fill:t[34]}),n.createElement("rect",{x:60,y:70,width:10,height:10,fill:t[35]}),n.createElement("rect",{x:10,y:10,width:10,height:10,fill:t[36]}),n.createElement("rect",{x:10,y:20,width:10,height:10,fill:t[37]}),n.createElement("rect",{x:10,y:30,width:10,height:10,fill:t[38]}),n.createElement("rect",{x:10,y:40,width:10,height:10,fill:t[39]}),n.createElement("rect",{x:10,y:50,width:10,height:10,fill:t[40]}),n.createElement("rect",{x:10,y:60,width:10,height:10,fill:t[41]}),n.createElement("rect",{x:10,y:70,width:10,height:10,fill:t[42]}),n.createElement("rect",{x:30,y:10,width:10,height:10,fill:t[43]}),n.createElement("rect",{x:30,y:20,width:10,height:10,fill:t[44]}),n.createElement("rect",{x:30,y:30,width:10,height:10,fill:t[45]}),n.createElement("rect",{x:30,y:40,width:10,height:10,fill:t[46]}),n.createElement("rect",{x:30,y:50,width:10,height:10,fill:t[47]}),n.createElement("rect",{x:30,y:60,width:10,height:10,fill:t[48]}),n.createElement("rect",{x:30,y:70,width:10,height:10,fill:t[49]}),n.createElement("rect",{x:50,y:10,width:10,height:10,fill:t[50]}),n.createElement("rect",{x:50,y:20,width:10,height:10,fill:t[51]}),n.createElement("rect",{x:50,y:30,width:10,height:10,fill:t[52]}),n.createElement("rect",{x:50,y:40,width:10,height:10,fill:t[53]}),n.createElement("rect",{x:50,y:50,width:10,height:10,fill:t[54]}),n.createElement("rect",{x:50,y:60,width:10,height:10,fill:t[55]}),n.createElement("rect",{x:50,y:70,width:10,height:10,fill:t[56]}),n.createElement("rect",{x:70,y:10,width:10,height:10,fill:t[57]}),n.createElement("rect",{x:70,y:20,width:10,height:10,fill:t[58]}),n.createElement("rect",{x:70,y:30,width:10,height:10,fill:t[59]}),n.createElement("rect",{x:70,y:40,width:10,height:10,fill:t[60]}),n.createElement("rect",{x:70,y:50,width:10,height:10,fill:t[61]}),n.createElement("rect",{x:70,y:60,width:10,height:10,fill:t[62]}),n.createElement("rect",{x:70,y:70,width:10,height:10,fill:t[63]})))};var w=function(e){var t=function(e,t){var r,l=h(e),i=t&&t.length,a=f(l,t,i),n=m(l,10,1),c=n<5?n+4:n,o=m(l,10,2),u=o<5?o+4:o;return {wrapperColor:a,faceColor:(r=a,"#"===r.slice(0,1)&&(r=r.slice(1)),(299*parseInt(r.substr(0,2),16)+587*parseInt(r.substr(2,2),16)+114*parseInt(r.substr(4,2),16))/1e3>=128?"#000000":"#FFFFFF"),backgroundColor:f(l+13,t,i),wrapperTranslateX:c,wrapperTranslateY:u,wrapperRotate:m(l,360),wrapperScale:1+m(l,3)/10,isMouthOpen:s(l,2),isCircle:s(l,1),eyeSpread:m(l,5),mouthSpread:m(l,3),faceRotate:m(l,10,3),faceTranslateX:c>6?c/2:m(l,8,1),faceTranslateY:u>6?u/2:m(l,7,2)}}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__beam",maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},n.createElement("rect",{width:36,height:36,rx:e.square?void 0:72,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__beam)"},n.createElement("rect",{width:36,height:36,fill:t.backgroundColor}),n.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+t.wrapperTranslateX+" "+t.wrapperTranslateY+") rotate("+t.wrapperRotate+" 18 18) scale("+t.wrapperScale+")",fill:t.wrapperColor,rx:t.isCircle?36:6}),n.createElement("g",{transform:"translate("+t.faceTranslateX+" "+t.faceTranslateY+") rotate("+t.faceRotate+" 18 18)"},t.isMouthOpen?n.createElement("path",{d:"M15 "+(19+t.mouthSpread)+"c2 1 4 1 6 0",stroke:t.faceColor,fill:"none",strokeLinecap:"round"}):n.createElement("path",{d:"M13,"+(19+t.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:t.faceColor}),n.createElement("rect",{x:14-t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}),n.createElement("rect",{x:20+t.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:t.faceColor}))))};var E=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:4},(function(e,i){return f(r+i,t,l)}))}(e.name,e.colors),r=e.name.replace(/\s/g,"");return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__sunset",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__sunset)"},n.createElement("path",{fill:"url(#gradient_paint0_linear_"+r+")",d:"M0 0h80v40H0z"}),n.createElement("path",{fill:"url(#gradient_paint1_linear_"+r+")",d:"M0 40h80v40H0z"})),n.createElement("defs",null,n.createElement("linearGradient",{id:"gradient_paint0_linear_"+r,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[0]}),n.createElement("stop",{offset:1,stopColor:t[1]})),n.createElement("linearGradient",{id:"gradient_paint1_linear_"+r,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:t[2]}),n.createElement("stop",{offset:1,stopColor:t[3]}))))};var p=function(e){var t=function(e,t){var r=h(e),l=t&&t.length;return Array.from({length:3},(function(e,i){return {color:f(r+i,t,l),translateX:m(r*(i+1),8,1),translateY:m(r*(i+1),8,2),scale:1.2+m(r*(i+1),4)/10,rotate:m(r*(i+1),360,1)}}))}(e.name,e.colors);return n.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size},e.title&&n.createElement("title",null,e.name),n.createElement("mask",{id:"mask__marble",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},n.createElement("rect",{width:80,height:80,rx:e.square?void 0:160,fill:"#FFFFFF"})),n.createElement("g",{mask:"url(#mask__marble)"},n.createElement("rect",{width:80,height:80,fill:t[0].color}),n.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:t[1].color,transform:"translate("+t[1].translateX+" "+t[1].translateY+") rotate("+t[1].rotate+" 40 40) scale("+t[2].scale+")"}),n.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:t[2].color,transform:"translate("+t[2].translateX+" "+t[2].translateY+") rotate("+t[2].rotate+" 40 40) scale("+t[2].scale+")"})),n.createElement("defs",null,n.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},n.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),n.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),n.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},y=["pixel","bauhaus","ring","beam","sunset","marble"],x={geometric:"beam",abstract:"bauhaus"},v=function(e){var t=e.variant,r=void 0===t?"marble":t,n=e.colors,h=void 0===n?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:n,o=e.name,s=void 0===o?"Clara Barton":o,m=e.square,f=void 0!==m&&m,v=e.title,b=void 0!==v&&v,_=e.size,F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){l(e,t,r[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t));}));}return e}({colors:h,name:s,title:b,size:void 0===_?40:_,square:f},a(e,["variant","colors","name","square","title","size"]));return {pixel:c.a.createElement(g,F),bauhaus:c.a.createElement(u,F),ring:c.a.createElement(d,F),beam:c.a.createElement(w,F),sunset:c.a.createElement(E,F),marble:c.a.createElement(p,F)}[Object.keys(x).includes(r)?x[r]:y.includes(r)?r:"marble"]};t.default=v;}])}));
|
|
18998
20731
|
} (build));
|
|
18999
20732
|
|
|
19000
|
-
var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs(build.exports);
|
|
20733
|
+
var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs$1(build.exports);
|
|
19001
20734
|
|
|
19002
20735
|
var COLOR_PALLETE = ["#ffb5a7", "#fcd5ce", "#f8edeb", "#f9dcc4", "#fec89a"];
|
|
19003
20736
|
var AVATAR_VARIANT = "beam";
|
|
@@ -19026,7 +20759,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
19026
20759
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
19027
20760
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
19028
20761
|
var _useState = React$3.useState(false),
|
|
19029
|
-
_useState2 = _slicedToArray$
|
|
20762
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
19030
20763
|
isLoadingFailed = _useState2[0],
|
|
19031
20764
|
setIsLoadingFailed = _useState2[1];
|
|
19032
20765
|
var _user$name = user.name,
|
|
@@ -20806,7 +22539,7 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
20806
22539
|
_ref$showPicker = _ref.showPicker,
|
|
20807
22540
|
showPicker = _ref$showPicker === void 0 ? true : _ref$showPicker;
|
|
20808
22541
|
var _useState = React$3.useState(color),
|
|
20809
|
-
_useState2 = _slicedToArray$
|
|
22542
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
20810
22543
|
colorInternal = _useState2[0],
|
|
20811
22544
|
setColorInternal = _useState2[1];
|
|
20812
22545
|
var isInputChanged = React$3.useRef(false);
|
|
@@ -21121,7 +22854,7 @@ DatePicker.displayName = "DatePicker";
|
|
|
21121
22854
|
var customParseFormat$1 = {exports: {}};
|
|
21122
22855
|
|
|
21123
22856
|
(function (module, exports) {
|
|
21124
|
-
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return (e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1);}],a:[i,function(e){this.afternoon=u(e,!0);}],S:[/\d/,function(e){this.milliseconds=100*+e;}],SS:[n,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
22857
|
+
!function(e,t){module.exports=t();}(commonjsGlobal$1,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return (e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1);}],a:[i,function(e){this.afternoon=u(e,!0);}],S:[/\d/,function(e){this.milliseconds=100*+e;}],SS:[n,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
21125
22858
|
} (customParseFormat$1));
|
|
21126
22859
|
|
|
21127
22860
|
var customParseFormat = customParseFormat$1.exports;
|
|
@@ -21152,15 +22885,15 @@ var DateTimePicker = function DateTimePicker(_ref) {
|
|
|
21152
22885
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
21153
22886
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$t);
|
|
21154
22887
|
var _React$useState = React__default["default"].useState(false),
|
|
21155
|
-
_React$useState2 = _slicedToArray$
|
|
22888
|
+
_React$useState2 = _slicedToArray$3(_React$useState, 2),
|
|
21156
22889
|
open = _React$useState2[0],
|
|
21157
22890
|
setOpen = _React$useState2[1];
|
|
21158
22891
|
var _useState = React$3.useState(),
|
|
21159
|
-
_useState2 = _slicedToArray$
|
|
22892
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
21160
22893
|
date = _useState2[0],
|
|
21161
22894
|
setDate = _useState2[1];
|
|
21162
22895
|
var _useState3 = React$3.useState(),
|
|
21163
|
-
_useState4 = _slicedToArray$
|
|
22896
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
21164
22897
|
time = _useState4[0],
|
|
21165
22898
|
setTime = _useState4[1];
|
|
21166
22899
|
var timeRef = React__default["default"].useRef(null);
|
|
@@ -21262,7 +22995,7 @@ var Input$3 = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
21262
22995
|
disableTrimOnBlur = _ref$disableTrimOnBlu === void 0 ? false : _ref$disableTrimOnBlu,
|
|
21263
22996
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$s);
|
|
21264
22997
|
var _useState = React$3.useState(otherProps.value),
|
|
21265
|
-
_useState2 = _slicedToArray$
|
|
22998
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
21266
22999
|
valueInternal = _useState2[0],
|
|
21267
23000
|
setValueInternal = _useState2[1];
|
|
21268
23001
|
var id = useId(otherProps.id);
|
|
@@ -21366,7 +23099,7 @@ var Kbd = function Kbd(_ref) {
|
|
|
21366
23099
|
};
|
|
21367
23100
|
|
|
21368
23101
|
function _arrayWithoutHoles$1(arr) {
|
|
21369
|
-
if (Array.isArray(arr)) return _arrayLikeToArray$
|
|
23102
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$3(arr);
|
|
21370
23103
|
}
|
|
21371
23104
|
|
|
21372
23105
|
function _iterableToArray$1(iter) {
|
|
@@ -21378,7 +23111,7 @@ function _nonIterableSpread$1() {
|
|
|
21378
23111
|
}
|
|
21379
23112
|
|
|
21380
23113
|
function _toConsumableArray$1(arr) {
|
|
21381
|
-
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$
|
|
23114
|
+
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread$1();
|
|
21382
23115
|
}
|
|
21383
23116
|
|
|
21384
23117
|
function _extends$2() {
|
|
@@ -28020,7 +29753,7 @@ var CreatableSelect = /*#__PURE__*/React$3.forwardRef(function (props, ref) {
|
|
|
28020
29753
|
});
|
|
28021
29754
|
|
|
28022
29755
|
function _toArray(arr) {
|
|
28023
|
-
return _arrayWithHoles$
|
|
29756
|
+
return _arrayWithHoles$3(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableRest$3();
|
|
28024
29757
|
}
|
|
28025
29758
|
|
|
28026
29759
|
var StateManagedSelect = /*#__PURE__*/React$3.forwardRef(function (props, ref) {
|
|
@@ -28262,11 +29995,11 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28262
29995
|
visibleEmailsCount = _ref$visibleEmailsCou === void 0 ? 3 : _ref$visibleEmailsCou,
|
|
28263
29996
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
28264
29997
|
var _useState = React$3.useState(""),
|
|
28265
|
-
_useState2 = _slicedToArray$
|
|
29998
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28266
29999
|
inputValue = _useState2[0],
|
|
28267
30000
|
setInputValue = _useState2[1];
|
|
28268
30001
|
var _useState3 = React$3.useState(false),
|
|
28269
|
-
_useState4 = _slicedToArray$
|
|
30002
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
28270
30003
|
isFocused = _useState4[0],
|
|
28271
30004
|
setIsFocused = _useState4[1];
|
|
28272
30005
|
var isCounterVisible = !!counter && (!counter.startsFrom || getValidEmailsCount(value) >= counter.startsFrom);
|
|
@@ -28337,10 +30070,9 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28337
30070
|
required: required,
|
|
28338
30071
|
className: "neeto-ui-email-input__label",
|
|
28339
30072
|
"data-cy": "".concat(hyphenize(label), "-input-label")
|
|
28340
|
-
}, labelProps), label), isCounterVisible && /*#__PURE__*/React__default["default"].createElement(
|
|
30073
|
+
}, labelProps), label), isCounterVisible && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
28341
30074
|
className: "neeto-ui-email-input__counter",
|
|
28342
|
-
"data-cy": "".concat(hyphenize(label), "-email-counter")
|
|
28343
|
-
style: "body2"
|
|
30075
|
+
"data-cy": "".concat(hyphenize(label), "-email-counter")
|
|
28344
30076
|
}, getValidEmailsCount(value), " ", counter.label ? counter.label : renderDefaultText(getValidEmailsCount(value)))), /*#__PURE__*/React__default["default"].createElement(CreatableSelect, _extends$4({
|
|
28345
30077
|
isMulti: true,
|
|
28346
30078
|
required: true,
|
|
@@ -28374,20 +30106,15 @@ var MultiEmailInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
28374
30106
|
visibleEmailsCount: visibleEmailsCount
|
|
28375
30107
|
}, !isOptionsPresent && {
|
|
28376
30108
|
menuIsOpen: false
|
|
28377
|
-
}), otherProps), overrideProps))), !!error && /*#__PURE__*/React__default["default"].createElement(
|
|
30109
|
+
}), otherProps), overrideProps))), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
28378
30110
|
className: "neeto-ui-input__error",
|
|
28379
|
-
"data-cy": "".concat(hyphenize(label), "-input-error")
|
|
28380
|
-
|
|
28381
|
-
|
|
28382
|
-
className: "cursor-pointer",
|
|
28383
|
-
component: "span",
|
|
28384
|
-
style: "body3",
|
|
28385
|
-
weight: "semibold",
|
|
30111
|
+
"data-cy": "".concat(hyphenize(label), "-input-error")
|
|
30112
|
+
}, error, isFilterEmailsLinkVisible && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
30113
|
+
className: "neeto-ui-font-semibold cursor-pointer",
|
|
28386
30114
|
onClick: handleFilterEmails
|
|
28387
|
-
}, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/React__default["default"].createElement(
|
|
30115
|
+
}, "\xA0", filterInvalidEmails.label ? filterInvalidEmails.label : "Click here to remove invalid emails.")), !!helpText && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
28388
30116
|
className: "neeto-ui-input__help-text",
|
|
28389
|
-
"data-cy": "".concat(hyphenize(label), "-input-help")
|
|
28390
|
-
style: "body3"
|
|
30117
|
+
"data-cy": "".concat(hyphenize(label), "-input-help")
|
|
28391
30118
|
}, helpText));
|
|
28392
30119
|
});
|
|
28393
30120
|
MultiEmailInput.displayName = "MultiEmailInput";
|
|
@@ -28443,7 +30170,7 @@ var NoData = function NoData(_ref) {
|
|
|
28443
30170
|
lineHeight: "normal",
|
|
28444
30171
|
style: "body2"
|
|
28445
30172
|
}, helpText), (hasPrimaryButtonProps || hasSecondaryButtonProps) && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
28446
|
-
className: "neeto-ui-no-data__action-block
|
|
30173
|
+
className: "neeto-ui-no-data__action-block"
|
|
28447
30174
|
}, hasPrimaryButtonProps && /*#__PURE__*/React__default["default"].createElement(Button, _extends$4({
|
|
28448
30175
|
"data-cy": "no-data-primary-button"
|
|
28449
30176
|
}, primaryButtonProps)), showButtonSeparator && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
@@ -28678,7 +30405,7 @@ var Pane = function Pane(_ref) {
|
|
|
28678
30405
|
finalFocusRef = _ref.finalFocusRef,
|
|
28679
30406
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$i);
|
|
28680
30407
|
var _useState = React$3.useState(false),
|
|
28681
|
-
_useState2 = _slicedToArray$
|
|
30408
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28682
30409
|
hasTransitionCompleted = _useState2[0],
|
|
28683
30410
|
setHasTransitionCompleted = _useState2[1];
|
|
28684
30411
|
var paneWrapper = React$3.useRef(null);
|
|
@@ -28821,7 +30548,7 @@ var Radio = function Radio(_ref) {
|
|
|
28821
30548
|
labelProps = _ref.labelProps,
|
|
28822
30549
|
props = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
28823
30550
|
var _useState = React$3.useState(""),
|
|
28824
|
-
_useState2 = _slicedToArray$
|
|
30551
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
28825
30552
|
internalValue = _useState2[0],
|
|
28826
30553
|
setInternalValue = _useState2[1];
|
|
28827
30554
|
var id = useId(props.id);
|
|
@@ -29351,16 +31078,14 @@ var Slider = function Slider(_ref) {
|
|
|
29351
31078
|
value: value
|
|
29352
31079
|
}, otherProps), {}, {
|
|
29353
31080
|
id: id
|
|
29354
|
-
}))), !!error && /*#__PURE__*/React__default["default"].createElement(
|
|
31081
|
+
}))), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
29355
31082
|
className: "neeto-ui-input__error",
|
|
29356
31083
|
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
29357
|
-
id: errorId
|
|
29358
|
-
|
|
29359
|
-
}, error), helpText && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
31084
|
+
id: errorId
|
|
31085
|
+
}, error), helpText && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
29360
31086
|
className: "neeto-ui-input__help-text",
|
|
29361
31087
|
"data-cy": "".concat(hyphenize(label), "-input-help"),
|
|
29362
|
-
id: helpTextId
|
|
29363
|
-
style: "body3"
|
|
31088
|
+
id: helpTextId
|
|
29364
31089
|
}, helpText)));
|
|
29365
31090
|
};
|
|
29366
31091
|
|
|
@@ -33876,22 +35601,22 @@ var Table = function Table(_ref) {
|
|
|
33876
35601
|
components = _ref$components === void 0 ? {} : _ref$components,
|
|
33877
35602
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
33878
35603
|
var _useState = React$3.useState(null),
|
|
33879
|
-
_useState2 = _slicedToArray$
|
|
35604
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
33880
35605
|
containerHeight = _useState2[0],
|
|
33881
35606
|
setContainerHeight = _useState2[1];
|
|
33882
35607
|
var _useState3 = React$3.useState(TABLE_DEFAULT_HEADER_HEIGHT),
|
|
33883
|
-
_useState4 = _slicedToArray$
|
|
35608
|
+
_useState4 = _slicedToArray$3(_useState3, 2),
|
|
33884
35609
|
headerHeight = _useState4[0],
|
|
33885
35610
|
setHeaderHeight = _useState4[1];
|
|
33886
35611
|
var _useState5 = React$3.useState(columnData),
|
|
33887
|
-
_useState6 = _slicedToArray$
|
|
35612
|
+
_useState6 = _slicedToArray$3(_useState5, 2),
|
|
33888
35613
|
columns = _useState6[0],
|
|
33889
35614
|
setColumns = _useState6[1];
|
|
33890
35615
|
var isDefaultPageChangeHandler = handlePageChange === noop$3;
|
|
33891
35616
|
var history = reactRouterDom.useHistory();
|
|
33892
35617
|
var headerRef = React$3.useRef();
|
|
33893
35618
|
var resizeObserver = React$3.useRef(new ResizeObserver(function (_ref2) {
|
|
33894
|
-
var _ref3 = _slicedToArray$
|
|
35619
|
+
var _ref3 = _slicedToArray$3(_ref2, 1),
|
|
33895
35620
|
entry = _ref3[0];
|
|
33896
35621
|
return setContainerHeight(entry.contentRect.height);
|
|
33897
35622
|
}));
|
|
@@ -34145,7 +35870,7 @@ var Textarea = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
34145
35870
|
labelProps = _ref.labelProps,
|
|
34146
35871
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
34147
35872
|
var _useState = React$3.useState(""),
|
|
34148
|
-
_useState2 = _slicedToArray$
|
|
35873
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
34149
35874
|
valueInternal = _useState2[0],
|
|
34150
35875
|
setValueInternal = _useState2[1];
|
|
34151
35876
|
var value = (_ref2 = (_otherProps$value = otherProps.value) !== null && _otherProps$value !== void 0 ? _otherProps$value : valueInternal) !== null && _ref2 !== void 0 ? _ref2 : "";
|
|
@@ -34676,7 +36401,7 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
|
34676
36401
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
34677
36402
|
|
|
34678
36403
|
/** Detect free variable `global` from Node.js. */
|
|
34679
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
36404
|
+
var freeGlobal = typeof commonjsGlobal$1 == 'object' && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
|
|
34680
36405
|
|
|
34681
36406
|
/** Detect free variable `self`. */
|
|
34682
36407
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
@@ -36927,7 +38652,7 @@ var HoverIcon = function HoverIcon(_ref) {
|
|
|
36927
38652
|
var _ref$time = _ref.time,
|
|
36928
38653
|
time = _ref$time === void 0 ? false : _ref$time;
|
|
36929
38654
|
var _useState = React$3.useState(false),
|
|
36930
|
-
_useState2 = _slicedToArray$
|
|
38655
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
36931
38656
|
hovered = _useState2[0],
|
|
36932
38657
|
setHovered = _useState2[1];
|
|
36933
38658
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -36971,7 +38696,7 @@ var TimePickerInput = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
36971
38696
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
36972
38697
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
36973
38698
|
var _useState = React$3.useState(value),
|
|
36974
|
-
_useState2 = _slicedToArray$
|
|
38699
|
+
_useState2 = _slicedToArray$3(_useState, 2),
|
|
36975
38700
|
time = _useState2[0],
|
|
36976
38701
|
setTime = _useState2[1];
|
|
36977
38702
|
var id = useId(otherProps.id);
|
|
@@ -38854,7 +40579,7 @@ var TOAST_ICON = {
|
|
|
38854
40579
|
};
|
|
38855
40580
|
var toastrList = new UniqueArray();
|
|
38856
40581
|
var parseToastrConfig = function parseToastrConfig(config) {
|
|
38857
|
-
if (_typeof$
|
|
40582
|
+
if (_typeof$7(config[0]) === "object") {
|
|
38858
40583
|
var _config$ = config[0],
|
|
38859
40584
|
_buttonLabel = _config$.buttonLabel,
|
|
38860
40585
|
_onClick = _config$.onClick,
|
|
@@ -38865,7 +40590,7 @@ var parseToastrConfig = function parseToastrConfig(config) {
|
|
|
38865
40590
|
customConfig: _customConfig
|
|
38866
40591
|
};
|
|
38867
40592
|
}
|
|
38868
|
-
var _config = _slicedToArray$
|
|
40593
|
+
var _config = _slicedToArray$3(config, 3),
|
|
38869
40594
|
buttonLabel = _config[0],
|
|
38870
40595
|
onClick = _config[1],
|
|
38871
40596
|
customConfig = _config[2];
|
|
@@ -38878,9 +40603,9 @@ var parseToastrConfig = function parseToastrConfig(config) {
|
|
|
38878
40603
|
var getToastrMessage = function getToastrMessage(message) {
|
|
38879
40604
|
if ((message === null || message === void 0 ? void 0 : message.noticeCode) === "custom_message" && "customMessage" in message) {
|
|
38880
40605
|
return message.customMessage;
|
|
38881
|
-
} else if (_typeof$
|
|
40606
|
+
} else if (_typeof$7(message) === "object" && message.noticeCode) {
|
|
38882
40607
|
return i18next.t(message.noticeCode, message);
|
|
38883
|
-
} else if (_typeof$
|
|
40608
|
+
} else if (_typeof$7(message) === "object" && message.notice) {
|
|
38884
40609
|
return message.notice;
|
|
38885
40610
|
}
|
|
38886
40611
|
return message;
|
|
@@ -38960,13 +40685,13 @@ var isError = function isError(e) {
|
|
|
38960
40685
|
return e && e.stack && e.message;
|
|
38961
40686
|
};
|
|
38962
40687
|
var isAxiosError = function isAxiosError(e) {
|
|
38963
|
-
return _typeof$
|
|
40688
|
+
return _typeof$7(e) === "object" && e.isAxiosError === true;
|
|
38964
40689
|
};
|
|
38965
40690
|
var isString = function isString(s) {
|
|
38966
40691
|
return typeof s === "string" || s instanceof String;
|
|
38967
40692
|
};
|
|
38968
40693
|
var isErrorCodeObject = function isErrorCodeObject(e) {
|
|
38969
|
-
return _typeof$
|
|
40694
|
+
return _typeof$7(e) === "object" && "key" in e && "context" in e;
|
|
38970
40695
|
};
|
|
38971
40696
|
var errorCodeTranslation = function errorCodeTranslation(errorCode) {
|
|
38972
40697
|
if (typeof errorCode === "string") {
|
|
@@ -39118,24 +40843,25 @@ var TreeSelect = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
39118
40843
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
39119
40844
|
className: "neeto-ui-input__wrapper"
|
|
39120
40845
|
}, label && /*#__PURE__*/React__default["default"].createElement(Label, {
|
|
39121
|
-
|
|
39122
|
-
|
|
40846
|
+
required: required,
|
|
40847
|
+
"data-testid": "treeselect-label"
|
|
39123
40848
|
}, label), /*#__PURE__*/React__default["default"].createElement(_TreeSelect__default["default"], _extends$4({
|
|
39124
40849
|
allowClear: allowClear,
|
|
39125
|
-
"data-cy": "neeto-ui-tree-select-wrapper",
|
|
39126
40850
|
disabled: disabled,
|
|
39127
|
-
dropdownStyle: {
|
|
39128
|
-
zIndex: 100000
|
|
39129
|
-
},
|
|
39130
40851
|
fieldNames: fieldNames,
|
|
40852
|
+
onChange: onChange,
|
|
39131
40853
|
placeholder: placeholder,
|
|
39132
|
-
popupClassName: "neeto-ui-tree-select-dropdown",
|
|
39133
40854
|
ref: ref,
|
|
39134
40855
|
showSearch: showSearch,
|
|
39135
40856
|
size: size,
|
|
39136
|
-
suffixIcon: /*#__PURE__*/React__default["default"].createElement(SuffixIcon, null),
|
|
39137
40857
|
treeData: treeData,
|
|
39138
40858
|
treeDataSimpleMode: treeDataSimpleMode,
|
|
40859
|
+
"data-cy": "neeto-ui-tree-select-wrapper",
|
|
40860
|
+
dropdownStyle: {
|
|
40861
|
+
zIndex: 100000
|
|
40862
|
+
},
|
|
40863
|
+
popupClassName: "neeto-ui-tree-select-dropdown",
|
|
40864
|
+
suffixIcon: /*#__PURE__*/React__default["default"].createElement(SuffixIcon, null),
|
|
39139
40865
|
treeNodeFilterProp: (_fieldNames$label = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) !== null && _fieldNames$label !== void 0 ? _fieldNames$label : "label",
|
|
39140
40866
|
value: value || undefined,
|
|
39141
40867
|
className: classnames$1("neeto-ui-tree-select__wrapper", className, {
|
|
@@ -39149,12 +40875,10 @@ var TreeSelect = /*#__PURE__*/React$3.forwardRef(function (_ref, ref) {
|
|
|
39149
40875
|
}, "No options"),
|
|
39150
40876
|
switcherIcon: function switcherIcon(props) {
|
|
39151
40877
|
return /*#__PURE__*/React__default["default"].createElement("div", props, /*#__PURE__*/React__default["default"].createElement(SwitcherIcon, null));
|
|
39152
|
-
}
|
|
39153
|
-
|
|
39154
|
-
}, otherProps)), error && /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
40878
|
+
}
|
|
40879
|
+
}, otherProps)), error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
39155
40880
|
className: "neeto-ui-input__error",
|
|
39156
|
-
"data-testid": "treeselect-error"
|
|
39157
|
-
style: "body3"
|
|
40881
|
+
"data-testid": "treeselect-error"
|
|
39158
40882
|
}, error)));
|
|
39159
40883
|
});
|
|
39160
40884
|
TreeSelect.displayName = "TreeSelect";
|