PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.2
Elementor Website Builder – more than just a page builder v4.3.2
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | assets/js/packages/editor-notifications/editor-notifications.js +1640 -2349 4.2.1 → 4.3.2 View file →
@@ -1,2365 +1,1656 @@
1 -/******/ (function() { // webpackBootstrap
2 -/******/ "use strict";
3 -/******/ var __webpack_modules__ = ({
1 +(function(_elementor_editor, _elementor_store, react, react_dom, _elementor_icons, _elementor_ui) {
4 2
5 -/***/ "./node_modules/goober/dist/goober.modern.js":
6 -/*!***************************************************!*\
7 - !*** ./node_modules/goober/dist/goober.modern.js ***!
8 - \***************************************************/
9 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3 +//#region \0rolldown/runtime.js
4 + var __create = Object.create;
5 + var __defProp = Object.defineProperty;
6 + var __name = (target, value) => __defProp(target, "name", {
7 + value,
8 + configurable: true
9 + });
10 + var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 + var __getOwnPropNames = Object.getOwnPropertyNames;
12 + var __getProtoOf = Object.getPrototypeOf;
13 + var __hasOwnProp = Object.prototype.hasOwnProperty;
14 + var __exportAll = (all, no_symbols) => {
15 + let target = {};
16 + for (var name in all) {
17 + __defProp(target, name, {
18 + get: all[name],
19 + enumerable: true
20 + });
21 + }
22 + if (!no_symbols) {
23 + __defProp(target, Symbol.toStringTag, { value: "Module" });
24 + }
25 + return target;
26 + };
27 + var __copyProps = (to, from, except, desc) => {
28 + if (from && typeof from === "object" || typeof from === "function") {
29 + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
30 + key = keys[i];
31 + if (!__hasOwnProp.call(to, key) && key !== except) {
32 + __defProp(to, key, {
33 + get: ((k) => from[k]).bind(null, key),
34 + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
35 + });
36 + }
37 + }
38 + }
39 + return to;
40 + };
41 + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
42 + value: mod,
43 + enumerable: true
44 + }) : target, mod));
10 45
11 -__webpack_require__.r(__webpack_exports__);
12 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 -/* harmony export */ css: function() { return /* binding */ u; },
14 -/* harmony export */ extractCss: function() { return /* binding */ r; },
15 -/* harmony export */ glob: function() { return /* binding */ b; },
16 -/* harmony export */ keyframes: function() { return /* binding */ h; },
17 -/* harmony export */ setup: function() { return /* binding */ m; },
18 -/* harmony export */ styled: function() { return /* binding */ w; }
19 -/* harmony export */ });
20 -let e={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e},r=e=>{let r=t(e),l=r.data;return r.data="",l},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n=/\n+/g,o=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o(c,n):n+"{"+o(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o.p?o.p(n,c):n+":"+c+";")}return r+(t&&a?t+"{"+a+"}":a)+l},c={},s=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s(e[r]);return t}return e},i=(e,t,r,i,p)=>{let u=s(e),d=c[u]||(c[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(u));if(!c[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n," ").trim();return o[0]})(e);c[d]=o(p?{["@keyframes "+d]:t}:t,r?"":"."+d)}let f=r&&c.g?c.g:null;return r&&(c.g=c[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e)})(c[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o(e,""):!1===e?"":e}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}let d,f,g,b=u.bind({g:1}),h=u.bind({k:1});function m(e,t,r,l){o.p=t,d=e,f=r,g=l}function w(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=u.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=e;return e[0]&&(i=c.as||e,delete c.as),g&&i[0]&&g(c),d(i,c)}return t?t(a):a}}
46 +//#endregion
47 +react = __toESM(react);
21 48
49 +//#region node_modules/notistack/node_modules/clsx/dist/clsx.m.js
50 + function r(e) {
51 + var t;
52 + var f;
53 + var n = "";
54 + if ("string" == typeof e || "number" == typeof e) n += e;
55 + else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
56 + else for (t in e) e[t] && (n && (n += " "), n += t);
57 + return n;
58 + }
59 + function clsx() {
60 + for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
61 + return n;
62 + }
22 63
23 -/***/ }),
64 +//#endregion
65 +//#region node_modules/goober/dist/goober.modern.js
66 + var e = { data: "" };
67 + var t = (t) => {
68 + if ("object" == typeof window) {
69 + let e = (t ? t.querySelector("#_goober") : window._goober) || Object.assign(document.createElement("style"), {
70 + innerHTML: " ",
71 + id: "_goober"
72 + });
73 + return e.nonce = window.__nonce__, e.parentNode || (t || document.head).appendChild(e), e.firstChild;
74 + }
75 + return t || e;
76 + };
77 + var l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
78 + var a = /\/\*[^]*?\*\/| +/g;
79 + var n = /\n+/g;
80 + var o = (e, t) => {
81 + let r = "";
82 + let l = "";
83 + let a = "";
84 + for (let n in e) {
85 + let c = e[n];
86 + "@" == n[0] ? "i" == n[1] ? r = n + " " + c + ";" : l += "f" == n[1] ? o(c, n) : n + "{" + o(c, "k" == n[1] ? "" : t) + "}" : "object" == typeof c ? l += o(c, t ? t.replace(/([^,])+/g, (e) => n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t) => /&/.test(t) ? t.replace(/&/g, e) : e ? e + " " + t : t)) : n) : null != c && (n = /^--/.test(n) ? n : n.replace(/[A-Z]/g, "-$&").toLowerCase(), a += o.p ? o.p(n, c) : n + ":" + c + ";");
87 + }
88 + return r + (t && a ? t + "{" + a + "}" : a) + l;
89 + };
90 + var c = {};
91 + var s = (e) => {
92 + if ("object" == typeof e) {
93 + let t = "";
94 + for (let r in e) t += r + s(e[r]);
95 + return t;
96 + }
97 + return e;
98 + };
99 + var i = (e, t, r, i, p) => {
100 + let u = s(e);
101 + let d = c[u] || (c[u] = ((e) => {
102 + let t = 0;
103 + let r = 11;
104 + for (; t < e.length;) r = 101 * r + e.charCodeAt(t++) >>> 0;
105 + return "go" + r;
106 + })(u));
107 + if (!c[d]) {
108 + let t = u !== e ? e : ((e) => {
109 + let t;
110 + let r;
111 + let o = [{}];
112 + for (; t = l.exec(e.replace(a, ""));) t[4] ? o.shift() : t[3] ? (r = t[3].replace(n, " ").trim(), o.unshift(o[0][r] = o[0][r] || {})) : o[0][t[1]] = t[2].replace(n, " ").trim();
113 + return o[0];
114 + })(e);
115 + c[d] = o(p ? { ["@keyframes " + d]: t } : t, r ? "" : "." + d);
116 + }
117 + let f = r && c.g ? c.g : null;
118 + return r && (c.g = c[d]), ((e, t, r, l) => {
119 + l ? t.data = t.data.replace(l, e) : -1 === t.data.indexOf(e) && (t.data = r ? e + t.data : t.data + e);
120 + })(c[d], t, i, f), d;
121 + };
122 + var p = (e, t, r) => e.reduce((e, l, a) => {
123 + let n = t[a];
124 + if (n && n.call) {
125 + let e = n(r);
126 + let t = e && e.props && e.props.className || /^go/.test(e) && e;
127 + n = t ? "." + t : e && "object" == typeof e ? e.props ? "" : o(e, "") : !1 === e ? "" : e;
128 + }
129 + return e + l + (null == n ? "" : n);
130 + }, "");
131 + function u(e) {
132 + let r = this || {};
133 + let l = e.call ? e(r.p) : e;
134 + return i(l.unshift ? l.raw ? p(l, [].slice.call(arguments, 1), r.p) : l.reduce((e, t) => Object.assign(e, t && t.call ? t(r.p) : t), {}) : l, t(r.target), r.g, r.o, r.k);
135 + }
136 + var b = u.bind({ g: 1 });
137 + var h = u.bind({ k: 1 });
24 138
25 -/***/ "./node_modules/notistack/node_modules/clsx/dist/clsx.m.js":
26 -/*!*****************************************************************!*\
27 - !*** ./node_modules/notistack/node_modules/clsx/dist/clsx.m.js ***!
28 - \*****************************************************************/
29 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
139 +//#endregion
140 +//#region node_modules/notistack/notistack.esm.js
141 + function _defineProperties(target, props) {
142 + for (var i = 0; i < props.length; i++) {
143 + var descriptor = props[i];
144 + descriptor.enumerable = descriptor.enumerable || false;
145 + descriptor.configurable = true;
146 + if ("value" in descriptor) descriptor.writable = true;
147 + Object.defineProperty(target, descriptor.key, descriptor);
148 + }
149 + }
150 + function _createClass(Constructor, protoProps, staticProps) {
151 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
152 + if (staticProps) _defineProperties(Constructor, staticProps);
153 + return Constructor;
154 + }
155 + function _extends() {
156 + _extends = Object.assign || function(target) {
157 + for (var i = 1; i < arguments.length; i++) {
158 + var source = arguments[i];
159 + for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
160 + }
161 + return target;
162 + };
163 + return _extends.apply(this, arguments);
164 + }
165 + function _inheritsLoose(subClass, superClass) {
166 + subClass.prototype = Object.create(superClass.prototype);
167 + subClass.prototype.constructor = subClass;
168 + subClass.__proto__ = superClass;
169 + }
170 + function _objectWithoutPropertiesLoose(source, excluded) {
171 + if (source == null) return {};
172 + var target = {};
173 + var sourceKeys = Object.keys(source);
174 + var key;
175 + var i;
176 + for (i = 0; i < sourceKeys.length; i++) {
177 + key = sourceKeys[i];
178 + if (excluded.indexOf(key) >= 0) continue;
179 + target[key] = source[key];
180 + }
181 + return target;
182 + }
183 + function _assertThisInitialized(self) {
184 + if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
185 + return self;
186 + }
187 + var noOp = function noOp() {
188 + return "";
189 + };
190 + var SnackbarContext = /*#__PURE__*/ react.default.createContext({
191 + enqueueSnackbar: noOp,
192 + closeSnackbar: noOp
193 + });
194 + var breakpoints = {
195 + downXs: "@media (max-width:599.95px)",
196 + upSm: "@media (min-width:600px)"
197 + };
198 + var capitalise = function capitalise(text) {
199 + return text.charAt(0).toUpperCase() + text.slice(1);
200 + };
201 + var originKeyExtractor = function originKeyExtractor(anchor) {
202 + return "" + capitalise(anchor.vertical) + capitalise(anchor.horizontal);
203 + };
204 + var isDefined = function isDefined(value) {
205 + return !!value || value === 0;
206 + };
207 + var UNMOUNTED = "unmounted";
208 + var EXITED = "exited";
209 + var ENTERING = "entering";
210 + var ENTERED = "entered";
211 + var EXITING = "exiting";
212 + var Transition = /*#__PURE__*/ function(_React$Component) {
213 + _inheritsLoose(Transition, _React$Component);
214 + function Transition(props) {
215 + var _this = _React$Component.call(this, props) || this;
216 + var appear = props.appear;
217 + var initialStatus;
218 + _this.appearStatus = null;
219 + if (props["in"]) if (appear) {
220 + initialStatus = EXITED;
221 + _this.appearStatus = ENTERING;
222 + } else initialStatus = ENTERED;
223 + else if (props.unmountOnExit || props.mountOnEnter) initialStatus = UNMOUNTED;
224 + else initialStatus = EXITED;
225 + _this.state = { status: initialStatus };
226 + _this.nextCallback = null;
227 + return _this;
228 + }
229 + Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
230 + if (_ref["in"] && prevState.status === UNMOUNTED) return { status: EXITED };
231 + return null;
232 + };
233 + var _proto = Transition.prototype;
234 + _proto.componentDidMount = function componentDidMount() {
235 + this.updateStatus(true, this.appearStatus);
236 + };
237 + _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
238 + var nextStatus = null;
239 + if (prevProps !== this.props) {
240 + var status = this.state.status;
241 + if (this.props["in"]) {
242 + if (status !== ENTERING && status !== ENTERED) nextStatus = ENTERING;
243 + } else if (status === ENTERING || status === ENTERED) nextStatus = EXITING;
244 + }
245 + this.updateStatus(false, nextStatus);
246 + };
247 + _proto.componentWillUnmount = function componentWillUnmount() {
248 + this.cancelNextCallback();
249 + };
250 + _proto.getTimeouts = function getTimeouts() {
251 + var timeout = this.props.timeout;
252 + var enter = timeout;
253 + var exit = timeout;
254 + if (timeout != null && typeof timeout !== "number" && typeof timeout !== "string") {
255 + exit = timeout.exit;
256 + enter = timeout.enter;
257 + }
258 + return {
259 + exit,
260 + enter
261 + };
262 + };
263 + _proto.updateStatus = function updateStatus(mounting, nextStatus) {
264 + if (mounting === void 0) mounting = false;
265 + if (nextStatus !== null) {
266 + this.cancelNextCallback();
267 + if (nextStatus === ENTERING) this.performEnter(mounting);
268 + else this.performExit();
269 + } else if (this.props.unmountOnExit && this.state.status === EXITED) this.setState({ status: UNMOUNTED });
270 + };
271 + _proto.performEnter = function performEnter(mounting) {
272 + var _this2 = this;
273 + var enter = this.props.enter;
274 + var isAppearing = mounting;
275 + var timeouts = this.getTimeouts();
276 + if (!mounting && !enter) {
277 + this.safeSetState({ status: ENTERED }, function() {
278 + if (_this2.props.onEntered) _this2.props.onEntered(_this2.node, isAppearing);
279 + });
280 + return;
281 + }
282 + if (this.props.onEnter) this.props.onEnter(this.node, isAppearing);
283 + this.safeSetState({ status: ENTERING }, function() {
284 + if (_this2.props.onEntering) _this2.props.onEntering(_this2.node, isAppearing);
285 + _this2.onTransitionEnd(timeouts.enter, function() {
286 + _this2.safeSetState({ status: ENTERED }, function() {
287 + if (_this2.props.onEntered) _this2.props.onEntered(_this2.node, isAppearing);
288 + });
289 + });
290 + });
291 + };
292 + _proto.performExit = function performExit() {
293 + var _this3 = this;
294 + var exit = this.props.exit;
295 + var timeouts = this.getTimeouts();
296 + if (!exit) {
297 + this.safeSetState({ status: EXITED }, function() {
298 + if (_this3.props.onExited) _this3.props.onExited(_this3.node);
299 + });
300 + return;
301 + }
302 + if (this.props.onExit) this.props.onExit(this.node);
303 + this.safeSetState({ status: EXITING }, function() {
304 + if (_this3.props.onExiting) _this3.props.onExiting(_this3.node);
305 + _this3.onTransitionEnd(timeouts.exit, function() {
306 + _this3.safeSetState({ status: EXITED }, function() {
307 + if (_this3.props.onExited) _this3.props.onExited(_this3.node);
308 + });
309 + });
310 + });
311 + };
312 + _proto.cancelNextCallback = function cancelNextCallback() {
313 + if (this.nextCallback !== null && this.nextCallback.cancel) {
314 + this.nextCallback.cancel();
315 + this.nextCallback = null;
316 + }
317 + };
318 + _proto.safeSetState = function safeSetState(nextState, callback) {
319 + callback = this.setNextCallback(callback);
320 + this.setState(nextState, callback);
321 + };
322 + _proto.setNextCallback = function setNextCallback(callback) {
323 + var _this4 = this;
324 + var active = true;
325 + this.nextCallback = function() {
326 + if (active) {
327 + active = false;
328 + _this4.nextCallback = null;
329 + callback();
330 + }
331 + };
332 + this.nextCallback.cancel = function() {
333 + active = false;
334 + };
335 + return this.nextCallback;
336 + };
337 + _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
338 + this.setNextCallback(handler);
339 + var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
340 + if (!this.node || doesNotHaveTimeoutOrListener) {
341 + setTimeout(this.nextCallback, 0);
342 + return;
343 + }
344 + if (this.props.addEndListener) this.props.addEndListener(this.node, this.nextCallback);
345 + if (timeout != null) setTimeout(this.nextCallback, timeout);
346 + };
347 + _proto.render = function render() {
348 + var status = this.state.status;
349 + if (status === UNMOUNTED) return null;
350 + var _this$props = this.props;
351 + var children = _this$props.children;
352 + return children(status, _objectWithoutPropertiesLoose(_this$props, [
353 + "children",
354 + "in",
355 + "mountOnEnter",
356 + "unmountOnExit",
357 + "appear",
358 + "enter",
359 + "exit",
360 + "timeout",
361 + "addEndListener",
362 + "onEnter",
363 + "onEntering",
364 + "onEntered",
365 + "onExit",
366 + "onExiting",
367 + "onExited",
368 + "nodeRef"
369 + ]));
370 + };
371 + _createClass(Transition, [{
372 + key: "node",
373 + get: function get() {
374 + var _this$props$nodeRef;
375 + var node = (_this$props$nodeRef = this.props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current;
376 + if (!node) throw new Error("notistack - Custom snackbar is not refForwarding");
377 + return node;
378 + }
379 + }]);
380 + return Transition;
381 + }(react.default.Component);
382 + function noop() {}
383 + Transition.defaultProps = {
384 + "in": false,
385 + mountOnEnter: false,
386 + unmountOnExit: false,
387 + appear: false,
388 + enter: true,
389 + exit: true,
390 + onEnter: noop,
391 + onEntering: noop,
392 + onEntered: noop,
393 + onExit: noop,
394 + onExiting: noop,
395 + onExited: noop
396 + };
397 + /**
398 + * Credit to MUI team @ https://mui.com
399 + */
400 + /**
401 + * passes {value} to {ref}
402 + *
403 + * Useful if you want to expose the ref of an inner component to the public API
404 + * while still using it inside the component.
405 + * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
406 + */
407 + function setRef(ref, value) {
408 + if (typeof ref === "function") ref(value);
409 + else if (ref) ref.current = value;
410 + }
411 + function useForkRef(refA, refB) {
412 + /**
413 + * This will create a new function if the ref props change and are defined.
414 + * This means react will call the old forkRef with `null` and the new forkRef
415 + * with the ref. Cleanup naturally emerges from this behavior.
416 + */
417 + return (0, react.useMemo)(function() {
418 + if (refA == null && refB == null) return null;
419 + return function(refValue) {
420 + setRef(refA, refValue);
421 + setRef(refB, refValue);
422 + };
423 + }, [refA, refB]);
424 + }
425 + function getTransitionProps(props) {
426 + var timeout = props.timeout;
427 + var _props$style = props.style;
428 + var style = _props$style === void 0 ? {} : _props$style;
429 + var mode = props.mode;
430 + return {
431 + duration: typeof timeout === "object" ? timeout[mode] || 0 : timeout,
432 + easing: style.transitionTimingFunction,
433 + delay: style.transitionDelay
434 + };
435 + }
436 + /**
437 + * Credit to MUI team @ https://mui.com
438 + */
439 + var defaultEasing = {
440 + easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
441 + easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
442 + easeIn: "cubic-bezier(0.4, 0, 1, 1)",
443 + sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
444 + };
445 + /**
446 + * CSS hack to force a repaint
447 + */
448 + var reflow = function reflow(node) {
449 + node.scrollTop = node.scrollTop;
450 + };
451 + var formatMs = function formatMs(milliseconds) {
452 + return Math.round(milliseconds) + "ms";
453 + };
454 + function createTransition(props, options) {
455 + if (props === void 0) props = ["all"];
456 + var _ref = options || {};
457 + var _ref$duration = _ref.duration;
458 + var duration = _ref$duration === void 0 ? 300 : _ref$duration;
459 + var _ref$easing = _ref.easing;
460 + var easing = _ref$easing === void 0 ? defaultEasing.easeInOut : _ref$easing;
461 + var _ref$delay = _ref.delay;
462 + var delay = _ref$delay === void 0 ? 0 : _ref$delay;
463 + return (Array.isArray(props) ? props : [props]).map(function(animatedProp) {
464 + var formattedDuration = typeof duration === "string" ? duration : formatMs(duration);
465 + var formattedDelay = typeof delay === "string" ? delay : formatMs(delay);
466 + return animatedProp + " " + formattedDuration + " " + easing + " " + formattedDelay;
467 + }).join(",");
468 + }
469 + function ownerDocument(node) {
470 + return node && node.ownerDocument || document;
471 + }
472 + function ownerWindow(node) {
473 + return ownerDocument(node).defaultView || window;
474 + }
475 + /**
476 + * Corresponds to 10 frames at 60 Hz.
477 + * A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
478 + */
479 + function debounce(func, wait) {
480 + if (wait === void 0) wait = 166;
481 + var timeout;
482 + function debounced() {
483 + var _this = this;
484 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
485 + var later = function later() {
486 + func.apply(_this, args);
487 + };
488 + clearTimeout(timeout);
489 + timeout = setTimeout(later, wait);
490 + }
491 + debounced.clear = function() {
492 + clearTimeout(timeout);
493 + };
494 + return debounced;
495 + }
496 + /**
497 + * Translate the node so it can't be seen on the screen.
498 + * Later, we're going to translate the node back to its original location with `none`.
499 + */
500 + function getTranslateValue(direction, node) {
501 + var rect = node.getBoundingClientRect();
502 + var containerWindow = ownerWindow(node);
503 + var transform;
504 + if (node.fakeTransform) transform = node.fakeTransform;
505 + else {
506 + var computedStyle = containerWindow.getComputedStyle(node);
507 + transform = computedStyle.getPropertyValue("-webkit-transform") || computedStyle.getPropertyValue("transform");
508 + }
509 + var offsetX = 0;
510 + var offsetY = 0;
511 + if (transform && transform !== "none" && typeof transform === "string") {
512 + var transformValues = transform.split("(")[1].split(")")[0].split(",");
513 + offsetX = parseInt(transformValues[4], 10);
514 + offsetY = parseInt(transformValues[5], 10);
515 + }
516 + switch (direction) {
517 + case "left": return "translateX(" + (containerWindow.innerWidth + offsetX - rect.left) + "px)";
518 + case "right": return "translateX(-" + (rect.left + rect.width - offsetX) + "px)";
519 + case "up": return "translateY(" + (containerWindow.innerHeight + offsetY - rect.top) + "px)";
520 + default: return "translateY(-" + (rect.top + rect.height - offsetY) + "px)";
521 + }
522 + }
523 + function setTranslateValue(direction, node) {
524 + if (!node) return;
525 + var transform = getTranslateValue(direction, node);
526 + if (transform) {
527 + node.style.webkitTransform = transform;
528 + node.style.transform = transform;
529 + }
530 + }
531 + var Slide = /*#__PURE__*/ (0, react.forwardRef)(function(props, ref) {
532 + var children = props.children;
533 + var _props$direction = props.direction;
534 + var direction = _props$direction === void 0 ? "down" : _props$direction;
535 + var inProp = props["in"];
536 + var style = props.style;
537 + var _props$timeout = props.timeout;
538 + var timeout = _props$timeout === void 0 ? 0 : _props$timeout;
539 + var onEnter = props.onEnter;
540 + var onEntered = props.onEntered;
541 + var onExit = props.onExit;
542 + var onExited = props.onExited;
543 + var other = _objectWithoutPropertiesLoose(props, [
544 + "children",
545 + "direction",
546 + "in",
547 + "style",
548 + "timeout",
549 + "onEnter",
550 + "onEntered",
551 + "onExit",
552 + "onExited"
553 + ]);
554 + var nodeRef = (0, react.useRef)(null);
555 + var handleRef = useForkRef(useForkRef(children.ref, nodeRef), ref);
556 + var handleEnter = function handleEnter(node, isAppearing) {
557 + setTranslateValue(direction, node);
558 + reflow(node);
559 + if (onEnter) onEnter(node, isAppearing);
560 + };
561 + var handleEntering = function handleEntering(node) {
562 + var easing = (style === null || style === void 0 ? void 0 : style.transitionTimingFunction) || defaultEasing.easeOut;
563 + var transitionProps = getTransitionProps({
564 + timeout,
565 + mode: "enter",
566 + style: _extends({}, style, { transitionTimingFunction: easing })
567 + });
568 + node.style.webkitTransition = createTransition("-webkit-transform", transitionProps);
569 + node.style.transition = createTransition("transform", transitionProps);
570 + node.style.webkitTransform = "none";
571 + node.style.transform = "none";
572 + };
573 + var handleExit = function handleExit(node) {
574 + var easing = (style === null || style === void 0 ? void 0 : style.transitionTimingFunction) || defaultEasing.sharp;
575 + var transitionProps = getTransitionProps({
576 + timeout,
577 + mode: "exit",
578 + style: _extends({}, style, { transitionTimingFunction: easing })
579 + });
580 + node.style.webkitTransition = createTransition("-webkit-transform", transitionProps);
581 + node.style.transition = createTransition("transform", transitionProps);
582 + setTranslateValue(direction, node);
583 + if (onExit) onExit(node);
584 + };
585 + var handleExited = function handleExited(node) {
586 + node.style.webkitTransition = "";
587 + node.style.transition = "";
588 + if (onExited) onExited(node);
589 + };
590 + var updatePosition = (0, react.useCallback)(function() {
591 + if (nodeRef.current) setTranslateValue(direction, nodeRef.current);
592 + }, [direction]);
593 + (0, react.useEffect)(function() {
594 + if (inProp || direction === "down" || direction === "right") return;
595 + var handleResize = debounce(function() {
596 + if (nodeRef.current) setTranslateValue(direction, nodeRef.current);
597 + });
598 + var containerWindow = ownerWindow(nodeRef.current);
599 + containerWindow.addEventListener("resize", handleResize);
600 + return function() {
601 + handleResize.clear();
602 + containerWindow.removeEventListener("resize", handleResize);
603 + };
604 + }, [direction, inProp]);
605 + (0, react.useEffect)(function() {
606 + if (!inProp) updatePosition();
607 + }, [inProp, updatePosition]);
608 + return (0, react.createElement)(Transition, Object.assign({
609 + appear: true,
610 + nodeRef,
611 + onEnter: handleEnter,
612 + onEntered,
613 + onEntering: handleEntering,
614 + onExit: handleExit,
615 + onExited: handleExited,
616 + "in": inProp,
617 + timeout
618 + }, other), function(state, childProps) {
619 + return (0, react.cloneElement)(children, _extends({
620 + ref: handleRef,
621 + style: _extends({ visibility: state === "exited" && !inProp ? "hidden" : void 0 }, style, {}, children.props.style)
622 + }, childProps));
623 + });
624 + });
625 + Slide.displayName = "Slide";
626 + var SvgIcon = function SvgIcon(props) {
627 + return react.default.createElement("svg", Object.assign({
628 + viewBox: "0 0 24 24",
629 + focusable: "false",
630 + style: {
631 + fontSize: 20,
632 + marginInlineEnd: 8,
633 + userSelect: "none",
634 + width: "1em",
635 + height: "1em",
636 + display: "inline-block",
637 + fill: "currentColor",
638 + flexShrink: 0
639 + }
640 + }, props));
641 + };
642 + var defaults = {
643 + maxSnack: 3,
644 + persist: false,
645 + hideIconVariant: false,
646 + disableWindowBlurListener: false,
647 + variant: "default",
648 + autoHideDuration: 5e3,
649 + iconVariant: {
650 + "default": void 0,
651 + success: /*#__PURE__*/ react.default.createElement(function CheckIcon() {
652 + return react.default.createElement(SvgIcon, null, react.default.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z" }));
653 + }, null),
654 + warning: /*#__PURE__*/ react.default.createElement(function WarningIcon() {
655 + return react.default.createElement(SvgIcon, null, react.default.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
656 + }, null),
657 + error: /*#__PURE__*/ react.default.createElement(function ErrorIcon() {
658 + return react.default.createElement(SvgIcon, null, react.default.createElement("path", { d: "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z" }));
659 + }, null),
660 + info: /*#__PURE__*/ react.default.createElement(function InfoIcon() {
661 + return react.default.createElement(SvgIcon, null, react.default.createElement("path", { d: "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z" }));
662 + }, null)
663 + },
664 + anchorOrigin: {
665 + vertical: "bottom",
666 + horizontal: "left"
667 + },
668 + TransitionComponent: Slide,
669 + transitionDuration: {
670 + enter: 225,
671 + exit: 195
672 + }
673 + };
674 + /**
675 + * Derives the right autoHideDuration taking into account the following
676 + * prority order: 1: Options, 2: Props, 3: default fallback
677 + */
678 + var getAutoHideDuration = function getAutoHideDuration(optionsDuration, propsDuration) {
679 + var isNumberOrNull = function isNumberOrNull(numberish) {
680 + return typeof numberish === "number" || numberish === null;
681 + };
682 + if (isNumberOrNull(optionsDuration)) return optionsDuration;
683 + if (isNumberOrNull(propsDuration)) return propsDuration;
684 + return defaults.autoHideDuration;
685 + };
686 + /**
687 + * Derives the right transitionDuration taking into account the following
688 + * prority order: 1: Options, 2: Props, 3: default fallback
689 + */
690 + var getTransitionDuration = function getTransitionDuration(optionsDuration, propsDuration) {
691 + var is = function is(item, types) {
692 + return types.some(function(t) {
693 + return typeof item === t;
694 + });
695 + };
696 + if (is(optionsDuration, ["string", "number"])) return optionsDuration;
697 + if (is(optionsDuration, ["object"])) return _extends({}, defaults.transitionDuration, {}, is(propsDuration, ["object"]) && propsDuration, {}, optionsDuration);
698 + if (is(propsDuration, ["string", "number"])) return propsDuration;
699 + if (is(propsDuration, ["object"])) return _extends({}, defaults.transitionDuration, {}, propsDuration);
700 + return defaults.transitionDuration;
701 + };
702 + var merge = function merge(options, props) {
703 + return function(name, shouldObjectMerge) {
704 + if (shouldObjectMerge === void 0) shouldObjectMerge = false;
705 + if (shouldObjectMerge) return _extends({}, defaults[name], {}, props[name], {}, options[name]);
706 + if (name === "autoHideDuration") return getAutoHideDuration(options.autoHideDuration, props.autoHideDuration);
707 + if (name === "transitionDuration") return getTransitionDuration(options.transitionDuration, props.transitionDuration);
708 + return options[name] || props[name] || defaults[name];
709 + };
710 + };
711 + function makeStyles(styles) {
712 + return Object.entries(styles).reduce(function(acc, _ref) {
713 + var _extends2;
714 + var key = _ref[0];
715 + var value = _ref[1];
716 + return _extends({}, acc, (_extends2 = {}, _extends2[key] = u(value), _extends2));
717 + }, {});
718 + }
719 + var ComponentClasses = {
720 + SnackbarContainer: "notistack-SnackbarContainer",
721 + Snackbar: "notistack-Snackbar",
722 + CollapseWrapper: "notistack-CollapseWrapper",
723 + MuiContent: "notistack-MuiContent",
724 + MuiContentVariant: function MuiContentVariant(variant) {
725 + return "notistack-MuiContent-" + variant;
726 + }
727 + };
728 + var classes = /*#__PURE__*/ makeStyles({
729 + root: { height: 0 },
730 + entered: { height: "auto" }
731 + });
732 + var collapsedSize = "0px";
733 + var timeout = 175;
734 + var Collapse = /*#__PURE__*/ (0, react.forwardRef)(function(props, ref) {
735 + var children = props.children;
736 + var inProp = props["in"];
737 + var onExited = props.onExited;
738 + var wrapperRef = (0, react.useRef)(null);
739 + var nodeRef = (0, react.useRef)(null);
740 + var handleRef = useForkRef(ref, nodeRef);
741 + var getWrapperSize = function getWrapperSize() {
742 + return wrapperRef.current ? wrapperRef.current.clientHeight : 0;
743 + };
744 + return (0, react.createElement)(Transition, {
745 + "in": inProp,
746 + unmountOnExit: true,
747 + onEnter: function handleEnter(node) {
748 + node.style.height = collapsedSize;
749 + },
750 + onEntered: function handleEntered(node) {
751 + node.style.height = "auto";
752 + },
753 + onEntering: function handleEntering(node) {
754 + var wrapperSize = getWrapperSize();
755 + var _getTransitionProps = getTransitionProps({
756 + timeout,
757 + mode: "enter"
758 + });
759 + var transitionDuration = _getTransitionProps.duration;
760 + var easing = _getTransitionProps.easing;
761 + node.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : transitionDuration + "ms";
762 + node.style.height = wrapperSize + "px";
763 + node.style.transitionTimingFunction = easing || "";
764 + },
765 + onExit: function handleExit(node) {
766 + node.style.height = getWrapperSize() + "px";
767 + },
768 + onExited,
769 + onExiting: function handleExiting(node) {
770 + reflow(node);
771 + var _getTransitionProps2 = getTransitionProps({
772 + timeout,
773 + mode: "exit"
774 + });
775 + var transitionDuration = _getTransitionProps2.duration;
776 + var easing = _getTransitionProps2.easing;
777 + node.style.transitionDuration = typeof transitionDuration === "string" ? transitionDuration : transitionDuration + "ms";
778 + node.style.height = collapsedSize;
779 + node.style.transitionTimingFunction = easing || "";
780 + },
781 + nodeRef,
782 + timeout
783 + }, function(state, childProps) {
784 + return (0, react.createElement)("div", Object.assign({
785 + ref: handleRef,
786 + className: clsx(classes.root, state === "entered" && classes.entered),
787 + style: _extends({
788 + pointerEvents: "all",
789 + overflow: "hidden",
790 + minHeight: collapsedSize,
791 + transition: createTransition("height")
792 + }, state === "entered" && { overflow: "visible" }, {}, state === "exited" && !inProp && { visibility: "hidden" })
793 + }, childProps), (0, react.createElement)("div", {
794 + ref: wrapperRef,
795 + className: ComponentClasses.CollapseWrapper,
796 + style: {
797 + display: "flex",
798 + width: "100%"
799 + }
800 + }, children));
801 + });
802 + });
803 + Collapse.displayName = "Collapse";
804 + var direction = {
805 + right: "left",
806 + left: "right",
807 + bottom: "up",
808 + top: "down"
809 + };
810 + var getSlideDirection = function getSlideDirection(anchorOrigin) {
811 + if (anchorOrigin.horizontal !== "center") return direction[anchorOrigin.horizontal];
812 + return direction[anchorOrigin.vertical];
813 + };
814 + /** Tranforms classes name */
815 + var toSnackbarAnchorOrigin = function toSnackbarAnchorOrigin(anchorOrigin) {
816 + return "anchorOrigin" + originKeyExtractor(anchorOrigin);
817 + };
818 + /**
819 + * Omit SnackbarContainer class keys that are not needed for SnackbarItem
820 + */
821 + var keepSnackbarClassKeys = function keepSnackbarClassKeys(classes) {
822 + if (classes === void 0) classes = {};
823 + var containerClasses = {
824 + containerRoot: true,
825 + containerAnchorOriginTopCenter: true,
826 + containerAnchorOriginBottomCenter: true,
827 + containerAnchorOriginTopRight: true,
828 + containerAnchorOriginBottomRight: true,
829 + containerAnchorOriginTopLeft: true,
830 + containerAnchorOriginBottomLeft: true
831 + };
832 + return Object.keys(classes).filter(function(key) {
833 + return !containerClasses[key];
834 + }).reduce(function(obj, key) {
835 + var _extends2;
836 + return _extends({}, obj, (_extends2 = {}, _extends2[key] = classes[key], _extends2));
837 + }, {});
838 + };
839 + var noOp$1 = function noOp() {};
840 + /**
841 + * Credit to MUI team @ https://mui.com
842 + * Safe chained function.
843 + *
844 + * Will only create a new function if needed,
845 + * otherwise will pass back existing functions or null.
846 + */
847 + function createChainedFunction(funcs, snackbarId) {
848 + return funcs.reduce(function(acc, func) {
849 + if (func === null || func === void 0) return acc;
850 + return function chainedFunction() {
851 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
852 + var argums = [].concat(args);
853 + if (snackbarId && argums.indexOf(snackbarId) === -1) argums.push(snackbarId);
854 + acc.apply(this, argums);
855 + func.apply(this, argums);
856 + };
857 + }, noOp$1);
858 + }
859 + /**
860 + * Credit to MUI team @ https://mui.com
861 + * https://github.com/facebook/react/issues/14099#issuecomment-440013892
862 + */
863 + var useEnhancedEffect = typeof window !== "undefined" ? react.useLayoutEffect : react.useEffect;
864 + function useEventCallback(fn) {
865 + var ref = (0, react.useRef)(fn);
866 + useEnhancedEffect(function() {
867 + ref.current = fn;
868 + });
869 + return (0, react.useCallback)(function() {
870 + return ref.current.apply(void 0, arguments);
871 + }, []);
872 + }
873 + /**
874 + * Credit to MUI team @ https://mui.com
875 + */
876 + var Snackbar = /*#__PURE__*/ (0, react.forwardRef)(function(props, ref) {
877 + var children = props.children;
878 + var className = props.className;
879 + var autoHideDuration = props.autoHideDuration;
880 + var _props$disableWindowB = props.disableWindowBlurListener;
881 + var disableWindowBlurListener = _props$disableWindowB === void 0 ? false : _props$disableWindowB;
882 + var onClose = props.onClose;
883 + var id = props.id;
884 + var open = props.open;
885 + var _props$SnackbarProps = props.SnackbarProps;
886 + var SnackbarProps = _props$SnackbarProps === void 0 ? {} : _props$SnackbarProps;
887 + var timerAutoHide = (0, react.useRef)();
888 + var handleClose = useEventCallback(function() {
889 + if (onClose) onClose.apply(void 0, arguments);
890 + });
891 + var setAutoHideTimer = useEventCallback(function(autoHideDurationParam) {
892 + if (!onClose || autoHideDurationParam == null) return;
893 + if (timerAutoHide.current) clearTimeout(timerAutoHide.current);
894 + timerAutoHide.current = setTimeout(function() {
895 + handleClose(null, "timeout", id);
896 + }, autoHideDurationParam);
897 + });
898 + (0, react.useEffect)(function() {
899 + if (open) setAutoHideTimer(autoHideDuration);
900 + return function() {
901 + if (timerAutoHide.current) clearTimeout(timerAutoHide.current);
902 + };
903 + }, [
904 + open,
905 + autoHideDuration,
906 + setAutoHideTimer
907 + ]);
908 + /**
909 + * Pause the timer when the user is interacting with the Snackbar
910 + * or when the user hide the window.
911 + */
912 + var handlePause = function handlePause() {
913 + if (timerAutoHide.current) clearTimeout(timerAutoHide.current);
914 + };
915 + /**
916 + * Restart the timer when the user is no longer interacting with the Snackbar
917 + * or when the window is shown back.
918 + */
919 + var handleResume = (0, react.useCallback)(function() {
920 + if (autoHideDuration != null) setAutoHideTimer(autoHideDuration * .5);
921 + }, [autoHideDuration, setAutoHideTimer]);
922 + var handleMouseEnter = function handleMouseEnter(event) {
923 + if (SnackbarProps.onMouseEnter) SnackbarProps.onMouseEnter(event);
924 + handlePause();
925 + };
926 + var handleMouseLeave = function handleMouseLeave(event) {
927 + if (SnackbarProps.onMouseLeave) SnackbarProps.onMouseLeave(event);
928 + handleResume();
929 + };
930 + (0, react.useEffect)(function() {
931 + if (!disableWindowBlurListener && open) {
932 + window.addEventListener("focus", handleResume);
933 + window.addEventListener("blur", handlePause);
934 + return function() {
935 + window.removeEventListener("focus", handleResume);
936 + window.removeEventListener("blur", handlePause);
937 + };
938 + }
939 + }, [
940 + disableWindowBlurListener,
941 + handleResume,
942 + open
943 + ]);
944 + return (0, react.createElement)("div", Object.assign({ ref }, SnackbarProps, {
945 + className: clsx(ComponentClasses.Snackbar, className),
946 + onMouseEnter: handleMouseEnter,
947 + onMouseLeave: handleMouseLeave
948 + }), children);
949 + });
950 + Snackbar.displayName = "Snackbar";
951 + var _root;
952 + var classes$1 = /*#__PURE__*/ makeStyles({ root: (_root = {
953 + display: "flex",
954 + flexWrap: "wrap",
955 + flexGrow: 1
956 + }, _root[breakpoints.upSm] = {
957 + flexGrow: "initial",
958 + minWidth: "288px"
959 + }, _root) });
960 + var SnackbarContent$1 = /*#__PURE__*/ (0, react.forwardRef)(function(_ref, ref) {
961 + var className = _ref.className;
962 + var props = _objectWithoutPropertiesLoose(_ref, ["className"]);
963 + return react.default.createElement("div", Object.assign({
964 + ref,
965 + className: clsx(classes$1.root, className)
966 + }, props));
967 + });
968 + SnackbarContent$1.displayName = "SnackbarContent";
969 + var classes$2 = /*#__PURE__*/ makeStyles({
970 + root: {
971 + backgroundColor: "#313131",
972 + fontSize: "0.875rem",
973 + lineHeight: 1.43,
974 + letterSpacing: "0.01071em",
975 + color: "#fff",
976 + alignItems: "center",
977 + padding: "6px 16px",
978 + borderRadius: "4px",
979 + boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
980 + },
981 + lessPadding: { paddingLeft: "20px" },
982 + "default": { backgroundColor: "#313131" },
983 + success: { backgroundColor: "#43a047" },
984 + error: { backgroundColor: "#d32f2f" },
985 + warning: { backgroundColor: "#ff9800" },
986 + info: { backgroundColor: "#2196f3" },
987 + message: {
988 + display: "flex",
989 + alignItems: "center",
990 + padding: "8px 0"
991 + },
992 + action: {
993 + display: "flex",
994 + alignItems: "center",
995 + marginLeft: "auto",
996 + paddingLeft: "16px",
997 + marginRight: "-8px"
998 + }
999 + });
1000 + var ariaDescribedby = "notistack-snackbar";
1001 + var MaterialDesignContent = /*#__PURE__*/ (0, react.forwardRef)(function(props, forwardedRef) {
1002 + var id = props.id;
1003 + var message = props.message;
1004 + var componentOrFunctionAction = props.action;
1005 + var iconVariant = props.iconVariant;
1006 + var variant = props.variant;
1007 + var hideIconVariant = props.hideIconVariant;
1008 + var style = props.style;
1009 + var className = props.className;
1010 + var icon = iconVariant[variant];
1011 + var action = componentOrFunctionAction;
1012 + if (typeof action === "function") action = action(id);
1013 + return react.default.createElement(SnackbarContent$1, {
1014 + ref: forwardedRef,
1015 + role: "alert",
1016 + "aria-describedby": ariaDescribedby,
1017 + style,
1018 + className: clsx(ComponentClasses.MuiContent, ComponentClasses.MuiContentVariant(variant), classes$2.root, classes$2[variant], className, !hideIconVariant && icon && classes$2.lessPadding)
1019 + }, react.default.createElement("div", {
1020 + id: ariaDescribedby,
1021 + className: classes$2.message
1022 + }, !hideIconVariant ? icon : null, message), action && react.default.createElement("div", { className: classes$2.action }, action));
1023 + });
1024 + MaterialDesignContent.displayName = "MaterialDesignContent";
1025 + var MaterialDesignContent$1 = /*#__PURE__*/ (0, react.memo)(MaterialDesignContent);
1026 + var styles = /*#__PURE__*/ makeStyles({ wrappedRoot: {
1027 + width: "100%",
1028 + position: "relative",
1029 + transform: "translateX(0)",
1030 + top: 0,
1031 + right: 0,
1032 + bottom: 0,
1033 + left: 0,
1034 + minWidth: "288px"
1035 + } });
1036 + var SnackbarItem = function SnackbarItem(props) {
1037 + var timeout = (0, react.useRef)();
1038 + var _useState = (0, react.useState)(true);
1039 + var collapsed = _useState[0];
1040 + var setCollapsed = _useState[1];
1041 + var handleClose = createChainedFunction([props.snack.onClose, props.onClose]);
1042 + var handleEntered = function handleEntered() {
1043 + if (props.snack.requestClose) handleClose(null, "instructed", props.snack.id);
1044 + };
1045 + var handleExitedScreen = (0, react.useCallback)(function() {
1046 + timeout.current = setTimeout(function() {
1047 + setCollapsed(function(col) {
1048 + return !col;
1049 + });
1050 + }, 125);
1051 + }, []);
1052 + (0, react.useEffect)(function() {
1053 + return function() {
1054 + if (timeout.current) clearTimeout(timeout.current);
1055 + };
1056 + }, []);
1057 + var snack = props.snack;
1058 + var allClasses = props.classes;
1059 + var _props$Component = props.Component;
1060 + var Component = _props$Component === void 0 ? MaterialDesignContent$1 : _props$Component;
1061 + var classes = (0, react.useMemo)(function() {
1062 + return keepSnackbarClassKeys(allClasses);
1063 + }, [allClasses]);
1064 + var open = snack.open;
1065 + var SnackbarProps = snack.SnackbarProps;
1066 + var TransitionComponent = snack.TransitionComponent;
1067 + var TransitionProps = snack.TransitionProps;
1068 + var transitionDuration = snack.transitionDuration;
1069 + var disableWindowBlurListener = snack.disableWindowBlurListener;
1070 + var componentOrFunctionContent = snack.content;
1071 + var otherSnack = _objectWithoutPropertiesLoose(snack, [
1072 + "open",
1073 + "SnackbarProps",
1074 + "TransitionComponent",
1075 + "TransitionProps",
1076 + "transitionDuration",
1077 + "disableWindowBlurListener",
1078 + "content",
1079 + "entered",
1080 + "requestClose",
1081 + "onEnter",
1082 + "onEntered",
1083 + "onExit",
1084 + "onExited"
1085 + ]);
1086 + var transitionProps = _extends({
1087 + direction: getSlideDirection(otherSnack.anchorOrigin),
1088 + timeout: transitionDuration
1089 + }, TransitionProps);
1090 + var content = componentOrFunctionContent;
1091 + if (typeof content === "function") content = content(otherSnack.id, otherSnack.message);
1092 + var callbacks = [
1093 + "onEnter",
1094 + "onEntered",
1095 + "onExit",
1096 + "onExited"
1097 + ].reduce(function(acc, cbName) {
1098 + var _extends2;
1099 + return _extends({}, acc, (_extends2 = {}, _extends2[cbName] = createChainedFunction([props.snack[cbName], props[cbName]], otherSnack.id), _extends2));
1100 + }, {});
1101 + return react.default.createElement(Collapse, {
1102 + "in": collapsed,
1103 + onExited: callbacks.onExited
1104 + }, react.default.createElement(Snackbar, {
1105 + open,
1106 + id: otherSnack.id,
1107 + disableWindowBlurListener,
1108 + autoHideDuration: otherSnack.autoHideDuration,
1109 + className: clsx(styles.wrappedRoot, classes.root, classes[toSnackbarAnchorOrigin(otherSnack.anchorOrigin)]),
1110 + SnackbarProps,
1111 + onClose: handleClose
1112 + }, react.default.createElement(TransitionComponent, Object.assign({}, transitionProps, {
1113 + appear: true,
1114 + "in": open,
1115 + onExit: callbacks.onExit,
1116 + onExited: handleExitedScreen,
1117 + onEnter: callbacks.onEnter,
1118 + onEntered: createChainedFunction([callbacks.onEntered, handleEntered], otherSnack.id)
1119 + }), content || react.default.createElement(Component, Object.assign({}, otherSnack)))));
1120 + };
1121 + var _root$1;
1122 + var _rootDense;
1123 + var _left;
1124 + var _right;
1125 + var _center;
1126 + var indents = {
1127 + view: {
1128 + "default": 20,
1129 + dense: 4
1130 + },
1131 + snackbar: {
1132 + "default": 6,
1133 + dense: 2
1134 + }
1135 + };
1136 + var collapseWrapper = "." + ComponentClasses.CollapseWrapper;
1137 + var xsWidthMargin = 16;
1138 + var styles$1 = /*#__PURE__*/ makeStyles({
1139 + root: (_root$1 = {
1140 + boxSizing: "border-box",
1141 + display: "flex",
1142 + maxHeight: "100%",
1143 + position: "fixed",
1144 + zIndex: 1400,
1145 + height: "auto",
1146 + width: "auto",
1147 + transition: /*#__PURE__*/ createTransition([
1148 + "top",
1149 + "right",
1150 + "bottom",
1151 + "left",
1152 + "max-width"
1153 + ], {
1154 + duration: 300,
1155 + easing: "ease"
1156 + }),
1157 + pointerEvents: "none"
1158 + }, _root$1[collapseWrapper] = {
1159 + padding: indents.snackbar["default"] + "px 0px",
1160 + transition: "padding 300ms ease 0ms"
1161 + }, _root$1.maxWidth = "calc(100% - " + indents.view["default"] * 2 + "px)", _root$1[breakpoints.downXs] = {
1162 + width: "100%",
1163 + maxWidth: "calc(100% - " + xsWidthMargin * 2 + "px)"
1164 + }, _root$1),
1165 + rootDense: (_rootDense = {}, _rootDense[collapseWrapper] = { padding: indents.snackbar.dense + "px 0px" }, _rootDense),
1166 + top: {
1167 + top: indents.view["default"] - indents.snackbar["default"] + "px",
1168 + flexDirection: "column"
1169 + },
1170 + bottom: {
1171 + bottom: indents.view["default"] - indents.snackbar["default"] + "px",
1172 + flexDirection: "column-reverse"
1173 + },
1174 + left: (_left = { left: indents.view["default"] + "px" }, _left[breakpoints.upSm] = { alignItems: "flex-start" }, _left[breakpoints.downXs] = { left: xsWidthMargin + "px" }, _left),
1175 + right: (_right = { right: indents.view["default"] + "px" }, _right[breakpoints.upSm] = { alignItems: "flex-end" }, _right[breakpoints.downXs] = { right: xsWidthMargin + "px" }, _right),
1176 + center: (_center = {
1177 + left: "50%",
1178 + transform: "translateX(-50%)"
1179 + }, _center[breakpoints.upSm] = { alignItems: "center" }, _center)
1180 + });
1181 + var SnackbarContainer$1 = /*#__PURE__*/ (0, react.memo)(function SnackbarContainer(props) {
1182 + var _props$classes = props.classes;
1183 + var classes = _props$classes === void 0 ? {} : _props$classes;
1184 + var anchorOrigin = props.anchorOrigin;
1185 + var dense = props.dense;
1186 + var children = props.children;
1187 + var combinedClassname = clsx(ComponentClasses.SnackbarContainer, styles$1[anchorOrigin.vertical], styles$1[anchorOrigin.horizontal], styles$1.root, classes.containerRoot, classes["containerAnchorOrigin" + originKeyExtractor(anchorOrigin)], dense && styles$1.rootDense);
1188 + return react.default.createElement("div", { className: combinedClassname }, children);
1189 + });
1190 + var __DEV__ = true;
1191 + var messages = { NO_PERSIST_ALL: "Reached maxSnack while all enqueued snackbars have 'persist' flag. Notistack will dismiss the oldest snackbar anyway to allow other ones in the queue to be presented." };
1192 + var warning = (function(messageKey) {
1193 + if (!__DEV__) return;
1194 + var message = messages[messageKey];
1195 + if (typeof console !== "undefined") console.error("WARNING - notistack: " + message);
1196 + try {
1197 + throw new Error(message);
1198 + } catch (x) {}
1199 + });
1200 + var isOptions = function isOptions(messageOrOptions) {
1201 + return !(typeof messageOrOptions === "string" || (0, react.isValidElement)(messageOrOptions));
1202 + };
1203 + var enqueueSnackbar;
1204 + var closeSnackbar;
1205 + var SnackbarProvider = /*#__PURE__*/ function(_Component) {
1206 + _inheritsLoose(SnackbarProvider, _Component);
1207 + function SnackbarProvider(props) {
1208 + var _this = _Component.call(this, props) || this;
1209 + /**
1210 + * Adds a new snackbar to the queue to be presented.
1211 + * Returns generated or user defined key referencing the new snackbar or null
1212 + */
1213 + _this.enqueueSnackbar = function(messageOrOptions, optsOrUndefined) {
1214 + if (optsOrUndefined === void 0) optsOrUndefined = {};
1215 + if (messageOrOptions === void 0 || messageOrOptions === null) throw new Error("enqueueSnackbar called with invalid argument");
1216 + var opts = isOptions(messageOrOptions) ? messageOrOptions : optsOrUndefined;
1217 + var message = isOptions(messageOrOptions) ? messageOrOptions.message : messageOrOptions;
1218 + var key = opts.key;
1219 + var preventDuplicate = opts.preventDuplicate;
1220 + var options = _objectWithoutPropertiesLoose(opts, ["key", "preventDuplicate"]);
1221 + var hasSpecifiedKey = isDefined(key);
1222 + var id = hasSpecifiedKey ? key : (/* @__PURE__ */ new Date()).getTime() + Math.random();
1223 + var merger = merge(options, _this.props);
1224 + var snack = _extends({ id }, options, {
1225 + message,
1226 + open: true,
1227 + entered: false,
1228 + requestClose: false,
1229 + persist: merger("persist"),
1230 + action: merger("action"),
1231 + content: merger("content"),
1232 + variant: merger("variant"),
1233 + anchorOrigin: merger("anchorOrigin"),
1234 + disableWindowBlurListener: merger("disableWindowBlurListener"),
1235 + autoHideDuration: merger("autoHideDuration"),
1236 + hideIconVariant: merger("hideIconVariant"),
1237 + TransitionComponent: merger("TransitionComponent"),
1238 + transitionDuration: merger("transitionDuration"),
1239 + TransitionProps: merger("TransitionProps", true),
1240 + iconVariant: merger("iconVariant", true),
1241 + style: merger("style", true),
1242 + SnackbarProps: merger("SnackbarProps", true),
1243 + className: clsx(_this.props.className, options.className)
1244 + });
1245 + if (snack.persist) snack.autoHideDuration = void 0;
1246 + _this.setState(function(state) {
1247 + if (preventDuplicate === void 0 && _this.props.preventDuplicate || preventDuplicate) {
1248 + var compareFunction = function compareFunction(item) {
1249 + return hasSpecifiedKey ? item.id === id : item.message === message;
1250 + };
1251 + var inQueue = state.queue.findIndex(compareFunction) > -1;
1252 + var inView = state.snacks.findIndex(compareFunction) > -1;
1253 + if (inQueue || inView) return state;
1254 + }
1255 + return _this.handleDisplaySnack(_extends({}, state, { queue: [].concat(state.queue, [snack]) }));
1256 + });
1257 + return id;
1258 + };
1259 + /**
1260 + * Reducer: Display snack if there's space for it. Otherwise, immediately
1261 + * begin dismissing the oldest message to start showing the new one.
1262 + */
1263 + _this.handleDisplaySnack = function(state) {
1264 + if (state.snacks.length >= _this.maxSnack) return _this.handleDismissOldest(state);
1265 + return _this.processQueue(state);
1266 + };
1267 + /**
1268 + * Reducer: Display items (notifications) in the queue if there's space for them.
1269 + */
1270 + _this.processQueue = function(state) {
1271 + var queue = state.queue;
1272 + var snacks = state.snacks;
1273 + if (queue.length > 0) return _extends({}, state, {
1274 + snacks: [].concat(snacks, [queue[0]]),
1275 + queue: queue.slice(1, queue.length)
1276 + });
1277 + return state;
1278 + };
1279 + /**
1280 + * Reducer: Hide oldest snackbar on the screen because there exists a new one which we have to display.
1281 + * (ignoring the one with 'persist' flag. i.e. explicitly told by user not to get dismissed).
1282 + *
1283 + * Note 1: If there is already a message leaving the screen, no new messages are dismissed.
1284 + * Note 2: If the oldest message has not yet entered the screen, only a request to close the
1285 + * snackbar is made. Once it entered the screen, it will be immediately dismissed.
1286 + */
1287 + _this.handleDismissOldest = function(state) {
1288 + if (state.snacks.some(function(item) {
1289 + return !item.open || item.requestClose;
1290 + })) return state;
1291 + var popped = false;
1292 + var ignore = false;
1293 + if (state.snacks.reduce(function(acc, current) {
1294 + return acc + (current.open && current.persist ? 1 : 0);
1295 + }, 0) === _this.maxSnack) {
1296 + warning("NO_PERSIST_ALL");
1297 + ignore = true;
1298 + }
1299 + var snacks = state.snacks.map(function(item) {
1300 + if (!popped && (!item.persist || ignore)) {
1301 + popped = true;
1302 + if (!item.entered) return _extends({}, item, { requestClose: true });
1303 + if (item.onClose) item.onClose(null, "maxsnack", item.id);
1304 + if (_this.props.onClose) _this.props.onClose(null, "maxsnack", item.id);
1305 + return _extends({}, item, { open: false });
1306 + }
1307 + return _extends({}, item);
1308 + });
1309 + return _extends({}, state, { snacks });
1310 + };
1311 + /**
1312 + * Set the entered state of the snackbar with the given key.
1313 + */
1314 + _this.handleEnteredSnack = function(node, isAppearing, key) {
1315 + if (!isDefined(key)) throw new Error("handleEnteredSnack Cannot be called with undefined key");
1316 + _this.setState(function(_ref) {
1317 + return { snacks: _ref.snacks.map(function(item) {
1318 + return item.id === key ? _extends({}, item, { entered: true }) : _extends({}, item);
1319 + }) };
1320 + });
1321 + };
1322 + /**
1323 + * Hide a snackbar after its timeout.
1324 + */
1325 + _this.handleCloseSnack = function(event, reason, key) {
1326 + if (_this.props.onClose) _this.props.onClose(event, reason, key);
1327 + var shouldCloseAll = key === void 0;
1328 + _this.setState(function(_ref2) {
1329 + var snacks = _ref2.snacks;
1330 + var queue = _ref2.queue;
1331 + return {
1332 + snacks: snacks.map(function(item) {
1333 + if (!shouldCloseAll && item.id !== key) return _extends({}, item);
1334 + return item.entered ? _extends({}, item, { open: false }) : _extends({}, item, { requestClose: true });
1335 + }),
1336 + queue: queue.filter(function(item) {
1337 + return item.id !== key;
1338 + })
1339 + };
1340 + });
1341 + };
1342 + /**
1343 + * Close snackbar with the given key
1344 + */
1345 + _this.closeSnackbar = function(key) {
1346 + var toBeClosed = _this.state.snacks.find(function(item) {
1347 + return item.id === key;
1348 + });
1349 + if (isDefined(key) && toBeClosed && toBeClosed.onClose) toBeClosed.onClose(null, "instructed", key);
1350 + _this.handleCloseSnack(null, "instructed", key);
1351 + };
1352 + /**
1353 + * When we set open attribute of a snackbar to false (i.e. after we hide a snackbar),
1354 + * it leaves the screen and immediately after leaving animation is done, this method
1355 + * gets called. We remove the hidden snackbar from state and then display notifications
1356 + * waiting in the queue (if any). If after this process the queue is not empty, the
1357 + * oldest message is dismissed.
1358 + */
1359 + _this.handleExitedSnack = function(node, key) {
1360 + if (!isDefined(key)) throw new Error("handleExitedSnack Cannot be called with undefined key");
1361 + _this.setState(function(state) {
1362 + var newState = _this.processQueue(_extends({}, state, { snacks: state.snacks.filter(function(item) {
1363 + return item.id !== key;
1364 + }) }));
1365 + if (newState.queue.length === 0) return newState;
1366 + return _this.handleDismissOldest(newState);
1367 + });
1368 + };
1369 + enqueueSnackbar = _this.enqueueSnackbar;
1370 + closeSnackbar = _this.closeSnackbar;
1371 + _this.state = {
1372 + snacks: [],
1373 + queue: [],
1374 + contextValue: {
1375 + enqueueSnackbar: _this.enqueueSnackbar.bind(_assertThisInitialized(_this)),
1376 + closeSnackbar: _this.closeSnackbar.bind(_assertThisInitialized(_this))
1377 + }
1378 + };
1379 + return _this;
1380 + }
1381 + var _proto = SnackbarProvider.prototype;
1382 + _proto.render = function render() {
1383 + var _this2 = this;
1384 + var contextValue = this.state.contextValue;
1385 + var _this$props = this.props;
1386 + var domRoot = _this$props.domRoot;
1387 + var children = _this$props.children;
1388 + var _this$props$dense = _this$props.dense;
1389 + var dense = _this$props$dense === void 0 ? false : _this$props$dense;
1390 + var _this$props$Component = _this$props.Components;
1391 + var Components = _this$props$Component === void 0 ? {} : _this$props$Component;
1392 + var classes = _this$props.classes;
1393 + var categ = this.state.snacks.reduce(function(acc, current) {
1394 + var _extends2;
1395 + var category = originKeyExtractor(current.anchorOrigin);
1396 + var existingOfCategory = acc[category] || [];
1397 + return _extends({}, acc, (_extends2 = {}, _extends2[category] = [].concat(existingOfCategory, [current]), _extends2));
1398 + }, {});
1399 + var snackbars = Object.keys(categ).map(function(origin) {
1400 + var snacks = categ[origin];
1401 + var nomineeSnack = snacks[0];
1402 + return react.default.createElement(SnackbarContainer$1, {
1403 + key: origin,
1404 + dense,
1405 + anchorOrigin: nomineeSnack.anchorOrigin,
1406 + classes
1407 + }, snacks.map(function(snack) {
1408 + return react.default.createElement(SnackbarItem, {
1409 + key: snack.id,
1410 + snack,
1411 + classes,
1412 + Component: Components[snack.variant],
1413 + onClose: _this2.handleCloseSnack,
1414 + onEnter: _this2.props.onEnter,
1415 + onExit: _this2.props.onExit,
1416 + onExited: createChainedFunction([_this2.handleExitedSnack, _this2.props.onExited], snack.id),
1417 + onEntered: createChainedFunction([_this2.handleEnteredSnack, _this2.props.onEntered], snack.id)
1418 + });
1419 + }));
1420 + });
1421 + return react.default.createElement(SnackbarContext.Provider, { value: contextValue }, children, domRoot ? (0, react_dom.createPortal)(snackbars, domRoot) : snackbars);
1422 + };
1423 + _createClass(SnackbarProvider, [{
1424 + key: "maxSnack",
1425 + get: function get() {
1426 + return this.props.maxSnack || defaults.maxSnack;
1427 + }
1428 + }]);
1429 + return SnackbarProvider;
1430 + }(react.Component);
1431 + var useSnackbar = (function() {
1432 + return (0, react.useContext)(SnackbarContext);
1433 + });
30 1434
31 -__webpack_require__.r(__webpack_exports__);
32 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
33 -/* harmony export */ clsx: function() { return /* binding */ clsx; }
34 -/* harmony export */ });
35 -function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ __webpack_exports__["default"] = (clsx);
1435 +//#endregion
1436 +//#region packages/packages/core/editor-notifications/src/slice.ts
1437 + var notificationsSlice = (0, _elementor_store.__createSlice)({
1438 + name: "notifications",
1439 + initialState: {},
1440 + reducers: {
1441 + notifyAction: (state, action) => {
1442 + const newState = { ...state };
1443 + if (!newState[action.payload.id]) newState[action.payload.id] = action.payload;
1444 + return newState;
1445 + },
1446 + clearAction: (state, action) => {
1447 + const newState = { ...state };
1448 + if (newState[action.payload.id]) delete newState[action.payload.id];
1449 + return newState;
1450 + }
1451 + }
1452 + });
1453 + var { notifyAction, clearAction } = notificationsSlice.actions;
36 1454
37 -/***/ }),
1455 +//#endregion
1456 +//#region packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx
1457 + var AUTO_HIDE_DURATION$1 = 8e3;
1458 + function createDefaultAction(notification, onDismiss) {
1459 + return /* @__PURE__ */ react.createElement(react.Fragment, { key: notification.id }, notification.additionalActionProps?.map((additionalAction, index) => /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
1460 + key: `${index}`,
1461 + ...additionalAction
1462 + })), /* @__PURE__ */ react.createElement(_elementor_ui.CloseButton, {
1463 + "aria-label": "close",
1464 + color: "inherit",
1465 + onClick: onDismiss
1466 + }));
1467 + }
1468 + function createPromotionAction(notification) {
1469 + return /* @__PURE__ */ react.createElement(react.Fragment, { key: notification.id }, notification.additionalActionProps?.map((additionalAction, index) => /* @__PURE__ */ react.createElement(_elementor_ui.Button, {
1470 + key: `${index}`,
1471 + ...additionalAction
1472 + })));
1473 + }
1474 + var useEnqueueNotification = (notifications) => {
1475 + const { enqueueSnackbar } = useSnackbar();
1476 + const dispatch = (0, _elementor_store.__useDispatch)();
1477 + (0, react.useEffect)(() => {
1478 + Object.values(notifications).forEach((notification) => {
1479 + const dismiss = () => {
1480 + closeSnackbar(notification.id);
1481 + dispatch(clearAction({ id: notification.id }));
1482 + };
1483 + const action = [
1484 + "promotion",
1485 + "info",
1486 + "success",
1487 + "error"
1488 + ].includes(notification.type) ? createPromotionAction(notification) : createDefaultAction(notification, dismiss);
1489 + enqueueSnackbar(notification.message, {
1490 + variant: notification.type,
1491 + key: notification.id,
1492 + onClose: () => dispatch(clearAction({ id: notification.id })),
1493 + preventDuplicate: true,
1494 + action,
1495 + autoHideDuration: notification.autoHideDuration ?? AUTO_HIDE_DURATION$1
1496 + });
1497 + });
1498 + }, [
1499 + notifications,
1500 + enqueueSnackbar,
1501 + dispatch
1502 + ]);
1503 + };
38 1504
39 -/***/ "./node_modules/notistack/notistack.esm.js":
40 -/*!*************************************************!*\
41 - !*** ./node_modules/notistack/notistack.esm.js ***!
42 - \*************************************************/
43 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1505 +//#endregion
1506 +//#region packages/packages/core/editor-notifications/src/sync/get-app-bar-height.ts
1507 + var EDITOR_APP_BAR_WRAPPER_ID = "elementor-editor-wrapper-v2";
1508 + function getAppBarHeight() {
1509 + return document.getElementById(EDITOR_APP_BAR_WRAPPER_ID)?.getBoundingClientRect().height ?? 0;
1510 + }
44 1511
45 -__webpack_require__.r(__webpack_exports__);
46 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
47 -/* harmony export */ MaterialDesignContent: function() { return /* binding */ MaterialDesignContent$1; },
48 -/* harmony export */ SnackbarContent: function() { return /* binding */ SnackbarContent; },
49 -/* harmony export */ SnackbarProvider: function() { return /* binding */ SnackbarProvider; },
50 -/* harmony export */ Transition: function() { return /* binding */ Transition; },
51 -/* harmony export */ closeSnackbar: function() { return /* binding */ closeSnackbar; },
52 -/* harmony export */ enqueueSnackbar: function() { return /* binding */ enqueueSnackbar; },
53 -/* harmony export */ useSnackbar: function() { return /* binding */ useSnackbar; }
54 -/* harmony export */ });
55 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
56 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
57 -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
58 -/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
59 -/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! clsx */ "./node_modules/notistack/node_modules/clsx/dist/clsx.m.js");
60 -/* harmony import */ var goober__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! goober */ "./node_modules/goober/dist/goober.modern.js");
1512 +//#endregion
1513 +//#region packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts
1514 + function getEditingPanelWidth() {
1515 + return document.querySelector(".elementor-panel")?.clientWidth || 0;
1516 + }
61 1517
1518 +//#endregion
1519 +//#region packages/packages/core/editor-notifications/src/components/notifications.tsx
1520 + var AUTO_HIDE_DURATION = 8e3;
1521 + var DefaultCustomSnackbar = (0, react.forwardRef)((props, ref) => {
1522 + const filteredProps = getFilteredSnackbarProps(props);
1523 + const panelWidth = getEditingPanelWidth();
1524 + const appBarHeight = getAppBarHeight();
1525 + return /* @__PURE__ */ react.createElement(_elementor_ui.ThemeProvider, { palette: "unstable" }, /* @__PURE__ */ react.createElement(_elementor_ui.SnackbarContent, {
1526 + ref,
1527 + ...filteredProps,
1528 + sx: {
1529 + "&.MuiPaper-root": { minWidth: "max-content" },
1530 + ml: panelWidth + "px",
1531 + mt: `-${appBarHeight}px`
1532 + }
1533 + }));
1534 + });
1535 + var AlertSnackbar = (0, react.forwardRef)(({ color, icon, ...props }, ref) => {
1536 + const panelWidth = getEditingPanelWidth();
1537 + const appBarHeight = getAppBarHeight();
1538 + return /* @__PURE__ */ react.createElement(_elementor_ui.ThemeProvider, {
1539 + colorScheme: "light",
1540 + palette: "unstable"
1541 + }, /* @__PURE__ */ react.createElement(_elementor_ui.Alert, {
1542 + ref,
1543 + variant: "standard",
1544 + color,
1545 + icon,
1546 + role: "alert",
1547 + action: props.action,
1548 + onClose: () => closeSnackbar(props.id),
1549 + sx: {
1550 + ml: panelWidth + "px",
1551 + mt: `-${appBarHeight}px`,
1552 + "& .MuiAlert-message": {
1553 + display: "flex",
1554 + flexWrap: "nowrap",
1555 + alignItems: "center"
1556 + },
1557 + "& .MuiAlert-content": { whiteSpace: "nowrap" }
1558 + }
1559 + }, props.message));
1560 + });
1561 + var muiToEuiMapper = {
1562 + default: DefaultCustomSnackbar,
1563 + promotion: (0, react.forwardRef)((props, ref) => /* @__PURE__ */ react.createElement(AlertSnackbar, {
1564 + ref,
1565 + color: "promotion",
1566 + icon: /* @__PURE__ */ react.createElement(_elementor_icons.CrownFilledIcon, null),
1567 + ...props
1568 + })),
1569 + info: (0, react.forwardRef)((props, ref) => /* @__PURE__ */ react.createElement(AlertSnackbar, {
1570 + ref,
1571 + color: "info",
1572 + icon: /* @__PURE__ */ react.createElement(_elementor_icons.InfoCircleFilledIcon, null),
1573 + ...props
1574 + })),
1575 + success: (0, react.forwardRef)((props, ref) => /* @__PURE__ */ react.createElement(AlertSnackbar, {
1576 + ref,
1577 + color: "success",
1578 + icon: /* @__PURE__ */ react.createElement(_elementor_icons.CircleCheckFilledIcon, null),
1579 + ...props
1580 + })),
1581 + error: (0, react.forwardRef)((props, ref) => /* @__PURE__ */ react.createElement(AlertSnackbar, {
1582 + ref,
1583 + color: "error",
1584 + icon: /* @__PURE__ */ react.createElement(_elementor_icons.AlertCircleFilled, null),
1585 + ...props
1586 + }))
1587 + };
1588 + var Handler = () => {
1589 + useEnqueueNotification((0, _elementor_store.__useSelector)((state) => state.notifications));
1590 + return null;
1591 + };
1592 + var Wrapper = () => {
1593 + return /* @__PURE__ */ react.createElement(SnackbarProvider, {
1594 + maxSnack: 3,
1595 + autoHideDuration: AUTO_HIDE_DURATION,
1596 + disableWindowBlurListener: true,
1597 + anchorOrigin: {
1598 + horizontal: "center",
1599 + vertical: "bottom"
1600 + },
1601 + Components: muiToEuiMapper,
1602 + domRoot: document.body
1603 + }, /* @__PURE__ */ react.createElement(Handler, null));
1604 + };
1605 + function notify(notification) {
1606 + (0, _elementor_store.__getStore)()?.dispatch(notifyAction(notification));
1607 + }
1608 + function dismissNotification(id) {
1609 + const store = (0, _elementor_store.__getStore)();
1610 + closeSnackbar(id);
1611 + store?.dispatch(clearAction({ id }));
1612 + }
1613 + function NotifyReact(notification) {
1614 + (0, _elementor_store.__useDispatch)()(notifyAction(notification));
1615 + }
1616 + function getFilteredSnackbarProps(props) {
1617 + const forbiddenProps = [
1618 + "autoHideDuration",
1619 + "persist",
1620 + "hideIconVariant",
1621 + "iconVariant",
1622 + "anchorOrigin"
1623 + ];
1624 + return Object.entries(props).reduce((filteredProps, [key, value]) => {
1625 + if (!forbiddenProps.includes(key)) filteredProps[key] = value;
1626 + return filteredProps;
1627 + }, {});
1628 + }
62 1629
1630 +//#endregion
1631 +//#region packages/packages/core/editor-notifications/src/init.ts
1632 + function init() {
1633 + (0, _elementor_store.__registerSlice)(notificationsSlice);
1634 + (0, _elementor_editor.injectIntoTop)({
1635 + id: "notifications",
1636 + component: Wrapper
1637 + });
1638 + }
63 1639
1640 +//#endregion
1641 +//#region packages/packages/core/editor-notifications/src/index.ts
1642 + var src_exports = /* @__PURE__ */ __exportAll({
1643 + NotifyReact: () => NotifyReact,
1644 + dismissNotification: () => dismissNotification,
1645 + init: () => init,
1646 + notify: () => notify
1647 + });
64 1648
1649 +//#endregion
1650 +//#region \0elementor-package-library-entry
1651 + (window.elementorV2 = window.elementorV2 || {}).editorNotifications = src_exports;
65 1652
66 -function _defineProperties(target, props) {
67 - for (var i = 0; i < props.length; i++) {
68 - var descriptor = props[i];
69 - descriptor.enumerable = descriptor.enumerable || false;
70 - descriptor.configurable = true;
71 - if ("value" in descriptor) descriptor.writable = true;
72 - Object.defineProperty(target, descriptor.key, descriptor);
73 - }
74 -}
75 -
76 -function _createClass(Constructor, protoProps, staticProps) {
77 - if (protoProps) _defineProperties(Constructor.prototype, protoProps);
78 - if (staticProps) _defineProperties(Constructor, staticProps);
79 - return Constructor;
80 -}
81 -
82 -function _extends() {
83 - _extends = Object.assign || function (target) {
84 - for (var i = 1; i < arguments.length; i++) {
85 - var source = arguments[i];
86 -
87 - for (var key in source) {
88 - if (Object.prototype.hasOwnProperty.call(source, key)) {
89 - target[key] = source[key];
90 - }
91 - }
92 - }
93 -
94 - return target;
95 - };
96 -
97 - return _extends.apply(this, arguments);
98 -}
99 -
100 -function _inheritsLoose(subClass, superClass) {
101 - subClass.prototype = Object.create(superClass.prototype);
102 - subClass.prototype.constructor = subClass;
103 - subClass.__proto__ = superClass;
104 -}
105 -
106 -function _objectWithoutPropertiesLoose(source, excluded) {
107 - if (source == null) return {};
108 - var target = {};
109 - var sourceKeys = Object.keys(source);
110 - var key, i;
111 -
112 - for (i = 0; i < sourceKeys.length; i++) {
113 - key = sourceKeys[i];
114 - if (excluded.indexOf(key) >= 0) continue;
115 - target[key] = source[key];
116 - }
117 -
118 - return target;
119 -}
120 -
121 -function _assertThisInitialized(self) {
122 - if (self === void 0) {
123 - throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
124 - }
125 -
126 - return self;
127 -}
128 -
129 -var noOp = function noOp() {
130 - return '';
131 -};
132 -
133 -var SnackbarContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext({
134 - enqueueSnackbar: noOp,
135 - closeSnackbar: noOp
136 -});
137 -
138 -var breakpoints = {
139 - downXs: '@media (max-width:599.95px)',
140 - upSm: '@media (min-width:600px)'
141 -};
142 -
143 -var capitalise = function capitalise(text) {
144 - return text.charAt(0).toUpperCase() + text.slice(1);
145 -};
146 -
147 -var originKeyExtractor = function originKeyExtractor(anchor) {
148 - return "" + capitalise(anchor.vertical) + capitalise(anchor.horizontal);
149 -};
150 -var isDefined = function isDefined(value) {
151 - return !!value || value === 0;
152 -};
153 -
154 -var UNMOUNTED = 'unmounted';
155 -var EXITED = 'exited';
156 -var ENTERING = 'entering';
157 -var ENTERED = 'entered';
158 -var EXITING = 'exiting';
159 -
160 -var Transition = /*#__PURE__*/function (_React$Component) {
161 - _inheritsLoose(Transition, _React$Component);
162 -
163 - function Transition(props) {
164 - var _this;
165 -
166 - _this = _React$Component.call(this, props) || this;
167 - var appear = props.appear;
168 - var initialStatus;
169 - _this.appearStatus = null;
170 -
171 - if (props["in"]) {
172 - if (appear) {
173 - initialStatus = EXITED;
174 - _this.appearStatus = ENTERING;
175 - } else {
176 - initialStatus = ENTERED;
177 - }
178 - } else if (props.unmountOnExit || props.mountOnEnter) {
179 - initialStatus = UNMOUNTED;
180 - } else {
181 - initialStatus = EXITED;
182 - }
183 -
184 - _this.state = {
185 - status: initialStatus
186 - };
187 - _this.nextCallback = null;
188 - return _this;
189 - }
190 -
191 - Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
192 - var nextIn = _ref["in"];
193 -
194 - if (nextIn && prevState.status === UNMOUNTED) {
195 - return {
196 - status: EXITED
197 - };
198 - }
199 -
200 - return null;
201 - };
202 -
203 - var _proto = Transition.prototype;
204 -
205 - _proto.componentDidMount = function componentDidMount() {
206 - this.updateStatus(true, this.appearStatus);
207 - };
208 -
209 - _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
210 - var nextStatus = null;
211 -
212 - if (prevProps !== this.props) {
213 - var status = this.state.status;
214 -
215 - if (this.props["in"]) {
216 - if (status !== ENTERING && status !== ENTERED) {
217 - nextStatus = ENTERING;
218 - }
219 - } else if (status === ENTERING || status === ENTERED) {
220 - nextStatus = EXITING;
221 - }
222 - }
223 -
224 - this.updateStatus(false, nextStatus);
225 - };
226 -
227 - _proto.componentWillUnmount = function componentWillUnmount() {
228 - this.cancelNextCallback();
229 - };
230 -
231 - _proto.getTimeouts = function getTimeouts() {
232 - var timeout = this.props.timeout;
233 - var enter = timeout;
234 - var exit = timeout;
235 -
236 - if (timeout != null && typeof timeout !== 'number' && typeof timeout !== 'string') {
237 - exit = timeout.exit;
238 - enter = timeout.enter;
239 - }
240 -
241 - return {
242 - exit: exit,
243 - enter: enter
244 - };
245 - };
246 -
247 - _proto.updateStatus = function updateStatus(mounting, nextStatus) {
248 - if (mounting === void 0) {
249 - mounting = false;
250 - }
251 -
252 - if (nextStatus !== null) {
253 - this.cancelNextCallback();
254 -
255 - if (nextStatus === ENTERING) {
256 - this.performEnter(mounting);
257 - } else {
258 - this.performExit();
259 - }
260 - } else if (this.props.unmountOnExit && this.state.status === EXITED) {
261 - this.setState({
262 - status: UNMOUNTED
263 - });
264 - }
265 - };
266 -
267 - _proto.performEnter = function performEnter(mounting) {
268 - var _this2 = this;
269 -
270 - var enter = this.props.enter;
271 - var isAppearing = mounting;
272 - var timeouts = this.getTimeouts();
273 -
274 - if (!mounting && !enter) {
275 - this.safeSetState({
276 - status: ENTERED
277 - }, function () {
278 - if (_this2.props.onEntered) {
279 - _this2.props.onEntered(_this2.node, isAppearing);
280 - }
281 - });
282 - return;
283 - }
284 -
285 - if (this.props.onEnter) {
286 - this.props.onEnter(this.node, isAppearing);
287 - }
288 -
289 - this.safeSetState({
290 - status: ENTERING
291 - }, function () {
292 - if (_this2.props.onEntering) {
293 - _this2.props.onEntering(_this2.node, isAppearing);
294 - }
295 -
296 - _this2.onTransitionEnd(timeouts.enter, function () {
297 - _this2.safeSetState({
298 - status: ENTERED
299 - }, function () {
300 - if (_this2.props.onEntered) {
301 - _this2.props.onEntered(_this2.node, isAppearing);
302 - }
303 - });
304 - });
305 - });
306 - };
307 -
308 - _proto.performExit = function performExit() {
309 - var _this3 = this;
310 -
311 - var exit = this.props.exit;
312 - var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
313 -
314 - if (!exit) {
315 - this.safeSetState({
316 - status: EXITED
317 - }, function () {
318 - if (_this3.props.onExited) {
319 - _this3.props.onExited(_this3.node);
320 - }
321 - });
322 - return;
323 - }
324 -
325 - if (this.props.onExit) {
326 - this.props.onExit(this.node);
327 - }
328 -
329 - this.safeSetState({
330 - status: EXITING
331 - }, function () {
332 - if (_this3.props.onExiting) {
333 - _this3.props.onExiting(_this3.node);
334 - }
335 -
336 - _this3.onTransitionEnd(timeouts.exit, function () {
337 - _this3.safeSetState({
338 - status: EXITED
339 - }, function () {
340 - if (_this3.props.onExited) {
341 - _this3.props.onExited(_this3.node);
342 - }
343 - });
344 - });
345 - });
346 - };
347 -
348 - _proto.cancelNextCallback = function cancelNextCallback() {
349 - if (this.nextCallback !== null && this.nextCallback.cancel) {
350 - this.nextCallback.cancel();
351 - this.nextCallback = null;
352 - }
353 - };
354 -
355 - _proto.safeSetState = function safeSetState(nextState, callback) {
356 - callback = this.setNextCallback(callback);
357 - this.setState(nextState, callback);
358 - };
359 -
360 - _proto.setNextCallback = function setNextCallback(callback) {
361 - var _this4 = this;
362 -
363 - var active = true;
364 -
365 - this.nextCallback = function () {
366 - if (active) {
367 - active = false;
368 - _this4.nextCallback = null;
369 - callback();
370 - }
371 - };
372 -
373 - this.nextCallback.cancel = function () {
374 - active = false;
375 - };
376 -
377 - return this.nextCallback;
378 - };
379 -
380 - _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
381 - this.setNextCallback(handler);
382 - var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
383 -
384 - if (!this.node || doesNotHaveTimeoutOrListener) {
385 - setTimeout(this.nextCallback, 0);
386 - return;
387 - }
388 -
389 - if (this.props.addEndListener) {
390 - this.props.addEndListener(this.node, this.nextCallback);
391 - }
392 -
393 - if (timeout != null) {
394 - setTimeout(this.nextCallback, timeout);
395 - }
396 - };
397 -
398 - _proto.render = function render() {
399 - var status = this.state.status;
400 -
401 - if (status === UNMOUNTED) {
402 - return null;
403 - }
404 -
405 - var _this$props = this.props,
406 - children = _this$props.children,
407 - childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
408 -
409 - return children(status, childProps);
410 - };
411 -
412 - _createClass(Transition, [{
413 - key: "node",
414 - get: function get() {
415 - var _this$props$nodeRef;
416 -
417 - var node = (_this$props$nodeRef = this.props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current;
418 -
419 - if (!node) {
420 - throw new Error('notistack - Custom snackbar is not refForwarding');
421 - }
422 -
423 - return node;
424 - }
425 - }]);
426 -
427 - return Transition;
428 -}((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
429 -
430 -function noop() {//
431 -}
432 -
433 -Transition.defaultProps = {
434 - "in": false,
435 - mountOnEnter: false,
436 - unmountOnExit: false,
437 - appear: false,
438 - enter: true,
439 - exit: true,
440 - onEnter: noop,
441 - onEntering: noop,
442 - onEntered: noop,
443 - onExit: noop,
444 - onExiting: noop,
445 - onExited: noop
446 -};
447 -
448 -/**
449 - * Credit to MUI team @ https://mui.com
450 - */
451 -/**
452 - * passes {value} to {ref}
453 - *
454 - * Useful if you want to expose the ref of an inner component to the public API
455 - * while still using it inside the component.
456 - * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
457 - */
458 -
459 -function setRef(ref, value) {
460 - if (typeof ref === 'function') {
461 - ref(value);
462 - } else if (ref) {
463 - ref.current = value;
464 - }
465 -}
466 -
467 -function useForkRef(refA, refB) {
468 - /**
469 - * This will create a new function if the ref props change and are defined.
470 - * This means react will call the old forkRef with `null` and the new forkRef
471 - * with the ref. Cleanup naturally emerges from this behavior.
472 - */
473 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
474 - if (refA == null && refB == null) {
475 - return null;
476 - }
477 -
478 - return function (refValue) {
479 - setRef(refA, refValue);
480 - setRef(refB, refValue);
481 - };
482 - }, [refA, refB]);
483 -}
484 -
485 -function getTransitionProps(props) {
486 - var timeout = props.timeout,
487 - _props$style = props.style,
488 - style = _props$style === void 0 ? {} : _props$style,
489 - mode = props.mode;
490 - return {
491 - duration: typeof timeout === 'object' ? timeout[mode] || 0 : timeout,
492 - easing: style.transitionTimingFunction,
493 - delay: style.transitionDelay
494 - };
495 -}
496 -
497 -/**
498 - * Credit to MUI team @ https://mui.com
499 - */
500 -var defaultEasing = {
501 - // This is the most common easing curve.
502 - easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
503 - // Objects enter the screen at full velocity from off-screen and
504 - // slowly decelerate to a resting point.
505 - easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
506 - // Objects leave the screen at full velocity. They do not decelerate when off-screen.
507 - easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
508 - // The sharp curve is used by objects that may return to the screen at any time.
509 - sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
510 -};
511 -/**
512 - * CSS hack to force a repaint
513 - */
514 -
515 -var reflow = function reflow(node) {
516 - // We have to do something with node.scrollTop.
517 - // Otherwise it's removed from the compiled code by optimisers
518 - // eslint-disable-next-line no-self-assign
519 - node.scrollTop = node.scrollTop;
520 -};
521 -
522 -var formatMs = function formatMs(milliseconds) {
523 - return Math.round(milliseconds) + "ms";
524 -};
525 -
526 -function createTransition(props, options) {
527 - if (props === void 0) {
528 - props = ['all'];
529 - }
530 -
531 - var _ref = options || {},
532 - _ref$duration = _ref.duration,
533 - duration = _ref$duration === void 0 ? 300 : _ref$duration,
534 - _ref$easing = _ref.easing,
535 - easing = _ref$easing === void 0 ? defaultEasing.easeInOut : _ref$easing,
536 - _ref$delay = _ref.delay,
537 - delay = _ref$delay === void 0 ? 0 : _ref$delay;
538 -
539 - var properties = Array.isArray(props) ? props : [props];
540 - return properties.map(function (animatedProp) {
541 - var formattedDuration = typeof duration === 'string' ? duration : formatMs(duration);
542 - var formattedDelay = typeof delay === 'string' ? delay : formatMs(delay);
543 - return animatedProp + " " + formattedDuration + " " + easing + " " + formattedDelay;
544 - }).join(',');
545 -}
546 -
547 -function ownerDocument(node) {
548 - return node && node.ownerDocument || document;
549 -}
550 -
551 -function ownerWindow(node) {
552 - var doc = ownerDocument(node);
553 - return doc.defaultView || window;
554 -}
555 -/**
556 - * Corresponds to 10 frames at 60 Hz.
557 - * A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
558 - */
559 -
560 -
561 -function debounce(func, wait) {
562 - if (wait === void 0) {
563 - wait = 166;
564 - }
565 -
566 - var timeout;
567 -
568 - function debounced() {
569 - var _this = this;
570 -
571 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
572 - args[_key] = arguments[_key];
573 - }
574 -
575 - var later = function later() {
576 - // @ts-ignore
577 - func.apply(_this, args);
578 - };
579 -
580 - clearTimeout(timeout);
581 - timeout = setTimeout(later, wait);
582 - }
583 -
584 - debounced.clear = function () {
585 - clearTimeout(timeout);
586 - };
587 -
588 - return debounced;
589 -}
590 -/**
591 - * Translate the node so it can't be seen on the screen.
592 - * Later, we're going to translate the node back to its original location with `none`.
593 - */
594 -
595 -
596 -function getTranslateValue(direction, node) {
597 - var rect = node.getBoundingClientRect();
598 - var containerWindow = ownerWindow(node);
599 - var transform;
600 -
601 - if (node.fakeTransform) {
602 - transform = node.fakeTransform;
603 - } else {
604 - var computedStyle = containerWindow.getComputedStyle(node);
605 - transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');
606 - }
607 -
608 - var offsetX = 0;
609 - var offsetY = 0;
610 -
611 - if (transform && transform !== 'none' && typeof transform === 'string') {
612 - var transformValues = transform.split('(')[1].split(')')[0].split(',');
613 - offsetX = parseInt(transformValues[4], 10);
614 - offsetY = parseInt(transformValues[5], 10);
615 - }
616 -
617 - switch (direction) {
618 - case 'left':
619 - return "translateX(" + (containerWindow.innerWidth + offsetX - rect.left) + "px)";
620 -
621 - case 'right':
622 - return "translateX(-" + (rect.left + rect.width - offsetX) + "px)";
623 -
624 - case 'up':
625 - return "translateY(" + (containerWindow.innerHeight + offsetY - rect.top) + "px)";
626 -
627 - default:
628 - // down
629 - return "translateY(-" + (rect.top + rect.height - offsetY) + "px)";
630 - }
631 -}
632 -
633 -function setTranslateValue(direction, node) {
634 - if (!node) return;
635 - var transform = getTranslateValue(direction, node);
636 -
637 - if (transform) {
638 - node.style.webkitTransform = transform;
639 - node.style.transform = transform;
640 - }
641 -}
642 -
643 -var Slide = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
644 - var children = props.children,
645 - _props$direction = props.direction,
646 - direction = _props$direction === void 0 ? 'down' : _props$direction,
647 - inProp = props["in"],
648 - style = props.style,
649 - _props$timeout = props.timeout,
650 - timeout = _props$timeout === void 0 ? 0 : _props$timeout,
651 - onEnter = props.onEnter,
652 - onEntered = props.onEntered,
653 - onExit = props.onExit,
654 - onExited = props.onExited,
655 - other = _objectWithoutPropertiesLoose(props, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]);
656 -
657 - var nodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
658 - var handleRefIntermediary = useForkRef(children.ref, nodeRef);
659 - var handleRef = useForkRef(handleRefIntermediary, ref);
660 -
661 - var handleEnter = function handleEnter(node, isAppearing) {
662 - setTranslateValue(direction, node);
663 - reflow(node);
664 -
665 - if (onEnter) {
666 - onEnter(node, isAppearing);
667 - }
668 - };
669 -
670 - var handleEntering = function handleEntering(node) {
671 - var easing = (style === null || style === void 0 ? void 0 : style.transitionTimingFunction) || defaultEasing.easeOut;
672 - var transitionProps = getTransitionProps({
673 - timeout: timeout,
674 - mode: 'enter',
675 - style: _extends({}, style, {
676 - transitionTimingFunction: easing
677 - })
678 - });
679 - node.style.webkitTransition = createTransition('-webkit-transform', transitionProps);
680 - node.style.transition = createTransition('transform', transitionProps);
681 - node.style.webkitTransform = 'none';
682 - node.style.transform = 'none';
683 - };
684 -
685 - var handleExit = function handleExit(node) {
686 - var easing = (style === null || style === void 0 ? void 0 : style.transitionTimingFunction) || defaultEasing.sharp;
687 - var transitionProps = getTransitionProps({
688 - timeout: timeout,
689 - mode: 'exit',
690 - style: _extends({}, style, {
691 - transitionTimingFunction: easing
692 - })
693 - });
694 - node.style.webkitTransition = createTransition('-webkit-transform', transitionProps);
695 - node.style.transition = createTransition('transform', transitionProps);
696 - setTranslateValue(direction, node);
697 -
698 - if (onExit) {
699 - onExit(node);
700 - }
701 - };
702 -
703 - var handleExited = function handleExited(node) {
704 - // No need for transitions when the component is hidden
705 - node.style.webkitTransition = '';
706 - node.style.transition = '';
707 -
708 - if (onExited) {
709 - onExited(node);
710 - }
711 - };
712 -
713 - var updatePosition = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
714 - if (nodeRef.current) {
715 - setTranslateValue(direction, nodeRef.current);
716 - }
717 - }, [direction]);
718 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
719 - // Skip configuration where the position is screen size invariant.
720 - if (inProp || direction === 'down' || direction === 'right') {
721 - return undefined;
722 - }
723 -
724 - var handleResize = debounce(function () {
725 - if (nodeRef.current) {
726 - setTranslateValue(direction, nodeRef.current);
727 - }
728 - });
729 - var containerWindow = ownerWindow(nodeRef.current);
730 - containerWindow.addEventListener('resize', handleResize);
731 - return function () {
732 - handleResize.clear();
733 - containerWindow.removeEventListener('resize', handleResize);
734 - };
735 - }, [direction, inProp]);
736 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
737 - if (!inProp) {
738 - // We need to update the position of the drawer when the direction change and
739 - // when it's hidden.
740 - updatePosition();
741 - }
742 - }, [inProp, updatePosition]);
743 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Transition, Object.assign({
744 - appear: true,
745 - nodeRef: nodeRef,
746 - onEnter: handleEnter,
747 - onEntered: onEntered,
748 - onEntering: handleEntering,
749 - onExit: handleExit,
750 - onExited: handleExited,
751 - "in": inProp,
752 - timeout: timeout
753 - }, other), function (state, childProps) {
754 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(children, _extends({
755 - ref: handleRef,
756 - style: _extends({
757 - visibility: state === 'exited' && !inProp ? 'hidden' : undefined
758 - }, style, {}, children.props.style)
759 - }, childProps));
760 - });
761 -});
762 -Slide.displayName = 'Slide';
763 -
764 -var SvgIcon = function SvgIcon(props) {
765 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", Object.assign({
766 - viewBox: "0 0 24 24",
767 - focusable: "false",
768 - style: {
769 - fontSize: 20,
770 - marginInlineEnd: 8,
771 - userSelect: 'none',
772 - width: '1em',
773 - height: '1em',
774 - display: 'inline-block',
775 - fill: 'currentColor',
776 - flexShrink: 0
777 - }
778 - }, props));
779 -};
780 -
781 -var CheckIcon = function CheckIcon() {
782 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SvgIcon, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
783 - d: "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"
784 - }));
785 -};
786 -
787 -var WarningIcon = function WarningIcon() {
788 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SvgIcon, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
789 - d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"
790 - }));
791 -};
792 -
793 -var ErrorIcon = function ErrorIcon() {
794 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SvgIcon, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
795 - d: "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"
796 - }));
797 -};
798 -
799 -var InfoIcon = function InfoIcon() {
800 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SvgIcon, null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", {
801 - d: "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"
802 - }));
803 -};
804 -
805 -var defaultIconVariants = {
806 - "default": undefined,
807 - success: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CheckIcon, null),
808 - warning: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(WarningIcon, null),
809 - error: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ErrorIcon, null),
810 - info: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InfoIcon, null)
811 -};
812 -
813 -var defaults = {
814 - maxSnack: 3,
815 - persist: false,
816 - hideIconVariant: false,
817 - disableWindowBlurListener: false,
818 - variant: 'default',
819 - autoHideDuration: 5000,
820 - iconVariant: defaultIconVariants,
821 - anchorOrigin: {
822 - vertical: 'bottom',
823 - horizontal: 'left'
824 - },
825 - TransitionComponent: Slide,
826 - transitionDuration: {
827 - enter: 225,
828 - exit: 195
829 - }
830 -};
831 -/**
832 - * Derives the right autoHideDuration taking into account the following
833 - * prority order: 1: Options, 2: Props, 3: default fallback
834 - */
835 -
836 -var getAutoHideDuration = function getAutoHideDuration(optionsDuration, propsDuration) {
837 - var isNumberOrNull = function isNumberOrNull(numberish) {
838 - return typeof numberish === 'number' || numberish === null;
839 - };
840 -
841 - if (isNumberOrNull(optionsDuration)) return optionsDuration;
842 - if (isNumberOrNull(propsDuration)) return propsDuration;
843 - return defaults.autoHideDuration;
844 -};
845 -/**
846 - * Derives the right transitionDuration taking into account the following
847 - * prority order: 1: Options, 2: Props, 3: default fallback
848 - */
849 -
850 -
851 -var getTransitionDuration = function getTransitionDuration(optionsDuration, propsDuration) {
852 - var is = function is(item, types) {
853 - return types.some(function (t) {
854 - return typeof item === t;
855 - });
856 - };
857 -
858 - if (is(optionsDuration, ['string', 'number'])) {
859 - return optionsDuration;
860 - }
861 -
862 - if (is(optionsDuration, ['object'])) {
863 - return _extends({}, defaults.transitionDuration, {}, is(propsDuration, ['object']) && propsDuration, {}, optionsDuration);
864 - }
865 -
866 - if (is(propsDuration, ['string', 'number'])) {
867 - return propsDuration;
868 - }
869 -
870 - if (is(propsDuration, ['object'])) {
871 - return _extends({}, defaults.transitionDuration, {}, propsDuration);
872 - }
873 -
874 - return defaults.transitionDuration;
875 -};
876 -
877 -var merge = function merge(options, props) {
878 - return function (name, shouldObjectMerge) {
879 - if (shouldObjectMerge === void 0) {
880 - shouldObjectMerge = false;
881 - }
882 -
883 - if (shouldObjectMerge) {
884 - return _extends({}, defaults[name], {}, props[name], {}, options[name]);
885 - }
886 -
887 - if (name === 'autoHideDuration') {
888 - return getAutoHideDuration(options.autoHideDuration, props.autoHideDuration);
889 - }
890 -
891 - if (name === 'transitionDuration') {
892 - return getTransitionDuration(options.transitionDuration, props.transitionDuration);
893 - }
894 -
895 - return options[name] || props[name] || defaults[name];
896 - };
897 -};
898 -
899 -function makeStyles(styles) {
900 - return Object.entries(styles).reduce(function (acc, _ref) {
901 - var _extends2;
902 -
903 - var key = _ref[0],
904 - value = _ref[1];
905 - return _extends({}, acc, (_extends2 = {}, _extends2[key] = (0,goober__WEBPACK_IMPORTED_MODULE_3__.css)(value), _extends2));
906 - }, {});
907 -}
908 -var ComponentClasses = {
909 - SnackbarContainer: 'notistack-SnackbarContainer',
910 - Snackbar: 'notistack-Snackbar',
911 - CollapseWrapper: 'notistack-CollapseWrapper',
912 - MuiContent: 'notistack-MuiContent',
913 - MuiContentVariant: function MuiContentVariant(variant) {
914 - return "notistack-MuiContent-" + variant;
915 - }
916 -};
917 -
918 -var classes = /*#__PURE__*/makeStyles({
919 - root: {
920 - height: 0
921 - },
922 - entered: {
923 - height: 'auto'
924 - }
925 -});
926 -var collapsedSize = '0px';
927 -var timeout = 175;
928 -var Collapse = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
929 - var children = props.children,
930 - inProp = props["in"],
931 - onExited = props.onExited;
932 - var wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
933 - var nodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
934 - var handleRef = useForkRef(ref, nodeRef);
935 -
936 - var getWrapperSize = function getWrapperSize() {
937 - return wrapperRef.current ? wrapperRef.current.clientHeight : 0;
938 - };
939 -
940 - var handleEnter = function handleEnter(node) {
941 - node.style.height = collapsedSize;
942 - };
943 -
944 - var handleEntering = function handleEntering(node) {
945 - var wrapperSize = getWrapperSize();
946 -
947 - var _getTransitionProps = getTransitionProps({
948 - timeout: timeout,
949 - mode: 'enter'
950 - }),
951 - transitionDuration = _getTransitionProps.duration,
952 - easing = _getTransitionProps.easing;
953 -
954 - node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : transitionDuration + "ms";
955 - node.style.height = wrapperSize + "px";
956 - node.style.transitionTimingFunction = easing || '';
957 - };
958 -
959 - var handleEntered = function handleEntered(node) {
960 - node.style.height = 'auto';
961 - };
962 -
963 - var handleExit = function handleExit(node) {
964 - node.style.height = getWrapperSize() + "px";
965 - };
966 -
967 - var handleExiting = function handleExiting(node) {
968 - reflow(node);
969 -
970 - var _getTransitionProps2 = getTransitionProps({
971 - timeout: timeout,
972 - mode: 'exit'
973 - }),
974 - transitionDuration = _getTransitionProps2.duration,
975 - easing = _getTransitionProps2.easing;
976 -
977 - node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : transitionDuration + "ms";
978 - node.style.height = collapsedSize;
979 - node.style.transitionTimingFunction = easing || '';
980 - };
981 -
982 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Transition, {
983 - "in": inProp,
984 - unmountOnExit: true,
985 - onEnter: handleEnter,
986 - onEntered: handleEntered,
987 - onEntering: handleEntering,
988 - onExit: handleExit,
989 - onExited: onExited,
990 - onExiting: handleExiting,
991 - nodeRef: nodeRef,
992 - timeout: timeout
993 - }, function (state, childProps) {
994 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", Object.assign({
995 - ref: handleRef,
996 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(classes.root, state === 'entered' && classes.entered),
997 - style: _extends({
998 - pointerEvents: 'all',
999 - overflow: 'hidden',
1000 - minHeight: collapsedSize,
1001 - transition: createTransition('height')
1002 - }, state === 'entered' && {
1003 - overflow: 'visible'
1004 - }, {}, state === 'exited' && !inProp && {
1005 - visibility: 'hidden'
1006 - })
1007 - }, childProps), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
1008 - ref: wrapperRef,
1009 - className: ComponentClasses.CollapseWrapper,
1010 - // Hack to get children with a negative margin to not falsify the height computation.
1011 - style: {
1012 - display: 'flex',
1013 - width: '100%'
1014 - }
1015 - }, children));
1016 - });
1017 -});
1018 -Collapse.displayName = 'Collapse';
1019 -
1020 -var direction = {
1021 - right: 'left',
1022 - left: 'right',
1023 - bottom: 'up',
1024 - top: 'down'
1025 -};
1026 -var getSlideDirection = function getSlideDirection(anchorOrigin) {
1027 - if (anchorOrigin.horizontal !== 'center') {
1028 - return direction[anchorOrigin.horizontal];
1029 - }
1030 -
1031 - return direction[anchorOrigin.vertical];
1032 -};
1033 -/** Tranforms classes name */
1034 -
1035 -var toSnackbarAnchorOrigin = function toSnackbarAnchorOrigin(anchorOrigin) {
1036 - return "anchorOrigin" + originKeyExtractor(anchorOrigin);
1037 -};
1038 -/**
1039 - * Omit SnackbarContainer class keys that are not needed for SnackbarItem
1040 - */
1041 -
1042 -var keepSnackbarClassKeys = function keepSnackbarClassKeys(classes) {
1043 - if (classes === void 0) {
1044 - classes = {};
1045 - }
1046 -
1047 - var containerClasses = {
1048 - containerRoot: true,
1049 - containerAnchorOriginTopCenter: true,
1050 - containerAnchorOriginBottomCenter: true,
1051 - containerAnchorOriginTopRight: true,
1052 - containerAnchorOriginBottomRight: true,
1053 - containerAnchorOriginTopLeft: true,
1054 - containerAnchorOriginBottomLeft: true
1055 - };
1056 - return Object.keys(classes).filter(function (key) {
1057 - return !containerClasses[key];
1058 - }).reduce(function (obj, key) {
1059 - var _extends2;
1060 -
1061 - return _extends({}, obj, (_extends2 = {}, _extends2[key] = classes[key], _extends2));
1062 - }, {});
1063 -};
1064 -
1065 -var noOp$1 = function noOp() {
1066 - /* */
1067 -};
1068 -/**
1069 - * Credit to MUI team @ https://mui.com
1070 - * Safe chained function.
1071 - *
1072 - * Will only create a new function if needed,
1073 - * otherwise will pass back existing functions or null.
1074 - */
1075 -
1076 -
1077 -function createChainedFunction(funcs, snackbarId) {
1078 - // @ts-ignore
1079 - return funcs.reduce(function (acc, func) {
1080 - if (func === null || func === undefined) {
1081 - return acc;
1082 - }
1083 -
1084 - return function chainedFunction() {
1085 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1086 - args[_key] = arguments[_key];
1087 - }
1088 -
1089 - var argums = [].concat(args);
1090 -
1091 - if (snackbarId && argums.indexOf(snackbarId) === -1) {
1092 - argums.push(snackbarId);
1093 - } // @ts-ignore
1094 -
1095 -
1096 - acc.apply(this, argums);
1097 - func.apply(this, argums);
1098 - };
1099 - }, noOp$1);
1100 -}
1101 -
1102 -/**
1103 - * Credit to MUI team @ https://mui.com
1104 - * https://github.com/facebook/react/issues/14099#issuecomment-440013892
1105 - */
1106 -var useEnhancedEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
1107 -function useEventCallback(fn) {
1108 - var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(fn);
1109 - useEnhancedEffect(function () {
1110 - ref.current = fn;
1111 - });
1112 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
1113 - return (// @ts-expect-error hide `this`
1114 - (ref.current).apply(void 0, arguments)
1115 - );
1116 - }, []);
1117 -}
1118 -
1119 -/**
1120 - * Credit to MUI team @ https://mui.com
1121 - */
1122 -var Snackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
1123 - var children = props.children,
1124 - className = props.className,
1125 - autoHideDuration = props.autoHideDuration,
1126 - _props$disableWindowB = props.disableWindowBlurListener,
1127 - disableWindowBlurListener = _props$disableWindowB === void 0 ? false : _props$disableWindowB,
1128 - onClose = props.onClose,
1129 - id = props.id,
1130 - open = props.open,
1131 - _props$SnackbarProps = props.SnackbarProps,
1132 - SnackbarProps = _props$SnackbarProps === void 0 ? {} : _props$SnackbarProps;
1133 - var timerAutoHide = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1134 - var handleClose = useEventCallback(function () {
1135 - if (onClose) {
1136 - onClose.apply(void 0, arguments);
1137 - }
1138 - });
1139 - var setAutoHideTimer = useEventCallback(function (autoHideDurationParam) {
1140 - if (!onClose || autoHideDurationParam == null) {
1141 - return;
1142 - }
1143 -
1144 - if (timerAutoHide.current) {
1145 - clearTimeout(timerAutoHide.current);
1146 - }
1147 -
1148 - timerAutoHide.current = setTimeout(function () {
1149 - handleClose(null, 'timeout', id);
1150 - }, autoHideDurationParam);
1151 - });
1152 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1153 - if (open) {
1154 - setAutoHideTimer(autoHideDuration);
1155 - }
1156 -
1157 - return function () {
1158 - if (timerAutoHide.current) {
1159 - clearTimeout(timerAutoHide.current);
1160 - }
1161 - };
1162 - }, [open, autoHideDuration, setAutoHideTimer]);
1163 - /**
1164 - * Pause the timer when the user is interacting with the Snackbar
1165 - * or when the user hide the window.
1166 - */
1167 -
1168 - var handlePause = function handlePause() {
1169 - if (timerAutoHide.current) {
1170 - clearTimeout(timerAutoHide.current);
1171 - }
1172 - };
1173 - /**
1174 - * Restart the timer when the user is no longer interacting with the Snackbar
1175 - * or when the window is shown back.
1176 - */
1177 -
1178 -
1179 - var handleResume = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
1180 - if (autoHideDuration != null) {
1181 - setAutoHideTimer(autoHideDuration * 0.5);
1182 - }
1183 - }, [autoHideDuration, setAutoHideTimer]);
1184 -
1185 - var handleMouseEnter = function handleMouseEnter(event) {
1186 - if (SnackbarProps.onMouseEnter) {
1187 - SnackbarProps.onMouseEnter(event);
1188 - }
1189 -
1190 - handlePause();
1191 - };
1192 -
1193 - var handleMouseLeave = function handleMouseLeave(event) {
1194 - if (SnackbarProps.onMouseLeave) {
1195 - SnackbarProps.onMouseLeave(event);
1196 - }
1197 -
1198 - handleResume();
1199 - };
1200 -
1201 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1202 - if (!disableWindowBlurListener && open) {
1203 - window.addEventListener('focus', handleResume);
1204 - window.addEventListener('blur', handlePause);
1205 - return function () {
1206 - window.removeEventListener('focus', handleResume);
1207 - window.removeEventListener('blur', handlePause);
1208 - };
1209 - }
1210 -
1211 - return undefined;
1212 - }, [disableWindowBlurListener, handleResume, open]);
1213 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", Object.assign({
1214 - ref: ref
1215 - }, SnackbarProps, {
1216 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(ComponentClasses.Snackbar, className),
1217 - onMouseEnter: handleMouseEnter,
1218 - onMouseLeave: handleMouseLeave
1219 - }), children);
1220 -});
1221 -Snackbar.displayName = 'Snackbar';
1222 -
1223 -var _root;
1224 -var classes$1 = /*#__PURE__*/makeStyles({
1225 - root: (_root = {
1226 - display: 'flex',
1227 - flexWrap: 'wrap',
1228 - flexGrow: 1
1229 - }, _root[breakpoints.upSm] = {
1230 - flexGrow: 'initial',
1231 - minWidth: '288px'
1232 - }, _root)
1233 -});
1234 -var SnackbarContent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) {
1235 - var className = _ref.className,
1236 - props = _objectWithoutPropertiesLoose(_ref, ["className"]);
1237 -
1238 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", Object.assign({
1239 - ref: ref,
1240 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(classes$1.root, className)
1241 - }, props));
1242 -});
1243 -SnackbarContent.displayName = 'SnackbarContent';
1244 -
1245 -var classes$2 = /*#__PURE__*/makeStyles({
1246 - root: {
1247 - backgroundColor: '#313131',
1248 - fontSize: '0.875rem',
1249 - lineHeight: 1.43,
1250 - letterSpacing: '0.01071em',
1251 - color: '#fff',
1252 - alignItems: 'center',
1253 - padding: '6px 16px',
1254 - borderRadius: '4px',
1255 - boxShadow: '0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)'
1256 - },
1257 - lessPadding: {
1258 - paddingLeft: 8 * 2.5 + "px"
1259 - },
1260 - "default": {
1261 - backgroundColor: '#313131'
1262 - },
1263 - success: {
1264 - backgroundColor: '#43a047'
1265 - },
1266 - error: {
1267 - backgroundColor: '#d32f2f'
1268 - },
1269 - warning: {
1270 - backgroundColor: '#ff9800'
1271 - },
1272 - info: {
1273 - backgroundColor: '#2196f3'
1274 - },
1275 - message: {
1276 - display: 'flex',
1277 - alignItems: 'center',
1278 - padding: '8px 0'
1279 - },
1280 - action: {
1281 - display: 'flex',
1282 - alignItems: 'center',
1283 - marginLeft: 'auto',
1284 - paddingLeft: '16px',
1285 - marginRight: '-8px'
1286 - }
1287 -});
1288 -var ariaDescribedby = 'notistack-snackbar';
1289 -var MaterialDesignContent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, forwardedRef) {
1290 - var id = props.id,
1291 - message = props.message,
1292 - componentOrFunctionAction = props.action,
1293 - iconVariant = props.iconVariant,
1294 - variant = props.variant,
1295 - hideIconVariant = props.hideIconVariant,
1296 - style = props.style,
1297 - className = props.className;
1298 - var icon = iconVariant[variant];
1299 - var action = componentOrFunctionAction;
1300 -
1301 - if (typeof action === 'function') {
1302 - action = action(id);
1303 - }
1304 -
1305 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SnackbarContent, {
1306 - ref: forwardedRef,
1307 - role: "alert",
1308 - "aria-describedby": ariaDescribedby,
1309 - style: style,
1310 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(ComponentClasses.MuiContent, ComponentClasses.MuiContentVariant(variant), classes$2.root, classes$2[variant], className, !hideIconVariant && icon && classes$2.lessPadding)
1311 - }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1312 - id: ariaDescribedby,
1313 - className: classes$2.message
1314 - }, !hideIconVariant ? icon : null, message), action && react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1315 - className: classes$2.action
1316 - }, action));
1317 -});
1318 -MaterialDesignContent.displayName = 'MaterialDesignContent';
1319 -var MaterialDesignContent$1 = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(MaterialDesignContent);
1320 -
1321 -var styles = /*#__PURE__*/makeStyles({
1322 - wrappedRoot: {
1323 - width: '100%',
1324 - position: 'relative',
1325 - transform: 'translateX(0)',
1326 - top: 0,
1327 - right: 0,
1328 - bottom: 0,
1329 - left: 0,
1330 - minWidth: '288px'
1331 - }
1332 -});
1333 -
1334 -var SnackbarItem = function SnackbarItem(props) {
1335 - var timeout = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
1336 -
1337 - var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
1338 - collapsed = _useState[0],
1339 - setCollapsed = _useState[1];
1340 -
1341 - var handleClose = createChainedFunction([props.snack.onClose, props.onClose]);
1342 -
1343 - var handleEntered = function handleEntered() {
1344 - if (props.snack.requestClose) {
1345 - handleClose(null, 'instructed', props.snack.id);
1346 - }
1347 - };
1348 -
1349 - var handleExitedScreen = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
1350 - timeout.current = setTimeout(function () {
1351 - setCollapsed(function (col) {
1352 - return !col;
1353 - });
1354 - }, 125);
1355 - }, []);
1356 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
1357 - return function () {
1358 - if (timeout.current) {
1359 - clearTimeout(timeout.current);
1360 - }
1361 - };
1362 - }, []);
1363 - var snack = props.snack,
1364 - allClasses = props.classes,
1365 - _props$Component = props.Component,
1366 - Component = _props$Component === void 0 ? MaterialDesignContent$1 : _props$Component;
1367 - var classes = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
1368 - return keepSnackbarClassKeys(allClasses);
1369 - }, [allClasses]);
1370 -
1371 - var open = snack.open,
1372 - SnackbarProps = snack.SnackbarProps,
1373 - TransitionComponent = snack.TransitionComponent,
1374 - TransitionProps = snack.TransitionProps,
1375 - transitionDuration = snack.transitionDuration,
1376 - disableWindowBlurListener = snack.disableWindowBlurListener,
1377 - componentOrFunctionContent = snack.content,
1378 - otherSnack = _objectWithoutPropertiesLoose(snack, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]);
1379 -
1380 - var transitionProps = _extends({
1381 - direction: getSlideDirection(otherSnack.anchorOrigin),
1382 - timeout: transitionDuration
1383 - }, TransitionProps);
1384 -
1385 - var content = componentOrFunctionContent;
1386 -
1387 - if (typeof content === 'function') {
1388 - content = content(otherSnack.id, otherSnack.message);
1389 - }
1390 -
1391 - var callbacks = ['onEnter', 'onEntered', 'onExit', 'onExited'].reduce(function (acc, cbName) {
1392 - var _extends2;
1393 -
1394 - return _extends({}, acc, (_extends2 = {}, _extends2[cbName] = createChainedFunction([props.snack[cbName], props[cbName]], otherSnack.id), _extends2));
1395 - }, {});
1396 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Collapse, {
1397 - "in": collapsed,
1398 - onExited: callbacks.onExited
1399 - }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Snackbar, {
1400 - open: open,
1401 - id: otherSnack.id,
1402 - disableWindowBlurListener: disableWindowBlurListener,
1403 - autoHideDuration: otherSnack.autoHideDuration,
1404 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(styles.wrappedRoot, classes.root, classes[toSnackbarAnchorOrigin(otherSnack.anchorOrigin)]),
1405 - SnackbarProps: SnackbarProps,
1406 - onClose: handleClose
1407 - }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(TransitionComponent, Object.assign({}, transitionProps, {
1408 - appear: true,
1409 - "in": open,
1410 - onExit: callbacks.onExit,
1411 - onExited: handleExitedScreen,
1412 - onEnter: callbacks.onEnter,
1413 - // order matters. first callbacks.onEntered to set entered: true,
1414 - // then handleEntered to check if there's a request for closing
1415 - onEntered: createChainedFunction([callbacks.onEntered, handleEntered], otherSnack.id)
1416 - }), content || react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, Object.assign({}, otherSnack)))));
1417 -};
1418 -
1419 -var _root$1, _rootDense, _left, _right, _center;
1420 -var indents = {
1421 - view: {
1422 - "default": 20,
1423 - dense: 4
1424 - },
1425 - snackbar: {
1426 - "default": 6,
1427 - dense: 2
1428 - }
1429 -};
1430 -var collapseWrapper = "." + ComponentClasses.CollapseWrapper;
1431 -var xsWidthMargin = 16;
1432 -var styles$1 = /*#__PURE__*/makeStyles({
1433 - root: (_root$1 = {
1434 - boxSizing: 'border-box',
1435 - display: 'flex',
1436 - maxHeight: '100%',
1437 - position: 'fixed',
1438 - zIndex: 1400,
1439 - height: 'auto',
1440 - width: 'auto',
1441 - transition: /*#__PURE__*/createTransition(['top', 'right', 'bottom', 'left', 'max-width'], {
1442 - duration: 300,
1443 - easing: 'ease'
1444 - }),
1445 - // container itself is invisible and should not block clicks, clicks should be passed to its children
1446 - // a pointerEvents: all is applied in the collapse component
1447 - pointerEvents: 'none'
1448 - }, _root$1[collapseWrapper] = {
1449 - padding: indents.snackbar["default"] + "px 0px",
1450 - transition: 'padding 300ms ease 0ms'
1451 - }, _root$1.maxWidth = "calc(100% - " + indents.view["default"] * 2 + "px)", _root$1[breakpoints.downXs] = {
1452 - width: '100%',
1453 - maxWidth: "calc(100% - " + xsWidthMargin * 2 + "px)"
1454 - }, _root$1),
1455 - rootDense: (_rootDense = {}, _rootDense[collapseWrapper] = {
1456 - padding: indents.snackbar.dense + "px 0px"
1457 - }, _rootDense),
1458 - top: {
1459 - top: indents.view["default"] - indents.snackbar["default"] + "px",
1460 - flexDirection: 'column'
1461 - },
1462 - bottom: {
1463 - bottom: indents.view["default"] - indents.snackbar["default"] + "px",
1464 - flexDirection: 'column-reverse'
1465 - },
1466 - left: (_left = {
1467 - left: indents.view["default"] + "px"
1468 - }, _left[breakpoints.upSm] = {
1469 - alignItems: 'flex-start'
1470 - }, _left[breakpoints.downXs] = {
1471 - left: xsWidthMargin + "px"
1472 - }, _left),
1473 - right: (_right = {
1474 - right: indents.view["default"] + "px"
1475 - }, _right[breakpoints.upSm] = {
1476 - alignItems: 'flex-end'
1477 - }, _right[breakpoints.downXs] = {
1478 - right: xsWidthMargin + "px"
1479 - }, _right),
1480 - center: (_center = {
1481 - left: '50%',
1482 - transform: 'translateX(-50%)'
1483 - }, _center[breakpoints.upSm] = {
1484 - alignItems: 'center'
1485 - }, _center)
1486 -});
1487 -
1488 -var SnackbarContainer = function SnackbarContainer(props) {
1489 - var _props$classes = props.classes,
1490 - classes = _props$classes === void 0 ? {} : _props$classes,
1491 - anchorOrigin = props.anchorOrigin,
1492 - dense = props.dense,
1493 - children = props.children;
1494 - var combinedClassname = (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(ComponentClasses.SnackbarContainer, styles$1[anchorOrigin.vertical], styles$1[anchorOrigin.horizontal], styles$1.root, // root should come after others to override maxWidth
1495 - classes.containerRoot, classes["containerAnchorOrigin" + originKeyExtractor(anchorOrigin)], dense && styles$1.rootDense);
1496 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1497 - className: combinedClassname
1498 - }, children);
1499 -};
1500 -
1501 -var SnackbarContainer$1 = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(SnackbarContainer);
1502 -
1503 -/* eslint-disable */
1504 -var __DEV__ = "development" !== 'production';
1505 -
1506 -var messages = {
1507 - NO_PERSIST_ALL: "Reached maxSnack while all enqueued snackbars have 'persist' flag. Notistack will dismiss the oldest snackbar anyway to allow other ones in the queue to be presented."
1508 -};
1509 -var warning = (function (messageKey) {
1510 - if (!__DEV__) return;
1511 - var message = messages[messageKey];
1512 -
1513 - if (typeof console !== 'undefined') {
1514 - console.error("WARNING - notistack: " + message);
1515 - }
1516 -
1517 - try {
1518 - throw new Error(message);
1519 - } catch (x) {}
1520 -});
1521 -
1522 -var isOptions = function isOptions(messageOrOptions) {
1523 - var isMessage = typeof messageOrOptions === 'string' || (0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(messageOrOptions);
1524 - return !isMessage;
1525 -};
1526 -
1527 -var enqueueSnackbar;
1528 -var closeSnackbar;
1529 -
1530 -var SnackbarProvider = /*#__PURE__*/function (_Component) {
1531 - _inheritsLoose(SnackbarProvider, _Component);
1532 -
1533 - function SnackbarProvider(props) {
1534 - var _this;
1535 -
1536 - _this = _Component.call(this, props) || this;
1537 - /**
1538 - * Adds a new snackbar to the queue to be presented.
1539 - * Returns generated or user defined key referencing the new snackbar or null
1540 - */
1541 -
1542 - _this.enqueueSnackbar = function (messageOrOptions, optsOrUndefined) {
1543 - if (optsOrUndefined === void 0) {
1544 - optsOrUndefined = {};
1545 - }
1546 -
1547 - if (messageOrOptions === undefined || messageOrOptions === null) {
1548 - throw new Error('enqueueSnackbar called with invalid argument');
1549 - }
1550 -
1551 - var opts = isOptions(messageOrOptions) ? messageOrOptions : optsOrUndefined;
1552 - var message = isOptions(messageOrOptions) ? messageOrOptions.message : messageOrOptions;
1553 -
1554 - var key = opts.key,
1555 - preventDuplicate = opts.preventDuplicate,
1556 - options = _objectWithoutPropertiesLoose(opts, ["key", "preventDuplicate"]);
1557 -
1558 - var hasSpecifiedKey = isDefined(key);
1559 - var id = hasSpecifiedKey ? key : new Date().getTime() + Math.random();
1560 - var merger = merge(options, _this.props);
1561 -
1562 - var snack = _extends({
1563 - id: id
1564 - }, options, {
1565 - message: message,
1566 - open: true,
1567 - entered: false,
1568 - requestClose: false,
1569 - persist: merger('persist'),
1570 - action: merger('action'),
1571 - content: merger('content'),
1572 - variant: merger('variant'),
1573 - anchorOrigin: merger('anchorOrigin'),
1574 - disableWindowBlurListener: merger('disableWindowBlurListener'),
1575 - autoHideDuration: merger('autoHideDuration'),
1576 - hideIconVariant: merger('hideIconVariant'),
1577 - TransitionComponent: merger('TransitionComponent'),
1578 - transitionDuration: merger('transitionDuration'),
1579 - TransitionProps: merger('TransitionProps', true),
1580 - iconVariant: merger('iconVariant', true),
1581 - style: merger('style', true),
1582 - SnackbarProps: merger('SnackbarProps', true),
1583 - className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_this.props.className, options.className)
1584 - });
1585 -
1586 - if (snack.persist) {
1587 - snack.autoHideDuration = undefined;
1588 - }
1589 -
1590 - _this.setState(function (state) {
1591 - if (preventDuplicate === undefined && _this.props.preventDuplicate || preventDuplicate) {
1592 - var compareFunction = function compareFunction(item) {
1593 - return hasSpecifiedKey ? item.id === id : item.message === message;
1594 - };
1595 -
1596 - var inQueue = state.queue.findIndex(compareFunction) > -1;
1597 - var inView = state.snacks.findIndex(compareFunction) > -1;
1598 -
1599 - if (inQueue || inView) {
1600 - return state;
1601 - }
1602 - }
1603 -
1604 - return _this.handleDisplaySnack(_extends({}, state, {
1605 - queue: [].concat(state.queue, [snack])
1606 - }));
1607 - });
1608 -
1609 - return id;
1610 - };
1611 - /**
1612 - * Reducer: Display snack if there's space for it. Otherwise, immediately
1613 - * begin dismissing the oldest message to start showing the new one.
1614 - */
1615 -
1616 -
1617 - _this.handleDisplaySnack = function (state) {
1618 - var snacks = state.snacks;
1619 -
1620 - if (snacks.length >= _this.maxSnack) {
1621 - return _this.handleDismissOldest(state);
1622 - }
1623 -
1624 - return _this.processQueue(state);
1625 - };
1626 - /**
1627 - * Reducer: Display items (notifications) in the queue if there's space for them.
1628 - */
1629 -
1630 -
1631 - _this.processQueue = function (state) {
1632 - var queue = state.queue,
1633 - snacks = state.snacks;
1634 -
1635 - if (queue.length > 0) {
1636 - return _extends({}, state, {
1637 - snacks: [].concat(snacks, [queue[0]]),
1638 - queue: queue.slice(1, queue.length)
1639 - });
1640 - }
1641 -
1642 - return state;
1643 - };
1644 - /**
1645 - * Reducer: Hide oldest snackbar on the screen because there exists a new one which we have to display.
1646 - * (ignoring the one with 'persist' flag. i.e. explicitly told by user not to get dismissed).
1647 - *
1648 - * Note 1: If there is already a message leaving the screen, no new messages are dismissed.
1649 - * Note 2: If the oldest message has not yet entered the screen, only a request to close the
1650 - * snackbar is made. Once it entered the screen, it will be immediately dismissed.
1651 - */
1652 -
1653 -
1654 - _this.handleDismissOldest = function (state) {
1655 - if (state.snacks.some(function (item) {
1656 - return !item.open || item.requestClose;
1657 - })) {
1658 - return state;
1659 - }
1660 -
1661 - var popped = false;
1662 - var ignore = false;
1663 - var persistentCount = state.snacks.reduce(function (acc, current) {
1664 - return acc + (current.open && current.persist ? 1 : 0);
1665 - }, 0);
1666 -
1667 - if (persistentCount === _this.maxSnack) {
1668 - true ? warning('NO_PERSIST_ALL') : 0;
1669 - ignore = true;
1670 - }
1671 -
1672 - var snacks = state.snacks.map(function (item) {
1673 - if (!popped && (!item.persist || ignore)) {
1674 - popped = true;
1675 -
1676 - if (!item.entered) {
1677 - return _extends({}, item, {
1678 - requestClose: true
1679 - });
1680 - }
1681 -
1682 - if (item.onClose) {
1683 - item.onClose(null, 'maxsnack', item.id);
1684 - }
1685 -
1686 - if (_this.props.onClose) {
1687 - _this.props.onClose(null, 'maxsnack', item.id);
1688 - }
1689 -
1690 - return _extends({}, item, {
1691 - open: false
1692 - });
1693 - }
1694 -
1695 - return _extends({}, item);
1696 - });
1697 - return _extends({}, state, {
1698 - snacks: snacks
1699 - });
1700 - };
1701 - /**
1702 - * Set the entered state of the snackbar with the given key.
1703 - */
1704 -
1705 -
1706 - _this.handleEnteredSnack = function (node, isAppearing, key) {
1707 - if (!isDefined(key)) {
1708 - throw new Error('handleEnteredSnack Cannot be called with undefined key');
1709 - }
1710 -
1711 - _this.setState(function (_ref) {
1712 - var snacks = _ref.snacks;
1713 - return {
1714 - snacks: snacks.map(function (item) {
1715 - return item.id === key ? _extends({}, item, {
1716 - entered: true
1717 - }) : _extends({}, item);
1718 - })
1719 - };
1720 - });
1721 - };
1722 - /**
1723 - * Hide a snackbar after its timeout.
1724 - */
1725 -
1726 -
1727 - _this.handleCloseSnack = function (event, reason, key) {
1728 - // should not use createChainedFunction for onClose.
1729 - // because this.closeSnackbar called this function
1730 - if (_this.props.onClose) {
1731 - _this.props.onClose(event, reason, key);
1732 - }
1733 -
1734 - var shouldCloseAll = key === undefined;
1735 -
1736 - _this.setState(function (_ref2) {
1737 - var snacks = _ref2.snacks,
1738 - queue = _ref2.queue;
1739 - return {
1740 - snacks: snacks.map(function (item) {
1741 - if (!shouldCloseAll && item.id !== key) {
1742 - return _extends({}, item);
1743 - }
1744 -
1745 - return item.entered ? _extends({}, item, {
1746 - open: false
1747 - }) : _extends({}, item, {
1748 - requestClose: true
1749 - });
1750 - }),
1751 - queue: queue.filter(function (item) {
1752 - return item.id !== key;
1753 - })
1754 - };
1755 - });
1756 - };
1757 - /**
1758 - * Close snackbar with the given key
1759 - */
1760 -
1761 -
1762 - _this.closeSnackbar = function (key) {
1763 - // call individual snackbar onClose callback passed through options parameter
1764 - var toBeClosed = _this.state.snacks.find(function (item) {
1765 - return item.id === key;
1766 - });
1767 -
1768 - if (isDefined(key) && toBeClosed && toBeClosed.onClose) {
1769 - toBeClosed.onClose(null, 'instructed', key);
1770 - }
1771 -
1772 - _this.handleCloseSnack(null, 'instructed', key);
1773 - };
1774 - /**
1775 - * When we set open attribute of a snackbar to false (i.e. after we hide a snackbar),
1776 - * it leaves the screen and immediately after leaving animation is done, this method
1777 - * gets called. We remove the hidden snackbar from state and then display notifications
1778 - * waiting in the queue (if any). If after this process the queue is not empty, the
1779 - * oldest message is dismissed.
1780 - */
1781 -
1782 -
1783 - _this.handleExitedSnack = function (node, key) {
1784 - if (!isDefined(key)) {
1785 - throw new Error('handleExitedSnack Cannot be called with undefined key');
1786 - }
1787 -
1788 - _this.setState(function (state) {
1789 - var newState = _this.processQueue(_extends({}, state, {
1790 - snacks: state.snacks.filter(function (item) {
1791 - return item.id !== key;
1792 - })
1793 - }));
1794 -
1795 - if (newState.queue.length === 0) {
1796 - return newState;
1797 - }
1798 -
1799 - return _this.handleDismissOldest(newState);
1800 - });
1801 - };
1802 -
1803 - enqueueSnackbar = _this.enqueueSnackbar;
1804 - closeSnackbar = _this.closeSnackbar;
1805 - _this.state = {
1806 - snacks: [],
1807 - queue: [],
1808 - contextValue: {
1809 - enqueueSnackbar: _this.enqueueSnackbar.bind(_assertThisInitialized(_this)),
1810 - closeSnackbar: _this.closeSnackbar.bind(_assertThisInitialized(_this))
1811 - }
1812 - };
1813 - return _this;
1814 - }
1815 -
1816 - var _proto = SnackbarProvider.prototype;
1817 -
1818 - _proto.render = function render() {
1819 - var _this2 = this;
1820 -
1821 - var contextValue = this.state.contextValue;
1822 - var _this$props = this.props,
1823 - domRoot = _this$props.domRoot,
1824 - children = _this$props.children,
1825 - _this$props$dense = _this$props.dense,
1826 - dense = _this$props$dense === void 0 ? false : _this$props$dense,
1827 - _this$props$Component = _this$props.Components,
1828 - Components = _this$props$Component === void 0 ? {} : _this$props$Component,
1829 - classes = _this$props.classes;
1830 - var categ = this.state.snacks.reduce(function (acc, current) {
1831 - var _extends2;
1832 -
1833 - var category = originKeyExtractor(current.anchorOrigin);
1834 - var existingOfCategory = acc[category] || [];
1835 - return _extends({}, acc, (_extends2 = {}, _extends2[category] = [].concat(existingOfCategory, [current]), _extends2));
1836 - }, {});
1837 - var snackbars = Object.keys(categ).map(function (origin) {
1838 - var snacks = categ[origin];
1839 - var nomineeSnack = snacks[0];
1840 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SnackbarContainer$1, {
1841 - key: origin,
1842 - dense: dense,
1843 - anchorOrigin: nomineeSnack.anchorOrigin,
1844 - classes: classes
1845 - }, snacks.map(function (snack) {
1846 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SnackbarItem, {
1847 - key: snack.id,
1848 - snack: snack,
1849 - classes: classes,
1850 - Component: Components[snack.variant],
1851 - onClose: _this2.handleCloseSnack,
1852 - onEnter: _this2.props.onEnter,
1853 - onExit: _this2.props.onExit,
1854 - onExited: createChainedFunction([_this2.handleExitedSnack, _this2.props.onExited], snack.id),
1855 - onEntered: createChainedFunction([_this2.handleEnteredSnack, _this2.props.onEntered], snack.id)
1856 - });
1857 - }));
1858 - });
1859 - return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SnackbarContext.Provider, {
1860 - value: contextValue
1861 - }, children, domRoot ? (0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(snackbars, domRoot) : snackbars);
1862 - };
1863 -
1864 - _createClass(SnackbarProvider, [{
1865 - key: "maxSnack",
1866 - get: function get() {
1867 - return this.props.maxSnack || defaults.maxSnack;
1868 - }
1869 - }]);
1870 -
1871 - return SnackbarProvider;
1872 -}(react__WEBPACK_IMPORTED_MODULE_0__.Component);
1873 -
1874 -var useSnackbar = (function () {
1875 - return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(SnackbarContext);
1876 -});
1877 -
1878 -
1879 -//# sourceMappingURL=notistack.esm.js.map
1880 -
1881 -
1882 -/***/ }),
1883 -
1884 -/***/ "./packages/packages/core/editor-notifications/src/components/notifications.tsx":
1885 -/*!**************************************************************************************!*\
1886 - !*** ./packages/packages/core/editor-notifications/src/components/notifications.tsx ***!
1887 - \**************************************************************************************/
1888 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1889 -
1890 -__webpack_require__.r(__webpack_exports__);
1891 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1892 -/* harmony export */ NotifyReact: function() { return /* binding */ NotifyReact; },
1893 -/* harmony export */ dismissNotification: function() { return /* binding */ dismissNotification; },
1894 -/* harmony export */ notify: function() { return /* binding */ notify; }
1895 -/* harmony export */ });
1896 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1897 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1898 -/* harmony import */ var notistack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! notistack */ "./node_modules/notistack/notistack.esm.js");
1899 -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
1900 -/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__);
1901 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @elementor/store */ "@elementor/store");
1902 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_elementor_store__WEBPACK_IMPORTED_MODULE_3__);
1903 -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
1904 -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_4__);
1905 -/* harmony import */ var _hooks_use_enqueue_notifications__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../hooks/use-enqueue-notifications */ "./packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx");
1906 -/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../slice */ "./packages/packages/core/editor-notifications/src/slice.ts");
1907 -/* harmony import */ var _sync_get_editing_panel_width__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../sync/get-editing-panel-width */ "./packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts");
1908 -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
1909 -
1910 -
1911 -
1912 -
1913 -
1914 -
1915 -
1916 -
1917 -
1918 -// 8 seconds
1919 -const AUTO_HIDE_DURATION = 8000;
1920 -const DefaultCustomSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => {
1921 - const filteredProps = getFilteredSnackbarProps(props);
1922 - const panelWidth = (0,_sync_get_editing_panel_width__WEBPACK_IMPORTED_MODULE_7__.getEditingPanelWidth)();
1923 - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_4__.ThemeProvider, {
1924 - palette: "unstable"
1925 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_4__.SnackbarContent, _extends({
1926 - ref: ref
1927 - }, filteredProps, {
1928 - sx: {
1929 - '&.MuiPaper-root': {
1930 - minWidth: 'max-content'
1931 - },
1932 - ml: panelWidth + 'px'
1933 - }
1934 - })));
1935 -});
1936 -const AlertSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
1937 - color,
1938 - icon,
1939 - ...props
1940 -}, ref) => {
1941 - const panelWidth = (0,_sync_get_editing_panel_width__WEBPACK_IMPORTED_MODULE_7__.getEditingPanelWidth)();
1942 - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_4__.ThemeProvider, {
1943 - colorScheme: "light",
1944 - palette: "unstable"
1945 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_4__.Alert, {
1946 - ref: ref,
1947 - variant: "standard",
1948 - color: color,
1949 - icon: icon,
1950 - role: "alert",
1951 - action: props.action,
1952 - onClose: () => (0,notistack__WEBPACK_IMPORTED_MODULE_1__.closeSnackbar)(props.id),
1953 - sx: {
1954 - ml: panelWidth + 'px',
1955 - '& .MuiAlert-message': {
1956 - display: 'flex',
1957 - flexWrap: 'nowrap',
1958 - alignItems: 'center'
1959 - },
1960 - '& .MuiAlert-content': {
1961 - whiteSpace: 'nowrap'
1962 - }
1963 - }
1964 - }, props.message));
1965 -});
1966 -const PromotionSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertSnackbar, _extends({
1967 - ref: ref,
1968 - color: "promotion",
1969 - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.CrownFilledIcon, null)
1970 -}, props)));
1971 -const InfoSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertSnackbar, _extends({
1972 - ref: ref,
1973 - color: "info",
1974 - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.InfoCircleFilledIcon, null)
1975 -}, props)));
1976 -const SuccessSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertSnackbar, _extends({
1977 - ref: ref,
1978 - color: "success",
1979 - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.CircleCheckFilledIcon, null)
1980 -}, props)));
1981 -const ErrorSnackbar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AlertSnackbar, _extends({
1982 - ref: ref,
1983 - color: "error",
1984 - icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.AlertCircleFilled, null)
1985 -}, props)));
1986 -const muiToEuiMapper = {
1987 - default: DefaultCustomSnackbar,
1988 - promotion: PromotionSnackbar,
1989 - info: InfoSnackbar,
1990 - success: SuccessSnackbar,
1991 - error: ErrorSnackbar
1992 -};
1993 -const Handler = () => {
1994 - const notifications = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_3__.__useSelector)(state => state.notifications);
1995 - (0,_hooks_use_enqueue_notifications__WEBPACK_IMPORTED_MODULE_5__.useEnqueueNotification)(notifications);
1996 - return null;
1997 -};
1998 -const Wrapper = () => {
1999 - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(notistack__WEBPACK_IMPORTED_MODULE_1__.SnackbarProvider, {
2000 - maxSnack: 3,
2001 - autoHideDuration: AUTO_HIDE_DURATION,
2002 - anchorOrigin: {
2003 - horizontal: 'center',
2004 - vertical: 'bottom'
2005 - },
2006 - Components: muiToEuiMapper
2007 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Handler, null));
2008 -};
2009 -
2010 -/*
2011 - * This function can be used to trigger notifications from anywhere in the code.
2012 - * even if you're running in a JS environment as opposed to a React environment.
2013 - */
2014 -function notify(notification) {
2015 - const store = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_3__.__getStore)();
2016 - store?.dispatch((0,_slice__WEBPACK_IMPORTED_MODULE_6__.notifyAction)(notification));
2017 -}
2018 -function dismissNotification(id) {
2019 - const store = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_3__.__getStore)();
2020 - (0,notistack__WEBPACK_IMPORTED_MODULE_1__.closeSnackbar)(id);
2021 - store?.dispatch((0,_slice__WEBPACK_IMPORTED_MODULE_6__.clearAction)({
2022 - id
2023 - }));
2024 -}
2025 -
2026 -/*
2027 - * This function can be used to trigger notifications from within a React component.
2028 - * This is the preferred way to trigger notifications.
2029 - */
2030 -function NotifyReact(notification) {
2031 - const dispatch = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_3__.__useDispatch)();
2032 - dispatch((0,_slice__WEBPACK_IMPORTED_MODULE_6__.notifyAction)(notification));
2033 -}
2034 -function getFilteredSnackbarProps(props) {
2035 - const forbiddenProps = ['autoHideDuration', 'persist', 'hideIconVariant', 'iconVariant', 'anchorOrigin'];
2036 - return Object.entries(props).reduce((filteredProps, [key, value]) => {
2037 - if (!forbiddenProps.includes(key)) {
2038 - filteredProps[key] = value;
2039 - }
2040 - return filteredProps;
2041 - }, {});
2042 -}
2043 -/* harmony default export */ __webpack_exports__["default"] = (Wrapper);
2044 -
2045 -/***/ }),
2046 -
2047 -/***/ "./packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx":
2048 -/*!*********************************************************************************************!*\
2049 - !*** ./packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx ***!
2050 - \*********************************************************************************************/
2051 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2052 -
2053 -__webpack_require__.r(__webpack_exports__);
2054 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2055 -/* harmony export */ useEnqueueNotification: function() { return /* binding */ useEnqueueNotification; }
2056 -/* harmony export */ });
2057 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2058 -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2059 -/* harmony import */ var notistack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! notistack */ "./node_modules/notistack/notistack.esm.js");
2060 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/store */ "@elementor/store");
2061 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_store__WEBPACK_IMPORTED_MODULE_2__);
2062 -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
2063 -/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__);
2064 -/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../slice */ "./packages/packages/core/editor-notifications/src/slice.ts");
2065 -function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2066 -
2067 -
2068 -
2069 -
2070 -
2071 -
2072 -const AUTO_HIDE_DURATION = 8000;
2073 -function createDefaultAction(notification, onDismiss) {
2074 - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
2075 - key: notification.id
2076 - }, notification.additionalActionProps?.map((additionalAction, index) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Button, _extends({
2077 - key: `${index}`
2078 - }, additionalAction))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.CloseButton, {
2079 - "aria-label": "close",
2080 - color: "inherit",
2081 - onClick: onDismiss
2082 - }));
2083 -}
2084 -function createPromotionAction(notification) {
2085 - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
2086 - key: notification.id
2087 - }, notification.additionalActionProps?.map((additionalAction, index) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Button, _extends({
2088 - key: `${index}`
2089 - }, additionalAction))));
2090 -}
2091 -const useEnqueueNotification = notifications => {
2092 - const {
2093 - enqueueSnackbar
2094 - } = (0,notistack__WEBPACK_IMPORTED_MODULE_1__.useSnackbar)();
2095 - const dispatch = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_2__.__useDispatch)();
2096 - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
2097 - Object.values(notifications).forEach(notification => {
2098 - const dismiss = () => {
2099 - (0,notistack__WEBPACK_IMPORTED_MODULE_1__.closeSnackbar)(notification.id);
2100 - dispatch((0,_slice__WEBPACK_IMPORTED_MODULE_4__.clearAction)({
2101 - id: notification.id
2102 - }));
2103 - };
2104 - const useAlertAction = ['promotion', 'info', 'success', 'error'].includes(notification.type);
2105 - const action = useAlertAction ? createPromotionAction(notification) : createDefaultAction(notification, dismiss);
2106 - enqueueSnackbar(notification.message, {
2107 - variant: notification.type,
2108 - key: notification.id,
2109 - onClose: () => dispatch((0,_slice__WEBPACK_IMPORTED_MODULE_4__.clearAction)({
2110 - id: notification.id
2111 - })),
2112 - preventDuplicate: true,
2113 - action,
2114 - autoHideDuration: notification.autoHideDuration ?? AUTO_HIDE_DURATION
2115 - });
2116 - });
2117 - }, [notifications, enqueueSnackbar, dispatch]);
2118 -};
2119 -
2120 -/***/ }),
2121 -
2122 -/***/ "./packages/packages/core/editor-notifications/src/init.ts":
2123 -/*!*****************************************************************!*\
2124 - !*** ./packages/packages/core/editor-notifications/src/init.ts ***!
2125 - \*****************************************************************/
2126 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2127 -
2128 -__webpack_require__.r(__webpack_exports__);
2129 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2130 -/* harmony export */ init: function() { return /* binding */ init; }
2131 -/* harmony export */ });
2132 -/* harmony import */ var _elementor_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor */ "@elementor/editor");
2133 -/* harmony import */ var _elementor_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor__WEBPACK_IMPORTED_MODULE_0__);
2134 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/store */ "@elementor/store");
2135 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_store__WEBPACK_IMPORTED_MODULE_1__);
2136 -/* harmony import */ var _components_notifications__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/notifications */ "./packages/packages/core/editor-notifications/src/components/notifications.tsx");
2137 -/* harmony import */ var _slice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./slice */ "./packages/packages/core/editor-notifications/src/slice.ts");
2138 -
2139 -
2140 -
2141 -
2142 -function init() {
2143 - (0,_elementor_store__WEBPACK_IMPORTED_MODULE_1__.__registerSlice)(_slice__WEBPACK_IMPORTED_MODULE_3__.notificationsSlice);
2144 - (0,_elementor_editor__WEBPACK_IMPORTED_MODULE_0__.injectIntoTop)({
2145 - id: 'notifications',
2146 - component: _components_notifications__WEBPACK_IMPORTED_MODULE_2__["default"]
2147 - });
2148 -}
2149 -
2150 -/***/ }),
2151 -
2152 -/***/ "./packages/packages/core/editor-notifications/src/slice.ts":
2153 -/*!******************************************************************!*\
2154 - !*** ./packages/packages/core/editor-notifications/src/slice.ts ***!
2155 - \******************************************************************/
2156 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2157 -
2158 -__webpack_require__.r(__webpack_exports__);
2159 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2160 -/* harmony export */ clearAction: function() { return /* binding */ clearAction; },
2161 -/* harmony export */ notificationsSlice: function() { return /* binding */ notificationsSlice; },
2162 -/* harmony export */ notifyAction: function() { return /* binding */ notifyAction; }
2163 -/* harmony export */ });
2164 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/store */ "@elementor/store");
2165 -/* harmony import */ var _elementor_store__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_store__WEBPACK_IMPORTED_MODULE_0__);
2166 -
2167 -const notificationsSlice = (0,_elementor_store__WEBPACK_IMPORTED_MODULE_0__.__createSlice)({
2168 - name: 'notifications',
2169 - initialState: {},
2170 - reducers: {
2171 - notifyAction: (state, action) => {
2172 - const newState = {
2173 - ...state
2174 - };
2175 - if (!newState[action.payload.id]) {
2176 - newState[action.payload.id] = action.payload;
2177 - }
2178 - return newState;
2179 - },
2180 - clearAction: (state, action) => {
2181 - const newState = {
2182 - ...state
2183 - };
2184 - if (newState[action.payload.id]) {
2185 - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
2186 - delete newState[action.payload.id];
2187 - }
2188 - return newState;
2189 - }
2190 - }
2191 -});
2192 -const {
2193 - notifyAction,
2194 - clearAction
2195 -} = notificationsSlice.actions;
2196 -
2197 -/***/ }),
2198 -
2199 -/***/ "./packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts":
2200 -/*!*****************************************************************************************!*\
2201 - !*** ./packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts ***!
2202 - \*****************************************************************************************/
2203 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2204 -
2205 -__webpack_require__.r(__webpack_exports__);
2206 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2207 -/* harmony export */ getEditingPanelWidth: function() { return /* binding */ getEditingPanelWidth; }
2208 -/* harmony export */ });
2209 -function getEditingPanelWidth() {
2210 - return document.querySelector('.elementor-panel')?.clientWidth || 0;
2211 -}
2212 -
2213 -/***/ }),
2214 -
2215 -/***/ "@elementor/editor":
2216 -/*!*****************************************!*\
2217 - !*** external ["elementorV2","editor"] ***!
2218 - \*****************************************/
2219 -/***/ (function(module) {
2220 -
2221 -module.exports = window["elementorV2"]["editor"];
2222 -
2223 -/***/ }),
2224 -
2225 -/***/ "@elementor/icons":
2226 -/*!****************************************!*\
2227 - !*** external ["elementorV2","icons"] ***!
2228 - \****************************************/
2229 -/***/ (function(module) {
2230 -
2231 -module.exports = window["elementorV2"]["icons"];
2232 -
2233 -/***/ }),
2234 -
2235 -/***/ "@elementor/store":
2236 -/*!****************************************!*\
2237 - !*** external ["elementorV2","store"] ***!
2238 - \****************************************/
2239 -/***/ (function(module) {
2240 -
2241 -module.exports = window["elementorV2"]["store"];
2242 -
2243 -/***/ }),
2244 -
2245 -/***/ "@elementor/ui":
2246 -/*!*************************************!*\
2247 - !*** external ["elementorV2","ui"] ***!
2248 - \*************************************/
2249 -/***/ (function(module) {
2250 -
2251 -module.exports = window["elementorV2"]["ui"];
2252 -
2253 -/***/ }),
2254 -
2255 -/***/ "react":
2256 -/*!**************************!*\
2257 - !*** external ["React"] ***!
2258 - \**************************/
2259 -/***/ (function(module) {
2260 -
2261 -module.exports = window["React"];
2262 -
2263 -/***/ }),
2264 -
2265 -/***/ "react-dom":
2266 -/*!*****************************!*\
2267 - !*** external ["ReactDOM"] ***!
2268 - \*****************************/
2269 -/***/ (function(module) {
2270 -
2271 -module.exports = window["ReactDOM"];
2272 -
2273 -/***/ })
2274 -
2275 -/******/ });
2276 -/************************************************************************/
2277 -/******/ // The module cache
2278 -/******/ var __webpack_module_cache__ = {};
2279 -/******/
2280 -/******/ // The require function
2281 -/******/ function __webpack_require__(moduleId) {
2282 -/******/ // Check if module is in cache
2283 -/******/ var cachedModule = __webpack_module_cache__[moduleId];
2284 -/******/ if (cachedModule !== undefined) {
2285 -/******/ return cachedModule.exports;
2286 -/******/ }
2287 -/******/ // Create a new module (and put it into the cache)
2288 -/******/ var module = __webpack_module_cache__[moduleId] = {
2289 -/******/ // no module.id needed
2290 -/******/ // no module.loaded needed
2291 -/******/ exports: {}
2292 -/******/ };
2293 -/******/
2294 -/******/ // Execute the module function
2295 -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2296 -/******/
2297 -/******/ // Return the exports of the module
2298 -/******/ return module.exports;
2299 -/******/ }
2300 -/******/
2301 -/************************************************************************/
2302 -/******/ /* webpack/runtime/compat get default export */
2303 -/******/ !function() {
2304 -/******/ // getDefaultExport function for compatibility with non-harmony modules
2305 -/******/ __webpack_require__.n = function(module) {
2306 -/******/ var getter = module && module.__esModule ?
2307 -/******/ function() { return module['default']; } :
2308 -/******/ function() { return module; };
2309 -/******/ __webpack_require__.d(getter, { a: getter });
2310 -/******/ return getter;
2311 -/******/ };
2312 -/******/ }();
2313 -/******/
2314 -/******/ /* webpack/runtime/define property getters */
2315 -/******/ !function() {
2316 -/******/ // define getter functions for harmony exports
2317 -/******/ __webpack_require__.d = function(exports, definition) {
2318 -/******/ for(var key in definition) {
2319 -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2320 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2321 -/******/ }
2322 -/******/ }
2323 -/******/ };
2324 -/******/ }();
2325 -/******/
2326 -/******/ /* webpack/runtime/hasOwnProperty shorthand */
2327 -/******/ !function() {
2328 -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
2329 -/******/ }();
2330 -/******/
2331 -/******/ /* webpack/runtime/make namespace object */
2332 -/******/ !function() {
2333 -/******/ // define __esModule on exports
2334 -/******/ __webpack_require__.r = function(exports) {
2335 -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2336 -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2337 -/******/ }
2338 -/******/ Object.defineProperty(exports, '__esModule', { value: true });
2339 -/******/ };
2340 -/******/ }();
2341 -/******/
2342 -/************************************************************************/
2343 -var __webpack_exports__ = {};
2344 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
2345 -!function() {
2346 -/*!******************************************************************!*\
2347 - !*** ./packages/packages/core/editor-notifications/src/index.ts ***!
2348 - \******************************************************************/
2349 -__webpack_require__.r(__webpack_exports__);
2350 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2351 -/* harmony export */ NotifyReact: function() { return /* reexport safe */ _components_notifications__WEBPACK_IMPORTED_MODULE_1__.NotifyReact; },
2352 -/* harmony export */ dismissNotification: function() { return /* reexport safe */ _components_notifications__WEBPACK_IMPORTED_MODULE_1__.dismissNotification; },
2353 -/* harmony export */ init: function() { return /* reexport safe */ _init__WEBPACK_IMPORTED_MODULE_0__.init; },
2354 -/* harmony export */ notify: function() { return /* reexport safe */ _components_notifications__WEBPACK_IMPORTED_MODULE_1__.notify; }
2355 -/* harmony export */ });
2356 -/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init */ "./packages/packages/core/editor-notifications/src/init.ts");
2357 -/* harmony import */ var _components_notifications__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/notifications */ "./packages/packages/core/editor-notifications/src/components/notifications.tsx");
2358 -
2359 -
2360 -}();
2361 -(window.elementorV2 = window.elementorV2 || {}).editorNotifications = __webpack_exports__;
2362 -/******/ })()
2363 -;
1653 +//#endregion
1654 +})(elementorV2.editor, elementorV2.store, React, ReactDOM, elementorV2.icons, elementorV2.ui);
2364 1655 window.elementorV2.editorNotifications?.init?.();
2365 1656 //# sourceMappingURL=editor-notifications.js.map