← All changes
|
assets/js/packages/editor-notifications/editor-notifications.js
+2
-1655
4.3.1
→
3.35.0-dev2
View file →
| @@ -1,1656 +1,3 @@ | ||
| 1 | -(function(_elementor_editor, _elementor_store, react, react_dom, _elementor_icons, _elementor_ui) { | |
| 2 | - | |
| 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)); | |
| 45 | - | |
| 46 | -//#endregion | |
| 47 | -react = __toESM(react); | |
| 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 | - } | |
| 63 | - | |
| 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 }); | |
| 138 | - | |
| 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 | - }); | |
| 1434 | - | |
| 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; | |
| 1454 | - | |
| 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 | - }; | |
| 1504 | - | |
| 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 | - } | |
| 1511 | - | |
| 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 | - } | |
| 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 | - } | |
| 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 | - } | |
| 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 | - }); | |
| 1648 | - | |
| 1649 | -//#endregion | |
| 1650 | -//#region \0elementor-package-library-entry | |
| 1651 | - (window.elementorV2 = window.elementorV2 || {}).editorNotifications = src_exports; | |
| 1652 | - | |
| 1653 | -//#endregion | |
| 1654 | -})(elementorV2.editor, elementorV2.store, React, ReactDOM, elementorV2.icons, elementorV2.ui); | |
| 1655 | -window.elementorV2.editorNotifications?.init?.(); | |
| 1 | +/*! For license information please see editor-notifications.js.LICENSE.txt */ | |
| 2 | +!function(){"use strict";var e={"./packages/node_modules/goober/dist/goober.modern.js":function(e,n,c){c.r(n),c.d(n,{css:function(){return u},extractCss:function(){return r},glob:function(){return v},keyframes:function(){return E},setup:function(){return m},styled:function(){return w}});let l={data:""},t=e=>{if("object"==typeof window){let n=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return n.nonce=window.__nonce__,n.parentNode||(e||document.head).appendChild(n),n.firstChild}return e||l},r=e=>{let n=t(e),c=n.data;return n.data="",c},d=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,f=/\/\*[^]*?\*\/| +/g,h=/\n+/g,o=(e,n)=>{let c="",l="",d="";for(let f in e){let h=e[f];"@"==f[0]?"i"==f[1]?c=f+" "+h+";":l+="f"==f[1]?o(h,f):f+"{"+o(h,"k"==f[1]?"":n)+"}":"object"==typeof h?l+=o(h,n?n.replace(/([^,])+/g,e=>f.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,n=>/&/.test(n)?n.replace(/&/g,e):e?e+" "+n:n)):f):null!=h&&(f=/^--/.test(f)?f:f.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=o.p?o.p(f,h):f+":"+h+";")}return c+(n&&d?n+"{"+d+"}":d)+l},g={},s=e=>{if("object"==typeof e){let n="";for(let c in e)n+=c+s(e[c]);return n}return e},i=(e,n,c,l,x)=>{let k=s(e),b=g[k]||(g[k]=(e=>{let n=0,c=11;for(;n<e.length;)c=101*c+e.charCodeAt(n++)>>>0;return"go"+c})(k));if(!g[b]){let n=k!==e?e:(e=>{let n,c,l=[{}];for(;n=d.exec(e.replace(f,""));)n[4]?l.shift():n[3]?(c=n[3].replace(h," ").trim(),l.unshift(l[0][c]=l[0][c]||{})):l[0][n[1]]=n[2].replace(h," ").trim();return l[0]})(e);g[b]=o(x?{["@keyframes "+b]:n}:n,c?"":"."+b)}let v=c&&g.g?g.g:null;return c&&(g.g=g[b]),((e,n,c,l)=>{l?n.data=n.data.replace(l,e):-1===n.data.indexOf(e)&&(n.data=c?e+n.data:n.data+e)})(g[b],n,l,v),b},p=(e,n,c)=>e.reduce((e,l,d)=>{let f=n[d];if(f&&f.call){let e=f(c),n=e&&e.props&&e.props.className||/^go/.test(e)&&e;f=n?"."+n:e&&"object"==typeof e?e.props?"":o(e,""):!1===e?"":e}return e+l+(null==f?"":f)},"");function u(e){let n=this||{},c=e.call?e(n.p):e;return i(c.unshift?c.raw?p(c,[].slice.call(arguments,1),n.p):c.reduce((e,c)=>Object.assign(e,c&&c.call?c(n.p):c),{}):c,t(n.target),n.g,n.o,n.k)}let x,k,b,v=u.bind({g:1}),E=u.bind({k:1});function m(e,n,c,l){o.p=n,x=e,k=c,b=l}function w(e,n){let c=this||{};return function(){let l=arguments;function a(d,f){let h=Object.assign({},d),g=h.className||a.className;c.p=Object.assign({theme:k&&k()},h),c.o=/ *go\d+/.test(g),h.className=u.apply(c,l)+(g?" "+g:""),n&&(h.ref=f);let v=e;return e[0]&&(v=h.as||e,delete h.as),b&&v[0]&&b(h),x(v,h)}return n?n(a):a}}},"./packages/node_modules/notistack/node_modules/clsx/dist/clsx.m.js":function(e,n,c){function r(e){var n,c,l="";if("string"==typeof e||"number"==typeof e)l+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(c=r(e[n]))&&(l&&(l+=" "),l+=c);else for(n in e)e[n]&&(l&&(l+=" "),l+=n);return l}function clsx(){for(var e,n,c=0,l="";c<arguments.length;)(e=arguments[c++])&&(n=r(e))&&(l&&(l+=" "),l+=n);return l}c.r(n),c.d(n,{clsx:function(){return clsx}}),n.default=clsx},"./packages/node_modules/notistack/notistack.esm.js":function(e,n,c){c.r(n),c.d(n,{MaterialDesignContent:function(){return xe},SnackbarContent:function(){return ae},SnackbarProvider:function(){return Oe},Transition:function(){return P},closeSnackbar:function(){return ge},enqueueSnackbar:function(){return he},useSnackbar:function(){return useSnackbar}});var l=c("react"),d=c.n(l),f=c("react-dom"),h=c("./packages/node_modules/notistack/node_modules/clsx/dist/clsx.m.js"),g=c("./packages/node_modules/goober/dist/goober.modern.js");function _defineProperties(e,n){for(var c=0;c<n.length;c++){var l=n[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function _createClass(e,n,c){return n&&_defineProperties(e.prototype,n),c&&_defineProperties(e,c),e}function _extends(){return _extends=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var c=arguments[n];for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(e[l]=c[l])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}function _objectWithoutPropertiesLoose(e,n){if(null==e)return{};var c,l,d={},f=Object.keys(e);for(l=0;l<f.length;l++)c=f[l],n.indexOf(c)>=0||(d[c]=e[c]);return d}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var x=function noOp(){return""},k=d().createContext({enqueueSnackbar:x,closeSnackbar:x}),b="@media (max-width:599.95px)",v="@media (min-width:600px)",E=function capitalise(e){return e.charAt(0).toUpperCase()+e.slice(1)},y=function originKeyExtractor(e){return""+E(e.vertical)+E(e.horizontal)},_=function isDefined(e){return!!e||0===e},S="unmounted",C="exited",T="entering",O="entered",L="exiting",P=function(e){function Transition(n){var c;c=e.call(this,n)||this;var l,d=n.appear;return c.appearStatus=null,n.in?d?(l=C,c.appearStatus=T):l=O:l=n.unmountOnExit||n.mountOnEnter?S:C,c.state={status:l},c.nextCallback=null,c}_inheritsLoose(Transition,e),Transition.getDerivedStateFromProps=function getDerivedStateFromProps(e,n){return e.in&&n.status===S?{status:C}:null};var n=Transition.prototype;return n.componentDidMount=function componentDidMount(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function componentDidUpdate(e){var n=null;if(e!==this.props){var c=this.state.status;this.props.in?c!==T&&c!==O&&(n=T):c!==T&&c!==O||(n=L)}this.updateStatus(!1,n)},n.componentWillUnmount=function componentWillUnmount(){this.cancelNextCallback()},n.getTimeouts=function getTimeouts(){var e=this.props.timeout,n=e,c=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(c=e.exit,n=e.enter),{exit:c,enter:n}},n.updateStatus=function updateStatus(e,n){void 0===e&&(e=!1),null!==n?(this.cancelNextCallback(),n===T?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===C&&this.setState({status:S})},n.performEnter=function performEnter(e){var n=this,c=this.props.enter,l=e,d=this.getTimeouts();e||c?(this.props.onEnter&&this.props.onEnter(this.node,l),this.safeSetState({status:T},function(){n.props.onEntering&&n.props.onEntering(n.node,l),n.onTransitionEnd(d.enter,function(){n.safeSetState({status:O},function(){n.props.onEntered&&n.props.onEntered(n.node,l)})})})):this.safeSetState({status:O},function(){n.props.onEntered&&n.props.onEntered(n.node,l)})},n.performExit=function performExit(){var e=this,n=this.props.exit,c=this.getTimeouts();n?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:L},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(c.exit,function(){e.safeSetState({status:C},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:C},function(){e.props.onExited&&e.props.onExited(e.node)})},n.cancelNextCallback=function cancelNextCallback(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function safeSetState(e,n){n=this.setNextCallback(n),this.setState(e,n)},n.setNextCallback=function setNextCallback(e){var n=this,c=!0;return this.nextCallback=function(){c&&(c=!1,n.nextCallback=null,e())},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function onTransitionEnd(e,n){this.setNextCallback(n);var c=null==e&&!this.props.addEndListener;this.node&&!c?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},n.render=function render(){var e=this.state.status;if(e===S)return null;var n=this.props;return(0,n.children)(e,_objectWithoutPropertiesLoose(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},_createClass(Transition,[{key:"node",get:function get(){var e,n=null===(e=this.props.nodeRef)||void 0===e?void 0:e.current;if(!n)throw new Error("notistack - Custom snackbar is not refForwarding");return n}}]),Transition}(d().Component);function noop(){}function setRef(e,n){"function"==typeof e?e(n):e&&(e.current=n)}function useForkRef(e,n){return(0,l.useMemo)(function(){return null==e&&null==n?null:function(c){setRef(e,c),setRef(n,c)}},[e,n])}function getTransitionProps(e){var n=e.timeout,c=e.style,l=void 0===c?{}:c,d=e.mode;return{duration:"object"==typeof n?n[d]||0:n,easing:l.transitionTimingFunction,delay:l.transitionDelay}}P.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop};var D="cubic-bezier(0.4, 0, 0.2, 1)",j="cubic-bezier(0.0, 0, 0.2, 1)",N="cubic-bezier(0.4, 0, 0.6, 1)",R=function reflow(e){e.scrollTop=e.scrollTop},q=function formatMs(e){return Math.round(e)+"ms"};function createTransition(e,n){void 0===e&&(e=["all"]);var c=n||{},l=c.duration,d=void 0===l?300:l,f=c.easing,h=void 0===f?D:f,g=c.delay,x=void 0===g?0:g;return(Array.isArray(e)?e:[e]).map(function(e){var n="string"==typeof d?d:q(d),c="string"==typeof x?x:q(x);return e+" "+n+" "+h+" "+c}).join(",")}function ownerWindow(e){var n=function ownerDocument(e){return e&&e.ownerDocument||document}(e);return n.defaultView||window}function setTranslateValue(e,n){if(n){var c=function getTranslateValue(e,n){var c,l=n.getBoundingClientRect(),d=ownerWindow(n);if(n.fakeTransform)c=n.fakeTransform;else{var f=d.getComputedStyle(n);c=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}var h=0,g=0;if(c&&"none"!==c&&"string"==typeof c){var x=c.split("(")[1].split(")")[0].split(",");h=parseInt(x[4],10),g=parseInt(x[5],10)}switch(e){case"left":return"translateX("+(d.innerWidth+h-l.left)+"px)";case"right":return"translateX(-"+(l.left+l.width-h)+"px)";case"up":return"translateY("+(d.innerHeight+g-l.top)+"px)";default:return"translateY(-"+(l.top+l.height-g)+"px)"}}(e,n);c&&(n.style.webkitTransform=c,n.style.transform=c)}}var A=(0,l.forwardRef)(function(e,n){var c=e.children,d=e.direction,f=void 0===d?"down":d,h=e.in,g=e.style,x=e.timeout,k=void 0===x?0:x,b=e.onEnter,v=e.onEntered,E=e.onExit,y=e.onExited,_=_objectWithoutPropertiesLoose(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),S=(0,l.useRef)(null),C=useForkRef(c.ref,S),T=useForkRef(C,n),O=(0,l.useCallback)(function(){S.current&&setTranslateValue(f,S.current)},[f]);return(0,l.useEffect)(function(){if(!h&&"down"!==f&&"right"!==f){var e=function debounce(e,n){var c;function debounced(){for(var l=this,d=arguments.length,f=new Array(d),h=0;h<d;h++)f[h]=arguments[h];clearTimeout(c),c=setTimeout(function later(){e.apply(l,f)},n)}return void 0===n&&(n=166),debounced.clear=function(){clearTimeout(c)},debounced}(function(){S.current&&setTranslateValue(f,S.current)}),n=ownerWindow(S.current);return n.addEventListener("resize",e),function(){e.clear(),n.removeEventListener("resize",e)}}},[f,h]),(0,l.useEffect)(function(){h||O()},[h,O]),(0,l.createElement)(P,Object.assign({appear:!0,nodeRef:S,onEnter:function handleEnter(e,n){setTranslateValue(f,e),R(e),b&&b(e,n)},onEntered:v,onEntering:function handleEntering(e){var n=(null==g?void 0:g.transitionTimingFunction)||j,c=getTransitionProps({timeout:k,mode:"enter",style:_extends({},g,{transitionTimingFunction:n})});e.style.webkitTransition=createTransition("-webkit-transform",c),e.style.transition=createTransition("transform",c),e.style.webkitTransform="none",e.style.transform="none"},onExit:function handleExit(e){var n=(null==g?void 0:g.transitionTimingFunction)||N,c=getTransitionProps({timeout:k,mode:"exit",style:_extends({},g,{transitionTimingFunction:n})});e.style.webkitTransition=createTransition("-webkit-transform",c),e.style.transition=createTransition("transform",c),setTranslateValue(f,e),E&&E(e)},onExited:function handleExited(e){e.style.webkitTransition="",e.style.transition="",y&&y(e)},in:h,timeout:k},_),function(e,n){return(0,l.cloneElement)(c,_extends({ref:T,style:_extends({visibility:"exited"!==e||h?void 0:"hidden"},g,{},c.props.style)},n))})});A.displayName="Slide";var M=function SvgIcon(e){return d().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},W=function CheckIcon(){return d().createElement(M,null,d().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"}))},V=function WarningIcon(){return d().createElement(M,null,d().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},I=function ErrorIcon(){return d().createElement(M,null,d().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"}))},H=function InfoIcon(){return d().createElement(M,null,d().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"}))},F={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:d().createElement(W,null),warning:d().createElement(V,null),error:d().createElement(I,null),info:d().createElement(H,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:A,transitionDuration:{enter:225,exit:195}},z=function merge(e,n){return function(c,l){return void 0===l&&(l=!1),l?_extends({},F[c],{},n[c],{},e[c]):"autoHideDuration"===c?function getAutoHideDuration(e,n){var c=function isNumberOrNull(e){return"number"==typeof e||null===e};return c(e)?e:c(n)?n:F.autoHideDuration}(e.autoHideDuration,n.autoHideDuration):"transitionDuration"===c?function getTransitionDuration(e,n){var c=function is(e,n){return n.some(function(n){return typeof e===n})};return c(e,["string","number"])?e:c(e,["object"])?_extends({},F.transitionDuration,{},c(n,["object"])&&n,{},e):c(n,["string","number"])?n:c(n,["object"])?_extends({},F.transitionDuration,{},n):F.transitionDuration}(e.transitionDuration,n.transitionDuration):e[c]||n[c]||F[c]}};function makeStyles(e){return Object.entries(e).reduce(function(e,n){var c,l=n[0],d=n[1];return _extends({},e,((c={})[l]=(0,g.css)(d),c))},{})}var B="notistack-SnackbarContainer",U="notistack-Snackbar",Z="notistack-CollapseWrapper",X="notistack-MuiContent",G=function MuiContentVariant(e){return"notistack-MuiContent-"+e},Q=makeStyles({root:{height:0},entered:{height:"auto"}}),K="0px",Y=(0,l.forwardRef)(function(e,n){var c=e.children,d=e.in,f=e.onExited,g=(0,l.useRef)(null),x=(0,l.useRef)(null),k=useForkRef(n,x),b=function getWrapperSize(){return g.current?g.current.clientHeight:0};return(0,l.createElement)(P,{in:d,unmountOnExit:!0,onEnter:function handleEnter(e){e.style.height=K},onEntered:function handleEntered(e){e.style.height="auto"},onEntering:function handleEntering(e){var n=b(),c=getTransitionProps({timeout:175,mode:"enter"}),l=c.duration,d=c.easing;e.style.transitionDuration="string"==typeof l?l:l+"ms",e.style.height=n+"px",e.style.transitionTimingFunction=d||""},onExit:function handleExit(e){e.style.height=b()+"px"},onExited:f,onExiting:function handleExiting(e){R(e);var n=getTransitionProps({timeout:175,mode:"exit"}),c=n.duration,l=n.easing;e.style.transitionDuration="string"==typeof c?c:c+"ms",e.style.height=K,e.style.transitionTimingFunction=l||""},nodeRef:x,timeout:175},function(e,n){return(0,l.createElement)("div",Object.assign({ref:k,className:(0,h.default)(Q.root,"entered"===e&&Q.entered),style:_extends({pointerEvents:"all",overflow:"hidden",minHeight:K,transition:createTransition("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!d&&{visibility:"hidden"})},n),(0,l.createElement)("div",{ref:g,className:Z,style:{display:"flex",width:"100%"}},c))})});Y.displayName="Collapse";var $={right:"left",left:"right",bottom:"up",top:"down"},J=function getSlideDirection(e){return"center"!==e.horizontal?$[e.horizontal]:$[e.vertical]},ee=function toSnackbarAnchorOrigin(e){return"anchorOrigin"+y(e)},ne=function noOp(){};function createChainedFunction(e,n){return e.reduce(function(e,c){return null==c?e:function chainedFunction(){for(var l=arguments.length,d=new Array(l),f=0;f<l;f++)d[f]=arguments[f];var h=[].concat(d);n&&-1===h.indexOf(n)&&h.push(n),e.apply(this,h),c.apply(this,h)}},ne)}var te="undefined"!=typeof window?l.useLayoutEffect:l.useEffect;function useEventCallback(e){var n=(0,l.useRef)(e);return te(function(){n.current=e}),(0,l.useCallback)(function(){return n.current.apply(void 0,arguments)},[])}var re,ie=(0,l.forwardRef)(function(e,n){var c=e.children,d=e.className,f=e.autoHideDuration,g=e.disableWindowBlurListener,x=void 0!==g&&g,k=e.onClose,b=e.id,v=e.open,E=e.SnackbarProps,y=void 0===E?{}:E,_=(0,l.useRef)(),S=useEventCallback(function(){k&&k.apply(void 0,arguments)}),C=useEventCallback(function(e){k&&null!=e&&(_.current&&clearTimeout(_.current),_.current=setTimeout(function(){S(null,"timeout",b)},e))});(0,l.useEffect)(function(){return v&&C(f),function(){_.current&&clearTimeout(_.current)}},[v,f,C]);var T=function handlePause(){_.current&&clearTimeout(_.current)},O=(0,l.useCallback)(function(){null!=f&&C(.5*f)},[f,C]);return(0,l.useEffect)(function(){if(!x&&v)return window.addEventListener("focus",O),window.addEventListener("blur",T),function(){window.removeEventListener("focus",O),window.removeEventListener("blur",T)}},[x,O,v]),(0,l.createElement)("div",Object.assign({ref:n},y,{className:(0,h.default)(U,d),onMouseEnter:function handleMouseEnter(e){y.onMouseEnter&&y.onMouseEnter(e),T()},onMouseLeave:function handleMouseLeave(e){y.onMouseLeave&&y.onMouseLeave(e),O()}}),c)});ie.displayName="Snackbar";var oe=makeStyles({root:(re={display:"flex",flexWrap:"wrap",flexGrow:1},re[v]={flexGrow:"initial",minWidth:"288px"},re)}),ae=(0,l.forwardRef)(function(e,n){var c=e.className,l=_objectWithoutPropertiesLoose(e,["className"]);return d().createElement("div",Object.assign({ref:n,className:(0,h.default)(oe.root,c)},l))});ae.displayName="SnackbarContent";var se=makeStyles({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",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)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),ce="notistack-snackbar",ue=(0,l.forwardRef)(function(e,n){var c=e.id,l=e.message,f=e.action,g=e.iconVariant,x=e.variant,k=e.hideIconVariant,b=e.style,v=e.className,E=g[x],y=f;return"function"==typeof y&&(y=y(c)),d().createElement(ae,{ref:n,role:"alert","aria-describedby":ce,style:b,className:(0,h.default)(X,G(x),se.root,se[x],v,!k&&E&&se.lessPadding)},d().createElement("div",{id:ce,className:se.message},k?null:E,l),y&&d().createElement("div",{className:se.action},y))});ue.displayName="MaterialDesignContent";var le,de,fe,pe,me,he,ge,xe=(0,l.memo)(ue),ke=makeStyles({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),be=function SnackbarItem(e){var n=(0,l.useRef)(),c=(0,l.useState)(!0),f=c[0],g=c[1],x=createChainedFunction([e.snack.onClose,e.onClose]),k=(0,l.useCallback)(function(){n.current=setTimeout(function(){g(function(e){return!e})},125)},[]);(0,l.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var b=e.snack,v=e.classes,E=e.Component,y=void 0===E?xe:E,_=(0,l.useMemo)(function(){return function keepSnackbarClassKeys(e){void 0===e&&(e={});var n={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!n[e]}).reduce(function(n,c){var l;return _extends({},n,((l={})[c]=e[c],l))},{})}(v)},[v]),S=b.open,C=b.SnackbarProps,T=b.TransitionComponent,O=b.TransitionProps,L=b.transitionDuration,P=b.disableWindowBlurListener,D=b.content,j=_objectWithoutPropertiesLoose(b,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),N=_extends({direction:J(j.anchorOrigin),timeout:L},O),R=D;"function"==typeof R&&(R=R(j.id,j.message));var q=["onEnter","onEntered","onExit","onExited"].reduce(function(n,c){var l;return _extends({},n,((l={})[c]=createChainedFunction([e.snack[c],e[c]],j.id),l))},{});return d().createElement(Y,{in:f,onExited:q.onExited},d().createElement(ie,{open:S,id:j.id,disableWindowBlurListener:P,autoHideDuration:j.autoHideDuration,className:(0,h.default)(ke.wrappedRoot,_.root,_[ee(j.anchorOrigin)]),SnackbarProps:C,onClose:x},d().createElement(T,Object.assign({},N,{appear:!0,in:S,onExit:q.onExit,onExited:k,onEnter:q.onEnter,onEntered:createChainedFunction([q.onEntered,function handleEntered(){e.snack.requestClose&&x(null,"instructed",e.snack.id)}],j.id)}),R||d().createElement(y,Object.assign({},j)))))},ve={default:20,dense:4},Ee={default:6,dense:2},ye="."+Z,_e=makeStyles({root:(le={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:createTransition(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},le[ye]={padding:Ee.default+"px 0px",transition:"padding 300ms ease 0ms"},le.maxWidth="calc(100% - "+2*ve.default+"px)",le[b]={width:"100%",maxWidth:"calc(100% - 32px)"},le),rootDense:(de={},de[ye]={padding:Ee.dense+"px 0px"},de),top:{top:ve.default-Ee.default+"px",flexDirection:"column"},bottom:{bottom:ve.default-Ee.default+"px",flexDirection:"column-reverse"},left:(fe={left:ve.default+"px"},fe[v]={alignItems:"flex-start"},fe[b]={left:"16px"},fe),right:(pe={right:ve.default+"px"},pe[v]={alignItems:"flex-end"},pe[b]={right:"16px"},pe),center:(me={left:"50%",transform:"translateX(-50%)"},me[v]={alignItems:"center"},me)}),we=function SnackbarContainer(e){var n=e.classes,c=void 0===n?{}:n,l=e.anchorOrigin,f=e.dense,g=e.children,x=(0,h.default)(B,_e[l.vertical],_e[l.horizontal],_e.root,c.containerRoot,c["containerAnchorOrigin"+y(l)],f&&_e.rootDense);return d().createElement("div",{className:x},g)},Se=(0,l.memo)(we),Ce={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."},Te=function isOptions(e){return!("string"==typeof e||(0,l.isValidElement)(e))},Oe=function(e){function SnackbarProvider(n){var c;return(c=e.call(this,n)||this).enqueueSnackbar=function(e,n){if(void 0===n&&(n={}),null==e)throw new Error("enqueueSnackbar called with invalid argument");var l=Te(e)?e:n,d=Te(e)?e.message:e,f=l.key,g=l.preventDuplicate,x=_objectWithoutPropertiesLoose(l,["key","preventDuplicate"]),k=_(f),b=k?f:(new Date).getTime()+Math.random(),v=z(x,c.props),E=_extends({id:b},x,{message:d,open:!0,entered:!1,requestClose:!1,persist:v("persist"),action:v("action"),content:v("content"),variant:v("variant"),anchorOrigin:v("anchorOrigin"),disableWindowBlurListener:v("disableWindowBlurListener"),autoHideDuration:v("autoHideDuration"),hideIconVariant:v("hideIconVariant"),TransitionComponent:v("TransitionComponent"),transitionDuration:v("transitionDuration"),TransitionProps:v("TransitionProps",!0),iconVariant:v("iconVariant",!0),style:v("style",!0),SnackbarProps:v("SnackbarProps",!0),className:(0,h.default)(c.props.className,x.className)});return E.persist&&(E.autoHideDuration=void 0),c.setState(function(e){if(void 0===g&&c.props.preventDuplicate||g){var n=function compareFunction(e){return k?e.id===b:e.message===d},l=e.queue.findIndex(n)>-1,f=e.snacks.findIndex(n)>-1;if(l||f)return e}return c.handleDisplaySnack(_extends({},e,{queue:[].concat(e.queue,[E])}))}),b},c.handleDisplaySnack=function(e){return e.snacks.length>=c.maxSnack?c.handleDismissOldest(e):c.processQueue(e)},c.processQueue=function(e){var n=e.queue,c=e.snacks;return n.length>0?_extends({},e,{snacks:[].concat(c,[n[0]]),queue:n.slice(1,n.length)}):e},c.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var n=!1,l=!1;e.snacks.reduce(function(e,n){return e+(n.open&&n.persist?1:0)},0)===c.maxSnack&&(!function(e){var n=Ce[e];"undefined"!=typeof console&&console.error("WARNING - notistack: "+n);try{throw new Error(n)}catch(e){}}("NO_PERSIST_ALL"),l=!0);var d=e.snacks.map(function(e){return n||e.persist&&!l?_extends({},e):(n=!0,e.entered?(e.onClose&&e.onClose(null,"maxsnack",e.id),c.props.onClose&&c.props.onClose(null,"maxsnack",e.id),_extends({},e,{open:!1})):_extends({},e,{requestClose:!0}))});return _extends({},e,{snacks:d})},c.handleEnteredSnack=function(e,n,l){if(!_(l))throw new Error("handleEnteredSnack Cannot be called with undefined key");c.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===l?_extends({},e,{entered:!0}):_extends({},e)})}})},c.handleCloseSnack=function(e,n,l){c.props.onClose&&c.props.onClose(e,n,l);var d=void 0===l;c.setState(function(e){var n=e.snacks,c=e.queue;return{snacks:n.map(function(e){return d||e.id===l?e.entered?_extends({},e,{open:!1}):_extends({},e,{requestClose:!0}):_extends({},e)}),queue:c.filter(function(e){return e.id!==l})}})},c.closeSnackbar=function(e){var n=c.state.snacks.find(function(n){return n.id===e});_(e)&&n&&n.onClose&&n.onClose(null,"instructed",e),c.handleCloseSnack(null,"instructed",e)},c.handleExitedSnack=function(e,n){if(!_(n))throw new Error("handleExitedSnack Cannot be called with undefined key");c.setState(function(e){var l=c.processQueue(_extends({},e,{snacks:e.snacks.filter(function(e){return e.id!==n})}));return 0===l.queue.length?l:c.handleDismissOldest(l)})},he=c.enqueueSnackbar,ge=c.closeSnackbar,c.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:c.enqueueSnackbar.bind(_assertThisInitialized(c)),closeSnackbar:c.closeSnackbar.bind(_assertThisInitialized(c))}},c}return _inheritsLoose(SnackbarProvider,e),SnackbarProvider.prototype.render=function render(){var e=this,n=this.state.contextValue,c=this.props,l=c.domRoot,h=c.children,g=c.dense,x=void 0!==g&&g,b=c.Components,v=void 0===b?{}:b,E=c.classes,_=this.state.snacks.reduce(function(e,n){var c,l=y(n.anchorOrigin),d=e[l]||[];return _extends({},e,((c={})[l]=[].concat(d,[n]),c))},{}),S=Object.keys(_).map(function(n){var c=_[n],l=c[0];return d().createElement(Se,{key:n,dense:x,anchorOrigin:l.anchorOrigin,classes:E},c.map(function(n){return d().createElement(be,{key:n.id,snack:n,classes:E,Component:v[n.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:createChainedFunction([e.handleExitedSnack,e.props.onExited],n.id),onEntered:createChainedFunction([e.handleEnteredSnack,e.props.onEntered],n.id)})}))});return d().createElement(k.Provider,{value:n},h,l?(0,f.createPortal)(S,l):S)},_createClass(SnackbarProvider,[{key:"maxSnack",get:function get(){return this.props.maxSnack||F.maxSnack}}]),SnackbarProvider}(l.Component),useSnackbar=function(){return(0,l.useContext)(k)}},"./packages/packages/core/editor-notifications/src/components/notifications.tsx":function(e,n,c){c.r(n),c.d(n,{NotifyReact:function(){return NotifyReact},notify:function(){return notify}});var l=c("react"),d=c("./packages/node_modules/notistack/notistack.esm.js"),f=c("@elementor/store"),h=c("@elementor/ui"),g=c("./packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx"),x=c("./packages/packages/core/editor-notifications/src/slice.ts"),k=c("./packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts");function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var c=arguments[n];for(var l in c)({}).hasOwnProperty.call(c,l)&&(e[l]=c[l])}return e},_extends.apply(null,arguments)}const b={default:(0,l.forwardRef)((e,n)=>{const c=function getFilteredSnackbarProps(e){const n=["autoHideDuration","persist","hideIconVariant","iconVariant","anchorOrigin"];return Object.entries(e).reduce((e,[c,l])=>(n.includes(c)||(e[c]=l),e),{})}(e),d=(0,k.getEditingPanelWidth)();return l.createElement(h.ThemeProvider,{palette:"unstable"},l.createElement(h.SnackbarContent,_extends({ref:n},c,{sx:{"&.MuiPaper-root":{minWidth:"max-content"},ml:d+"px"}})))})},Handler=()=>{const e=(0,f.__useSelector)(e=>e.notifications);return(0,g.useEnqueueNotification)(e),null};function notify(e){const n=(0,f.__getStore)();n?.dispatch((0,x.notifyAction)(e))}function NotifyReact(e){(0,f.__useDispatch)()((0,x.notifyAction)(e))}n.default=()=>l.createElement(d.SnackbarProvider,{maxSnack:3,autoHideDuration:8e3,anchorOrigin:{horizontal:"center",vertical:"bottom"},Components:b},l.createElement(Handler,null))},"./packages/packages/core/editor-notifications/src/hooks/use-enqueue-notifications.tsx":function(e,n,c){c.r(n),c.d(n,{useEnqueueNotification:function(){return useEnqueueNotification}});var l=c("react"),d=c("./packages/node_modules/notistack/notistack.esm.js"),f=c("@elementor/store"),h=c("@elementor/ui"),g=c("./packages/packages/core/editor-notifications/src/slice.ts");function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var c=arguments[n];for(var l in c)({}).hasOwnProperty.call(c,l)&&(e[l]=c[l])}return e},_extends.apply(null,arguments)}const useEnqueueNotification=e=>{const{enqueueSnackbar:n}=(0,d.useSnackbar)(),c=(0,f.__useDispatch)();(0,l.useEffect)(()=>{Object.values(e).forEach(e=>{const Action=()=>l.createElement(l.Fragment,{key:e.id},e.additionalActionProps?.map((e,n)=>l.createElement(h.Button,_extends({key:`${n}`},e))),l.createElement(h.CloseButton,{"aria-label":"close",color:"inherit",onClick:()=>{(0,d.closeSnackbar)(e.id),c((0,g.clearAction)({id:e.id}))}}));n(e.message,{variant:e.type,key:e.id,onClose:()=>c((0,g.clearAction)({id:e.id})),preventDuplicate:!0,action:l.createElement(Action,null)})})},[e,n,c])}},"./packages/packages/core/editor-notifications/src/init.ts":function(e,n,c){c.r(n),c.d(n,{init:function(){return init}});var l=c("@elementor/editor"),d=c("@elementor/store"),f=c("./packages/packages/core/editor-notifications/src/components/notifications.tsx"),h=c("./packages/packages/core/editor-notifications/src/slice.ts");function init(){(0,d.__registerSlice)(h.notificationsSlice),(0,l.injectIntoTop)({id:"notifications",component:f.default})}},"./packages/packages/core/editor-notifications/src/slice.ts":function(e,n,c){c.r(n),c.d(n,{clearAction:function(){return h},notificationsSlice:function(){return d},notifyAction:function(){return f}});var l=c("@elementor/store");const d=(0,l.__createSlice)({name:"notifications",initialState:{},reducers:{notifyAction:(e,n)=>{const c={...e};return c[n.payload.id]||(c[n.payload.id]=n.payload),c},clearAction:(e,n)=>{const c={...e};return c[n.payload.id]&&delete c[n.payload.id],c}}}),{notifyAction:f,clearAction:h}=d.actions},"./packages/packages/core/editor-notifications/src/sync/get-editing-panel-width.ts":function(e,n,c){function getEditingPanelWidth(){return document.querySelector(".elementor-panel")?.clientWidth||0}c.r(n),c.d(n,{getEditingPanelWidth:function(){return getEditingPanelWidth}})},"@elementor/editor":function(e){e.exports=window.elementorV2.editor},"@elementor/store":function(e){e.exports=window.elementorV2.store},"@elementor/ui":function(e){e.exports=window.elementorV2.ui},react:function(e){e.exports=window.React},"react-dom":function(e){e.exports=window.ReactDOM}},n={};function __webpack_require__(c){var l=n[c];if(void 0!==l)return l.exports;var d=n[c]={exports:{}};return e[c](d,d.exports,__webpack_require__),d.exports}__webpack_require__.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=function(e,n){for(var c in n)__webpack_require__.o(n,c)&&!__webpack_require__.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:n[c]})},__webpack_require__.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};!function(){__webpack_require__.r(c),__webpack_require__.d(c,{NotifyReact:function(){return n.NotifyReact},init:function(){return e.init},notify:function(){return n.notify}});var e=__webpack_require__("./packages/packages/core/editor-notifications/src/init.ts"),n=__webpack_require__("./packages/packages/core/editor-notifications/src/components/notifications.tsx")}(),(window.elementorV2=window.elementorV2||{}).editorNotifications=c}(),window.elementorV2.editorNotifications?.init?.(); | |
| 1656 | 3 | //# sourceMappingURL=editor-notifications.js.map |