@majoo-ui/react 1.59.6-rc.5 → 1.59.6-rc.6
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/index.esm.js +1484 -1497
- package/index.umd.js +1521 -1574
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -4942,1648 +4942,1648 @@
|
|
|
4942
4942
|
|
|
4943
4943
|
const ToastContext = /*#__PURE__*/React__namespace.createContext({});
|
|
4944
4944
|
|
|
4945
|
-
var
|
|
4946
|
-
|
|
4947
|
-
var
|
|
4948
|
-
|
|
4949
|
-
var getBuiltIn$3 = getBuiltIn$7;
|
|
4950
|
-
var defineBuiltInAccessor$2 = defineBuiltInAccessor$4;
|
|
4951
|
-
var wellKnownSymbol$c = wellKnownSymbol$l;
|
|
4952
|
-
var DESCRIPTORS$4 = descriptors;
|
|
4953
|
-
|
|
4954
|
-
var SPECIES$3 = wellKnownSymbol$c('species');
|
|
4945
|
+
var $$l = _export;
|
|
4946
|
+
var $includes = arrayIncludes.includes;
|
|
4947
|
+
var fails$h = fails$t;
|
|
4948
|
+
var addToUnscopables = addToUnscopables$2;
|
|
4955
4949
|
|
|
4956
|
-
|
|
4957
|
-
|
|
4950
|
+
// FF99+ bug
|
|
4951
|
+
var BROKEN_ON_SPARSE = fails$h(function () {
|
|
4952
|
+
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
4953
|
+
return !Array(1).includes();
|
|
4954
|
+
});
|
|
4958
4955
|
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4956
|
+
// `Array.prototype.includes` method
|
|
4957
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
4958
|
+
$$l({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
4959
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
|
4960
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
4964
4961
|
}
|
|
4965
|
-
};
|
|
4966
|
-
|
|
4967
|
-
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
4968
|
-
|
|
4969
|
-
var $TypeError$9 = TypeError;
|
|
4970
|
-
|
|
4971
|
-
var anInstance$3 = function (it, Prototype) {
|
|
4972
|
-
if (isPrototypeOf$3(Prototype, it)) return it;
|
|
4973
|
-
throw $TypeError$9('Incorrect invocation');
|
|
4974
|
-
};
|
|
4962
|
+
});
|
|
4975
4963
|
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
var isCallable$8 = isCallable$p;
|
|
4979
|
-
var classof$5 = classof$8;
|
|
4980
|
-
var getBuiltIn$2 = getBuiltIn$7;
|
|
4981
|
-
var inspectSource$1 = inspectSource$3;
|
|
4964
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
4965
|
+
addToUnscopables('includes');
|
|
4982
4966
|
|
|
4983
|
-
var
|
|
4984
|
-
var
|
|
4985
|
-
var
|
|
4986
|
-
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
4987
|
-
var exec$6 = uncurryThis$n(constructorRegExp.exec);
|
|
4988
|
-
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
|
|
4967
|
+
var isObject$7 = isObject$e;
|
|
4968
|
+
var classof$6 = classofRaw$2;
|
|
4969
|
+
var wellKnownSymbol$c = wellKnownSymbol$l;
|
|
4989
4970
|
|
|
4990
|
-
var
|
|
4991
|
-
if (!isCallable$8(argument)) return false;
|
|
4992
|
-
try {
|
|
4993
|
-
construct(noop$1, empty, argument);
|
|
4994
|
-
return true;
|
|
4995
|
-
} catch (error) {
|
|
4996
|
-
return false;
|
|
4997
|
-
}
|
|
4998
|
-
};
|
|
4971
|
+
var MATCH$2 = wellKnownSymbol$c('match');
|
|
4999
4972
|
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
case 'AsyncGeneratorFunction': return false;
|
|
5006
|
-
}
|
|
5007
|
-
try {
|
|
5008
|
-
// we can't check .prototype since constructors produced by .bind haven't it
|
|
5009
|
-
// `Function#toString` throws on some built-it function in some legacy engines
|
|
5010
|
-
// (for example, `DOMQuad` and similar in FF41-)
|
|
5011
|
-
return INCORRECT_TO_STRING || !!exec$6(constructorRegExp, inspectSource$1(argument));
|
|
5012
|
-
} catch (error) {
|
|
5013
|
-
return true;
|
|
5014
|
-
}
|
|
4973
|
+
// `IsRegExp` abstract operation
|
|
4974
|
+
// https://tc39.es/ecma262/#sec-isregexp
|
|
4975
|
+
var isRegexp = function (it) {
|
|
4976
|
+
var isRegExp;
|
|
4977
|
+
return isObject$7(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$6(it) == 'RegExp');
|
|
5015
4978
|
};
|
|
5016
4979
|
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
// `IsConstructor` abstract operation
|
|
5020
|
-
// https://tc39.es/ecma262/#sec-isconstructor
|
|
5021
|
-
var isConstructor$2 = !construct || fails$h(function () {
|
|
5022
|
-
var called;
|
|
5023
|
-
return isConstructorModern(isConstructorModern.call)
|
|
5024
|
-
|| !isConstructorModern(Object)
|
|
5025
|
-
|| !isConstructorModern(function () { called = true; })
|
|
5026
|
-
|| called;
|
|
5027
|
-
}) ? isConstructorLegacy : isConstructorModern;
|
|
5028
|
-
|
|
5029
|
-
var isConstructor$1 = isConstructor$2;
|
|
5030
|
-
var tryToString$3 = tryToString$5;
|
|
4980
|
+
var isRegExp$2 = isRegexp;
|
|
5031
4981
|
|
|
5032
|
-
var $TypeError$
|
|
4982
|
+
var $TypeError$9 = TypeError;
|
|
5033
4983
|
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
4984
|
+
var notARegexp = function (it) {
|
|
4985
|
+
if (isRegExp$2(it)) {
|
|
4986
|
+
throw $TypeError$9("The method doesn't accept regular expressions");
|
|
4987
|
+
} return it;
|
|
5038
4988
|
};
|
|
5039
4989
|
|
|
5040
|
-
var anObject$d = anObject$j;
|
|
5041
|
-
var aConstructor = aConstructor$1;
|
|
5042
|
-
var isNullOrUndefined$5 = isNullOrUndefined$8;
|
|
5043
4990
|
var wellKnownSymbol$b = wellKnownSymbol$l;
|
|
5044
4991
|
|
|
5045
|
-
var
|
|
4992
|
+
var MATCH$1 = wellKnownSymbol$b('match');
|
|
5046
4993
|
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
4994
|
+
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
4995
|
+
var regexp = /./;
|
|
4996
|
+
try {
|
|
4997
|
+
'/./'[METHOD_NAME](regexp);
|
|
4998
|
+
} catch (error1) {
|
|
4999
|
+
try {
|
|
5000
|
+
regexp[MATCH$1] = false;
|
|
5001
|
+
return '/./'[METHOD_NAME](regexp);
|
|
5002
|
+
} catch (error2) { /* empty */ }
|
|
5003
|
+
} return false;
|
|
5053
5004
|
};
|
|
5054
5005
|
|
|
5055
|
-
var
|
|
5006
|
+
var $$k = _export;
|
|
5007
|
+
var uncurryThis$n = functionUncurryThis;
|
|
5008
|
+
var notARegExp$2 = notARegexp;
|
|
5009
|
+
var requireObjectCoercible$9 = requireObjectCoercible$c;
|
|
5010
|
+
var toString$h = toString$j;
|
|
5011
|
+
var correctIsRegExpLogic$2 = correctIsRegexpLogic;
|
|
5056
5012
|
|
|
5057
|
-
var
|
|
5058
|
-
var apply$3 = FunctionPrototype.apply;
|
|
5059
|
-
var call$h = FunctionPrototype.call;
|
|
5013
|
+
var stringIndexOf$2 = uncurryThis$n(''.indexOf);
|
|
5060
5014
|
|
|
5061
|
-
//
|
|
5062
|
-
|
|
5063
|
-
|
|
5015
|
+
// `String.prototype.includes` method
|
|
5016
|
+
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
5017
|
+
$$k({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
|
|
5018
|
+
includes: function includes(searchString /* , position = 0 */) {
|
|
5019
|
+
return !!~stringIndexOf$2(
|
|
5020
|
+
toString$h(requireObjectCoercible$9(this)),
|
|
5021
|
+
toString$h(notARegExp$2(searchString)),
|
|
5022
|
+
arguments.length > 1 ? arguments[1] : undefined
|
|
5023
|
+
);
|
|
5024
|
+
}
|
|
5064
5025
|
});
|
|
5065
5026
|
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
// optional / simple context binding
|
|
5083
|
-
var functionBindContext = function (fn, that) {
|
|
5084
|
-
aCallable$7(fn);
|
|
5085
|
-
return that === undefined ? fn : NATIVE_BIND ? bind$7(fn, that) : function (/* ...args */) {
|
|
5086
|
-
return fn.apply(that, arguments);
|
|
5087
|
-
};
|
|
5088
|
-
};
|
|
5089
|
-
|
|
5090
|
-
var uncurryThis$k = functionUncurryThis;
|
|
5091
|
-
|
|
5092
|
-
var arraySlice$4 = uncurryThis$k([].slice);
|
|
5093
|
-
|
|
5094
|
-
var $TypeError$7 = TypeError;
|
|
5095
|
-
|
|
5096
|
-
var validateArgumentsLength$3 = function (passed, required) {
|
|
5097
|
-
if (passed < required) throw $TypeError$7('Not enough arguments');
|
|
5098
|
-
return passed;
|
|
5099
|
-
};
|
|
5100
|
-
|
|
5101
|
-
var userAgent$4 = engineUserAgent;
|
|
5102
|
-
|
|
5103
|
-
// eslint-disable-next-line redos/no-vulnerable -- safe
|
|
5104
|
-
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4);
|
|
5105
|
-
|
|
5106
|
-
var global$d = global$p;
|
|
5107
|
-
var apply$2 = functionApply;
|
|
5108
|
-
var bind$6 = functionBindContext;
|
|
5109
|
-
var isCallable$7 = isCallable$p;
|
|
5110
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
5111
|
-
var fails$g = fails$t;
|
|
5112
|
-
var html = html$2;
|
|
5113
|
-
var arraySlice$3 = arraySlice$4;
|
|
5114
|
-
var createElement = documentCreateElement$2;
|
|
5115
|
-
var validateArgumentsLength$2 = validateArgumentsLength$3;
|
|
5116
|
-
var IS_IOS$1 = engineIsIos;
|
|
5117
|
-
var IS_NODE$4 = engineIsNode;
|
|
5118
|
-
|
|
5119
|
-
var set = global$d.setImmediate;
|
|
5120
|
-
var clear = global$d.clearImmediate;
|
|
5121
|
-
var process$3 = global$d.process;
|
|
5122
|
-
var Dispatch = global$d.Dispatch;
|
|
5123
|
-
var Function$1 = global$d.Function;
|
|
5124
|
-
var MessageChannel = global$d.MessageChannel;
|
|
5125
|
-
var String$1 = global$d.String;
|
|
5126
|
-
var counter = 0;
|
|
5127
|
-
var queue$2 = {};
|
|
5128
|
-
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
5129
|
-
var $location, defer, channel, port;
|
|
5027
|
+
function useMediaQuery(query) {
|
|
5028
|
+
const [matches, setMatches] = React.useState(false);
|
|
5029
|
+
React.useEffect(() => {
|
|
5030
|
+
const media = window.matchMedia(query);
|
|
5031
|
+
if (media.matches !== matches) {
|
|
5032
|
+
setMatches(media.matches);
|
|
5033
|
+
}
|
|
5034
|
+
const listener = () => {
|
|
5035
|
+
setMatches(media.matches);
|
|
5036
|
+
};
|
|
5037
|
+
media.addEventListener('change', listener);
|
|
5038
|
+
return () => media.removeEventListener('change', listener);
|
|
5039
|
+
}, [matches, query]);
|
|
5040
|
+
return matches;
|
|
5041
|
+
}
|
|
5130
5042
|
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5043
|
+
const _excluded$t = ["id", "title", "description", "position", "dismissAfter", "variant", "onClick", "onRemove", "isExternalOfAction", "onClickOfAction", "captionOfAction", "hrefOfAction"];
|
|
5044
|
+
var _jsxFileName$V = "/home/alfiantryp/Projects/majoo-ui/packages/react/src/components/toast/Toast.js";
|
|
5045
|
+
const TOAST_WIDTH = 576;
|
|
5046
|
+
const ANIMATION_DURATION = 400;
|
|
5047
|
+
const TOP_RIGHT_POSITION = 'top-right';
|
|
5048
|
+
const TOP_LEFT_POSITION = 'top-left';
|
|
5049
|
+
const BOTTOM_RIGHT_POSITION = 'bottom-right';
|
|
5050
|
+
const BOTTOM_LEFT_POSITION = 'bottom_left';
|
|
5051
|
+
const positions = [TOP_RIGHT_POSITION, TOP_LEFT_POSITION, BOTTOM_RIGHT_POSITION, BOTTOM_LEFT_POSITION];
|
|
5052
|
+
const toastEnter = position => keyframes({
|
|
5053
|
+
'0%': {
|
|
5054
|
+
left: position === 'left' ? `-${TOAST_WIDTH}px` : 'unset',
|
|
5055
|
+
right: position === 'right' ? `-${TOAST_WIDTH}px` : 'unset',
|
|
5056
|
+
opacity: '0'
|
|
5057
|
+
},
|
|
5058
|
+
'100%': {
|
|
5059
|
+
left: position === 'left' ? '0' : 'unset',
|
|
5060
|
+
right: position === 'right' ? '0' : 'unset',
|
|
5061
|
+
opacity: '1'
|
|
5062
|
+
}
|
|
5134
5063
|
});
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5064
|
+
const toastExit = position => keyframes({
|
|
5065
|
+
'0%': {
|
|
5066
|
+
transform: 'translateX(0%)',
|
|
5067
|
+
opacity: '1'
|
|
5068
|
+
},
|
|
5069
|
+
'100%': {
|
|
5070
|
+
transform: `translateX(${position === 'right' ? '100%' : '-100%'})`,
|
|
5071
|
+
opacity: '0'
|
|
5141
5072
|
}
|
|
5142
|
-
};
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
};
|
|
5149
|
-
|
|
5150
|
-
var eventListener = function (event) {
|
|
5151
|
-
run(event.data);
|
|
5152
|
-
};
|
|
5153
|
-
|
|
5154
|
-
var globalPostMessageDefer = function (id) {
|
|
5155
|
-
// old engines have not location.origin
|
|
5156
|
-
global$d.postMessage(String$1(id), $location.protocol + '//' + $location.host);
|
|
5157
|
-
};
|
|
5158
|
-
|
|
5159
|
-
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
5160
|
-
if (!set || !clear) {
|
|
5161
|
-
set = function setImmediate(handler) {
|
|
5162
|
-
validateArgumentsLength$2(arguments.length, 1);
|
|
5163
|
-
var fn = isCallable$7(handler) ? handler : Function$1(handler);
|
|
5164
|
-
var args = arraySlice$3(arguments, 1);
|
|
5165
|
-
queue$2[++counter] = function () {
|
|
5166
|
-
apply$2(fn, undefined, args);
|
|
5167
|
-
};
|
|
5168
|
-
defer(counter);
|
|
5169
|
-
return counter;
|
|
5170
|
-
};
|
|
5171
|
-
clear = function clearImmediate(id) {
|
|
5172
|
-
delete queue$2[id];
|
|
5173
|
-
};
|
|
5174
|
-
// Node.js 0.8-
|
|
5175
|
-
if (IS_NODE$4) {
|
|
5176
|
-
defer = function (id) {
|
|
5177
|
-
process$3.nextTick(runner(id));
|
|
5178
|
-
};
|
|
5179
|
-
// Sphere (JS game engine) Dispatch API
|
|
5180
|
-
} else if (Dispatch && Dispatch.now) {
|
|
5181
|
-
defer = function (id) {
|
|
5182
|
-
Dispatch.now(runner(id));
|
|
5183
|
-
};
|
|
5184
|
-
// Browsers with MessageChannel, includes WebWorkers
|
|
5185
|
-
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
5186
|
-
} else if (MessageChannel && !IS_IOS$1) {
|
|
5187
|
-
channel = new MessageChannel();
|
|
5188
|
-
port = channel.port2;
|
|
5189
|
-
channel.port1.onmessage = eventListener;
|
|
5190
|
-
defer = bind$6(port.postMessage, port);
|
|
5191
|
-
// Browsers with postMessage, skip WebWorkers
|
|
5192
|
-
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
5193
|
-
} else if (
|
|
5194
|
-
global$d.addEventListener &&
|
|
5195
|
-
isCallable$7(global$d.postMessage) &&
|
|
5196
|
-
!global$d.importScripts &&
|
|
5197
|
-
$location && $location.protocol !== 'file:' &&
|
|
5198
|
-
!fails$g(globalPostMessageDefer)
|
|
5199
|
-
) {
|
|
5200
|
-
defer = globalPostMessageDefer;
|
|
5201
|
-
global$d.addEventListener('message', eventListener, false);
|
|
5202
|
-
// IE8-
|
|
5203
|
-
} else if (ONREADYSTATECHANGE in createElement('script')) {
|
|
5204
|
-
defer = function (id) {
|
|
5205
|
-
html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
|
5206
|
-
html.removeChild(this);
|
|
5207
|
-
run(id);
|
|
5208
|
-
};
|
|
5209
|
-
};
|
|
5210
|
-
// Rest old browsers
|
|
5211
|
-
} else {
|
|
5212
|
-
defer = function (id) {
|
|
5213
|
-
setTimeout(runner(id), 0);
|
|
5214
|
-
};
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
|
|
5218
|
-
var task$1 = {
|
|
5219
|
-
set: set,
|
|
5220
|
-
clear: clear
|
|
5221
|
-
};
|
|
5222
|
-
|
|
5223
|
-
var Queue$2 = function () {
|
|
5224
|
-
this.head = null;
|
|
5225
|
-
this.tail = null;
|
|
5226
|
-
};
|
|
5227
|
-
|
|
5228
|
-
Queue$2.prototype = {
|
|
5229
|
-
add: function (item) {
|
|
5230
|
-
var entry = { item: item, next: null };
|
|
5231
|
-
var tail = this.tail;
|
|
5232
|
-
if (tail) tail.next = entry;
|
|
5233
|
-
else this.head = entry;
|
|
5234
|
-
this.tail = entry;
|
|
5073
|
+
});
|
|
5074
|
+
const toastAnimationStyle = position => ({
|
|
5075
|
+
'&[state="entering"], &[state="entered"]': {
|
|
5076
|
+
animationFillMode: 'forwards',
|
|
5077
|
+
animationName: toastEnter(position),
|
|
5078
|
+
animationDuration: `${ANIMATION_DURATION}ms`
|
|
5235
5079
|
},
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5080
|
+
'&[state="exiting"]': {
|
|
5081
|
+
animationFillMode: 'forwards',
|
|
5082
|
+
animationName: toastExit(position),
|
|
5083
|
+
animationDuration: `${ANIMATION_DURATION * 2}ms`
|
|
5084
|
+
},
|
|
5085
|
+
'&[state="entered"]': {
|
|
5086
|
+
right: 0,
|
|
5087
|
+
opacity: '1'
|
|
5088
|
+
}
|
|
5089
|
+
});
|
|
5090
|
+
const Root = styled('div', {
|
|
5091
|
+
display: 'block',
|
|
5092
|
+
maxWidth: `${TOAST_WIDTH}px`,
|
|
5093
|
+
// width: `${TOAST_WIDTH}px`,
|
|
5094
|
+
height: '100%',
|
|
5095
|
+
position: 'relative',
|
|
5096
|
+
opacity: 0,
|
|
5097
|
+
variants: {
|
|
5098
|
+
hPosition: {
|
|
5099
|
+
right: toastAnimationStyle('right'),
|
|
5100
|
+
left: toastAnimationStyle('left')
|
|
5101
|
+
},
|
|
5102
|
+
vPosition: {
|
|
5103
|
+
top: {
|
|
5104
|
+
marginTop: '$spacing-05'
|
|
5105
|
+
},
|
|
5106
|
+
bottom: {
|
|
5107
|
+
marginBottom: '$spacing-05'
|
|
5108
|
+
}
|
|
5242
5109
|
}
|
|
5243
5110
|
}
|
|
5244
|
-
};
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
var flush = function () {
|
|
5280
|
-
var parent, fn;
|
|
5281
|
-
if (IS_NODE$3 && (parent = process$2.domain)) parent.exit();
|
|
5282
|
-
while (fn = queue.get()) try {
|
|
5283
|
-
fn();
|
|
5284
|
-
} catch (error) {
|
|
5285
|
-
if (queue.head) notify$1();
|
|
5286
|
-
throw error;
|
|
5111
|
+
});
|
|
5112
|
+
const StyledToast = styled(Flex$1, {
|
|
5113
|
+
// width: '100%',
|
|
5114
|
+
// maxWidth: TOAST_WIDTH,
|
|
5115
|
+
padding: '$spacing-03',
|
|
5116
|
+
textAlign: 'left',
|
|
5117
|
+
borderRadius: 8,
|
|
5118
|
+
pointer: 'default',
|
|
5119
|
+
variants: {
|
|
5120
|
+
variant: {
|
|
5121
|
+
info: {
|
|
5122
|
+
backgroundColor: '$blue100',
|
|
5123
|
+
border: '1px solid $hlNews'
|
|
5124
|
+
},
|
|
5125
|
+
warning: {
|
|
5126
|
+
backgroundColor: '$bgProcess',
|
|
5127
|
+
border: '1px solid $hlProcess'
|
|
5128
|
+
},
|
|
5129
|
+
success: {
|
|
5130
|
+
backgroundColor: '$bgSuccess',
|
|
5131
|
+
border: '1px solid $hlSuccess'
|
|
5132
|
+
},
|
|
5133
|
+
failed: {
|
|
5134
|
+
backgroundColor: '$bgFailed',
|
|
5135
|
+
border: '1px solid $hlFailed'
|
|
5136
|
+
},
|
|
5137
|
+
pending: {
|
|
5138
|
+
backgroundColor: '$bgProcess',
|
|
5139
|
+
border: '1px solid $orange500'
|
|
5140
|
+
}
|
|
5141
|
+
},
|
|
5142
|
+
hasAction: {
|
|
5143
|
+
true: {
|
|
5144
|
+
cursor: 'pointer'
|
|
5145
|
+
}
|
|
5287
5146
|
}
|
|
5288
|
-
if (parent) parent.enter();
|
|
5289
|
-
};
|
|
5290
|
-
|
|
5291
|
-
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
5292
|
-
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
5293
|
-
if (!IS_IOS && !IS_NODE$3 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
|
5294
|
-
toggle = true;
|
|
5295
|
-
node = document$2.createTextNode('');
|
|
5296
|
-
new MutationObserver(flush).observe(node, { characterData: true });
|
|
5297
|
-
notify$1 = function () {
|
|
5298
|
-
node.data = toggle = !toggle;
|
|
5299
|
-
};
|
|
5300
|
-
// environments with maybe non-completely correct, but existent Promise
|
|
5301
|
-
} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
|
5302
|
-
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
5303
|
-
promise = Promise$1.resolve(undefined);
|
|
5304
|
-
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
5305
|
-
promise.constructor = Promise$1;
|
|
5306
|
-
then = bind$5(promise.then, promise);
|
|
5307
|
-
notify$1 = function () {
|
|
5308
|
-
then(flush);
|
|
5309
|
-
};
|
|
5310
|
-
// Node.js without promises
|
|
5311
|
-
} else if (IS_NODE$3) {
|
|
5312
|
-
notify$1 = function () {
|
|
5313
|
-
process$2.nextTick(flush);
|
|
5314
|
-
};
|
|
5315
|
-
// for other environments - macrotask based on:
|
|
5316
|
-
// - setImmediate
|
|
5317
|
-
// - MessageChannel
|
|
5318
|
-
// - window.postMessage
|
|
5319
|
-
// - onreadystatechange
|
|
5320
|
-
// - setTimeout
|
|
5321
|
-
} else {
|
|
5322
|
-
// `webpack` dev server bug on IE global methods - use bind(fn, global)
|
|
5323
|
-
macrotask = bind$5(macrotask, global$c);
|
|
5324
|
-
notify$1 = function () {
|
|
5325
|
-
macrotask(flush);
|
|
5326
|
-
};
|
|
5327
5147
|
}
|
|
5328
|
-
|
|
5329
|
-
microtask$1 = function (fn) {
|
|
5330
|
-
if (!queue.head) notify$1();
|
|
5331
|
-
queue.add(fn);
|
|
5332
|
-
};
|
|
5333
|
-
}
|
|
5334
|
-
|
|
5335
|
-
var microtask_1 = microtask$1;
|
|
5336
|
-
|
|
5337
|
-
var hostReportErrors$1 = function (a, b) {
|
|
5338
|
-
try {
|
|
5339
|
-
// eslint-disable-next-line no-console -- safe
|
|
5340
|
-
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
5341
|
-
} catch (error) { /* empty */ }
|
|
5342
|
-
};
|
|
5343
|
-
|
|
5344
|
-
var perform$3 = function (exec) {
|
|
5345
|
-
try {
|
|
5346
|
-
return { error: false, value: exec() };
|
|
5347
|
-
} catch (error) {
|
|
5348
|
-
return { error: true, value: error };
|
|
5349
|
-
}
|
|
5350
|
-
};
|
|
5351
|
-
|
|
5352
|
-
var global$b = global$p;
|
|
5353
|
-
|
|
5354
|
-
var promiseNativeConstructor = global$b.Promise;
|
|
5355
|
-
|
|
5356
|
-
/* global Deno -- Deno case */
|
|
5357
|
-
|
|
5358
|
-
var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
|
|
5359
|
-
|
|
5360
|
-
var IS_DENO$1 = engineIsDeno;
|
|
5361
|
-
var IS_NODE$2 = engineIsNode;
|
|
5362
|
-
|
|
5363
|
-
var engineIsBrowser = !IS_DENO$1 && !IS_NODE$2
|
|
5364
|
-
&& typeof window == 'object'
|
|
5365
|
-
&& typeof document == 'object';
|
|
5366
|
-
|
|
5367
|
-
var global$a = global$p;
|
|
5368
|
-
var NativePromiseConstructor$3 = promiseNativeConstructor;
|
|
5369
|
-
var isCallable$6 = isCallable$p;
|
|
5370
|
-
var isForced$1 = isForced_1;
|
|
5371
|
-
var inspectSource = inspectSource$3;
|
|
5372
|
-
var wellKnownSymbol$a = wellKnownSymbol$l;
|
|
5373
|
-
var IS_BROWSER = engineIsBrowser;
|
|
5374
|
-
var IS_DENO = engineIsDeno;
|
|
5375
|
-
var V8_VERSION = engineV8Version;
|
|
5376
|
-
|
|
5377
|
-
NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
|
|
5378
|
-
var SPECIES$1 = wellKnownSymbol$a('species');
|
|
5379
|
-
var SUBCLASSING = false;
|
|
5380
|
-
var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$6(global$a.PromiseRejectionEvent);
|
|
5381
|
-
|
|
5382
|
-
var FORCED_PROMISE_CONSTRUCTOR$5 = isForced$1('Promise', function () {
|
|
5383
|
-
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
|
|
5384
|
-
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
|
|
5385
|
-
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
5386
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
5387
|
-
// We can't detect it synchronously, so just check versions
|
|
5388
|
-
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
|
5389
|
-
// We can't use @@species feature detection in V8 since it causes
|
|
5390
|
-
// deoptimization and performance degradation
|
|
5391
|
-
// https://github.com/zloirock/core-js/issues/679
|
|
5392
|
-
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
|
|
5393
|
-
// Detect correctness of subclassing with @@species support
|
|
5394
|
-
var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
|
|
5395
|
-
var FakePromise = function (exec) {
|
|
5396
|
-
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
5397
|
-
};
|
|
5398
|
-
var constructor = promise.constructor = {};
|
|
5399
|
-
constructor[SPECIES$1] = FakePromise;
|
|
5400
|
-
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
5401
|
-
if (!SUBCLASSING) return true;
|
|
5402
|
-
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
5403
|
-
} return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
|
|
5404
5148
|
});
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
this.reject = aCallable$6(reject);
|
|
5427
|
-
};
|
|
5428
|
-
|
|
5429
|
-
// `NewPromiseCapability` abstract operation
|
|
5430
|
-
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
5431
|
-
newPromiseCapability$2.f = function (C) {
|
|
5432
|
-
return new PromiseCapability(C);
|
|
5433
|
-
};
|
|
5434
|
-
|
|
5435
|
-
var $$l = _export;
|
|
5436
|
-
var IS_NODE$1 = engineIsNode;
|
|
5437
|
-
var global$9 = global$p;
|
|
5438
|
-
var call$g = functionCall;
|
|
5439
|
-
var defineBuiltIn$7 = defineBuiltIn$b;
|
|
5440
|
-
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
5441
|
-
var setToStringTag$2 = setToStringTag$5;
|
|
5442
|
-
var setSpecies$1 = setSpecies$2;
|
|
5443
|
-
var aCallable$5 = aCallable$a;
|
|
5444
|
-
var isCallable$5 = isCallable$p;
|
|
5445
|
-
var isObject$7 = isObject$e;
|
|
5446
|
-
var anInstance$2 = anInstance$3;
|
|
5447
|
-
var speciesConstructor$1 = speciesConstructor$2;
|
|
5448
|
-
var task = task$1.set;
|
|
5449
|
-
var microtask = microtask_1;
|
|
5450
|
-
var hostReportErrors = hostReportErrors$1;
|
|
5451
|
-
var perform$2 = perform$3;
|
|
5452
|
-
var Queue = queue$1;
|
|
5453
|
-
var InternalStateModule$3 = internalState;
|
|
5454
|
-
var NativePromiseConstructor$2 = promiseNativeConstructor;
|
|
5455
|
-
var PromiseConstructorDetection = promiseConstructorDetection;
|
|
5456
|
-
var newPromiseCapabilityModule$3 = newPromiseCapability$2;
|
|
5457
|
-
|
|
5458
|
-
var PROMISE = 'Promise';
|
|
5459
|
-
var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
|
|
5460
|
-
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
|
5461
|
-
var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
|
|
5462
|
-
var getInternalPromiseState = InternalStateModule$3.getterFor(PROMISE);
|
|
5463
|
-
var setInternalState$3 = InternalStateModule$3.set;
|
|
5464
|
-
var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
|
|
5465
|
-
var PromiseConstructor = NativePromiseConstructor$2;
|
|
5466
|
-
var PromisePrototype = NativePromisePrototype$1;
|
|
5467
|
-
var TypeError$3 = global$9.TypeError;
|
|
5468
|
-
var document$1 = global$9.document;
|
|
5469
|
-
var process$1 = global$9.process;
|
|
5470
|
-
var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
|
|
5471
|
-
var newGenericPromiseCapability = newPromiseCapability$1;
|
|
5472
|
-
|
|
5473
|
-
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$9.dispatchEvent);
|
|
5474
|
-
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
5475
|
-
var REJECTION_HANDLED = 'rejectionhandled';
|
|
5476
|
-
var PENDING = 0;
|
|
5477
|
-
var FULFILLED = 1;
|
|
5478
|
-
var REJECTED = 2;
|
|
5479
|
-
var HANDLED = 1;
|
|
5480
|
-
var UNHANDLED = 2;
|
|
5481
|
-
|
|
5482
|
-
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
5483
|
-
|
|
5484
|
-
// helpers
|
|
5485
|
-
var isThenable = function (it) {
|
|
5486
|
-
var then;
|
|
5487
|
-
return isObject$7(it) && isCallable$5(then = it.then) ? then : false;
|
|
5488
|
-
};
|
|
5489
|
-
|
|
5490
|
-
var callReaction = function (reaction, state) {
|
|
5491
|
-
var value = state.value;
|
|
5492
|
-
var ok = state.state == FULFILLED;
|
|
5493
|
-
var handler = ok ? reaction.ok : reaction.fail;
|
|
5494
|
-
var resolve = reaction.resolve;
|
|
5495
|
-
var reject = reaction.reject;
|
|
5496
|
-
var domain = reaction.domain;
|
|
5497
|
-
var result, then, exited;
|
|
5498
|
-
try {
|
|
5499
|
-
if (handler) {
|
|
5500
|
-
if (!ok) {
|
|
5501
|
-
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
5502
|
-
state.rejection = HANDLED;
|
|
5503
|
-
}
|
|
5504
|
-
if (handler === true) result = value;
|
|
5505
|
-
else {
|
|
5506
|
-
if (domain) domain.enter();
|
|
5507
|
-
result = handler(value); // can throw
|
|
5508
|
-
if (domain) {
|
|
5509
|
-
domain.exit();
|
|
5510
|
-
exited = true;
|
|
5511
|
-
}
|
|
5149
|
+
const LeftBar = styled('div', {
|
|
5150
|
+
width: '4px',
|
|
5151
|
+
alignSelf: 'stretch',
|
|
5152
|
+
borderRadius: '$lg',
|
|
5153
|
+
marginRight: '$spacing-03',
|
|
5154
|
+
variants: {
|
|
5155
|
+
variant: {
|
|
5156
|
+
info: {
|
|
5157
|
+
backgroundColor: '$hlNews'
|
|
5158
|
+
},
|
|
5159
|
+
warning: {
|
|
5160
|
+
backgroundColor: '$hlProcess'
|
|
5161
|
+
},
|
|
5162
|
+
success: {
|
|
5163
|
+
backgroundColor: '$hlSuccess'
|
|
5164
|
+
},
|
|
5165
|
+
failed: {
|
|
5166
|
+
backgroundColor: '$hlFailed'
|
|
5167
|
+
},
|
|
5168
|
+
pending: {
|
|
5169
|
+
backgroundColor: '$orange500'
|
|
5512
5170
|
}
|
|
5513
|
-
|
|
5514
|
-
reject(TypeError$3('Promise-chain cycle'));
|
|
5515
|
-
} else if (then = isThenable(result)) {
|
|
5516
|
-
call$g(then, result, resolve, reject);
|
|
5517
|
-
} else resolve(result);
|
|
5518
|
-
} else reject(value);
|
|
5519
|
-
} catch (error) {
|
|
5520
|
-
if (domain && !exited) domain.exit();
|
|
5521
|
-
reject(error);
|
|
5171
|
+
}
|
|
5522
5172
|
}
|
|
5523
|
-
};
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5173
|
+
});
|
|
5174
|
+
const DescriptionField = styled(Paragraph, {
|
|
5175
|
+
display: '-webkit-box',
|
|
5176
|
+
'-webkit-line-clamp': '3',
|
|
5177
|
+
'-webkit-box-orient': 'vertical',
|
|
5178
|
+
overflow: 'hidden',
|
|
5179
|
+
whiteSpace: 'unset'
|
|
5180
|
+
});
|
|
5181
|
+
const CloseButton$1 = styled(Flex$1, {
|
|
5182
|
+
cursor: 'pointer',
|
|
5183
|
+
size: '20px',
|
|
5184
|
+
borderRadius: '$round',
|
|
5185
|
+
'&:hover': {
|
|
5186
|
+
backgroundColor: 'rgba(0, 0, 0, .05)'
|
|
5187
|
+
},
|
|
5188
|
+
alignSelf: 'start',
|
|
5189
|
+
variants: {
|
|
5190
|
+
hasTitle: {
|
|
5191
|
+
false: {
|
|
5192
|
+
alignSelf: 'center'
|
|
5193
|
+
}
|
|
5533
5194
|
}
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5195
|
+
}
|
|
5196
|
+
});
|
|
5197
|
+
const Toast = _ref => {
|
|
5198
|
+
let {
|
|
5199
|
+
id,
|
|
5200
|
+
title,
|
|
5201
|
+
description,
|
|
5202
|
+
position,
|
|
5203
|
+
dismissAfter,
|
|
5204
|
+
variant,
|
|
5205
|
+
onClick,
|
|
5206
|
+
onRemove,
|
|
5207
|
+
isExternalOfAction,
|
|
5208
|
+
onClickOfAction,
|
|
5209
|
+
captionOfAction,
|
|
5210
|
+
hrefOfAction
|
|
5211
|
+
} = _ref,
|
|
5212
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
5213
|
+
const [isOpen, setIsOpen] = React__namespace.useState(false);
|
|
5214
|
+
const isMobile = useMediaQuery(`(max-width: 767px`);
|
|
5215
|
+
const close = React__namespace.useCallback(() => {
|
|
5216
|
+
setIsOpen(false);
|
|
5217
|
+
}, [setIsOpen]);
|
|
5218
|
+
React__namespace.useEffect(() => {
|
|
5219
|
+
let currentTimer = null;
|
|
5220
|
+
setIsOpen(true);
|
|
5221
|
+
currentTimer = setTimeout(() => {
|
|
5222
|
+
close();
|
|
5223
|
+
}, dismissAfter);
|
|
5224
|
+
return () => {
|
|
5225
|
+
if (currentTimer) {
|
|
5226
|
+
clearTimeout(currentTimer);
|
|
5227
|
+
}
|
|
5228
|
+
};
|
|
5229
|
+
}, [dismissAfter]);
|
|
5230
|
+
return /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.Transition, {
|
|
5231
|
+
appear: true,
|
|
5232
|
+
in: isOpen,
|
|
5233
|
+
timeout: {
|
|
5234
|
+
enter: ANIMATION_DURATION + 100,
|
|
5235
|
+
exit: ANIMATION_DURATION + 400
|
|
5236
|
+
},
|
|
5237
|
+
unmountOnExit: true,
|
|
5238
|
+
onExited: onRemove,
|
|
5239
|
+
__self: undefined,
|
|
5240
|
+
__source: {
|
|
5241
|
+
fileName: _jsxFileName$V,
|
|
5242
|
+
lineNumber: 216,
|
|
5243
|
+
columnNumber: 5
|
|
5567
5244
|
}
|
|
5568
|
-
}
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
};
|
|
5583
|
-
|
|
5584
|
-
var bind$4 = function (fn, state, unwrap) {
|
|
5585
|
-
return function (value) {
|
|
5586
|
-
fn(state, value, unwrap);
|
|
5587
|
-
};
|
|
5588
|
-
};
|
|
5589
|
-
|
|
5590
|
-
var internalReject = function (state, value, unwrap) {
|
|
5591
|
-
if (state.done) return;
|
|
5592
|
-
state.done = true;
|
|
5593
|
-
if (unwrap) state = unwrap;
|
|
5594
|
-
state.value = value;
|
|
5595
|
-
state.state = REJECTED;
|
|
5596
|
-
notify(state, true);
|
|
5597
|
-
};
|
|
5598
|
-
|
|
5599
|
-
var internalResolve = function (state, value, unwrap) {
|
|
5600
|
-
if (state.done) return;
|
|
5601
|
-
state.done = true;
|
|
5602
|
-
if (unwrap) state = unwrap;
|
|
5603
|
-
try {
|
|
5604
|
-
if (state.facade === value) throw TypeError$3("Promise can't be resolved itself");
|
|
5605
|
-
var then = isThenable(value);
|
|
5606
|
-
if (then) {
|
|
5607
|
-
microtask(function () {
|
|
5608
|
-
var wrapper = { done: false };
|
|
5609
|
-
try {
|
|
5610
|
-
call$g(then, value,
|
|
5611
|
-
bind$4(internalResolve, wrapper, state),
|
|
5612
|
-
bind$4(internalReject, wrapper, state)
|
|
5613
|
-
);
|
|
5614
|
-
} catch (error) {
|
|
5615
|
-
internalReject(wrapper, error, state);
|
|
5616
|
-
}
|
|
5617
|
-
});
|
|
5618
|
-
} else {
|
|
5619
|
-
state.value = value;
|
|
5620
|
-
state.state = FULFILLED;
|
|
5621
|
-
notify(state, false);
|
|
5245
|
+
}, state => /*#__PURE__*/React__namespace.createElement(Root, _extends({
|
|
5246
|
+
id: id,
|
|
5247
|
+
state: state,
|
|
5248
|
+
css: {
|
|
5249
|
+
maxWidth: isMobile ? '80vw' : TOAST_WIDTH
|
|
5250
|
+
},
|
|
5251
|
+
hPosition: position.includes('left') ? 'left' : 'right',
|
|
5252
|
+
vPosition: position.includes('top') ? 'top' : 'bottom'
|
|
5253
|
+
}, rest, {
|
|
5254
|
+
__self: undefined,
|
|
5255
|
+
__source: {
|
|
5256
|
+
fileName: _jsxFileName$V,
|
|
5257
|
+
lineNumber: 227,
|
|
5258
|
+
columnNumber: 9
|
|
5622
5259
|
}
|
|
5623
|
-
}
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
anInstance$2(this, PromisePrototype);
|
|
5633
|
-
aCallable$5(executor);
|
|
5634
|
-
call$g(Internal, this);
|
|
5635
|
-
var state = getInternalPromiseState(this);
|
|
5636
|
-
try {
|
|
5637
|
-
executor(bind$4(internalResolve, state), bind$4(internalReject, state));
|
|
5638
|
-
} catch (error) {
|
|
5639
|
-
internalReject(state, error);
|
|
5260
|
+
}), /*#__PURE__*/React__namespace.createElement(StyledToast, {
|
|
5261
|
+
variant: variant,
|
|
5262
|
+
hasAction: !!onClick,
|
|
5263
|
+
onClick: onClick,
|
|
5264
|
+
__self: undefined,
|
|
5265
|
+
__source: {
|
|
5266
|
+
fileName: _jsxFileName$V,
|
|
5267
|
+
lineNumber: 235,
|
|
5268
|
+
columnNumber: 11
|
|
5640
5269
|
}
|
|
5641
|
-
}
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
type: PROMISE,
|
|
5649
|
-
done: false,
|
|
5650
|
-
notified: false,
|
|
5651
|
-
parent: false,
|
|
5652
|
-
reactions: new Queue(),
|
|
5653
|
-
rejection: false,
|
|
5654
|
-
state: PENDING,
|
|
5655
|
-
value: undefined
|
|
5656
|
-
});
|
|
5657
|
-
};
|
|
5658
|
-
|
|
5659
|
-
// `Promise.prototype.then` method
|
|
5660
|
-
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
5661
|
-
Internal.prototype = defineBuiltIn$7(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
5662
|
-
var state = getInternalPromiseState(this);
|
|
5663
|
-
var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
|
|
5664
|
-
state.parent = true;
|
|
5665
|
-
reaction.ok = isCallable$5(onFulfilled) ? onFulfilled : true;
|
|
5666
|
-
reaction.fail = isCallable$5(onRejected) && onRejected;
|
|
5667
|
-
reaction.domain = IS_NODE$1 ? process$1.domain : undefined;
|
|
5668
|
-
if (state.state == PENDING) state.reactions.add(reaction);
|
|
5669
|
-
else microtask(function () {
|
|
5670
|
-
callReaction(reaction, state);
|
|
5671
|
-
});
|
|
5672
|
-
return reaction.promise;
|
|
5673
|
-
});
|
|
5674
|
-
|
|
5675
|
-
OwnPromiseCapability = function () {
|
|
5676
|
-
var promise = new Internal();
|
|
5677
|
-
var state = getInternalPromiseState(promise);
|
|
5678
|
-
this.promise = promise;
|
|
5679
|
-
this.resolve = bind$4(internalResolve, state);
|
|
5680
|
-
this.reject = bind$4(internalReject, state);
|
|
5681
|
-
};
|
|
5682
|
-
|
|
5683
|
-
newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
|
|
5684
|
-
return C === PromiseConstructor || C === PromiseWrapper
|
|
5685
|
-
? new OwnPromiseCapability(C)
|
|
5686
|
-
: newGenericPromiseCapability(C);
|
|
5687
|
-
};
|
|
5688
|
-
|
|
5689
|
-
if (isCallable$5(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
|
|
5690
|
-
nativeThen = NativePromisePrototype$1.then;
|
|
5691
|
-
|
|
5692
|
-
if (!NATIVE_PROMISE_SUBCLASSING) {
|
|
5693
|
-
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
5694
|
-
defineBuiltIn$7(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
|
|
5695
|
-
var that = this;
|
|
5696
|
-
return new PromiseConstructor(function (resolve, reject) {
|
|
5697
|
-
call$g(nativeThen, that, resolve, reject);
|
|
5698
|
-
}).then(onFulfilled, onRejected);
|
|
5699
|
-
// https://github.com/zloirock/core-js/issues/640
|
|
5700
|
-
}, { unsafe: true });
|
|
5270
|
+
}, /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5271
|
+
direction: "column",
|
|
5272
|
+
__self: undefined,
|
|
5273
|
+
__source: {
|
|
5274
|
+
fileName: _jsxFileName$V,
|
|
5275
|
+
lineNumber: 236,
|
|
5276
|
+
columnNumber: 13
|
|
5701
5277
|
}
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
if (setPrototypeOf$1) {
|
|
5710
|
-
setPrototypeOf$1(NativePromisePrototype$1, PromisePrototype);
|
|
5278
|
+
}, /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5279
|
+
direction: "row",
|
|
5280
|
+
__self: undefined,
|
|
5281
|
+
__source: {
|
|
5282
|
+
fileName: _jsxFileName$V,
|
|
5283
|
+
lineNumber: 237,
|
|
5284
|
+
columnNumber: 15
|
|
5711
5285
|
}
|
|
5712
|
-
}
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5286
|
+
}, /*#__PURE__*/React__namespace.createElement(LeftBar, {
|
|
5287
|
+
variant: variant,
|
|
5288
|
+
__self: undefined,
|
|
5289
|
+
__source: {
|
|
5290
|
+
fileName: _jsxFileName$V,
|
|
5291
|
+
lineNumber: 238,
|
|
5292
|
+
columnNumber: 17
|
|
5293
|
+
}
|
|
5294
|
+
}), /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5295
|
+
gap: 2,
|
|
5296
|
+
direction: "column",
|
|
5297
|
+
css: {
|
|
5298
|
+
flex: 1
|
|
5299
|
+
},
|
|
5300
|
+
__self: undefined,
|
|
5301
|
+
__source: {
|
|
5302
|
+
fileName: _jsxFileName$V,
|
|
5303
|
+
lineNumber: 239,
|
|
5304
|
+
columnNumber: 17
|
|
5305
|
+
}
|
|
5306
|
+
}, title && /*#__PURE__*/React__namespace.createElement(Flex$1, {
|
|
5307
|
+
justify: "between",
|
|
5308
|
+
__self: undefined,
|
|
5309
|
+
__source: {
|
|
5310
|
+
fileName: _jsxFileName$V,
|
|
5311
|
+
lineNumber: 247,
|
|
5312
|
+
columnNumber: 21
|
|
5313
|
+
}
|
|
5314
|
+
}, /*#__PURE__*/React__namespace.createElement(Heading, {
|
|
5315
|
+
heading: "sectionTitle",
|
|
5316
|
+
css: {
|
|
5317
|
+
lineHeight: '$long-content-regular',
|
|
5318
|
+
flex: 1,
|
|
5319
|
+
whiteSpace: 'unset',
|
|
5320
|
+
overflow: 'hidden',
|
|
5321
|
+
textOverflow: 'ellipsis'
|
|
5322
|
+
},
|
|
5323
|
+
__self: undefined,
|
|
5324
|
+
__source: {
|
|
5325
|
+
fileName: _jsxFileName$V,
|
|
5326
|
+
lineNumber: 248,
|
|
5327
|
+
columnNumber: 23
|
|
5328
|
+
}
|
|
5329
|
+
}, title)), /*#__PURE__*/React__namespace.createElement(DescriptionField, {
|
|
5330
|
+
paragraph: "longContentRegular",
|
|
5331
|
+
color: "secondary",
|
|
5332
|
+
__self: undefined,
|
|
5333
|
+
__source: {
|
|
5334
|
+
fileName: _jsxFileName$V,
|
|
5335
|
+
lineNumber: 262,
|
|
5336
|
+
columnNumber: 19
|
|
5337
|
+
}
|
|
5338
|
+
}, description)), /*#__PURE__*/React__namespace.createElement(CloseButton$1, {
|
|
5339
|
+
onClick: e => {
|
|
5340
|
+
e.preventDefault();
|
|
5341
|
+
e.stopPropagation();
|
|
5342
|
+
close();
|
|
5343
|
+
},
|
|
5344
|
+
align: "center",
|
|
5345
|
+
justify: "center",
|
|
5346
|
+
hasTitle: !!title,
|
|
5347
|
+
__self: undefined,
|
|
5348
|
+
__source: {
|
|
5349
|
+
fileName: _jsxFileName$V,
|
|
5350
|
+
lineNumber: 266,
|
|
5351
|
+
columnNumber: 17
|
|
5352
|
+
}
|
|
5353
|
+
}, /*#__PURE__*/React__namespace.createElement(icons.CloseOutline, {
|
|
5354
|
+
color: colors$8.iconSecondary,
|
|
5355
|
+
size: "16px",
|
|
5356
|
+
__self: undefined,
|
|
5357
|
+
__source: {
|
|
5358
|
+
fileName: _jsxFileName$V,
|
|
5359
|
+
lineNumber: 276,
|
|
5360
|
+
columnNumber: 19
|
|
5361
|
+
}
|
|
5362
|
+
}))), (hrefOfAction || isExternalOfAction || onClickOfAction) && /*#__PURE__*/React__namespace.createElement(Link, {
|
|
5363
|
+
href: hrefOfAction,
|
|
5364
|
+
isExternal: isExternalOfAction,
|
|
5365
|
+
onClick: onClickOfAction,
|
|
5366
|
+
color: variant,
|
|
5367
|
+
css: {
|
|
5368
|
+
alignSelf: 'self-end',
|
|
5369
|
+
marginTop: '$spacing-03'
|
|
5370
|
+
},
|
|
5371
|
+
__self: undefined,
|
|
5372
|
+
__source: {
|
|
5373
|
+
fileName: _jsxFileName$V,
|
|
5374
|
+
lineNumber: 280,
|
|
5375
|
+
columnNumber: 17
|
|
5376
|
+
}
|
|
5377
|
+
}, captionOfAction)))));
|
|
5378
|
+
};
|
|
5379
|
+
Toast.displayName = 'Toast';
|
|
5380
|
+
Toast.propTypes = {
|
|
5381
|
+
id: PropTypes__default["default"].string,
|
|
5382
|
+
title: PropTypes__default["default"].string,
|
|
5383
|
+
description: PropTypes__default["default"].string,
|
|
5384
|
+
position: PropTypes__default["default"].oneOf(positions).isRequired,
|
|
5385
|
+
dismissAfter: PropTypes__default["default"].number,
|
|
5386
|
+
variant: PropTypes__default["default"].string.isRequired,
|
|
5387
|
+
onClick: PropTypes__default["default"].func,
|
|
5388
|
+
onRemove: PropTypes__default["default"].func,
|
|
5389
|
+
disabledOfflineIntercept: PropTypes__default["default"].bool
|
|
5390
|
+
};
|
|
5391
|
+
Toast.defaultProps = {
|
|
5392
|
+
dismissAfter: 5000
|
|
5393
|
+
};
|
|
5738
5394
|
|
|
5739
|
-
|
|
5395
|
+
const _excluded$s = ["preventDuplicate"];
|
|
5396
|
+
var _jsxFileName$U = "/home/alfiantryp/Projects/majoo-ui/packages/react/src/components/toast/ToastContainer.js";
|
|
5397
|
+
const ToastBox = styled(Flex$1, {
|
|
5398
|
+
position: 'fixed',
|
|
5399
|
+
variants: {
|
|
5400
|
+
position: {
|
|
5401
|
+
[TOP_RIGHT_POSITION]: {
|
|
5402
|
+
top: '8%',
|
|
5403
|
+
right: '4%',
|
|
5404
|
+
flexDirection: 'column-reverse'
|
|
5405
|
+
},
|
|
5406
|
+
[TOP_LEFT_POSITION]: {
|
|
5407
|
+
top: '8%',
|
|
5408
|
+
left: '4%',
|
|
5409
|
+
flexDirection: 'column-reverse'
|
|
5410
|
+
},
|
|
5411
|
+
[BOTTOM_RIGHT_POSITION]: {
|
|
5412
|
+
bottom: '8%',
|
|
5413
|
+
right: '4%',
|
|
5414
|
+
flexDirection: 'column'
|
|
5415
|
+
},
|
|
5416
|
+
[BOTTOM_LEFT_POSITION]: {
|
|
5417
|
+
bottom: '8%',
|
|
5418
|
+
left: '4%',
|
|
5419
|
+
flexDirection: 'column'
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
},
|
|
5423
|
+
defaultVariants: {
|
|
5424
|
+
position: 'top-right'
|
|
5425
|
+
}
|
|
5426
|
+
});
|
|
5427
|
+
const ToastContainer = ({
|
|
5428
|
+
toasts,
|
|
5429
|
+
position
|
|
5430
|
+
}) => {
|
|
5431
|
+
const {
|
|
5432
|
+
removeToast
|
|
5433
|
+
} = React__namespace.useContext(ToastContext);
|
|
5434
|
+
return /*#__PURE__*/React__namespace.createElement(helpers.Portal, {
|
|
5435
|
+
style: {
|
|
5436
|
+
top: 0,
|
|
5437
|
+
left: 0,
|
|
5438
|
+
position: 'absolute',
|
|
5439
|
+
zIndex: 2147483647
|
|
5440
|
+
},
|
|
5441
|
+
__self: undefined,
|
|
5442
|
+
__source: {
|
|
5443
|
+
fileName: _jsxFileName$U,
|
|
5444
|
+
lineNumber: 43,
|
|
5445
|
+
columnNumber: 5
|
|
5446
|
+
}
|
|
5447
|
+
}, /*#__PURE__*/React__namespace.createElement(ToastBox, {
|
|
5448
|
+
position: position,
|
|
5449
|
+
__self: undefined,
|
|
5450
|
+
__source: {
|
|
5451
|
+
fileName: _jsxFileName$U,
|
|
5452
|
+
lineNumber: 44,
|
|
5453
|
+
columnNumber: 7
|
|
5454
|
+
}
|
|
5455
|
+
}, toasts.map((item, index) => {
|
|
5456
|
+
const {
|
|
5457
|
+
preventDuplicate
|
|
5458
|
+
} = item,
|
|
5459
|
+
toast = _objectWithoutPropertiesLoose(item, _excluded$s);
|
|
5460
|
+
return /*#__PURE__*/React__namespace.createElement(Toast, _extends({
|
|
5461
|
+
key: preventDuplicate ? toast.id : `${toast.id}-${index}`,
|
|
5462
|
+
onRemove: () => removeToast(toast.id)
|
|
5463
|
+
}, toast, {
|
|
5464
|
+
__self: undefined,
|
|
5465
|
+
__source: {
|
|
5466
|
+
fileName: _jsxFileName$U,
|
|
5467
|
+
lineNumber: 47,
|
|
5468
|
+
columnNumber: 18
|
|
5469
|
+
}
|
|
5470
|
+
}));
|
|
5471
|
+
})));
|
|
5472
|
+
};
|
|
5740
5473
|
|
|
5741
|
-
var
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5474
|
+
var getOnLineStatus = function getOnLineStatus() {
|
|
5475
|
+
return typeof navigator !== 'undefined' && typeof navigator.onLine === 'boolean' ? navigator.onLine : true;
|
|
5476
|
+
};
|
|
5477
|
+
var useNavigatorOnLine = function useNavigatorOnLine() {
|
|
5478
|
+
var _a = React__default["default"].useState(getOnLineStatus()),
|
|
5479
|
+
status = _a[0],
|
|
5480
|
+
setStatus = _a[1];
|
|
5481
|
+
var setOnline = function setOnline() {
|
|
5482
|
+
return setStatus(true);
|
|
5483
|
+
};
|
|
5484
|
+
var setOffline = function setOffline() {
|
|
5485
|
+
return setStatus(false);
|
|
5486
|
+
};
|
|
5487
|
+
React__default["default"].useEffect(function () {
|
|
5488
|
+
window.addEventListener('online', setOnline);
|
|
5489
|
+
window.addEventListener('offline', setOffline);
|
|
5490
|
+
return function () {
|
|
5491
|
+
window.removeEventListener('online', setOnline);
|
|
5492
|
+
window.removeEventListener('offline', setOffline);
|
|
5493
|
+
};
|
|
5494
|
+
}, []);
|
|
5495
|
+
return status;
|
|
5745
5496
|
};
|
|
5746
5497
|
|
|
5747
|
-
var
|
|
5748
|
-
var aCallable$4 = aCallable$a;
|
|
5749
|
-
var anObject$c = anObject$j;
|
|
5750
|
-
var tryToString$2 = tryToString$5;
|
|
5751
|
-
var getIteratorMethod$3 = getIteratorMethod$4;
|
|
5498
|
+
var classof$5 = classofRaw$2;
|
|
5752
5499
|
|
|
5753
|
-
var $
|
|
5500
|
+
var engineIsNode = typeof process != 'undefined' && classof$5(process) == 'process';
|
|
5754
5501
|
|
|
5755
|
-
var
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
};
|
|
5502
|
+
var getBuiltIn$3 = getBuiltIn$7;
|
|
5503
|
+
var defineBuiltInAccessor$2 = defineBuiltInAccessor$4;
|
|
5504
|
+
var wellKnownSymbol$a = wellKnownSymbol$l;
|
|
5505
|
+
var DESCRIPTORS$4 = descriptors;
|
|
5760
5506
|
|
|
5761
|
-
var
|
|
5762
|
-
var anObject$b = anObject$j;
|
|
5763
|
-
var getMethod$4 = getMethod$7;
|
|
5507
|
+
var SPECIES$3 = wellKnownSymbol$a('species');
|
|
5764
5508
|
|
|
5765
|
-
var
|
|
5766
|
-
var
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
}
|
|
5774
|
-
innerResult = call$e(innerResult, iterator);
|
|
5775
|
-
} catch (error) {
|
|
5776
|
-
innerError = true;
|
|
5777
|
-
innerResult = error;
|
|
5509
|
+
var setSpecies$2 = function (CONSTRUCTOR_NAME) {
|
|
5510
|
+
var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
|
|
5511
|
+
|
|
5512
|
+
if (DESCRIPTORS$4 && Constructor && !Constructor[SPECIES$3]) {
|
|
5513
|
+
defineBuiltInAccessor$2(Constructor, SPECIES$3, {
|
|
5514
|
+
configurable: true,
|
|
5515
|
+
get: function () { return this; }
|
|
5516
|
+
});
|
|
5778
5517
|
}
|
|
5779
|
-
if (kind === 'throw') throw value;
|
|
5780
|
-
if (innerError) throw innerResult;
|
|
5781
|
-
anObject$b(innerResult);
|
|
5782
|
-
return value;
|
|
5783
5518
|
};
|
|
5784
5519
|
|
|
5785
|
-
var
|
|
5786
|
-
var call$d = functionCall;
|
|
5787
|
-
var anObject$a = anObject$j;
|
|
5788
|
-
var tryToString$1 = tryToString$5;
|
|
5789
|
-
var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
|
|
5790
|
-
var lengthOfArrayLike$4 = lengthOfArrayLike$6;
|
|
5791
|
-
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
5792
|
-
var getIterator$2 = getIterator$3;
|
|
5793
|
-
var getIteratorMethod$2 = getIteratorMethod$4;
|
|
5794
|
-
var iteratorClose$1 = iteratorClose$2;
|
|
5520
|
+
var isPrototypeOf$3 = objectIsPrototypeOf;
|
|
5795
5521
|
|
|
5796
|
-
var $TypeError$
|
|
5522
|
+
var $TypeError$8 = TypeError;
|
|
5797
5523
|
|
|
5798
|
-
var
|
|
5799
|
-
|
|
5800
|
-
|
|
5524
|
+
var anInstance$3 = function (it, Prototype) {
|
|
5525
|
+
if (isPrototypeOf$3(Prototype, it)) return it;
|
|
5526
|
+
throw $TypeError$8('Incorrect invocation');
|
|
5801
5527
|
};
|
|
5802
5528
|
|
|
5803
|
-
var
|
|
5804
|
-
|
|
5805
|
-
var
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
5810
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
5811
|
-
var fn = bind$3(unboundFunction, that);
|
|
5812
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
5813
|
-
|
|
5814
|
-
var stop = function (condition) {
|
|
5815
|
-
if (iterator) iteratorClose$1(iterator, 'normal', condition);
|
|
5816
|
-
return new Result(true, condition);
|
|
5817
|
-
};
|
|
5529
|
+
var uncurryThis$m = functionUncurryThis;
|
|
5530
|
+
var fails$g = fails$t;
|
|
5531
|
+
var isCallable$8 = isCallable$p;
|
|
5532
|
+
var classof$4 = classof$8;
|
|
5533
|
+
var getBuiltIn$2 = getBuiltIn$7;
|
|
5534
|
+
var inspectSource$1 = inspectSource$3;
|
|
5818
5535
|
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5536
|
+
var noop$1 = function () { /* empty */ };
|
|
5537
|
+
var empty = [];
|
|
5538
|
+
var construct = getBuiltIn$2('Reflect', 'construct');
|
|
5539
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
5540
|
+
var exec$6 = uncurryThis$m(constructorRegExp.exec);
|
|
5541
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
|
|
5825
5542
|
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
// optimisation for array iterators
|
|
5834
|
-
if (isArrayIteratorMethod$1(iterFn)) {
|
|
5835
|
-
for (index = 0, length = lengthOfArrayLike$4(iterable); length > index; index++) {
|
|
5836
|
-
result = callFn(iterable[index]);
|
|
5837
|
-
if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
|
|
5838
|
-
} return new Result(false);
|
|
5839
|
-
}
|
|
5840
|
-
iterator = getIterator$2(iterable, iterFn);
|
|
5543
|
+
var isConstructorModern = function isConstructor(argument) {
|
|
5544
|
+
if (!isCallable$8(argument)) return false;
|
|
5545
|
+
try {
|
|
5546
|
+
construct(noop$1, empty, argument);
|
|
5547
|
+
return true;
|
|
5548
|
+
} catch (error) {
|
|
5549
|
+
return false;
|
|
5841
5550
|
}
|
|
5551
|
+
};
|
|
5842
5552
|
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5553
|
+
var isConstructorLegacy = function isConstructor(argument) {
|
|
5554
|
+
if (!isCallable$8(argument)) return false;
|
|
5555
|
+
switch (classof$4(argument)) {
|
|
5556
|
+
case 'AsyncFunction':
|
|
5557
|
+
case 'GeneratorFunction':
|
|
5558
|
+
case 'AsyncGeneratorFunction': return false;
|
|
5559
|
+
}
|
|
5560
|
+
try {
|
|
5561
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
5562
|
+
// `Function#toString` throws on some built-it function in some legacy engines
|
|
5563
|
+
// (for example, `DOMQuad` and similar in FF41-)
|
|
5564
|
+
return INCORRECT_TO_STRING || !!exec$6(constructorRegExp, inspectSource$1(argument));
|
|
5565
|
+
} catch (error) {
|
|
5566
|
+
return true;
|
|
5567
|
+
}
|
|
5852
5568
|
};
|
|
5853
5569
|
|
|
5854
|
-
|
|
5570
|
+
isConstructorLegacy.sham = true;
|
|
5855
5571
|
|
|
5856
|
-
|
|
5857
|
-
|
|
5572
|
+
// `IsConstructor` abstract operation
|
|
5573
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
5574
|
+
var isConstructor$2 = !construct || fails$g(function () {
|
|
5575
|
+
var called;
|
|
5576
|
+
return isConstructorModern(isConstructorModern.call)
|
|
5577
|
+
|| !isConstructorModern(Object)
|
|
5578
|
+
|| !isConstructorModern(function () { called = true; })
|
|
5579
|
+
|| called;
|
|
5580
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
5858
5581
|
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
var iteratorWithReturn = {
|
|
5862
|
-
next: function () {
|
|
5863
|
-
return { done: !!called++ };
|
|
5864
|
-
},
|
|
5865
|
-
'return': function () {
|
|
5866
|
-
SAFE_CLOSING = true;
|
|
5867
|
-
}
|
|
5868
|
-
};
|
|
5869
|
-
iteratorWithReturn[ITERATOR$4] = function () {
|
|
5870
|
-
return this;
|
|
5871
|
-
};
|
|
5872
|
-
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
5873
|
-
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
5874
|
-
} catch (error) { /* empty */ }
|
|
5582
|
+
var isConstructor$1 = isConstructor$2;
|
|
5583
|
+
var tryToString$3 = tryToString$5;
|
|
5875
5584
|
|
|
5876
|
-
var
|
|
5877
|
-
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
5878
|
-
var ITERATION_SUPPORT = false;
|
|
5879
|
-
try {
|
|
5880
|
-
var object = {};
|
|
5881
|
-
object[ITERATOR$4] = function () {
|
|
5882
|
-
return {
|
|
5883
|
-
next: function () {
|
|
5884
|
-
return { done: ITERATION_SUPPORT = true };
|
|
5885
|
-
}
|
|
5886
|
-
};
|
|
5887
|
-
};
|
|
5888
|
-
exec(object);
|
|
5889
|
-
} catch (error) { /* empty */ }
|
|
5890
|
-
return ITERATION_SUPPORT;
|
|
5891
|
-
};
|
|
5585
|
+
var $TypeError$7 = TypeError;
|
|
5892
5586
|
|
|
5893
|
-
|
|
5894
|
-
var
|
|
5895
|
-
|
|
5587
|
+
// `Assert: IsConstructor(argument) is true`
|
|
5588
|
+
var aConstructor$1 = function (argument) {
|
|
5589
|
+
if (isConstructor$1(argument)) return argument;
|
|
5590
|
+
throw $TypeError$7(tryToString$3(argument) + ' is not a constructor');
|
|
5591
|
+
};
|
|
5896
5592
|
|
|
5897
|
-
var
|
|
5898
|
-
|
|
5899
|
-
|
|
5593
|
+
var anObject$d = anObject$j;
|
|
5594
|
+
var aConstructor = aConstructor$1;
|
|
5595
|
+
var isNullOrUndefined$5 = isNullOrUndefined$8;
|
|
5596
|
+
var wellKnownSymbol$9 = wellKnownSymbol$l;
|
|
5900
5597
|
|
|
5901
|
-
var
|
|
5902
|
-
var call$c = functionCall;
|
|
5903
|
-
var aCallable$3 = aCallable$a;
|
|
5904
|
-
var newPromiseCapabilityModule$2 = newPromiseCapability$2;
|
|
5905
|
-
var perform$1 = perform$3;
|
|
5906
|
-
var iterate$1 = iterate$2;
|
|
5907
|
-
var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
|
|
5598
|
+
var SPECIES$2 = wellKnownSymbol$9('species');
|
|
5908
5599
|
|
|
5909
|
-
// `
|
|
5910
|
-
// https://tc39.es/ecma262/#sec-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
var reject = capability.reject;
|
|
5917
|
-
var result = perform$1(function () {
|
|
5918
|
-
var $promiseResolve = aCallable$3(C.resolve);
|
|
5919
|
-
var values = [];
|
|
5920
|
-
var counter = 0;
|
|
5921
|
-
var remaining = 1;
|
|
5922
|
-
iterate$1(iterable, function (promise) {
|
|
5923
|
-
var index = counter++;
|
|
5924
|
-
var alreadyCalled = false;
|
|
5925
|
-
remaining++;
|
|
5926
|
-
call$c($promiseResolve, C, promise).then(function (value) {
|
|
5927
|
-
if (alreadyCalled) return;
|
|
5928
|
-
alreadyCalled = true;
|
|
5929
|
-
values[index] = value;
|
|
5930
|
-
--remaining || resolve(values);
|
|
5931
|
-
}, reject);
|
|
5932
|
-
});
|
|
5933
|
-
--remaining || resolve(values);
|
|
5934
|
-
});
|
|
5935
|
-
if (result.error) reject(result.value);
|
|
5936
|
-
return capability.promise;
|
|
5937
|
-
}
|
|
5938
|
-
});
|
|
5600
|
+
// `SpeciesConstructor` abstract operation
|
|
5601
|
+
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
5602
|
+
var speciesConstructor$2 = function (O, defaultConstructor) {
|
|
5603
|
+
var C = anObject$d(O).constructor;
|
|
5604
|
+
var S;
|
|
5605
|
+
return C === undefined || isNullOrUndefined$5(S = anObject$d(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
|
|
5606
|
+
};
|
|
5939
5607
|
|
|
5940
|
-
var
|
|
5941
|
-
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
|
5942
|
-
var NativePromiseConstructor = promiseNativeConstructor;
|
|
5943
|
-
var getBuiltIn$1 = getBuiltIn$7;
|
|
5944
|
-
var isCallable$4 = isCallable$p;
|
|
5945
|
-
var defineBuiltIn$6 = defineBuiltIn$b;
|
|
5608
|
+
var NATIVE_BIND$1 = functionBindNative;
|
|
5946
5609
|
|
|
5947
|
-
var
|
|
5610
|
+
var FunctionPrototype = Function.prototype;
|
|
5611
|
+
var apply$3 = FunctionPrototype.apply;
|
|
5612
|
+
var call$h = FunctionPrototype.call;
|
|
5948
5613
|
|
|
5949
|
-
//
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
'catch': function (onRejected) {
|
|
5953
|
-
return this.then(undefined, onRejected);
|
|
5954
|
-
}
|
|
5614
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
5615
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$h.bind(apply$3) : function () {
|
|
5616
|
+
return call$h.apply(apply$3, arguments);
|
|
5955
5617
|
});
|
|
5956
5618
|
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
var method = getBuiltIn$1('Promise').prototype['catch'];
|
|
5960
|
-
if (NativePromisePrototype['catch'] !== method) {
|
|
5961
|
-
defineBuiltIn$6(NativePromisePrototype, 'catch', method, { unsafe: true });
|
|
5962
|
-
}
|
|
5963
|
-
}
|
|
5619
|
+
var classofRaw = classofRaw$2;
|
|
5620
|
+
var uncurryThis$l = functionUncurryThis;
|
|
5964
5621
|
|
|
5965
|
-
var
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
|
|
5622
|
+
var functionUncurryThisClause = function (fn) {
|
|
5623
|
+
// Nashorn bug:
|
|
5624
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
5625
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
5626
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$l(fn);
|
|
5627
|
+
};
|
|
5972
5628
|
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
race: function race(iterable) {
|
|
5977
|
-
var C = this;
|
|
5978
|
-
var capability = newPromiseCapabilityModule$1.f(C);
|
|
5979
|
-
var reject = capability.reject;
|
|
5980
|
-
var result = perform(function () {
|
|
5981
|
-
var $promiseResolve = aCallable$2(C.resolve);
|
|
5982
|
-
iterate(iterable, function (promise) {
|
|
5983
|
-
call$b($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
5984
|
-
});
|
|
5985
|
-
});
|
|
5986
|
-
if (result.error) reject(result.value);
|
|
5987
|
-
return capability.promise;
|
|
5988
|
-
}
|
|
5989
|
-
});
|
|
5629
|
+
var uncurryThis$k = functionUncurryThisClause;
|
|
5630
|
+
var aCallable$7 = aCallable$a;
|
|
5631
|
+
var NATIVE_BIND = functionBindNative;
|
|
5990
5632
|
|
|
5991
|
-
var
|
|
5992
|
-
var call$a = functionCall;
|
|
5993
|
-
var newPromiseCapabilityModule = newPromiseCapability$2;
|
|
5994
|
-
var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
|
|
5633
|
+
var bind$7 = uncurryThis$k(uncurryThis$k.bind);
|
|
5995
5634
|
|
|
5996
|
-
//
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
}
|
|
6004
|
-
});
|
|
5635
|
+
// optional / simple context binding
|
|
5636
|
+
var functionBindContext = function (fn, that) {
|
|
5637
|
+
aCallable$7(fn);
|
|
5638
|
+
return that === undefined ? fn : NATIVE_BIND ? bind$7(fn, that) : function (/* ...args */) {
|
|
5639
|
+
return fn.apply(that, arguments);
|
|
5640
|
+
};
|
|
5641
|
+
};
|
|
6005
5642
|
|
|
6006
|
-
var
|
|
6007
|
-
var isObject$6 = isObject$e;
|
|
6008
|
-
var newPromiseCapability = newPromiseCapability$2;
|
|
5643
|
+
var uncurryThis$j = functionUncurryThis;
|
|
6009
5644
|
|
|
6010
|
-
var
|
|
6011
|
-
anObject$9(C);
|
|
6012
|
-
if (isObject$6(x) && x.constructor === C) return x;
|
|
6013
|
-
var promiseCapability = newPromiseCapability.f(C);
|
|
6014
|
-
var resolve = promiseCapability.resolve;
|
|
6015
|
-
resolve(x);
|
|
6016
|
-
return promiseCapability.promise;
|
|
6017
|
-
};
|
|
5645
|
+
var arraySlice$4 = uncurryThis$j([].slice);
|
|
6018
5646
|
|
|
6019
|
-
var
|
|
6020
|
-
var getBuiltIn = getBuiltIn$7;
|
|
6021
|
-
var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
|
|
6022
|
-
var promiseResolve = promiseResolve$1;
|
|
5647
|
+
var $TypeError$6 = TypeError;
|
|
6023
5648
|
|
|
6024
|
-
|
|
5649
|
+
var validateArgumentsLength$3 = function (passed, required) {
|
|
5650
|
+
if (passed < required) throw $TypeError$6('Not enough arguments');
|
|
5651
|
+
return passed;
|
|
5652
|
+
};
|
|
6025
5653
|
|
|
6026
|
-
|
|
6027
|
-
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
6028
|
-
$$g({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
6029
|
-
resolve: function resolve(x) {
|
|
6030
|
-
return promiseResolve(this, x);
|
|
6031
|
-
}
|
|
6032
|
-
});
|
|
5654
|
+
var userAgent$4 = engineUserAgent;
|
|
6033
5655
|
|
|
6034
|
-
|
|
6035
|
-
var
|
|
5656
|
+
// eslint-disable-next-line redos/no-vulnerable -- safe
|
|
5657
|
+
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4);
|
|
5658
|
+
|
|
5659
|
+
var global$d = global$p;
|
|
5660
|
+
var apply$2 = functionApply;
|
|
5661
|
+
var bind$6 = functionBindContext;
|
|
5662
|
+
var isCallable$7 = isCallable$p;
|
|
5663
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
6036
5664
|
var fails$f = fails$t;
|
|
6037
|
-
var
|
|
5665
|
+
var html = html$2;
|
|
5666
|
+
var arraySlice$3 = arraySlice$4;
|
|
5667
|
+
var createElement = documentCreateElement$2;
|
|
5668
|
+
var validateArgumentsLength$2 = validateArgumentsLength$3;
|
|
5669
|
+
var IS_IOS$1 = engineIsIos;
|
|
5670
|
+
var IS_NODE$4 = engineIsNode;
|
|
6038
5671
|
|
|
6039
|
-
|
|
6040
|
-
var
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
5672
|
+
var set = global$d.setImmediate;
|
|
5673
|
+
var clear = global$d.clearImmediate;
|
|
5674
|
+
var process$3 = global$d.process;
|
|
5675
|
+
var Dispatch = global$d.Dispatch;
|
|
5676
|
+
var Function$1 = global$d.Function;
|
|
5677
|
+
var MessageChannel = global$d.MessageChannel;
|
|
5678
|
+
var String$1 = global$d.String;
|
|
5679
|
+
var counter = 0;
|
|
5680
|
+
var queue$2 = {};
|
|
5681
|
+
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
5682
|
+
var $location, defer, channel, port;
|
|
6044
5683
|
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
includes: function includes(el /* , fromIndex = 0 */) {
|
|
6049
|
-
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
6050
|
-
}
|
|
5684
|
+
fails$f(function () {
|
|
5685
|
+
// Deno throws a ReferenceError on `location` access without `--location` flag
|
|
5686
|
+
$location = global$d.location;
|
|
6051
5687
|
});
|
|
6052
5688
|
|
|
6053
|
-
|
|
6054
|
-
|
|
5689
|
+
var run = function (id) {
|
|
5690
|
+
if (hasOwn$4(queue$2, id)) {
|
|
5691
|
+
var fn = queue$2[id];
|
|
5692
|
+
delete queue$2[id];
|
|
5693
|
+
fn();
|
|
5694
|
+
}
|
|
5695
|
+
};
|
|
6055
5696
|
|
|
6056
|
-
var
|
|
6057
|
-
|
|
6058
|
-
|
|
5697
|
+
var runner = function (id) {
|
|
5698
|
+
return function () {
|
|
5699
|
+
run(id);
|
|
5700
|
+
};
|
|
5701
|
+
};
|
|
6059
5702
|
|
|
6060
|
-
var
|
|
5703
|
+
var eventListener = function (event) {
|
|
5704
|
+
run(event.data);
|
|
5705
|
+
};
|
|
6061
5706
|
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
var isRegExp;
|
|
6066
|
-
return isObject$5(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
|
|
5707
|
+
var globalPostMessageDefer = function (id) {
|
|
5708
|
+
// old engines have not location.origin
|
|
5709
|
+
global$d.postMessage(String$1(id), $location.protocol + '//' + $location.host);
|
|
6067
5710
|
};
|
|
6068
5711
|
|
|
6069
|
-
|
|
5712
|
+
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
|
|
5713
|
+
if (!set || !clear) {
|
|
5714
|
+
set = function setImmediate(handler) {
|
|
5715
|
+
validateArgumentsLength$2(arguments.length, 1);
|
|
5716
|
+
var fn = isCallable$7(handler) ? handler : Function$1(handler);
|
|
5717
|
+
var args = arraySlice$3(arguments, 1);
|
|
5718
|
+
queue$2[++counter] = function () {
|
|
5719
|
+
apply$2(fn, undefined, args);
|
|
5720
|
+
};
|
|
5721
|
+
defer(counter);
|
|
5722
|
+
return counter;
|
|
5723
|
+
};
|
|
5724
|
+
clear = function clearImmediate(id) {
|
|
5725
|
+
delete queue$2[id];
|
|
5726
|
+
};
|
|
5727
|
+
// Node.js 0.8-
|
|
5728
|
+
if (IS_NODE$4) {
|
|
5729
|
+
defer = function (id) {
|
|
5730
|
+
process$3.nextTick(runner(id));
|
|
5731
|
+
};
|
|
5732
|
+
// Sphere (JS game engine) Dispatch API
|
|
5733
|
+
} else if (Dispatch && Dispatch.now) {
|
|
5734
|
+
defer = function (id) {
|
|
5735
|
+
Dispatch.now(runner(id));
|
|
5736
|
+
};
|
|
5737
|
+
// Browsers with MessageChannel, includes WebWorkers
|
|
5738
|
+
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
5739
|
+
} else if (MessageChannel && !IS_IOS$1) {
|
|
5740
|
+
channel = new MessageChannel();
|
|
5741
|
+
port = channel.port2;
|
|
5742
|
+
channel.port1.onmessage = eventListener;
|
|
5743
|
+
defer = bind$6(port.postMessage, port);
|
|
5744
|
+
// Browsers with postMessage, skip WebWorkers
|
|
5745
|
+
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
|
|
5746
|
+
} else if (
|
|
5747
|
+
global$d.addEventListener &&
|
|
5748
|
+
isCallable$7(global$d.postMessage) &&
|
|
5749
|
+
!global$d.importScripts &&
|
|
5750
|
+
$location && $location.protocol !== 'file:' &&
|
|
5751
|
+
!fails$f(globalPostMessageDefer)
|
|
5752
|
+
) {
|
|
5753
|
+
defer = globalPostMessageDefer;
|
|
5754
|
+
global$d.addEventListener('message', eventListener, false);
|
|
5755
|
+
// IE8-
|
|
5756
|
+
} else if (ONREADYSTATECHANGE in createElement('script')) {
|
|
5757
|
+
defer = function (id) {
|
|
5758
|
+
html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
|
5759
|
+
html.removeChild(this);
|
|
5760
|
+
run(id);
|
|
5761
|
+
};
|
|
5762
|
+
};
|
|
5763
|
+
// Rest old browsers
|
|
5764
|
+
} else {
|
|
5765
|
+
defer = function (id) {
|
|
5766
|
+
setTimeout(runner(id), 0);
|
|
5767
|
+
};
|
|
5768
|
+
}
|
|
5769
|
+
}
|
|
6070
5770
|
|
|
6071
|
-
var $
|
|
5771
|
+
var task$1 = {
|
|
5772
|
+
set: set,
|
|
5773
|
+
clear: clear
|
|
5774
|
+
};
|
|
6072
5775
|
|
|
6073
|
-
var
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
} return it;
|
|
5776
|
+
var Queue$2 = function () {
|
|
5777
|
+
this.head = null;
|
|
5778
|
+
this.tail = null;
|
|
6077
5779
|
};
|
|
6078
5780
|
|
|
6079
|
-
|
|
5781
|
+
Queue$2.prototype = {
|
|
5782
|
+
add: function (item) {
|
|
5783
|
+
var entry = { item: item, next: null };
|
|
5784
|
+
var tail = this.tail;
|
|
5785
|
+
if (tail) tail.next = entry;
|
|
5786
|
+
else this.head = entry;
|
|
5787
|
+
this.tail = entry;
|
|
5788
|
+
},
|
|
5789
|
+
get: function () {
|
|
5790
|
+
var entry = this.head;
|
|
5791
|
+
if (entry) {
|
|
5792
|
+
var next = this.head = entry.next;
|
|
5793
|
+
if (next === null) this.tail = null;
|
|
5794
|
+
return entry.item;
|
|
5795
|
+
}
|
|
5796
|
+
}
|
|
5797
|
+
};
|
|
6080
5798
|
|
|
6081
|
-
var
|
|
5799
|
+
var queue$1 = Queue$2;
|
|
6082
5800
|
|
|
6083
|
-
var
|
|
6084
|
-
var regexp = /./;
|
|
6085
|
-
try {
|
|
6086
|
-
'/./'[METHOD_NAME](regexp);
|
|
6087
|
-
} catch (error1) {
|
|
6088
|
-
try {
|
|
6089
|
-
regexp[MATCH$1] = false;
|
|
6090
|
-
return '/./'[METHOD_NAME](regexp);
|
|
6091
|
-
} catch (error2) { /* empty */ }
|
|
6092
|
-
} return false;
|
|
6093
|
-
};
|
|
5801
|
+
var userAgent$3 = engineUserAgent;
|
|
6094
5802
|
|
|
6095
|
-
var
|
|
6096
|
-
var uncurryThis$j = functionUncurryThis;
|
|
6097
|
-
var notARegExp$2 = notARegexp;
|
|
6098
|
-
var requireObjectCoercible$9 = requireObjectCoercible$c;
|
|
6099
|
-
var toString$h = toString$j;
|
|
6100
|
-
var correctIsRegExpLogic$2 = correctIsRegexpLogic;
|
|
5803
|
+
var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && typeof Pebble != 'undefined';
|
|
6101
5804
|
|
|
6102
|
-
var
|
|
5805
|
+
var userAgent$2 = engineUserAgent;
|
|
6103
5806
|
|
|
6104
|
-
|
|
6105
|
-
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
6106
|
-
$$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
|
|
6107
|
-
includes: function includes(searchString /* , position = 0 */) {
|
|
6108
|
-
return !!~stringIndexOf$2(
|
|
6109
|
-
toString$h(requireObjectCoercible$9(this)),
|
|
6110
|
-
toString$h(notARegExp$2(searchString)),
|
|
6111
|
-
arguments.length > 1 ? arguments[1] : undefined
|
|
6112
|
-
);
|
|
6113
|
-
}
|
|
6114
|
-
});
|
|
5807
|
+
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2);
|
|
6115
5808
|
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
};
|
|
6126
|
-
media.addEventListener('change', listener);
|
|
6127
|
-
return () => media.removeEventListener('change', listener);
|
|
6128
|
-
}, [matches, query]);
|
|
6129
|
-
return matches;
|
|
6130
|
-
}
|
|
5809
|
+
var global$c = global$p;
|
|
5810
|
+
var bind$5 = functionBindContext;
|
|
5811
|
+
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
|
5812
|
+
var macrotask = task$1.set;
|
|
5813
|
+
var Queue$1 = queue$1;
|
|
5814
|
+
var IS_IOS = engineIsIos;
|
|
5815
|
+
var IS_IOS_PEBBLE = engineIsIosPebble;
|
|
5816
|
+
var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
|
|
5817
|
+
var IS_NODE$3 = engineIsNode;
|
|
6131
5818
|
|
|
6132
|
-
|
|
6133
|
-
var
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
const toastExit = position => keyframes({
|
|
6154
|
-
'0%': {
|
|
6155
|
-
transform: 'translateX(0%)',
|
|
6156
|
-
opacity: '1'
|
|
6157
|
-
},
|
|
6158
|
-
'100%': {
|
|
6159
|
-
transform: `translateX(${position === 'right' ? '100%' : '-100%'})`,
|
|
6160
|
-
opacity: '0'
|
|
6161
|
-
}
|
|
6162
|
-
});
|
|
6163
|
-
const toastAnimationStyle = position => ({
|
|
6164
|
-
'&[state="entering"], &[state="entered"]': {
|
|
6165
|
-
animationFillMode: 'forwards',
|
|
6166
|
-
animationName: toastEnter(position),
|
|
6167
|
-
animationDuration: `${ANIMATION_DURATION}ms`
|
|
6168
|
-
},
|
|
6169
|
-
'&[state="exiting"]': {
|
|
6170
|
-
animationFillMode: 'forwards',
|
|
6171
|
-
animationName: toastExit(position),
|
|
6172
|
-
animationDuration: `${ANIMATION_DURATION * 2}ms`
|
|
6173
|
-
},
|
|
6174
|
-
'&[state="entered"]': {
|
|
6175
|
-
right: 0,
|
|
6176
|
-
opacity: '1'
|
|
6177
|
-
}
|
|
6178
|
-
});
|
|
6179
|
-
const Root = styled('div', {
|
|
6180
|
-
display: 'block',
|
|
6181
|
-
maxWidth: `${TOAST_WIDTH}px`,
|
|
6182
|
-
// width: `${TOAST_WIDTH}px`,
|
|
6183
|
-
height: '100%',
|
|
6184
|
-
position: 'relative',
|
|
6185
|
-
opacity: 0,
|
|
6186
|
-
variants: {
|
|
6187
|
-
hPosition: {
|
|
6188
|
-
right: toastAnimationStyle('right'),
|
|
6189
|
-
left: toastAnimationStyle('left')
|
|
6190
|
-
},
|
|
6191
|
-
vPosition: {
|
|
6192
|
-
top: {
|
|
6193
|
-
marginTop: '$spacing-05'
|
|
6194
|
-
},
|
|
6195
|
-
bottom: {
|
|
6196
|
-
marginBottom: '$spacing-05'
|
|
6197
|
-
}
|
|
6198
|
-
}
|
|
6199
|
-
}
|
|
6200
|
-
});
|
|
6201
|
-
const StyledToast = styled(Flex$1, {
|
|
6202
|
-
// width: '100%',
|
|
6203
|
-
// maxWidth: TOAST_WIDTH,
|
|
6204
|
-
padding: '$spacing-03',
|
|
6205
|
-
textAlign: 'left',
|
|
6206
|
-
borderRadius: 8,
|
|
6207
|
-
pointer: 'default',
|
|
6208
|
-
variants: {
|
|
6209
|
-
variant: {
|
|
6210
|
-
info: {
|
|
6211
|
-
backgroundColor: '$blue100',
|
|
6212
|
-
border: '1px solid $hlNews'
|
|
6213
|
-
},
|
|
6214
|
-
warning: {
|
|
6215
|
-
backgroundColor: '$bgProcess',
|
|
6216
|
-
border: '1px solid $hlProcess'
|
|
6217
|
-
},
|
|
6218
|
-
success: {
|
|
6219
|
-
backgroundColor: '$bgSuccess',
|
|
6220
|
-
border: '1px solid $hlSuccess'
|
|
6221
|
-
},
|
|
6222
|
-
failed: {
|
|
6223
|
-
backgroundColor: '$bgFailed',
|
|
6224
|
-
border: '1px solid $hlFailed'
|
|
6225
|
-
},
|
|
6226
|
-
pending: {
|
|
6227
|
-
backgroundColor: '$bgProcess',
|
|
6228
|
-
border: '1px solid $orange500'
|
|
6229
|
-
}
|
|
6230
|
-
},
|
|
6231
|
-
hasAction: {
|
|
6232
|
-
true: {
|
|
6233
|
-
cursor: 'pointer'
|
|
6234
|
-
}
|
|
6235
|
-
}
|
|
6236
|
-
}
|
|
6237
|
-
});
|
|
6238
|
-
const LeftBar = styled('div', {
|
|
6239
|
-
width: '4px',
|
|
6240
|
-
alignSelf: 'stretch',
|
|
6241
|
-
borderRadius: '$lg',
|
|
6242
|
-
marginRight: '$spacing-03',
|
|
6243
|
-
variants: {
|
|
6244
|
-
variant: {
|
|
6245
|
-
info: {
|
|
6246
|
-
backgroundColor: '$hlNews'
|
|
6247
|
-
},
|
|
6248
|
-
warning: {
|
|
6249
|
-
backgroundColor: '$hlProcess'
|
|
6250
|
-
},
|
|
6251
|
-
success: {
|
|
6252
|
-
backgroundColor: '$hlSuccess'
|
|
6253
|
-
},
|
|
6254
|
-
failed: {
|
|
6255
|
-
backgroundColor: '$hlFailed'
|
|
6256
|
-
},
|
|
6257
|
-
pending: {
|
|
6258
|
-
backgroundColor: '$orange500'
|
|
6259
|
-
}
|
|
5819
|
+
var MutationObserver = global$c.MutationObserver || global$c.WebKitMutationObserver;
|
|
5820
|
+
var document$2 = global$c.document;
|
|
5821
|
+
var process$2 = global$c.process;
|
|
5822
|
+
var Promise$1 = global$c.Promise;
|
|
5823
|
+
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
5824
|
+
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global$c, 'queueMicrotask');
|
|
5825
|
+
var microtask$1 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
5826
|
+
var notify$1, toggle, node, promise, then;
|
|
5827
|
+
|
|
5828
|
+
// modern engines have queueMicrotask method
|
|
5829
|
+
if (!microtask$1) {
|
|
5830
|
+
var queue = new Queue$1();
|
|
5831
|
+
|
|
5832
|
+
var flush = function () {
|
|
5833
|
+
var parent, fn;
|
|
5834
|
+
if (IS_NODE$3 && (parent = process$2.domain)) parent.exit();
|
|
5835
|
+
while (fn = queue.get()) try {
|
|
5836
|
+
fn();
|
|
5837
|
+
} catch (error) {
|
|
5838
|
+
if (queue.head) notify$1();
|
|
5839
|
+
throw error;
|
|
6260
5840
|
}
|
|
5841
|
+
if (parent) parent.enter();
|
|
5842
|
+
};
|
|
5843
|
+
|
|
5844
|
+
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
5845
|
+
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
5846
|
+
if (!IS_IOS && !IS_NODE$3 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
|
5847
|
+
toggle = true;
|
|
5848
|
+
node = document$2.createTextNode('');
|
|
5849
|
+
new MutationObserver(flush).observe(node, { characterData: true });
|
|
5850
|
+
notify$1 = function () {
|
|
5851
|
+
node.data = toggle = !toggle;
|
|
5852
|
+
};
|
|
5853
|
+
// environments with maybe non-completely correct, but existent Promise
|
|
5854
|
+
} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
|
5855
|
+
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
5856
|
+
promise = Promise$1.resolve(undefined);
|
|
5857
|
+
// workaround of WebKit ~ iOS Safari 10.1 bug
|
|
5858
|
+
promise.constructor = Promise$1;
|
|
5859
|
+
then = bind$5(promise.then, promise);
|
|
5860
|
+
notify$1 = function () {
|
|
5861
|
+
then(flush);
|
|
5862
|
+
};
|
|
5863
|
+
// Node.js without promises
|
|
5864
|
+
} else if (IS_NODE$3) {
|
|
5865
|
+
notify$1 = function () {
|
|
5866
|
+
process$2.nextTick(flush);
|
|
5867
|
+
};
|
|
5868
|
+
// for other environments - macrotask based on:
|
|
5869
|
+
// - setImmediate
|
|
5870
|
+
// - MessageChannel
|
|
5871
|
+
// - window.postMessage
|
|
5872
|
+
// - onreadystatechange
|
|
5873
|
+
// - setTimeout
|
|
5874
|
+
} else {
|
|
5875
|
+
// `webpack` dev server bug on IE global methods - use bind(fn, global)
|
|
5876
|
+
macrotask = bind$5(macrotask, global$c);
|
|
5877
|
+
notify$1 = function () {
|
|
5878
|
+
macrotask(flush);
|
|
5879
|
+
};
|
|
6261
5880
|
}
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
}
|
|
5881
|
+
|
|
5882
|
+
microtask$1 = function (fn) {
|
|
5883
|
+
if (!queue.head) notify$1();
|
|
5884
|
+
queue.add(fn);
|
|
5885
|
+
};
|
|
5886
|
+
}
|
|
5887
|
+
|
|
5888
|
+
var microtask_1 = microtask$1;
|
|
5889
|
+
|
|
5890
|
+
var hostReportErrors$1 = function (a, b) {
|
|
5891
|
+
try {
|
|
5892
|
+
// eslint-disable-next-line no-console -- safe
|
|
5893
|
+
arguments.length == 1 ? console.error(a) : console.error(a, b);
|
|
5894
|
+
} catch (error) { /* empty */ }
|
|
5895
|
+
};
|
|
5896
|
+
|
|
5897
|
+
var perform$3 = function (exec) {
|
|
5898
|
+
try {
|
|
5899
|
+
return { error: false, value: exec() };
|
|
5900
|
+
} catch (error) {
|
|
5901
|
+
return { error: true, value: error };
|
|
6284
5902
|
}
|
|
6285
|
-
}
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
5903
|
+
};
|
|
5904
|
+
|
|
5905
|
+
var global$b = global$p;
|
|
5906
|
+
|
|
5907
|
+
var promiseNativeConstructor = global$b.Promise;
|
|
5908
|
+
|
|
5909
|
+
/* global Deno -- Deno case */
|
|
5910
|
+
|
|
5911
|
+
var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
|
|
5912
|
+
|
|
5913
|
+
var IS_DENO$1 = engineIsDeno;
|
|
5914
|
+
var IS_NODE$2 = engineIsNode;
|
|
5915
|
+
|
|
5916
|
+
var engineIsBrowser = !IS_DENO$1 && !IS_NODE$2
|
|
5917
|
+
&& typeof window == 'object'
|
|
5918
|
+
&& typeof document == 'object';
|
|
5919
|
+
|
|
5920
|
+
var global$a = global$p;
|
|
5921
|
+
var NativePromiseConstructor$3 = promiseNativeConstructor;
|
|
5922
|
+
var isCallable$6 = isCallable$p;
|
|
5923
|
+
var isForced$1 = isForced_1;
|
|
5924
|
+
var inspectSource = inspectSource$3;
|
|
5925
|
+
var wellKnownSymbol$8 = wellKnownSymbol$l;
|
|
5926
|
+
var IS_BROWSER = engineIsBrowser;
|
|
5927
|
+
var IS_DENO = engineIsDeno;
|
|
5928
|
+
var V8_VERSION = engineV8Version;
|
|
5929
|
+
|
|
5930
|
+
NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
|
|
5931
|
+
var SPECIES$1 = wellKnownSymbol$8('species');
|
|
5932
|
+
var SUBCLASSING = false;
|
|
5933
|
+
var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$6(global$a.PromiseRejectionEvent);
|
|
5934
|
+
|
|
5935
|
+
var FORCED_PROMISE_CONSTRUCTOR$5 = isForced$1('Promise', function () {
|
|
5936
|
+
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
|
|
5937
|
+
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
|
|
5938
|
+
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
5939
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
5940
|
+
// We can't detect it synchronously, so just check versions
|
|
5941
|
+
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
|
5942
|
+
// We can't use @@species feature detection in V8 since it causes
|
|
5943
|
+
// deoptimization and performance degradation
|
|
5944
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
5945
|
+
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
|
|
5946
|
+
// Detect correctness of subclassing with @@species support
|
|
5947
|
+
var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
|
|
5948
|
+
var FakePromise = function (exec) {
|
|
5949
|
+
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
6317
5950
|
};
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
5951
|
+
var constructor = promise.constructor = {};
|
|
5952
|
+
constructor[SPECIES$1] = FakePromise;
|
|
5953
|
+
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
|
|
5954
|
+
if (!SUBCLASSING) return true;
|
|
5955
|
+
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
5956
|
+
} return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
|
|
5957
|
+
});
|
|
5958
|
+
|
|
5959
|
+
var promiseConstructorDetection = {
|
|
5960
|
+
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
|
|
5961
|
+
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
|
|
5962
|
+
SUBCLASSING: SUBCLASSING
|
|
5963
|
+
};
|
|
5964
|
+
|
|
5965
|
+
var newPromiseCapability$2 = {};
|
|
5966
|
+
|
|
5967
|
+
var aCallable$6 = aCallable$a;
|
|
5968
|
+
|
|
5969
|
+
var $TypeError$5 = TypeError;
|
|
5970
|
+
|
|
5971
|
+
var PromiseCapability = function (C) {
|
|
5972
|
+
var resolve, reject;
|
|
5973
|
+
this.promise = new C(function ($$resolve, $$reject) {
|
|
5974
|
+
if (resolve !== undefined || reject !== undefined) throw $TypeError$5('Bad Promise constructor');
|
|
5975
|
+
resolve = $$resolve;
|
|
5976
|
+
reject = $$reject;
|
|
5977
|
+
});
|
|
5978
|
+
this.resolve = aCallable$6(resolve);
|
|
5979
|
+
this.reject = aCallable$6(reject);
|
|
5980
|
+
};
|
|
5981
|
+
|
|
5982
|
+
// `NewPromiseCapability` abstract operation
|
|
5983
|
+
// https://tc39.es/ecma262/#sec-newpromisecapability
|
|
5984
|
+
newPromiseCapability$2.f = function (C) {
|
|
5985
|
+
return new PromiseCapability(C);
|
|
5986
|
+
};
|
|
5987
|
+
|
|
5988
|
+
var $$j = _export;
|
|
5989
|
+
var IS_NODE$1 = engineIsNode;
|
|
5990
|
+
var global$9 = global$p;
|
|
5991
|
+
var call$g = functionCall;
|
|
5992
|
+
var defineBuiltIn$7 = defineBuiltIn$b;
|
|
5993
|
+
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
5994
|
+
var setToStringTag$2 = setToStringTag$5;
|
|
5995
|
+
var setSpecies$1 = setSpecies$2;
|
|
5996
|
+
var aCallable$5 = aCallable$a;
|
|
5997
|
+
var isCallable$5 = isCallable$p;
|
|
5998
|
+
var isObject$6 = isObject$e;
|
|
5999
|
+
var anInstance$2 = anInstance$3;
|
|
6000
|
+
var speciesConstructor$1 = speciesConstructor$2;
|
|
6001
|
+
var task = task$1.set;
|
|
6002
|
+
var microtask = microtask_1;
|
|
6003
|
+
var hostReportErrors = hostReportErrors$1;
|
|
6004
|
+
var perform$2 = perform$3;
|
|
6005
|
+
var Queue = queue$1;
|
|
6006
|
+
var InternalStateModule$3 = internalState;
|
|
6007
|
+
var NativePromiseConstructor$2 = promiseNativeConstructor;
|
|
6008
|
+
var PromiseConstructorDetection = promiseConstructorDetection;
|
|
6009
|
+
var newPromiseCapabilityModule$3 = newPromiseCapability$2;
|
|
6010
|
+
|
|
6011
|
+
var PROMISE = 'Promise';
|
|
6012
|
+
var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
|
|
6013
|
+
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
|
6014
|
+
var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
|
|
6015
|
+
var getInternalPromiseState = InternalStateModule$3.getterFor(PROMISE);
|
|
6016
|
+
var setInternalState$3 = InternalStateModule$3.set;
|
|
6017
|
+
var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
|
|
6018
|
+
var PromiseConstructor = NativePromiseConstructor$2;
|
|
6019
|
+
var PromisePrototype = NativePromisePrototype$1;
|
|
6020
|
+
var TypeError$3 = global$9.TypeError;
|
|
6021
|
+
var document$1 = global$9.document;
|
|
6022
|
+
var process$1 = global$9.process;
|
|
6023
|
+
var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
|
|
6024
|
+
var newGenericPromiseCapability = newPromiseCapability$1;
|
|
6025
|
+
|
|
6026
|
+
var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$9.dispatchEvent);
|
|
6027
|
+
var UNHANDLED_REJECTION = 'unhandledrejection';
|
|
6028
|
+
var REJECTION_HANDLED = 'rejectionhandled';
|
|
6029
|
+
var PENDING = 0;
|
|
6030
|
+
var FULFILLED = 1;
|
|
6031
|
+
var REJECTED = 2;
|
|
6032
|
+
var HANDLED = 1;
|
|
6033
|
+
var UNHANDLED = 2;
|
|
6034
|
+
|
|
6035
|
+
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
6036
|
+
|
|
6037
|
+
// helpers
|
|
6038
|
+
var isThenable = function (it) {
|
|
6039
|
+
var then;
|
|
6040
|
+
return isObject$6(it) && isCallable$5(then = it.then) ? then : false;
|
|
6041
|
+
};
|
|
6042
|
+
|
|
6043
|
+
var callReaction = function (reaction, state) {
|
|
6044
|
+
var value = state.value;
|
|
6045
|
+
var ok = state.state == FULFILLED;
|
|
6046
|
+
var handler = ok ? reaction.ok : reaction.fail;
|
|
6047
|
+
var resolve = reaction.resolve;
|
|
6048
|
+
var reject = reaction.reject;
|
|
6049
|
+
var domain = reaction.domain;
|
|
6050
|
+
var result, then, exited;
|
|
6051
|
+
try {
|
|
6052
|
+
if (handler) {
|
|
6053
|
+
if (!ok) {
|
|
6054
|
+
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
|
6055
|
+
state.rejection = HANDLED;
|
|
6056
|
+
}
|
|
6057
|
+
if (handler === true) result = value;
|
|
6058
|
+
else {
|
|
6059
|
+
if (domain) domain.enter();
|
|
6060
|
+
result = handler(value); // can throw
|
|
6061
|
+
if (domain) {
|
|
6062
|
+
domain.exit();
|
|
6063
|
+
exited = true;
|
|
6064
|
+
}
|
|
6065
|
+
}
|
|
6066
|
+
if (result === reaction.promise) {
|
|
6067
|
+
reject(TypeError$3('Promise-chain cycle'));
|
|
6068
|
+
} else if (then = isThenable(result)) {
|
|
6069
|
+
call$g(then, result, resolve, reject);
|
|
6070
|
+
} else resolve(result);
|
|
6071
|
+
} else reject(value);
|
|
6072
|
+
} catch (error) {
|
|
6073
|
+
if (domain && !exited) domain.exit();
|
|
6074
|
+
reject(error);
|
|
6075
|
+
}
|
|
6076
|
+
};
|
|
6077
|
+
|
|
6078
|
+
var notify = function (state, isReject) {
|
|
6079
|
+
if (state.notified) return;
|
|
6080
|
+
state.notified = true;
|
|
6081
|
+
microtask(function () {
|
|
6082
|
+
var reactions = state.reactions;
|
|
6083
|
+
var reaction;
|
|
6084
|
+
while (reaction = reactions.get()) {
|
|
6085
|
+
callReaction(reaction, state);
|
|
6402
6086
|
}
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6087
|
+
state.notified = false;
|
|
6088
|
+
if (isReject && !state.rejection) onUnhandled(state);
|
|
6089
|
+
});
|
|
6090
|
+
};
|
|
6091
|
+
|
|
6092
|
+
var dispatchEvent = function (name, promise, reason) {
|
|
6093
|
+
var event, handler;
|
|
6094
|
+
if (DISPATCH_EVENT) {
|
|
6095
|
+
event = document$1.createEvent('Event');
|
|
6096
|
+
event.promise = promise;
|
|
6097
|
+
event.reason = reason;
|
|
6098
|
+
event.initEvent(name, false, true);
|
|
6099
|
+
global$9.dispatchEvent(event);
|
|
6100
|
+
} else event = { promise: promise, reason: reason };
|
|
6101
|
+
if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$9['on' + name])) handler(event);
|
|
6102
|
+
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
|
6103
|
+
};
|
|
6104
|
+
|
|
6105
|
+
var onUnhandled = function (state) {
|
|
6106
|
+
call$g(task, global$9, function () {
|
|
6107
|
+
var promise = state.facade;
|
|
6108
|
+
var value = state.value;
|
|
6109
|
+
var IS_UNHANDLED = isUnhandled(state);
|
|
6110
|
+
var result;
|
|
6111
|
+
if (IS_UNHANDLED) {
|
|
6112
|
+
result = perform$2(function () {
|
|
6113
|
+
if (IS_NODE$1) {
|
|
6114
|
+
process$1.emit('unhandledRejection', value, promise);
|
|
6115
|
+
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
|
6116
|
+
});
|
|
6117
|
+
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
|
6118
|
+
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
|
|
6119
|
+
if (result.error) throw result.value;
|
|
6417
6120
|
}
|
|
6418
|
-
}
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6121
|
+
});
|
|
6122
|
+
};
|
|
6123
|
+
|
|
6124
|
+
var isUnhandled = function (state) {
|
|
6125
|
+
return state.rejection !== HANDLED && !state.parent;
|
|
6126
|
+
};
|
|
6127
|
+
|
|
6128
|
+
var onHandleUnhandled = function (state) {
|
|
6129
|
+
call$g(task, global$9, function () {
|
|
6130
|
+
var promise = state.facade;
|
|
6131
|
+
if (IS_NODE$1) {
|
|
6132
|
+
process$1.emit('rejectionHandled', promise);
|
|
6133
|
+
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
|
6134
|
+
});
|
|
6135
|
+
};
|
|
6136
|
+
|
|
6137
|
+
var bind$4 = function (fn, state, unwrap) {
|
|
6138
|
+
return function (value) {
|
|
6139
|
+
fn(state, value, unwrap);
|
|
6140
|
+
};
|
|
6141
|
+
};
|
|
6142
|
+
|
|
6143
|
+
var internalReject = function (state, value, unwrap) {
|
|
6144
|
+
if (state.done) return;
|
|
6145
|
+
state.done = true;
|
|
6146
|
+
if (unwrap) state = unwrap;
|
|
6147
|
+
state.value = value;
|
|
6148
|
+
state.state = REJECTED;
|
|
6149
|
+
notify(state, true);
|
|
6150
|
+
};
|
|
6151
|
+
|
|
6152
|
+
var internalResolve = function (state, value, unwrap) {
|
|
6153
|
+
if (state.done) return;
|
|
6154
|
+
state.done = true;
|
|
6155
|
+
if (unwrap) state = unwrap;
|
|
6156
|
+
try {
|
|
6157
|
+
if (state.facade === value) throw TypeError$3("Promise can't be resolved itself");
|
|
6158
|
+
var then = isThenable(value);
|
|
6159
|
+
if (then) {
|
|
6160
|
+
microtask(function () {
|
|
6161
|
+
var wrapper = { done: false };
|
|
6162
|
+
try {
|
|
6163
|
+
call$g(then, value,
|
|
6164
|
+
bind$4(internalResolve, wrapper, state),
|
|
6165
|
+
bind$4(internalReject, wrapper, state)
|
|
6166
|
+
);
|
|
6167
|
+
} catch (error) {
|
|
6168
|
+
internalReject(wrapper, error, state);
|
|
6169
|
+
}
|
|
6170
|
+
});
|
|
6171
|
+
} else {
|
|
6172
|
+
state.value = value;
|
|
6173
|
+
state.state = FULFILLED;
|
|
6174
|
+
notify(state, false);
|
|
6426
6175
|
}
|
|
6427
|
-
}
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6176
|
+
} catch (error) {
|
|
6177
|
+
internalReject({ done: false }, error, state);
|
|
6178
|
+
}
|
|
6179
|
+
};
|
|
6180
|
+
|
|
6181
|
+
// constructor polyfill
|
|
6182
|
+
if (FORCED_PROMISE_CONSTRUCTOR$4) {
|
|
6183
|
+
// 25.4.3.1 Promise(executor)
|
|
6184
|
+
PromiseConstructor = function Promise(executor) {
|
|
6185
|
+
anInstance$2(this, PromisePrototype);
|
|
6186
|
+
aCallable$5(executor);
|
|
6187
|
+
call$g(Internal, this);
|
|
6188
|
+
var state = getInternalPromiseState(this);
|
|
6189
|
+
try {
|
|
6190
|
+
executor(bind$4(internalResolve, state), bind$4(internalReject, state));
|
|
6191
|
+
} catch (error) {
|
|
6192
|
+
internalReject(state, error);
|
|
6441
6193
|
}
|
|
6442
|
-
}
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6194
|
+
};
|
|
6195
|
+
|
|
6196
|
+
PromisePrototype = PromiseConstructor.prototype;
|
|
6197
|
+
|
|
6198
|
+
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
6199
|
+
Internal = function Promise(executor) {
|
|
6200
|
+
setInternalState$3(this, {
|
|
6201
|
+
type: PROMISE,
|
|
6202
|
+
done: false,
|
|
6203
|
+
notified: false,
|
|
6204
|
+
parent: false,
|
|
6205
|
+
reactions: new Queue(),
|
|
6206
|
+
rejection: false,
|
|
6207
|
+
state: PENDING,
|
|
6208
|
+
value: undefined
|
|
6209
|
+
});
|
|
6210
|
+
};
|
|
6211
|
+
|
|
6212
|
+
// `Promise.prototype.then` method
|
|
6213
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.then
|
|
6214
|
+
Internal.prototype = defineBuiltIn$7(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
|
6215
|
+
var state = getInternalPromiseState(this);
|
|
6216
|
+
var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
|
|
6217
|
+
state.parent = true;
|
|
6218
|
+
reaction.ok = isCallable$5(onFulfilled) ? onFulfilled : true;
|
|
6219
|
+
reaction.fail = isCallable$5(onRejected) && onRejected;
|
|
6220
|
+
reaction.domain = IS_NODE$1 ? process$1.domain : undefined;
|
|
6221
|
+
if (state.state == PENDING) state.reactions.add(reaction);
|
|
6222
|
+
else microtask(function () {
|
|
6223
|
+
callReaction(reaction, state);
|
|
6224
|
+
});
|
|
6225
|
+
return reaction.promise;
|
|
6226
|
+
});
|
|
6227
|
+
|
|
6228
|
+
OwnPromiseCapability = function () {
|
|
6229
|
+
var promise = new Internal();
|
|
6230
|
+
var state = getInternalPromiseState(promise);
|
|
6231
|
+
this.promise = promise;
|
|
6232
|
+
this.resolve = bind$4(internalResolve, state);
|
|
6233
|
+
this.reject = bind$4(internalReject, state);
|
|
6234
|
+
};
|
|
6235
|
+
|
|
6236
|
+
newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
|
|
6237
|
+
return C === PromiseConstructor || C === PromiseWrapper
|
|
6238
|
+
? new OwnPromiseCapability(C)
|
|
6239
|
+
: newGenericPromiseCapability(C);
|
|
6240
|
+
};
|
|
6241
|
+
|
|
6242
|
+
if (isCallable$5(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
|
|
6243
|
+
nativeThen = NativePromisePrototype$1.then;
|
|
6244
|
+
|
|
6245
|
+
if (!NATIVE_PROMISE_SUBCLASSING) {
|
|
6246
|
+
// make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
|
|
6247
|
+
defineBuiltIn$7(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
|
|
6248
|
+
var that = this;
|
|
6249
|
+
return new PromiseConstructor(function (resolve, reject) {
|
|
6250
|
+
call$g(nativeThen, that, resolve, reject);
|
|
6251
|
+
}).then(onFulfilled, onRejected);
|
|
6252
|
+
// https://github.com/zloirock/core-js/issues/640
|
|
6253
|
+
}, { unsafe: true });
|
|
6450
6254
|
}
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
__self: undefined,
|
|
6461
|
-
__source: {
|
|
6462
|
-
fileName: _jsxFileName$V,
|
|
6463
|
-
lineNumber: 280,
|
|
6464
|
-
columnNumber: 17
|
|
6255
|
+
|
|
6256
|
+
// make `.constructor === Promise` work for native promise-based APIs
|
|
6257
|
+
try {
|
|
6258
|
+
delete NativePromisePrototype$1.constructor;
|
|
6259
|
+
} catch (error) { /* empty */ }
|
|
6260
|
+
|
|
6261
|
+
// make `instanceof Promise` work for native promise-based APIs
|
|
6262
|
+
if (setPrototypeOf$1) {
|
|
6263
|
+
setPrototypeOf$1(NativePromisePrototype$1, PromisePrototype);
|
|
6465
6264
|
}
|
|
6466
|
-
}
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
$$j({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
|
|
6269
|
+
Promise: PromiseConstructor
|
|
6270
|
+
});
|
|
6271
|
+
|
|
6272
|
+
setToStringTag$2(PromiseConstructor, PROMISE, false);
|
|
6273
|
+
setSpecies$1(PROMISE);
|
|
6274
|
+
|
|
6275
|
+
var wellKnownSymbol$7 = wellKnownSymbol$l;
|
|
6276
|
+
var Iterators$1 = iterators;
|
|
6277
|
+
|
|
6278
|
+
var ITERATOR$6 = wellKnownSymbol$7('iterator');
|
|
6279
|
+
var ArrayPrototype = Array.prototype;
|
|
6280
|
+
|
|
6281
|
+
// check on default Array iterator
|
|
6282
|
+
var isArrayIteratorMethod$2 = function (it) {
|
|
6283
|
+
return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$6] === it);
|
|
6467
6284
|
};
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6285
|
+
|
|
6286
|
+
var classof$3 = classof$8;
|
|
6287
|
+
var getMethod$5 = getMethod$7;
|
|
6288
|
+
var isNullOrUndefined$4 = isNullOrUndefined$8;
|
|
6289
|
+
var Iterators = iterators;
|
|
6290
|
+
var wellKnownSymbol$6 = wellKnownSymbol$l;
|
|
6291
|
+
|
|
6292
|
+
var ITERATOR$5 = wellKnownSymbol$6('iterator');
|
|
6293
|
+
|
|
6294
|
+
var getIteratorMethod$4 = function (it) {
|
|
6295
|
+
if (!isNullOrUndefined$4(it)) return getMethod$5(it, ITERATOR$5)
|
|
6296
|
+
|| getMethod$5(it, '@@iterator')
|
|
6297
|
+
|| Iterators[classof$3(it)];
|
|
6479
6298
|
};
|
|
6480
|
-
|
|
6481
|
-
|
|
6299
|
+
|
|
6300
|
+
var call$f = functionCall;
|
|
6301
|
+
var aCallable$4 = aCallable$a;
|
|
6302
|
+
var anObject$c = anObject$j;
|
|
6303
|
+
var tryToString$2 = tryToString$5;
|
|
6304
|
+
var getIteratorMethod$3 = getIteratorMethod$4;
|
|
6305
|
+
|
|
6306
|
+
var $TypeError$4 = TypeError;
|
|
6307
|
+
|
|
6308
|
+
var getIterator$3 = function (argument, usingIterator) {
|
|
6309
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$3(argument) : usingIterator;
|
|
6310
|
+
if (aCallable$4(iteratorMethod)) return anObject$c(call$f(iteratorMethod, argument));
|
|
6311
|
+
throw $TypeError$4(tryToString$2(argument) + ' is not iterable');
|
|
6482
6312
|
};
|
|
6483
6313
|
|
|
6484
|
-
|
|
6485
|
-
var
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
top: '8%',
|
|
6497
|
-
left: '4%',
|
|
6498
|
-
flexDirection: 'column-reverse'
|
|
6499
|
-
},
|
|
6500
|
-
[BOTTOM_RIGHT_POSITION]: {
|
|
6501
|
-
bottom: '8%',
|
|
6502
|
-
right: '4%',
|
|
6503
|
-
flexDirection: 'column'
|
|
6504
|
-
},
|
|
6505
|
-
[BOTTOM_LEFT_POSITION]: {
|
|
6506
|
-
bottom: '8%',
|
|
6507
|
-
left: '4%',
|
|
6508
|
-
flexDirection: 'column'
|
|
6509
|
-
}
|
|
6314
|
+
var call$e = functionCall;
|
|
6315
|
+
var anObject$b = anObject$j;
|
|
6316
|
+
var getMethod$4 = getMethod$7;
|
|
6317
|
+
|
|
6318
|
+
var iteratorClose$2 = function (iterator, kind, value) {
|
|
6319
|
+
var innerResult, innerError;
|
|
6320
|
+
anObject$b(iterator);
|
|
6321
|
+
try {
|
|
6322
|
+
innerResult = getMethod$4(iterator, 'return');
|
|
6323
|
+
if (!innerResult) {
|
|
6324
|
+
if (kind === 'throw') throw value;
|
|
6325
|
+
return value;
|
|
6510
6326
|
}
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6327
|
+
innerResult = call$e(innerResult, iterator);
|
|
6328
|
+
} catch (error) {
|
|
6329
|
+
innerError = true;
|
|
6330
|
+
innerResult = error;
|
|
6514
6331
|
}
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6332
|
+
if (kind === 'throw') throw value;
|
|
6333
|
+
if (innerError) throw innerResult;
|
|
6334
|
+
anObject$b(innerResult);
|
|
6335
|
+
return value;
|
|
6336
|
+
};
|
|
6337
|
+
|
|
6338
|
+
var bind$3 = functionBindContext;
|
|
6339
|
+
var call$d = functionCall;
|
|
6340
|
+
var anObject$a = anObject$j;
|
|
6341
|
+
var tryToString$1 = tryToString$5;
|
|
6342
|
+
var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
|
|
6343
|
+
var lengthOfArrayLike$4 = lengthOfArrayLike$6;
|
|
6344
|
+
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
6345
|
+
var getIterator$2 = getIterator$3;
|
|
6346
|
+
var getIteratorMethod$2 = getIteratorMethod$4;
|
|
6347
|
+
var iteratorClose$1 = iteratorClose$2;
|
|
6348
|
+
|
|
6349
|
+
var $TypeError$3 = TypeError;
|
|
6350
|
+
|
|
6351
|
+
var Result = function (stopped, result) {
|
|
6352
|
+
this.stopped = stopped;
|
|
6353
|
+
this.result = result;
|
|
6354
|
+
};
|
|
6355
|
+
|
|
6356
|
+
var ResultPrototype = Result.prototype;
|
|
6357
|
+
|
|
6358
|
+
var iterate$2 = function (iterable, unboundFunction, options) {
|
|
6359
|
+
var that = options && options.that;
|
|
6360
|
+
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
6361
|
+
var IS_RECORD = !!(options && options.IS_RECORD);
|
|
6362
|
+
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
6363
|
+
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
6364
|
+
var fn = bind$3(unboundFunction, that);
|
|
6365
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
6366
|
+
|
|
6367
|
+
var stop = function (condition) {
|
|
6368
|
+
if (iterator) iteratorClose$1(iterator, 'normal', condition);
|
|
6369
|
+
return new Result(true, condition);
|
|
6370
|
+
};
|
|
6371
|
+
|
|
6372
|
+
var callFn = function (value) {
|
|
6373
|
+
if (AS_ENTRIES) {
|
|
6374
|
+
anObject$a(value);
|
|
6375
|
+
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
6376
|
+
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
6377
|
+
};
|
|
6378
|
+
|
|
6379
|
+
if (IS_RECORD) {
|
|
6380
|
+
iterator = iterable.iterator;
|
|
6381
|
+
} else if (IS_ITERATOR) {
|
|
6382
|
+
iterator = iterable;
|
|
6383
|
+
} else {
|
|
6384
|
+
iterFn = getIteratorMethod$2(iterable);
|
|
6385
|
+
if (!iterFn) throw $TypeError$3(tryToString$1(iterable) + ' is not iterable');
|
|
6386
|
+
// optimisation for array iterators
|
|
6387
|
+
if (isArrayIteratorMethod$1(iterFn)) {
|
|
6388
|
+
for (index = 0, length = lengthOfArrayLike$4(iterable); length > index; index++) {
|
|
6389
|
+
result = callFn(iterable[index]);
|
|
6390
|
+
if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
|
|
6391
|
+
} return new Result(false);
|
|
6535
6392
|
}
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6393
|
+
iterator = getIterator$2(iterable, iterFn);
|
|
6394
|
+
}
|
|
6395
|
+
|
|
6396
|
+
next = IS_RECORD ? iterable.next : iterator.next;
|
|
6397
|
+
while (!(step = call$d(next, iterator)).done) {
|
|
6398
|
+
try {
|
|
6399
|
+
result = callFn(step.value);
|
|
6400
|
+
} catch (error) {
|
|
6401
|
+
iteratorClose$1(iterator, 'throw', error);
|
|
6543
6402
|
}
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
preventDuplicate
|
|
6547
|
-
} = item,
|
|
6548
|
-
toast = _objectWithoutPropertiesLoose(item, _excluded$s);
|
|
6549
|
-
return /*#__PURE__*/React__namespace.createElement(Toast, _extends({
|
|
6550
|
-
key: preventDuplicate ? toast.id : `${toast.id}-${index}`,
|
|
6551
|
-
onRemove: () => removeToast(toast.id)
|
|
6552
|
-
}, toast, {
|
|
6553
|
-
__self: undefined,
|
|
6554
|
-
__source: {
|
|
6555
|
-
fileName: _jsxFileName$U,
|
|
6556
|
-
lineNumber: 47,
|
|
6557
|
-
columnNumber: 18
|
|
6558
|
-
}
|
|
6559
|
-
}));
|
|
6560
|
-
})));
|
|
6403
|
+
if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
|
|
6404
|
+
} return new Result(false);
|
|
6561
6405
|
};
|
|
6562
6406
|
|
|
6563
|
-
var
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
var
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
var
|
|
6571
|
-
|
|
6407
|
+
var wellKnownSymbol$5 = wellKnownSymbol$l;
|
|
6408
|
+
|
|
6409
|
+
var ITERATOR$4 = wellKnownSymbol$5('iterator');
|
|
6410
|
+
var SAFE_CLOSING = false;
|
|
6411
|
+
|
|
6412
|
+
try {
|
|
6413
|
+
var called = 0;
|
|
6414
|
+
var iteratorWithReturn = {
|
|
6415
|
+
next: function () {
|
|
6416
|
+
return { done: !!called++ };
|
|
6417
|
+
},
|
|
6418
|
+
'return': function () {
|
|
6419
|
+
SAFE_CLOSING = true;
|
|
6420
|
+
}
|
|
6572
6421
|
};
|
|
6573
|
-
|
|
6574
|
-
return
|
|
6422
|
+
iteratorWithReturn[ITERATOR$4] = function () {
|
|
6423
|
+
return this;
|
|
6575
6424
|
};
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6425
|
+
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
6426
|
+
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
6427
|
+
} catch (error) { /* empty */ }
|
|
6428
|
+
|
|
6429
|
+
var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
|
|
6430
|
+
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
6431
|
+
var ITERATION_SUPPORT = false;
|
|
6432
|
+
try {
|
|
6433
|
+
var object = {};
|
|
6434
|
+
object[ITERATOR$4] = function () {
|
|
6435
|
+
return {
|
|
6436
|
+
next: function () {
|
|
6437
|
+
return { done: ITERATION_SUPPORT = true };
|
|
6438
|
+
}
|
|
6439
|
+
};
|
|
6582
6440
|
};
|
|
6583
|
-
|
|
6584
|
-
|
|
6441
|
+
exec(object);
|
|
6442
|
+
} catch (error) { /* empty */ }
|
|
6443
|
+
return ITERATION_SUPPORT;
|
|
6444
|
+
};
|
|
6445
|
+
|
|
6446
|
+
var NativePromiseConstructor$1 = promiseNativeConstructor;
|
|
6447
|
+
var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
|
|
6448
|
+
var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
|
|
6449
|
+
|
|
6450
|
+
var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
|
|
6451
|
+
NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
|
|
6452
|
+
});
|
|
6453
|
+
|
|
6454
|
+
var $$i = _export;
|
|
6455
|
+
var call$c = functionCall;
|
|
6456
|
+
var aCallable$3 = aCallable$a;
|
|
6457
|
+
var newPromiseCapabilityModule$2 = newPromiseCapability$2;
|
|
6458
|
+
var perform$1 = perform$3;
|
|
6459
|
+
var iterate$1 = iterate$2;
|
|
6460
|
+
var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
|
|
6461
|
+
|
|
6462
|
+
// `Promise.all` method
|
|
6463
|
+
// https://tc39.es/ecma262/#sec-promise.all
|
|
6464
|
+
$$i({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
|
|
6465
|
+
all: function all(iterable) {
|
|
6466
|
+
var C = this;
|
|
6467
|
+
var capability = newPromiseCapabilityModule$2.f(C);
|
|
6468
|
+
var resolve = capability.resolve;
|
|
6469
|
+
var reject = capability.reject;
|
|
6470
|
+
var result = perform$1(function () {
|
|
6471
|
+
var $promiseResolve = aCallable$3(C.resolve);
|
|
6472
|
+
var values = [];
|
|
6473
|
+
var counter = 0;
|
|
6474
|
+
var remaining = 1;
|
|
6475
|
+
iterate$1(iterable, function (promise) {
|
|
6476
|
+
var index = counter++;
|
|
6477
|
+
var alreadyCalled = false;
|
|
6478
|
+
remaining++;
|
|
6479
|
+
call$c($promiseResolve, C, promise).then(function (value) {
|
|
6480
|
+
if (alreadyCalled) return;
|
|
6481
|
+
alreadyCalled = true;
|
|
6482
|
+
values[index] = value;
|
|
6483
|
+
--remaining || resolve(values);
|
|
6484
|
+
}, reject);
|
|
6485
|
+
});
|
|
6486
|
+
--remaining || resolve(values);
|
|
6487
|
+
});
|
|
6488
|
+
if (result.error) reject(result.value);
|
|
6489
|
+
return capability.promise;
|
|
6490
|
+
}
|
|
6491
|
+
});
|
|
6492
|
+
|
|
6493
|
+
var $$h = _export;
|
|
6494
|
+
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
|
6495
|
+
var NativePromiseConstructor = promiseNativeConstructor;
|
|
6496
|
+
var getBuiltIn$1 = getBuiltIn$7;
|
|
6497
|
+
var isCallable$4 = isCallable$p;
|
|
6498
|
+
var defineBuiltIn$6 = defineBuiltIn$b;
|
|
6499
|
+
|
|
6500
|
+
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
|
6501
|
+
|
|
6502
|
+
// `Promise.prototype.catch` method
|
|
6503
|
+
// https://tc39.es/ecma262/#sec-promise.prototype.catch
|
|
6504
|
+
$$h({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
|
|
6505
|
+
'catch': function (onRejected) {
|
|
6506
|
+
return this.then(undefined, onRejected);
|
|
6507
|
+
}
|
|
6508
|
+
});
|
|
6509
|
+
|
|
6510
|
+
// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
|
|
6511
|
+
if (isCallable$4(NativePromiseConstructor)) {
|
|
6512
|
+
var method = getBuiltIn$1('Promise').prototype['catch'];
|
|
6513
|
+
if (NativePromisePrototype['catch'] !== method) {
|
|
6514
|
+
defineBuiltIn$6(NativePromisePrototype, 'catch', method, { unsafe: true });
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
|
|
6518
|
+
var $$g = _export;
|
|
6519
|
+
var call$b = functionCall;
|
|
6520
|
+
var aCallable$2 = aCallable$a;
|
|
6521
|
+
var newPromiseCapabilityModule$1 = newPromiseCapability$2;
|
|
6522
|
+
var perform = perform$3;
|
|
6523
|
+
var iterate = iterate$2;
|
|
6524
|
+
var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
|
|
6525
|
+
|
|
6526
|
+
// `Promise.race` method
|
|
6527
|
+
// https://tc39.es/ecma262/#sec-promise.race
|
|
6528
|
+
$$g({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
|
6529
|
+
race: function race(iterable) {
|
|
6530
|
+
var C = this;
|
|
6531
|
+
var capability = newPromiseCapabilityModule$1.f(C);
|
|
6532
|
+
var reject = capability.reject;
|
|
6533
|
+
var result = perform(function () {
|
|
6534
|
+
var $promiseResolve = aCallable$2(C.resolve);
|
|
6535
|
+
iterate(iterable, function (promise) {
|
|
6536
|
+
call$b($promiseResolve, C, promise).then(capability.resolve, reject);
|
|
6537
|
+
});
|
|
6538
|
+
});
|
|
6539
|
+
if (result.error) reject(result.value);
|
|
6540
|
+
return capability.promise;
|
|
6541
|
+
}
|
|
6542
|
+
});
|
|
6543
|
+
|
|
6544
|
+
var $$f = _export;
|
|
6545
|
+
var call$a = functionCall;
|
|
6546
|
+
var newPromiseCapabilityModule = newPromiseCapability$2;
|
|
6547
|
+
var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
|
|
6548
|
+
|
|
6549
|
+
// `Promise.reject` method
|
|
6550
|
+
// https://tc39.es/ecma262/#sec-promise.reject
|
|
6551
|
+
$$f({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
|
|
6552
|
+
reject: function reject(r) {
|
|
6553
|
+
var capability = newPromiseCapabilityModule.f(this);
|
|
6554
|
+
call$a(capability.reject, undefined, r);
|
|
6555
|
+
return capability.promise;
|
|
6556
|
+
}
|
|
6557
|
+
});
|
|
6558
|
+
|
|
6559
|
+
var anObject$9 = anObject$j;
|
|
6560
|
+
var isObject$5 = isObject$e;
|
|
6561
|
+
var newPromiseCapability = newPromiseCapability$2;
|
|
6562
|
+
|
|
6563
|
+
var promiseResolve$1 = function (C, x) {
|
|
6564
|
+
anObject$9(C);
|
|
6565
|
+
if (isObject$5(x) && x.constructor === C) return x;
|
|
6566
|
+
var promiseCapability = newPromiseCapability.f(C);
|
|
6567
|
+
var resolve = promiseCapability.resolve;
|
|
6568
|
+
resolve(x);
|
|
6569
|
+
return promiseCapability.promise;
|
|
6585
6570
|
};
|
|
6586
6571
|
|
|
6572
|
+
var $$e = _export;
|
|
6573
|
+
var getBuiltIn = getBuiltIn$7;
|
|
6574
|
+
var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
|
|
6575
|
+
var promiseResolve = promiseResolve$1;
|
|
6576
|
+
|
|
6577
|
+
getBuiltIn('Promise');
|
|
6578
|
+
|
|
6579
|
+
// `Promise.resolve` method
|
|
6580
|
+
// https://tc39.es/ecma262/#sec-promise.resolve
|
|
6581
|
+
$$e({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
6582
|
+
resolve: function resolve(x) {
|
|
6583
|
+
return promiseResolve(this, x);
|
|
6584
|
+
}
|
|
6585
|
+
});
|
|
6586
|
+
|
|
6587
6587
|
var aCallable$1 = aCallable$a;
|
|
6588
6588
|
var toObject$3 = toObject$7;
|
|
6589
6589
|
var IndexedObject = indexedObject;
|
|
@@ -6712,55 +6712,17 @@
|
|
|
6712
6712
|
|
|
6713
6713
|
const _excluded$r = ["id", "disabledOfflineIntercept"];
|
|
6714
6714
|
var _jsxFileName$T = "/home/alfiantryp/Projects/majoo-ui/packages/react/src/components/toast/context/ToastProvider.js";
|
|
6715
|
-
function _await$1(value, then, direct) {
|
|
6716
|
-
if (direct) {
|
|
6717
|
-
return then ? then(value) : value;
|
|
6718
|
-
}
|
|
6719
|
-
if (!value || !value.then) {
|
|
6720
|
-
value = Promise.resolve(value);
|
|
6721
|
-
}
|
|
6722
|
-
return then ? value.then(then) : value;
|
|
6723
|
-
}
|
|
6724
|
-
function _catch(body, recover) {
|
|
6725
|
-
try {
|
|
6726
|
-
var result = body();
|
|
6727
|
-
} catch (e) {
|
|
6728
|
-
return recover(e);
|
|
6729
|
-
}
|
|
6730
|
-
if (result && result.then) {
|
|
6731
|
-
return result.then(void 0, recover);
|
|
6732
|
-
}
|
|
6733
|
-
return result;
|
|
6734
|
-
}
|
|
6735
|
-
function _empty() {}
|
|
6736
6715
|
let toastCount = 0;
|
|
6737
|
-
function _continueIgnored(value) {
|
|
6738
|
-
if (value && value.then) {
|
|
6739
|
-
return value.then(_empty);
|
|
6740
|
-
}
|
|
6741
|
-
}
|
|
6742
6716
|
const ToastProvider = ({
|
|
6743
|
-
children
|
|
6717
|
+
children,
|
|
6718
|
+
translations
|
|
6744
6719
|
}) => {
|
|
6745
6720
|
const isOnline = useNavigatorOnLine();
|
|
6746
6721
|
const [toasts, setToasts] = React.useState([]);
|
|
6747
|
-
const [translations, setTranslations] = React.useState();
|
|
6748
6722
|
const {
|
|
6749
6723
|
t,
|
|
6750
6724
|
i18n
|
|
6751
6725
|
} = reactI18next.useTranslation(['MajooUI/toast', 'translation']);
|
|
6752
|
-
const fetchMultilang = _async$1(function () {
|
|
6753
|
-
return _continueIgnored(_catch(function () {
|
|
6754
|
-
return _await$1(fetch('https://pub-366ba540f0c84c41a0d9ac78d8296d22.r2.dev/backend.json'), function (response) {
|
|
6755
|
-
return _await$1(response.json(), function (responseJson) {
|
|
6756
|
-
setTranslations(responseJson);
|
|
6757
|
-
});
|
|
6758
|
-
});
|
|
6759
|
-
}, function (error) {
|
|
6760
|
-
setTranslations({});
|
|
6761
|
-
console.error(error);
|
|
6762
|
-
}));
|
|
6763
|
-
});
|
|
6764
6726
|
const catchError$1 = React.useCallback(e => {
|
|
6765
6727
|
const errorMsg = catchError(e);
|
|
6766
6728
|
if (translations && translations[errorMsg]) return translations[errorMsg][i18n.language];
|
|
@@ -6804,9 +6766,6 @@
|
|
|
6804
6766
|
const removeToast = React__namespace.useCallback(id => {
|
|
6805
6767
|
setToasts(toastItems => toastItems.filter(t => t.id !== id));
|
|
6806
6768
|
}, [setToasts]);
|
|
6807
|
-
React.useEffect(() => {
|
|
6808
|
-
fetchMultilang();
|
|
6809
|
-
}, []);
|
|
6810
6769
|
return /*#__PURE__*/React__namespace.createElement(ToastContext.Provider, {
|
|
6811
6770
|
value: {
|
|
6812
6771
|
addToast,
|
|
@@ -6815,7 +6774,7 @@
|
|
|
6815
6774
|
__self: undefined,
|
|
6816
6775
|
__source: {
|
|
6817
6776
|
fileName: _jsxFileName$T,
|
|
6818
|
-
lineNumber:
|
|
6777
|
+
lineNumber: 74,
|
|
6819
6778
|
columnNumber: 5
|
|
6820
6779
|
}
|
|
6821
6780
|
}, children, /*#__PURE__*/React__namespace.createElement(ToastContainer, {
|
|
@@ -6824,7 +6783,7 @@
|
|
|
6824
6783
|
__self: undefined,
|
|
6825
6784
|
__source: {
|
|
6826
6785
|
fileName: _jsxFileName$T,
|
|
6827
|
-
lineNumber:
|
|
6786
|
+
lineNumber: 76,
|
|
6828
6787
|
columnNumber: 7
|
|
6829
6788
|
}
|
|
6830
6789
|
}), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
|
|
@@ -6833,7 +6792,7 @@
|
|
|
6833
6792
|
__self: undefined,
|
|
6834
6793
|
__source: {
|
|
6835
6794
|
fileName: _jsxFileName$T,
|
|
6836
|
-
lineNumber:
|
|
6795
|
+
lineNumber: 80,
|
|
6837
6796
|
columnNumber: 7
|
|
6838
6797
|
}
|
|
6839
6798
|
}), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
|
|
@@ -6842,7 +6801,7 @@
|
|
|
6842
6801
|
__self: undefined,
|
|
6843
6802
|
__source: {
|
|
6844
6803
|
fileName: _jsxFileName$T,
|
|
6845
|
-
lineNumber:
|
|
6804
|
+
lineNumber: 84,
|
|
6846
6805
|
columnNumber: 7
|
|
6847
6806
|
}
|
|
6848
6807
|
}), /*#__PURE__*/React__namespace.createElement(ToastContainer, {
|
|
@@ -6851,23 +6810,11 @@
|
|
|
6851
6810
|
__self: undefined,
|
|
6852
6811
|
__source: {
|
|
6853
6812
|
fileName: _jsxFileName$T,
|
|
6854
|
-
lineNumber:
|
|
6813
|
+
lineNumber: 88,
|
|
6855
6814
|
columnNumber: 7
|
|
6856
6815
|
}
|
|
6857
6816
|
}));
|
|
6858
6817
|
};
|
|
6859
|
-
function _async$1(f) {
|
|
6860
|
-
return function () {
|
|
6861
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
6862
|
-
args[i] = arguments[i];
|
|
6863
|
-
}
|
|
6864
|
-
try {
|
|
6865
|
-
return Promise.resolve(f.apply(this, args));
|
|
6866
|
-
} catch (e) {
|
|
6867
|
-
return Promise.reject(e);
|
|
6868
|
-
}
|
|
6869
|
-
};
|
|
6870
|
-
}
|
|
6871
6818
|
|
|
6872
6819
|
const ConditionalWrapper = ({
|
|
6873
6820
|
condition,
|